var hideMenuTimerID = null;
var menuTables = new Array();

function showDropDownMenu(objName)
{
	clearHideTimer();
	hideDropDownMenu();

	var mnuTableObj = document.getElementById(objName + "Menu");

	if (mnuTableObj)
	{
		var imgObj = document.images[objName + "Link"];
		var mnuObj = document.getElementById("menuContainer");
		var macAdj = (navigator.appVersion.indexOf("Macintosh") > 0 ? 1 : 0);
		var objExists = false;

		for (i=0; i<menuTables.length; i++)
		{
			if (menuTables[i] == mnuTableObj)
			{
				objExists = true;
				break;
			}
		}

		if (!objExists)
			menuTables[menuTables.length] = mnuTableObj;
		
		mnuTableObj.style.display = "block";

		with (mnuObj.style)
		{
			top = parseInt(getObjY(imgObj) + 4 + macAdj) + "px";
			left = parseInt(getObjX(imgObj) + 32 + macAdj-1) + "px";
			visibility = "visible";
		}
	}
}

function itemMouseOver(obj)
{
	obj.className = "menuitemOver";
}

function itemMouseOut(obj)
{
	obj.className = "menuitem";
}

function clearHideTimer()
{
	clearTimeout(hideMenuTimerID);
	hideMenuTimerID = null;
}

function setHideTimer()
{
	hideMenuTimerID = setTimeout("hideDropDownMenu();", 250);
}

function hideDropDownMenu()
{
	var mnuObj = document.getElementById("menuContainer");
	mnuObj.style.visibility = "hidden";
	
	for (i=0; i<menuTables.length; i++)
		menuTables[i].style.display = "none";
}

function getObjX(o)
{
	var x = 0;
	while (o != document.body && o != null)
	{
		x += o.offsetLeft;
		o = o.offsetParent;
	}

	return x;
}

function getObjY(o)
{
	var y = 0;
	while (o != document.body && o != null)
	{
		y += o.offsetTop;
		o = o.offsetParent;
	}

	return y;
}