//Netscape and IE have different syntax for accessing layers
	var isNav, isIE;
	var coll = "";
	var styleObj = "";
	var addDoc = "";
	var addDoc2 = "";
	var visTag = "";
	var hidTag = "";

	if (parseInt(navigator.appVersion) >= 4) {
		if (navigator.appName == "Netscape") {
			isNav = true;
			addDoc = "Menus.document.";
			addDoc2 = "subMenus.document.";
			visTag = "show";
			hidTag = "hide";
		} else {
			isIE = true;
			coll = "all.";
			styleObj = ".style";
			visTag = "visible";
			hidTag = "hidden";
		}
	}

	//convient list of items on top menu (to loop through in for loops rather than type them all out each time
	//should be named the sames as the center part of the graphic
	//all divs, images, and submenu items arrays will use these names

	var menuItems = new Array("company","products","eonline","services","solutions","customers","partners","news","contact","careers");

	//do the corresponding items in the array above have tertiary menus for their submenu items
	var menuHasSub = new Array("n","y","n","n","n","n","n","y","n");

	//if so for each section, make another convient list of items on each sub menu (to loop through in for loops rather than type them all out each time
	//all  divs for these TERTIARY menu items will use these names
	//modify the CSS documents to reflect changes here

	var productsItems = new Array("standard","enterprise","blank");
	var newsItems = new Array("release","articles","contacts","blank");

	//for example if Products had tertiary menu items it would look like this
	//var productsItems = new Array("infrastructure","process","cost","mobilized");

	//turns on the initial menus for the section/page
	function init() {
		//mainVis, secondaryVis, and subMenusVis are set in the individual set*vis.txt files that are server side included on each page...so that the menus can be set specifically for each page
		if (mainVis) {
			//swap top menu image to on...be sure to keep current naming convention of images/files
		    eval("document." + mainVis + ".src = document." + mainVis +".src.replace('_off\.','_on.')");
			//set the visibility for the select main menu layer to visible
			eval("document." + addDoc + coll  + mainVis + "Menu" + styleObj + ".visibility = '" + visTag + "';");
		}
		//Are tertiary level menus being used? If so, subMenusVis should be set to visible
		if (subMenusVis == 'visible') {
			eval("document." + coll + "subMenus" + styleObj + ".visibility = '" + visTag + "';");
			if (secondaryVis) {
				//set the visibility for the select second/tertiary menu layer to visible
				eval("document." + addDoc2 + coll  + secondaryVis + "Menu" + styleObj + ".visibility = '" + visTag + "';");
			}
		}
	}

	//turn on one menu item and turn off any others currently visible
	function show(obj,arr,img,level) {
		//obj is the name of the layer/menu to show
		//arr is the name of the menu to array to loop through
		//img is whether or not that menu is one of the top items and therefore has an image to reset to the off state in addition to hiding the menu layer
		//img is set to 'y' or ''
		//level is whether or not it is a main level menu in which case level is 1

		//set a temp var to the correct Netscape variable for level one or two (Menus.document. or subMenus.document.)
		var doc;
		if (level == 2) {
			doc = addDoc2;
		} else {
			doc = addDoc;
		}

		for (i=0;i<eval(arr + "Items.length");i++) {

			//go through the array (arr) and turn off any currently visible layers

			if (obj != eval(arr + "Items[i]") && eval("document." + doc + coll + eval(arr + "Items[i]") + "Menu" + styleObj + ".visibility") == visTag) {
				hide(eval(arr + "Items[i]"),img,level);

				//if current item is a main level and tertiary menus are enabled and it has tertiary level menus, loop through its array and turn off any currently visible layers

				if (level == 1 && subMenusVis == 'visible' && eval(arr + "HasSub[i]") == 'y') {
					for (j=0;jeval(eval(arr + "Items[i]") + "Items.length");j++) {
						if (eval("document." + addDoc2 + coll  + eval(eval(arr + "Items[i]") + "Items[j]") + "Menu" + styleObj + ".visibility") == visTag) {
							hide(eval(eval(arr + "Items[i]") + "Items[j]"),'',2);
						}
					}
				}
			}
		}
		//if there is a top menu image associated, switch it to the on state
		if (img) {
		    eval("document." + obj + ".src = document." + obj +".src.replace('_off\.','_on.')");
		}

		//show the select layer
		eval("document." + doc + coll + obj + "Menu" + styleObj + ".visibility = '" + visTag + "';");

	}

	//hide all currently visible menus and show any initially selected section/page menus set to be on
	function hideAll() {
		for (i=0;imenuItems.length;i++) {

			//go through the array (arr) and turn off any currently visible layers
			if (eval("document." + addDoc + coll + menuItems[i] + "Menu" + styleObj + ".visibility") == visTag) {
				hide(menuItems[i],'y',1);

				//if tertiary menus are enabled and the current item has tertiary level menus, loop through its array and turn off any currently visible layers
				if (subMenusVis == 'visible' && menuHasSub[i] == 'y') {
					for (j=0;jeval(menuItems[i] + "Items.length");j++) {
						if (eval("document." + addDoc2 + coll + eval(menuItems[i] + "Items[j]") + "Menu" + styleObj + ".visibility") == visTag) {
							hide(eval(menuItems[i] + "Items[j]"),'',2);
						}
					}
				}
			}
		}
		//show any initially selected section/page menus set to be on
		init();
	}


	//hide a menu layer
	function hide(obj,img, level) {
		//obj is the name of the layer/menu to hide
		//img is whether or not that menu is one of the top items and therefore has an image to reset to the off state in addition to hiding the menu layer
		//img is set to 'y' or ''
		//level is whether or not it is a main level menu in which case level is 1

		//hide the selected layer
		//set a temp var to the correct Netscape variable for level one or two (Menus.document. or subMenus.document.)
		var doc;
		if (level == 2) {
			doc = addDoc2;
		} else {
			doc = addDoc;
		}
		eval("document." + doc + coll  + obj + "Menu" + styleObj + ".visibility = '" + hidTag + "';");

		//if there is a top menu image associated, switch it to the off state
		if (img) {
		    eval("document." + obj + ".src = document." + obj +".src.replace('_on\.','_off.');");
		}
	}

	//fixes an issue with Netscape & resizing a window with layers
	function handleResize() {
		location.reload();
		return false;
	}

	if (isNav) {
		window.captureEvents(Event.RESIZE);
		window.onresize = handleResize;
	}

	//set style style based on each browser...netscape has all absolute positions and ie has absolute positioned layers wrapped in relative positioned ones
	if (isNav) {
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet/layers_nav_inside.css">');
	} else if (isIE) {
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet/layers_ie_inside.css">');
	}
