var choice;
var subMenu;
var timer=0;
var infoArray = new Array();
var myCounter = 0;

function hideAllSubMenus()
{
    for(countA=0;countA<7;countA++)
    {
        theMenu="subMenu"+countA;
        document.getElementById(theMenu).style.visibility="hidden";
    }
}

function changeColor(theMenu)
{
    choice="choice"+theMenu;
    subMenu="subMenu"+theMenu;
    document.getElementById(choice).style.backgroundColor="ffffff";
    document.getElementById(choice).style.color="800000";
    hideAllSubMenus();
    if(timer)
        window.clearTimeout(timer);
    document.getElementById(subMenu).style.visibility="visible";
}

function changeColorBack(theMenu)
{
    choice="choice"+theMenu;
    subMenu="subMenu"+theMenu;
    document.getElementById(choice).style.backgroundColor="800000";
    document.getElementById(choice).style.color="ffffff";
    timer=window.setTimeout("eraseMenu(subMenu)",5000);
}

function eraseMenu(theMenu)
{
    document.getElementById(theMenu).style.visibility="hidden";
}

function changeColorSub(theMenu)
{
    choice="subMenu"+theMenu;
    document.getElementById(choice).style.backgroundColor="ffffff";
}

function changeColorBackSub(theMenu)
{
    choice="subMenu"+theMenu;
    document.getElementById(choice).style.backgroundColor="c0c0c0";
}

function clickedIt(theURL)
{
    document.location=theURL;
}

function changeData()
{
    if(myCounter<(infoArray.length - 1))
        myCounter++;
    else
        myCounter=0;
    document.getElementById('infoBar').innerHTML = infoArray[myCounter];
}

function writeEvent()
{
    document.getElementById('infoBar').innerHTML = infoArray[myCounter];
    myTimer=window.setInterval("changeData()",5000);
}
