function getElementPosition(elemID)
{
        var offsetTrail = document.getElementById(elemID);
        var offsetRight = offsetTrail.offsetWidth;
        var offsetBottom = offsetTrail.offsetHeight;
        var offsetLeft = 0;
        var offsetTop = 0;
        while (offsetTrail)
        {
                offsetLeft += offsetTrail.offsetLeft;
                offsetTop += offsetTrail.offsetTop;
                offsetTrail = offsetTrail.offsetParent;
                if (document.all) {
                        offsetLeft += 2;
                        offsetTop += 0;
                }
        }
        if (navigator.userAgent.indexOf("Mac") != -1 && typeof document.body.leftMargin != "undefined")
        {
                offsetLeft += document.body.leftMargin;
                offsetTop += document.body.topMargin;
        }
        offsetRight += offsetLeft;
        offsetBottom += offsetTop;

        if (document.all) {
                offsetLeft += 0;
                offsetTop += 0;
        }

        return {left:offsetLeft, right:offsetRight, top:offsetTop, bottom:offsetBottom};
}
function menu(action, id)
{
        switch(action)
        {
                case true:
                        menuArray[id]=true;
                        hide();
                break;
                case false:
                        menuArray[id]=false;
                        setTimeout("hide();",2000);
                break;
        }
}
function hide()
{
        var menuDiv;
        for (var count=1; count<=menuArray.length; count++)
        {
                if (menuDiv=document.getElementById("menu"+count))
                {
                        if (menuArray[count]==true)
                        {
                                var pos=new getElementPosition("item"+count);
                                menuDiv.style.left=pos.left+"px";
                                menuDiv.style.top=pos.bottom+"px";
                                menuDiv.style.display="block";
                        }
                        else
                                menuDiv.style.display="none";
                }
        }
}
function spamProtect(node, host, domain)
{
        node.href="mailto:"+host+"@"+domain;
}
var menuArray = new Array();
