//***********************************************************************
// This includes all of the functions necessary for the top menu
// Jeff Chew
//***********************************************************************

// preloads the images necesary for the top menu
var menu1Off = new Image();
var menu1On = new Image();
var menu1Off2 = new Image();
var menu1On2 = new Image();
var menu2Off = new Image();
var menu2On = new Image();
var menu2Off2 = new Image();
var menu2On2 = new Image();
var menu3Off = new Image();
var menu3On = new Image();
var menu3Off2 = new Image();
var menu3On2 = new Image();
var menu4Off = new Image();
var menu4On = new Image();
var menu4Off2 = new Image();
var menu4On2 = new Image();
var menu5Off = new Image();
var menu5On = new Image();
var menu5Off2 = new Image();
var menu5On2 = new Image();
var menu6Off = new Image();
var menu6On = new Image();
var menu6Off2 = new Image();
var menu6On2 = new Image();
var menu7Off = new Image();
var menu7On = new Image();

// large if-statement to determine the "On"/"Off" states for the rollovers, largely dependant on what page the user is currently on
if(currentPage != "rentonline"){
	if(currentPage == "costsavings"){
		menu1Off.src = '/imgs/global/menu/menu-01-rentonline-off2.gif';
		menu1On.src = '/imgs/global/menu/menu-01-rentonline-on2.gif';
	}else{
		menu1Off.src = '/imgs/global/menu/menu-01-rentonline-off.gif';
		menu1On.src = '/imgs/global/menu/menu-01-rentonline-on.gif';
		menu1Off2.src = '/imgs/global/menu/menu-01-rentonline-off.gif';
		menu1On2.src = '/imgs/global/menu/menu-01-rentonline-off2.gif';
	}
}else{
	menu1Off.src = '/imgs/global/menu/menu-01-rentonline-on.gif';
	menu1On.src = '/imgs/global/menu/menu-01-rentonline-on2.gif';
	menu1Off2.src = '/imgs/global/menu/menu-01-rentonline-on.gif';
	menu1On2.src = '/imgs/global/menu/menu-01-rentonline-on2.gif';
}
if(currentPage != "costsavings"){
	if(currentPage == "security"){
		menu2Off.src = '/imgs/global/menu/menu-02-costsavings-off2.gif';
		menu2On.src = '/imgs/global/menu/menu-02-costsavings-on2.gif';
	}else{
		menu2Off.src = '/imgs/global/menu/menu-02-costsavings-off.gif';
		menu2On.src = '/imgs/global/menu/menu-02-costsavings-on.gif';
		menu2Off2.src = '/imgs/global/menu/menu-02-costsavings-off.gif';
		menu2On2.src = '/imgs/global/menu/menu-02-costsavings-off2.gif';
	}
}else{
	menu2Off.src = '/imgs/global/menu/menu-02-costsavings-on.gif';
	menu2On.src = '/imgs/global/menu/menu-02-costsavings-on2.gif';
	menu2Off2.src = '/imgs/global/menu/menu-02-costsavings-on.gif';
	menu2On2.src = '/imgs/global/menu/menu-02-costsavings-on2.gif';
}
if(currentPage != "security"){
	if(currentPage == "whychooseus"){
		menu3Off.src = '/imgs/global/menu/menu-03-security-off2.gif';
		menu3On.src = '/imgs/global/menu/menu-03-security-on2.gif';
	}else{
		menu3Off.src = '/imgs/global/menu/menu-03-security-off.gif';
		menu3On.src = '/imgs/global/menu/menu-03-security-on.gif';
		menu3Off2.src = '/imgs/global/menu/menu-03-security-off.gif';
		menu3On2.src = '/imgs/global/menu/menu-03-security-off2.gif';
	}
}else{
	menu3Off.src = '/imgs/global/menu/menu-03-security-on.gif';
	menu3On.src = '/imgs/global/menu/menu-03-security-on2.gif';
	menu3Off2.src = '/imgs/global/menu/menu-03-security-on.gif';
	menu3On2.src = '/imgs/global/menu/menu-03-security-on2.gif';
}
if(currentPage != "whychooseus"){
	if(currentPage == "business"){
		menu4Off.src = '/imgs/global/menu/menu-04-whychooseus-off2.gif';
		menu4On.src = '/imgs/global/menu/menu-04-whychooseus-on2.gif';
	}else{
		menu4Off.src = '/imgs/global/menu/menu-04-whychooseus-off.gif';
		menu4On.src = '/imgs/global/menu/menu-04-whychooseus-on.gif';
		menu4Off2.src = '/imgs/global/menu/menu-04-whychooseus-off.gif';
		menu4On2.src = '/imgs/global/menu/menu-04-whychooseus-off2.gif';
	}
}else{
	menu4Off.src = '/imgs/global/menu/menu-04-whychooseus-on.gif';
	menu4On.src = '/imgs/global/menu/menu-04-whychooseus-on2.gif';
	menu4Off2.src = '/imgs/global/menu/menu-04-whychooseus-on.gif';
	menu4On2.src = '/imgs/global/menu/menu-04-whychooseus-on2.gif';
}
if(currentPage != "business"){
	if(currentPage == "storagetips"){
		menu5Off.src = '/imgs/global/menu/menu-05-business-off2.gif';
		menu5On.src = '/imgs/global/menu/menu-05-business-on2.gif';
	}else{
		menu5Off.src = '/imgs/global/menu/menu-05-business-off.gif';
		menu5On.src = '/imgs/global/menu/menu-05-business-on.gif';
		menu5Off2.src = '/imgs/global/menu/menu-05-business-off.gif';
		menu5On2.src = '/imgs/global/menu/menu-05-business-off2.gif';
	}
}else{
	menu5Off.src = '/imgs/global/menu/menu-05-business-on.gif';
	menu5On.src = '/imgs/global/menu/menu-05-business-on2.gif';
	menu5Off2.src = '/imgs/global/menu/menu-05-business-on.gif';
	menu5On2.src = '/imgs/global/menu/menu-05-business-on2.gif';
}
if(currentPage != "storagetips"){
	if(currentPage == "locations"){
		menu6Off.src = '/imgs/global/menu/menu-06-storagetips-off2.gif';
		menu6On.src = '/imgs/global/menu/menu-06-storagetips-on2.gif';
	}else{
		menu6Off.src = '/imgs/global/menu/menu-06-storagetips-off.gif';
		menu6On.src = '/imgs/global/menu/menu-06-storagetips-on.gif';
		menu6Off2.src = '/imgs/global/menu/menu-06-storagetips-off.gif';
		menu6On2.src = '/imgs/global/menu/menu-06-storagetips-off2.gif';
	}
}else{
	menu6Off.src = '/imgs/global/menu/menu-06-storagetips-on.gif';
	menu6On.src = '/imgs/global/menu/menu-06-storagetips-on2.gif';
	menu6Off2.src = '/imgs/global/menu/menu-06-storagetips-on.gif';
	menu6On2.src = '/imgs/global/menu/menu-06-storagetips-on2.gif';
}
if(currentPage != "locations"){
	menu7Off.src = '/imgs/global/menu/menu-07-locations-off.gif';
	menu7On.src = '/imgs/global/menu/menu-07-locations-on.gif';
}

// function for rolling over a menu item. Since rollovers affect the menu item to the left, 
// it also changes the rollover state of that as well.
function menuOn(imagenum){
	rollover("menu" + imagenum,"menu" + imagenum + "On");
	if(imagenum != 1){
		var previous = imagenum - 1;
		rollover("menu" + previous,"menu" + previous + "On2");
	}
}

function menuOff(imagenum){
	rollover("menu" + imagenum,"menu" + imagenum + "Off");
	if(imagenum != 1){
		var previous = imagenum - 1;
		rollover("menu" + previous,"menu" + previous + "Off2");
	}
}
