
// browser sniff
var whatAgent =  navigator.userAgent; 
IE = (whatAgent.indexOf("MSIE") > 0)? true:false;
NS = (whatAgent.indexOf("Netscape") > 0)? true:false;

// layering stuff
// set this up for the major different browser DOMs
// Netscape6 || IE5
if (document.getElementById){
	//alert("NS6/IE5!");
	range1 	 = "getElementById(";
	range2 	 = ")";
	styleObj = ".style";
	doLayer = false;
	xCoordObj = ".offsetLeft";
	yCoordObj = ".offsetTop";
// MSIE 4+
} else if (document.all) {
	//alert("IE4!");
	range1 	 = "all.";
	range2 	 = "";
	styleObj = ".style";
	doLayer = false;
	xCoordObj = ".x";
	yCoordObj = ".y";
// Netscape 4+ and others
} else {
	//alert("NS4!");
	range1 	 = "layers.";
	range2 	 = "";
	styleObj = "";
	doLayer = true;
	//interval=5
	xCoordObj = ".x";
	yCoordObj = ".y";
}

function getObj(obj,stil) {
	var tmpObj;
	if (typeof obj == "string" && obj != "") {
		if (range2=="") {
			if (stil) {
				tmpObj = eval("document." + range1 + obj + range2 + styleObj)
			} else {
				tmpObj = eval("document." + range1 + obj + range2)
			}
		} else {
			if (stil) {
				tmpObj = eval("document." + range1 + "\"" + obj + "\"" + range2 + styleObj)
			} else {
				tmpObj = eval("document." + range1 + "\"" + obj + "\"" + range2)
			}
		}
	}
	else {
		tmpObj = obj;
	}
	
	if (tmpObj) {
		var xp = tmpObj;
	} else {
		var xp = "Not An Object";
	}
	return xp;
}

//	highlights an image and subNavMenu
function Activate(imageName, subNavMenu)
{
	//	test to see if the browser supports the document.images object
	if (document.images) {
		// turn them all off first
		for (var i = 0; i < navButtons.length; i++) {
			Deactivate(navButtons[i], subNavMenus[i]);
		}
	}
	// now activate the image and the subNav
	document[imageName].src = eval(imageName + "_on.src");
	ShowLayer(subNavMenu);
}

//	turns off  an image and subNavMenu
function Deactivate(imageName, subNavMenu)
{
	//	test to see if the browser supports the document.images object
	if (document.images)
	{
		//	do it
		document[imageName].src = eval(imageName + "_off.src");
	}
	HideLayer(subNavMenu);
}

function ShowLayer (subNavMenu) {
	if (getObj(subNavMenu,true).visibility!='visible') {
		getObj(subNavMenu,true).visibility='visible';
	}
}

function HideLayer (subNavMenu) {
	if (getObj(subNavMenu,true).visibility!='hidden') {
		getObj(subNavMenu,true).visibility='hidden';
	}
}
