
function ShowHideLayer(divName, show, x, y, objectId)
{
    if (objectId.length > 0)
    {
        var obj = document.getElementById(objectId);
        var coords;

        if (obj != null)
        {
            coords = FindPosition(obj)
        }
    }
    
    divFloating = document.getElementById(divName);
    if (divFloating != null)
    {
        divFloating.style["display"] = (show == true) ? 'block' : 'none';
        if (show == true)
        {
            divFloating.style["top"] = y + "px";
            divFloating.style["left"] = (coords[0] - 330) + "px";
        }
    }
    
    return false;
}

function FindPosition(obj) 
{
    var curleft = curtop = 0;
    if (obj.offsetParent) 
    {
        do 
        {
            curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		
		return [curleft,curtop];
    }
}
