
var imgBase = '/images/navMain/';
var mouseOutSuffix = '.gif';
var mouseOverSuffix = '_on.gif';
 
//MAIN NAV STATE
//get the folder of the current page (which, in this case is the 3rd element in pathArray)
//the folder name and the id of the image are set up to use the same name
//thus we can use the folder name to set the img source to hover
//designate that this is current page by affixing 'Selected' to its id
//this is used as a flag so we don't change its state in mouseover and out events
var pathArray = new Array();
pathArray = document.location.href.split("/");
if (document.getElementById(pathArray[3])) {
	document.getElementById(pathArray[3]).src=imgBase+pathArray[3]+mouseOverSuffix;
	document.getElementById(pathArray[3]).id=document.getElementById(pathArray[3]).id+'Selected';
	}
	
function imgMouseOver(imgId) {
	if (document.getElementById(imgId) && !(document.getElementById(imgId).id.match(/Selected$/))) {
		document.getElementById(imgId).src=imgBase+imgId+mouseOverSuffix;
		}
 	}
 
function imgMouseOut(imgId) {
	if (document.getElementById(imgId) && !(document.getElementById(imgId).id.match(/Selected$/))){
		document.getElementById(imgId).src=imgBase+imgId+mouseOutSuffix;
		}
	}
