	/***Vars and functions for menu***/
/***** Identify Document Object Model of Browser *****/
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;
var isNewNS = 0;

if ((navigator.appName.indexOf('Netscape') == -1) && (parseInt(navigator.appVersion) == 7)) {isNewNS = 1;
	}

if (document.getElementById) {isID = 1; isDHTML = 1;}
else {
browserVersion = parseInt(navigator.appVersion);
if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {isLayers = 1; isDHTML = 1;}
else {
if (document.all) {isAll = 1; isDHTML = 1;}
}}

function findDOM(objectID,withStyle) {
var menuArea = "menuArea";
	if (withStyle == 1) {
		if (isID) { return (document.getElementById(objectID).style) ; }
		else { 
			if (isAll) { return (document.all[objectID].style); }
		else {
			if (isLayers) { return (document.layers[menuArea].layers[objectID]); }
		};}
	}
	else {
		if (isID) { return (document.getElementById(objectID)) ; }
		else { 
			if (isAll) { return (document.all[objectID]); }
		else {
			if (isLayers) { return (document.layers[menuArea].layers[objectID]); }
		};}
	}
}
/***** Set an Objects Class ************************************/
function setClass(objectID,newClass) {
	var dom = findDOM(objectID,0);
	dom.className = newClass;
}

/***** CSS Layers Menuing System ***********************************/
/***** Requires that menuing items and classes *********************/
/***** be set up in the style sheet. *******************************/
var menuTop = 45;
var menuLeft = 400;
var domSMenu = null;
var oldDomSMenu = null;
var t = 0;
var lDelay = 3;
var lCount = 0;
var pause = 100;

function dropMenuNew(menuNum){
	if (isDHTML) {
		t = 22;
		// Hide previous menu
		if (oldDomSMenu) {
			oldDomSMenu.visibility = 'hidden'; 
			oldDomSMenu.zIndex = '0'; 
			t = 6; 
			lCount = 0;
			}
		}
		var idSMenu = 'menus' + menuNum;
		var domSMenu = findDOM(idSMenu,1);

	// Define the positions of the sub-menus
	if (isID || isAll) { 	

		// Position and show the menu
		if (oldDomSMenu != domSMenu) {
			domSMenu.visibility = 'visible';
			oldDomSMenu = domSMenu;
		}

///// Resets oldDom if it is the same as the current DOM
		else { oldDomSMenu = null; }
	}

////// Returns a 'null' value for non-DHTML Browsers 
	else { return null; }
}

function delayHide() {
///// Checks to see if there is a menu showing and whether 
///// the global variable 't' has been set to 0
    if ((oldDomSMenu) && (t == 0)) {

///// Hides the old menu, resets menu conditions, 
///// and stops the function running
        oldDomSMenu.visibility = 'hidden'; 
        oldDomSMenu.zIndex = '0';
        oldDomSMenu = null;
        lCount = 0; 
        return false;
    }

///// Interupts the function if another menu is opened
    if (t == 2) { lCount = 0; return false; }

///// Repeats the function adding 1 to lCount each time until 
///// lCount is equal to lDelay and then sets 't' to 0 so that 
///// the menu will hide when it runs again
    if (t == 1) { 
        lCount = lCount + 1;
        if (lDelay <= lCount) { t = 0; }
        if (lDelay >= lCount) { setTimeout('delayHide(' + t + ')',pause); }
    }
}

/***************************************************************************************************************/
	//Hightlight the menu option
function menuChange(srcEle)
	{				
		if(srcEle.className.toLowerCase() == 'MenuDrop')
		{
			srcEle.className = 'MenuDrop';
		}
		else
		{
			srcEle.className = 'MenuDrop';
		}
	}
/***************************************************************************************************************/
	//Hightlight the menu option on Contacts page
function menuMainHover(srcEle)
	{				
		if(document.srcEle.className == 'Department')
		{
			document.srcEle.className = 'DepartmentHover';
		}
		else
		{
			document.srcEle.className = 'Department';
		}
	}
/***************************************************************************************************************/
	//Change class on object
function changeClass(srcEle, changeTo)
	{				
		document.srcEle.className = changeTo;
	}
/***************************************************************************************************************/
	//TextSwap functions
function textShow(StorageID,SetToID)	{
		if (document.getElementById)	{
			document.getElementById(SetToID).innerHTML=document.getElementById(StorageID).innerHTML;
	}

}

function textHide(StorageID,SetToID)	{
		if (document.getElementById)	{
			document.getElementById(SetToID).innerHTML=document.getElementById(StorageID).innerHTML;
	}
}

function jumpMenu(targ1,selObject,restoreit){
  	eval(targ1+".location='"+selObject.options[selObject.selectedIndex].value+"'");
  	if (restoreit) selObject.selectedIndex=0;
}

function findObject(n, d) { //v4.01
  	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObject(n,d.layers[i].document);
  	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function jumpMenuGo(selName,targ1,restoreit){ //v3.0
  	var selObject = findObject(selName); if (selObject) jumpMenu(targ1,selObject,restoreit);
}
