function GetAscendingLefts(elemID)
{
	var offsetTrail = document.getElementById(elemID);
	var offsetLeft = 0;
	
	while (offsetTrail) {
		offsetLeft += offsetTrail.offsetLeft;
		offsetTrail = offsetTrail.offsetParent;
	}
	if (navigator.userAgent.indexOf("Mac") != -1 &&
		typeof document.body.leftMargin != "undefined") {
		offsetLeft += document.body.leftMargin;
	}
	return offsetLeft;
}

function GetAscendingTops(elemID)
{
	var offsetTrail = document.getElementById(elemID);
	var offsetTop = 0;
	
	while (offsetTrail) {
		offsetTop += offsetTrail.offsetTop;
		offsetTrail = offsetTrail.offsetParent;
	}
	if (navigator.userAgent.indexOf("Mac") != -1 &&
		typeof document.body.topMargin != "undefined") {
		offsetTop += document.body.topMargin;	
	}
	return offsetTop;
}

function ShowMenu(menuName, elemID)
{
	document.getElementById(menuName).style.left = GetAscendingLefts(elemID) + document.getElementById(elemID).offsetWidth;
	document.getElementById(menuName).style.top = GetAscendingTops(elemID);
	document.getElementById(menuName).style.visibility = 'visible';
}

function HideMenu(menuName)
{
	document.getElementById(menuName).style.visibility = 'hidden';
}

