var xCurrent = 0;


function menus(menuName)
{   
    if(menuName)
        if(document.getElementById(menuName).style.display=="block")
        {   
            /*Hide selected Menu*/
            document.getElementById(menuName).style.display = "none";
            var titleName = menuName + "Topic";
            document.getElementById(titleName).style.color = "black";
        }
        else
        {
            /*Hide all Menus. Then Turn on the selected Menu*/
            document.getElementById("what").style.display = "none";
            document.getElementById("reading").style.display = "none";
            document.getElementById("outside").style.display = "none";

            document.getElementById(menuName).style.top = "0px";
            document.getElementById(menuName).style.display = "block";
            
            /*Declare that browser isn't N6, then verify this claim*/            
            var isit = "no";
            
            for(place=0; place<=navigator.userAgent.length; place++)
            {
                if(navigator.userAgent.substr(place,9)=="Netscape6")
                {
                    isit = "yes";
                }
            }
            
            /*If N6, don't animate. Otherwise, animate*/
            if(isit=="yes")
            {
                document.getElementById(menuName).style.top = "98px";
            }
            else
            {
                /*Call animate function*/
                animate(10, menuName);
            }

            /*Use menuName to access the menu's title*/
            var titleName = menuName + "Topic";

            /*Return all Menu Title colors to black, then make select menu gray*/
            document.getElementById("whatTopic").style.color = "black";
            document.getElementById("readingTopic").style.color = "black";
            document.getElementById("outsideTopic").style.color = "black";
            document.getElementById(titleName).style.color = "#676767";
        }
    else
    {
        /*Hide all Menus*/
        document.getElementById("what").style.display = "none";
        document.getElementById("reading").style.display = "none";
        document.getElementById("outside").style.display = "none";
        document.getElementById("whatHide").style.display = "none";
        document.getElementById("readingHide").style.display = "none";
        document.getElementById("outsideHide").style.display = "none";
        
    }
}

function animate(xCurrent, thisMenu)
{
    /*Check if menu is "open". If not, slide drop down menu until it is*/
    if(xCurrent>100)
    {
        return;
    }
    else
    {
        var topPosition = xCurrent + "px";
        currentMenu = thisMenu;
        document.getElementById(currentMenu).style.top = topPosition;
        newXCurrent = parseInt(xCurrent) + 10;
                
        setTimeout('animate(newXCurrent,currentMenu)',0);
    }
}


//reloads the window if Nav4 resized
function MM_reloadPage(init) {  
    if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}