// browser detection
isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE6 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;


// basic image rolloverFunction
function rollImage(imageObj, imgTarget) {
	document.getElementById(imgTarget).src = eval(imageObj + ".src");
}

// Really basic show and hide layer functions

function showLayer(divId) {
	document.getElementById(divId).style.visibility = "visible";
}
		
function hideLayer(divId) {
	document.getElementById(divId).style.visibility = "hidden";
}


//  show layer function

var menuTimer;
var menuTimeout;
var submenuTimeout;
var currentMenu;
var currentsubMenu;


function menuOn(menuName) {
	var theMenu;

	if (menuTimeout) { clearTimeout(menuTimeout); }	// clear the timeout

	if (currentMenu) {			// hide the current menu
		theMenu = document.getElementById(currentMenu);
		theMenu.style.visibility = "hidden";
	}
	currentMenu = menuName;
	theMenu = document.getElementById(currentMenu);
	theMenu.style.visibility = "visible";				// display menuName
}

function submenuOn(submenuName) {
	var thesubMenu;

	if (submenuTimeout) { clearTimeout(submenuTimeout);	} // clear the timeout

	if (currentsubMenu) {			// hide the current menu
		thesubMenu = document.getElementById(currentsubMenu);
		thesubMenu.style.visibility = "hidden";
	}
	currentsubMenu = submenuName;
	thesubMenu = document.getElementById(currentsubMenu);
	theMenu = document.getElementById(currentMenu);
	thesubMenu.style.visibility = "visible";
	theMenu.style.visibility = "visible";				// display menuName
}

// Hides the dropdown menus
// inputs: menuName - name of the menu DIV layer without the Div.  ie. vehicles
// outputs: none
function menuOff(menuName) {
	if (menuTimeout) clearTimeout(menuTimeout)	// clear the current timeout
	menuTimeout = setTimeout('document.getElementById("' + menuName + '").style.visibility = "hidden"', 500);		// set the new timeout
}

function submenuOff(submenuName) {
	if (submenuTimeout) clearTimeout(submenuTimeout)	// clear the current timeout
	submenuTimeout = setTimeout('document.getElementById("' + submenuName + '").style.visibility = "hidden"', 330);		// set the new timeout
}


function navItemRollOn(itemName) {
	document.getElementById(itemName).bgColor='#cf3b00';
}

function navItemRollOff(itemName) {
	document.getElementById(itemName).bgColor='#ff4800';
}