//Include file to handle the Menu Sticky function highlighting the active 
//table menu cell

//Global Variables Setting the Sicky menu element prefix and the max 
//number of elements.
var stickBase = "stick";
var stickMax = 7;
var timerSet = false;
var stickyTimer = 0;

function defaultStick() { menuHighlight(stickBase,stickDefault,stickMax); }

function menuDim(passedID) { document.getElementById(passedID).style.background="#00519A"; }

function menuHighlight(Base,ID,Max) {
	//alert(stickBase+":"+stickDefault+":"+stickMax);
	for (i = 1; i <= Max; i++) {
		//Test for the existance and break of element does not exist
		if (document.getElementById(Base + i) == null) break;
		
		if (i == ID) 
			{ document.getElementById(Base + i).style.background = "#FF9900"; }
		else 
			{ document.getElementById(Base + i).style.background = "#00519A"; }
	}
}

function leftMenuOver(ID) { 
	
	menuHighlight(stickBase, ID, stickMax);
	
	//Timer to Reset Default Stick
	if (timerSet) 
		{ window.clearTimeout(stickyTimer); }
	
	//alert('Debug Point');	
	if (stickDefault != "") 
		{ stickyTimer = window.setTimeout("menuHighlight('"+stickBase+"',"+stickDefault+","+stickMax+")",2000); }
	else
		{ stickyTimer = window.setTimeout("menuDim('"+stickBase+ID+"')",2000); }

	timerSet = true;
}