var currMenu;
var timeOutID;

function showMenu(menuIdx)
{
    if (currMenu)
    {
        window.clearTimeout(timeOutID);
        document.getElementById(currMenu).style.visibility="hidden";
    }
    
    currMenu = menuIdx;
    document.getElementById(menuIdx).style.visibility="visible";
    timeOutID = window.setTimeout('hideMenu()',5000);
}

function hideMenu()
{
    document.getElementById(currMenu).style.visibility="hidden";
    currMenu = Null;
}
        
function delayHideMenu()
{
    if (timeOutID)
    {
        window.clearTimeout(timeOutID);
        timeOutID = setTimeout("hideMenu()", 5000);
    }
}

function hideAll()
{
    document.getElementById(currMenu).style.visibility="hidden";
    currMenu = menuIdx;
}

function reSize()
{
    if (document.getElementById)
    {
        if (screen.width > 800)
        { 
            var element = new Array("top-border", "logo", "bottom-border", "tab-1", "tab-2", "tab-3", "tab-4", "nav-bar", "sub-nav1", "sub-nav2", "sub-nav3", "sub-nav4", "marquee", "content-area", "side-links");
            
            var oldLeft = new Array("0", "0", "0", "0", "200", "400", "600", "0", "0", "0", "0", "0", "0", "170", "0");
            var offset = (screen.width - 800) / 2;
            for (var i = 0; i <= 14; i++)
            {
                var newOffset = parseInt(offset) + parseInt(oldLeft[i]);
                document.getElementById(element[i]).style.left = newOffset + 'px';
            }
        }
    }
}