<!--
//
// Navigation and menu scripts.
// MLB - 6/21/2008
//


NUM_MAIN_MENUS = 7;
NUM_SUB_MENUS = 7;
menu_img_on = new Array();
menu_img_off = new Array();

var ns4;
var ie4;
var ns6;

function isBrowser(b,v)
{
	/*
	** Check if the current browser is compatible
	**  b  browser name
	**  v  version number (if 0 don't check version)
	** returns true if browser equals and version equals or greater
	*/
	browserOk = false;
	versionOk = false;
	
	browserOk = (navigator.appName.indexOf(b) != -1);
	if (v == 0) versionOk = true;
	else  versionOk = (v <= parseInt(navigator.appVersion));
	return browserOk && versionOk;
}


// Test for which browser
if (isBrowser('Netscape', 4)) ns4 = true;
if (document.all) ie4 = true;
if ((document.getElementById) && (!document.all)) ns6 = true;
if (ns6 == true) ns4 = false;
var ie=document.all;

// Number of seconds since last menu clear:
var menusCleared = 0;
// Number of seconds of idle time before clearing menus:
var MENU_START_TIME = 4;

var currentMenu = -1;


function InitMenus(path, current)
{
	currentMenu = current;
	showSubMenu(currentMenu);
}

function checkClearMenus()
{
	if (menusCleared > 0) {
		menusCleared--;
		if (menusCleared == 0) {
			clearAll(currentMenu);
		}
	}
}

var windowTimerFunc = window.setInterval("checkClearMenus()", 1000);

function showLayer(which)
{
	if (ie4) {
		document.all[which].style.visibility = "visible";
	}
	if (ns6) {
		document.getElementById(which).style.visibility = "visible";
	}
	if (ns4) {
		document.layers[which].visibility = "show";
	}
}

function hideLayer(which)
{
	if (ie4) {
		document.all[which].style.visibility = "hidden";
	}
	if (ns6) {
		document.getElementById(which).style.visibility = "hidden";
	}
	if (ns4) {
		document.layers[which].visibility = "hide";
	}
}

function hideAllSubMenus()
{
	for (i = 0;  i < NUM_SUB_MENUS;  i++) {
		hideLayer("submenu_" + i);
	}
	hideLayer("submenu-container");
}

function clearAll(menuNum)
{
	hideAllSubMenus();
	menusCleared = 0;
	if (currentMenu >= 0) {
		showSubMenu(currentMenu);
	}
}


function NewPopupWindow(url, name, options)
{
	var mynewwindow = window.open(url, name, options);
	//mynewwindow.document.close();
	mynewwindow.focus();
}

//-->

