﻿		function getLeft(element)
		{
			if (element == null) return 0;
			var e = element;
			var left = e.offsetLeft-1;
			while (e = e.offsetParent)
			{
				left += e.offsetLeft;
			}
			return left + "px";
		}
		function getTop(element)
		{
			if (element == null) return 0;
			var e = element;
			var top = 3 + e.offsetHeight;
			while (e = e.offsetParent)
			{
				top += e.offsetTop;
			}
			return top + "px";
		}
		var objMenu = null;
		var objLink = null;
		function showMenu(evt, idMenu)
		{
			objMenu = document.getElementById(idMenu);
			if (objMenu == null) return;
			if (objMenu.parentNode == null) return;
			if(evt == null) evt = window.event;
			objLink = evt.srcElement ? evt.srcElement : evt.target;
			objLink.className = objLink.className.replace("loMenu", "hiMenu");
			objMenu.parentNode.style.left = getLeft(objLink);
			objMenu.parentNode.style.top = getTop(objLink);
			//objMenu.style.width = objMenu.parentNode.clientWidth;
			showMenuFrame(objMenu.parentNode);
		}
		function hideMenu()
		{
			if (objMenu == null) return;
			if (objMenu.parentNode == null) return;
			hideMenuFrame(objMenu.parentNode);
		}
		function showMenuFrame(obj)
		{
			obj.style.display = "block";
			if (objMenu != null)
				objMenu.style.height = "auto";
			if (objLink != null)
				objLink.className = objLink.className.replace("loMenu", "hiMenu");
		}
		function hideMenuFrame(obj)
		{
			obj.style.display = "none";
			if (objMenu != null)
				objMenu.style.height = "0";
			if (objLink != null)
				objLink.className = objLink.className.replace("hiMenu", "loMenu");
		}
