var MENU_FOCUSED = false;
var MENU_NAME = '';

var MENU_FOCUSED_2 = false;
var MENU_NAME_2 = '';

IE4 = (document.all) ? 1 : 0;       // browser is Internet Explorer 4
NS4 = (document.layers) ? 1 : 0;    // browser is Netscape 4

ver4 = (IE4 || NS4) ? 1 : 0;  // know that we have version 4 browser
// this will be required for non-dhtml browsers

function hoverMenu(whichElement,status) {
	
	
		arrayOfLayers = ['discover_div','plan_div','about_div','media_div','contact_div'];
//		arrayOfLayers = ['plan_div'];

	
	
	maxNbrOfLayers = 5;
	if (status == true) {
		setMenuFocused()
		vis = 'visible';
	}
	else if (status == false) {
		vis = 'hidden';
	}


	// checking which browser
	if (IE4) {
		for (i=0;i<maxNbrOfLayers;i++) {
			layerName = arrayOfLayers[i];
			if (layerName == whichElement) {
				// get its index first
				layerIndex = i;
				theElement = eval('document.all.'+arrayOfLayers[i]+'.style');
				theElement.visibility=vis;
			} // check if layer exists
			else {
				theElement = eval('document.all.'+arrayOfLayers[i]+'.style');
				theElement.visibility='hidden';
			} // set other layers to hidden

		} // end if for loop
	} // end of IE4

	else if (NS4) { // netscape or similar browser
		for (i=0;i<maxNbrOfLayers;i++) {
			layerName = arrayOfLayers[i];
			if (layerName == whichElement) {
				// get its index first
				layerIndex = i;
				theElement = eval("document." + arrayOfLayers[i]);
				theElement.visibility=vis;
			} // check if layer exists
			else {
				theElement = eval("document." + arrayOfLayers[i]);
				theElement.visibility='hidden';
			} // set other layers to hidden


		} // end if for loop
	} // end of NS
	else { // for Opera browser
		for (i=0;i<maxNbrOfLayers;i++) {
			layerName = arrayOfLayers[i];
			if (layerName == whichElement) {
				// get its index first
				layerIndex = i;
				theElement = eval(document.getElementById(arrayOfLayers[i])).style;
				theElement.visibility=vis;
			} // check if layer exists
			else {
				
				theElement = eval(document.getElementById(arrayOfLayers[i])).style;
				theElement.visibility='hidden';
			} // set other layers to hidden

		} // end if for loop
	} // end of Opera

} // end hoverOver function

function startHideMenu(whichElement) {
	MENU_FOCUSED = false;
	MENU_NAME = whichElement;
	setTimeout("hideMenu()",500);
	return;
} // end startHideMenu()

function hideMenu() {
	if (!MENU_FOCUSED) hoverMenu(MENU_NAME,false);
	return;
} // end hideMenu()


function setMenuFocused() {
	MENU_FOCUSED = true;
} // end setMenuFocused

///////////////////////////////////////////////////////////////

function startHideMenu2(whichElement) {
	MENU_FOCUSED_2 = false;
	MENU_NAME_2 = whichElement;
	setTimeout("hideMenu2()",500);
	return;
} // end startHideMenu()

function hideMenu2() {
	if (!MENU_FOCUSED_2) hoverMenu2(MENU_NAME_2,false);
	return;
} // end hideMenu()

function setMenuFocused2() {
	MENU_FOCUSED_2 = true;
} // end setMenuFocused

function hoverMenu2(whichElement,status) {
	arrayOfLayers = ['plan_div'];
	maxNbrOfLayers = 1;
	if (status == true) {
		setMenuFocused2()
		vis = 'visible';
	}
	else if (status == false) {
		vis = 'hidden';
	}


	// checking which browser
	if (IE4) {
		for (i=0;i<maxNbrOfLayers;i++) {
			layerName = arrayOfLayers[i];
			if (layerName == whichElement) {
				// get its index first
				layerIndex = i;
				theElement = eval('document.all.'+arrayOfLayers[i]+'.style');
				theElement.visibility=vis;
			} // check if layer exists
			else {
				theElement = eval('document.all.'+arrayOfLayers[i]+'.style');
				theElement.visibility='hidden';
			} // set other layers to hidden

		} // end if for loop
	} // end of IE4

	else if (NS4) { // netscape or similar browser
		for (i=0;i<maxNbrOfLayers;i++) {
			layerName = arrayOfLayers[i];
			if (layerName == whichElement) {
				// get its index first
				layerIndex = i;
				theElement = eval("document." + arrayOfLayers[i]);
				theElement.visibility=vis;
			} // check if layer exists
			else {
				theElement = eval("document." + arrayOfLayers[i]);
				theElement.visibility='hidden';
			} // set other layers to hidden


		} // end if for loop
	} // end of NS
	else { // for Opera browser
		for (i=0;i<maxNbrOfLayers;i++) {
			layerName = arrayOfLayers[i];
			if (layerName == whichElement) {
				// get its index first
				layerIndex = i;
				theElement = eval(document.getElementById(arrayOfLayers[i])).style;
				theElement.visibility=vis;
			} // check if layer exists
			else {
				theElement = eval(document.getElementById(arrayOfLayers[i])).style;
				theElement.visibility='hidden';
			} // set other layers to hidden

		} // end if for loop
	} // end of Opera

} // end hoverOver function