window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
var menuActive = 0;
var menuOn = 0;
var onLayer;
var timeOn = null;

function showLayer(layerName,aa)
{
	var x =document.getElementById(aa);
//	var tt =findPosX(x);
//	var ww =findPosY(x)+20;

	if (timeOn != null) 
	{
		clearTimeout(timeOn);
		hideLayer(onLayer);
	}
	if (IE4) 
	{
		var layers = eval('document.all["'+layerName+'"].style');
//		layers.left = tt;
		eval('document.all["'+layerName+'"].style.visibility="visible"');
	}
	else 
	{
		if(document.getElementById)
		{
			var elementRef = document.getElementById(layerName);
			if((elementRef.style)&& (elementRef.style.visibility!=null))
			{
				elementRef.style.visibility = 'visible';
//				elementRef.style.left = tt;
//				elementRef.style.top = ww;
			}
		}
	}

	onLayer = layerName
}

function hideLayer(layerName)
{
	if (menuActive == 0)
	{
		if (IE4)
		{
			eval('document.all["'+layerName+'"].style.visibility="hidden"');
		}
	else
		{
			if(document.getElementById)
			{
				var elementRef = document.getElementById(layerName);
				if((elementRef.style)&& (elementRef.style.visibility!=null))
				{
					elementRef.style.visibility="hidden";
				}
			}
		}
	}
}

<!-- sets a timer to keep the menu open while the user moves the mouse from the button to the menu-->
function btnTimer() 
{
	timeOn = setTimeout("btnOut()",600)
}

<!--If the mouse is not over the menu, then hide the menu-->
function btnOut(layerName)
{
	if (menuActive == 0)
	{
		hideLayer(onLayer)
	}
}


var item; <!--Keeps track of which menu item is highlighted-->

<!--When the mouse moves over a menu item, highlight it, clear the timer, and activate menu-->
function menuOver(itemName,ocolor) 
{
	item=itemName;
	itemName.style.backgroundColor = ocolor; //background color change on mouse over 
	clearTimeout(timeOn);
	menuActive = 1;
}

<!--When the mouse moves off a menu item, de-highlight it, deacivate the menu, and reset the timer to hide the menu-->
function menuOut(itemName,ocolor)
{
	if(item)
	itemName.style.backgroundColor = ocolor; 
	menuActive = 0;
	timeOn = setTimeout("btnOut(onLayer)",900);
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
	curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
	curtop += obj.y;
return curtop;
}