function showPopupMenu(layerId, parentMenu)
    {
        var parentMenuObj = document.getElementById(parentMenu);
        var popupObj = document.getElementById(layerId);
        var offsetX =5;
        var offsetY =27;
        
        popupObj.style.top = getAbsY(parentMenuObj) + offsetY;
        popupObj.style.left = getAbsX(parentMenuObj) + offsetX;
        if(navigator.appName == "Netscape")
        {
            popupObj.style.left = getAbsX(parentMenuObj) + offsetX + "px";
            popupObj.style.top =  getAbsY(parentMenuObj) + offsetY + "px";
        }
        popupObj.style.display = "inline";
        popupObj.style.visibility = "visible";
        
    }
    function hidePopupMenu(layerId)
    {
        var popupObj = document.getElementById(layerId);
        popupObj.style.visibility = "hidden";
    }

    function getAbsX(obj) //gets absolute X coordinate of an object
    {
        var leftOffset = 0;
    	
        if (obj.offsetParent)
        {
            
            while (obj.offsetParent)
            {
	            leftOffset += obj.offsetLeft;
	            obj = obj.offsetParent;
            }
        }
        else if (obj.x) //for Netscape v.4
        {
            leftOffset = obj.x;
        }
        return leftOffset;
    }
              
    function getAbsY(obj) //gets absolute Y coordinate of an object
    {
        var topOffset = 0;
    	
        if (obj.offsetParent)
        {
            while (obj.offsetParent)
            {
	            topOffset += obj.offsetTop;
	            obj = obj.offsetParent;
            }
        }
        else if (obj.y) //for Netscape v.4
        {
            topOffset = obj.y;
        }
        return topOffset;
    }