var currentMenu, popTimer;
var menuDelay=200;

function showPop(whichOne) {
    // stop timer
    if (popTimer) stopTimer();

    // hide other menu
    if(currentMenu && (currentMenu!=whichOne)) hidePop(currentMenu);

    // objects
    myLink = document.getElementById('m'+whichOne);
    myPop = document.getElementById('sub'+whichOne);

    // highlight top link
    if(myLink) myLink.className='hi';

    // show menu
    if(myPop) myPop.className='show';

    currentMenu = whichOne;
}

function hidePop(whichOne) {
    // objects
    myLink = document.getElementById('m'+whichOne);
    myPop = document.getElementById('sub'+whichOne);

    // highlight top link
    if(hiMenu != whichOne) {
        if(myLink) myLink.className='';
    }

    // show menu
    if(myPop) myPop.className='';

    //currentMenu = null;
}

function startTimer() {
    popTimer=setTimeout("hidePop(currentMenu)",menuDelay)
}

function stopTimer() {
	clearTimeout(popTimer)
	popTimer = null;
}

function popup(myLink) {
    myWindow = window.open(myLink, "cPopUp", "width=700,height=530");
    myWindow.focus();
    return false;
}
