<!--
/*
User Friendly Drop-Down Menus 1.5
By Derron Fairbanks
Copyright (c) 2002 Candesa Interactive Corp
*/
//************************************* Begin Do Not Edit *************************************

var lastItem=0;

//Creates object arrays for Menu Category
var navCatLyrs = new Array();
for(i = 0; i < menuCat.length; i++)
{
	navCatLyrs[i] = eval("document." + dotall + getel + "navMenu" + i + dotstyle);
}

var navLyrs = new Array();
for(i = 0; i < menuCat.length; i++)
{
	navLyrs[i] = new Array(menuCat[i]);
}

//Creates an array of objects for each Menu under each Category
for(i = 0; i < navLyrs.length; i++)
{
	thsArray = navLyrs[i];
	for(j = 0; j < thsArray.length; j++)
	{
		thsArray[j] = eval("document." + dotall + getel + "navMenu" + i + "Layer" + j + dotstyle);
	}	
}

//Grabs backdrop and highlight layers as objects
var backLite = eval("document." + dotall + getel + "highLightLayer" + dotstyle);
var backDrop = eval("document." + dotall + getel + "backDropLayer" + dotstyle);

//Keeps the current menu on and closes previously open menus immediately
function clearTo(wMenu){
	if(tO != null){
		clearTimeout(tO);
			if(currentlyOn != wMenu){
				triggerNavOff(currentlyOn);
		}
	}
}

//Delays shutting menu off to give the user time to select an option
//Also turns off highlight layer
function delayedOff(wMenu){
	if(backLite){
		backLite.visibility = "hidden";

		// change the link color
//		thsDiv = "navMenu" + wMenu + "Layer" + lastItem;
//		var obj=document.all[thsDiv];
//		if(obj!=null)
//			document.all[thsDiv].all.tags("A")[0].style.color="#ffffff";
	}
	tO = setTimeout("triggerNavOff(" + wMenu + ")", menuDelay);
}

//Turns the menus on
function triggerNavOn(wMenu){
	clearTo(wMenu);
	backDropOn(wMenu);
	thsMenu = navLyrs[wMenu];
	for(i = 0; i < thsMenu.length; i++){
		thsMenu[i].visibility = "visible";
	}
	currentlyOn = wMenu;
	navSwap(wMenu,1);
}

//Turns the menus and backdrop off.  Only called by other functions.
function triggerNavOff(wMenu){
	thsMenu = navLyrs[wMenu];
	for(i = 0; i < thsMenu.length; i++){
		if(isIE && !isIE4){ //initializes filters
			backDrop.filter = "alpha(opacity=90)";
		}
		thsMenu[i].visibility = "hidden"; 
		backDrop.visibility = "hidden";		
		backLite.visibility = "hidden";	
		navSwap(wMenu,0);		
	}
}

//Positions, sizes and turns on backdrop.  Only called by other functions.
function backDropOn(wMenu){
	getMenu = navLyrs[wMenu];
	rightHeight = getMenu.length * menuItemHeight;
	if(isIE){
		topVal = getMenu[0].pixelTop
		leftVal = getMenu[0].pixelLeft;		
	} else if(isGecko){
		topVal = getMenu[0].top
		leftVal = getMenu[0].left
	}
	bdTop = parseInt(topVal);
	bdLeft = parseInt(leftVal) - blLeftPosnMod;
	backDrop.top = bdTop;
	backDrop.left = bdLeft;
	backDrop.width = menuItemWidth;
	backDrop.height = rightHeight;
	if(isIE && !isIE4)
	{ //initializes filters
		backDrop.filter = "alpha(opacity=90)";
	}
	backDrop.visibility = "visible";
//	alert(backDrop.left+' - '+backDrop.top+' '+backDrop.visibility);
}

//Positions and turns on highlight layer.  
function liteItUp(wMenu,wLayer){
	clearTo(wMenu);
	lastItem=wLayer;
	ltLayer = eval("navLyrs[" + wMenu + "][" + wLayer + "]");

	// change the link color
//	thsDiv = "navMenu" + wMenu + "Layer" + wLayer;
//	document.all[thsDiv].all.tags("A")[0].style.color="#000000";

	if(isIE){
		topVal = ltLayer.pixelTop
		leftVal = ltLayer.pixelLeft;		
	} else if(isGecko){
		topVal = ltLayer.top
		leftVal = ltLayer.left
	}
	blTop = parseInt(topVal);
	blLeft = parseInt(leftVal) - blLeftPosnMod;
	backLite.top = blTop;
	backLite.left = blLeft;
	backLite.visibility = "visible";
}

//Positions the menu item layers on the screen in accordance with values specified above
//Overrides any inline positioning of the layers
//Must be called at the end of the document to work in some browsers
function positionMenus(){
	nextTop = startingTop;
	nextLeft = startingLeft;
	for(i = 0; i < menuPosnVals.length; i++)
	{
		navCatLyrs[i].left = menuCatPosnVals[i];
		navCatLyrs[i].top = startingCatTop
		currentMenu = navLyrs[i];
		nextLeft = nextLeft + menuPosnVals[i];
		for(j = 0; j < currentMenu.length; j++)
		{ 
			nextTop = nextTop + menuItemHeight;
			currentMenu[j].left = nextLeft;
			currentMenu[j].top = nextTop;			
		}
		nextTop = startingTop
	}
}

//************************************* End Do Not Edit *************************************

//-->


