dom=false;
if (document.getElementById) dom=true;
if (navigator.appName=='Netscape') dom=false;


// PRELOAD IMAGES
if (document.images) {
	menu_food_on= new Image();
	menu_food_on.src= "/graphics/menu_food_on.gif";
	menu_nonfood_on= new Image();
	menu_nonfood_on.src= "/graphics/menu_nonfood_on.gif";
	menu_financial_on= new Image();
	menu_financial_on.src= "/graphics/menu_financial_on.gif";
	menu_travel_on= new Image();
	menu_travel_on.src= "/graphics/menu_travel_on.gif";
	menu_funerals_on= new Image();
	menu_funerals_on.src= "/graphics/menu_funerals_on.gif";
	menu_pharmacy_on= new Image();
	menu_pharmacy_on.src= "/graphics/menu_pharmacy_on.gif";
	menu_motoring_on= new Image();
	menu_motoring_on.src= "/graphics/menu_motoring_on.gif";
	menu_societies_on= new Image();
	menu_societies_on.src= "/graphics/menu_societies_on.gif";
	menu_otherservs_on= new Image();
	menu_otherservs_on.src= "/graphics/menu_otherservs_on.gif";
	menu_help_on= new Image();
	menu_help_on.src= "/graphics/menu_help_on.gif";
	menu_aboutcoops_on= new Image();
	menu_aboutcoops_on.src= "/graphics/menu_aboutcoops_on.gif";
	menu_mainmenu_on= new Image();
	menu_mainmenu_on.src= "/graphics/menu_mainmenu_on.gif";
	menu_feedback_on= new Image();
	menu_feedback_on.src= "/graphics/menu_feedback_on.gif";
	menu_aboutcoop_on= new Image();
	menu_aboutcoop_on.src= "/graphics/menu_aboutcoop_on.gif";
	menu_home_on= new Image();
	menu_home_on.src= "/graphics/menu_home_on.gif";
	menu_close_on= new Image();
	menu_close_on.src= "/graphics/menu_close_on.gif";
	menu_open_on= new Image();
	menu_open_on.src= "/graphics/menu_open_on.gif";
}

// MENUCHECKER FOR SECTION LINKS
function menuCheck (input) {
	if (loaded!='none') {
		document.images[loaded].src='/graphics/menu_'+loaded+'_on.gif';
		}
}

// MOUSE OVER 
function mOver (imgName) {
	if (pageloaded) {
	if(!document.images) return;
	if (imgName!=loaded){
		document.images[imgName].src='/graphics/menu_'+imgName+'_on.gif';
		}
	}	
}

// MOUSE OUT 
function mOut (imgName) {
	if (pageloaded) {
	if(!document.images) return;
	if (imgName!=loaded){
		document.images[imgName].src='/graphics/menu_'+imgName+'_off.gif';
		}
	}	
}

var menustate = window.location.search.substring(1,window.location.search.length);

if(! menustate){
	menustate='on';
}

// pass variables on load
function passLoad (url) {
//	alert (menustate);
	pass=url+'?'+menustate;
	window.location.href=pass;
}

// CHECK MENU STATE
function checkHistoryMenu() {
	if (menustate != 'on'){
		closeMenu();
		} else {
		openMenu();
		}
	}

// OPEN ABOUT CO-OPERATIVES MENU
function openMenu() {
	if (dom) {
		document.getElementById('menu').style.display="block";
		document.getElementById('menuclosed').style.display="none";	
		menustate = "on";	
		}
	}
	
// CLOSE ABOUT CO-OPERATIVES MENU	
function closeMenu() {
	if (dom) {
		document.getElementById('menu').style.display="none";
		document.getElementById('menuclosed').style.display="block";	
		menustate = "off";	
		}
	}
	
function show(id) {

if (dom) {
		if (document.getElementById(id).style.display=="block") {
			document.getElementById(id).style.display="none";
		}else{
			document.getElementById(id).style.display="block";
			}	
		}
	}
	
function on(id){
	if (document.getElementById){	
		document.getElementById(id).style.backgroundColor = "cccc00";
		document.getElementById(id).style.color = "000066";		
		}
	}
	
function off(id){
	if (document.getElementById){	
		document.getElementById(id).style.backgroundColor = "transparent";
		document.getElementById(id).style.color = "ffffff";				
		}
	}	
	
pageloaded="true";
	
