﻿// JScript File

function dropDownMenu(callingObj)
{

	var oMenu = document.getElementById("ProductMenu");
	var nTop = document.getElementById("MenuBar").offsetTop+callingObj.clientHeight;
	var nLeft = callingObj.offsetLeft+10;
	oMenu.style.display='block';
	oMenu.style.left = nLeft+"px";
	oMenu.style.top = nTop+"px";
}
function closeDropDown(callingObj,evt)
{
//if the mouse is in the drop down, do nothing, else close drop down.
	var nTop = document.getElementById("MenuBar").offsetTop+callingObj.clientHeight;
	var nLeft = callingObj.offsetLeft+10;
	var nRight = nLeft+callingObj.clientWidth
	var mouse = typeof event == 'undefined' ? evt : event;
	var nYCoord = parseInt(mouse.clientY);
	var nXCoord = parseInt(mouse.clientX);
	if((callingObj.id == "ProductLink" && !(nYCoord > nTop && (nXCoord < nRight || nXCoord > nLeft))) || (callingObj.id == "ProductMenu" && !(nYCoord < nTop+20 && nXCoord < (nRight-10) && nXCoord > nLeft)))
	{
		document.getElementById("ProductMenu").style.display='none';
	}
}