
function navOn(which) {
	showNav(which);
	return true;
}
function navOff(which) {
	hideNav(which);
	return true;
}

function navStayOn(which) {
	eval("document.getElementById('" + which + "_nav').className = 'nav_" + which + "_on'");
}

function navStayOff(which) {
	eval("document.getElementById('" + which + "_nav').className = 'nav_" + which + "'");
}

// dhtml layer variables for cross-browser compatability
if (document.layers) {	// Netscape 4
	doc = "document[";
	conDoc = "document";
	sty = "]";
	htm = ".document";
	cls = "].className";
} else if (document.getElementById) {	// NS 6 or IE 5 and up (W3C compliant browsers).
	doc = "document.getElementById(";
	conDoc = "document.getElementById(";
	sty = ").style";
	htm = ".document";
	cls = ").className";
} else if (document.all) {	// IE 4
	doc = "document.all[";
	conDoc = "document.all[";
	sty = "].style";
	htm = "";
	cls = "].className";
}

// vars for dropdown menus
var navTimer = null;
var currNav = null;
var navHideDelay = 500;
var isNavLoaded = false;

// build dropdown objects (run onload)
function buildNav() {
	aboutDropNavObj = eval(doc + '"aboutDropNav"' + sty);
	servicesDropNavObj = eval(doc + '"servicesDropNav"' + sty);
	contactDropNavObj = eval(doc + '"contactDropNav"' + sty);
	accountDropNavObj = eval(doc + '"accountDropNav"' + sty);
	isNavLoaded = true;
}

// shows a dropdown menu, hides any other dropdown that is currently showing
function showNav(which) {
	if (isNavLoaded) {
		clearTimeout(navTimer);
		navTimer = null;
		if ((currNav != null) && (currNav != which)) {
			eval(currNav + "DropNavObj.visibility = 'hidden'");
		}
		if ((which == "about") || (which == "services") || (which == "contact") || (which == "account")) {
			currNav = which;
			eval(currNav + "DropNavObj.visibility = 'visible'");
		}
	}
}
// hides a dropdown menu on a time delay
function hideNav(which) {
	if (isNavLoaded) {
		clearTimeout(navTimer);
		navTimer = null;
		if ((which == "about") || (which == "services") || (which == "contact") || (which == "account")) {
			navTimer = setTimeout(which + "DropNavObj.visibility = 'hidden'", navHideDelay);
		}
	}
}

function changeImages() {
	if (document.images) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			var argArray = arguments[i].split('.');
			var objName;
			if ((document.layers && argArray.length > 1) || argArray.length <= 1) {
				objName = eval("document." + arguments[i]);
			} else {
				objName = eval("document." + argArray[argArray.length - 1]);
			}
			objName.src = eval(changeImages.arguments[i+1] + ".src");
		}
	}
}
