﻿var mnCurrent = '';
var mnCurrentHov = '';
var mnTimeout = 0;
var mnMillis = 300;

function mnObjHide(id) {
    $("#" + mnCurrentHov).parent().css("border-bottom", "");   
    //obj = document.getElementById(id);
    obj = $("div.popups").find("ul[id=" + id + "]");
    if (obj) {
        //obj.style.display = 'none';
        obj.hide();
        $("div.persistent").show();
    }
    
}

function mnObjShow(id) {
    //obj = document.getElementById(id);
    obj = $("div.popups").find("ul[id=" + id + "]");
    if (obj) {
        //obj.style.display = 'block';
        obj.css("display", "block");
        $("div.persistent").hide();
    }  
}

function mnShow(id, menuid) {
    if (mnTimeout != 0)
        clearTimeout(mnTimeout);

    if ((mnCurrent != '') && (mnCurrent != id)) {
        mnObjHide(mnCurrent);
        document.getElementById(mnCurrentHov).className = mnCurrentHov;
    }

    mnCurrent = id;
    mnCurrentHov = menuid;
    mnObjShow(mnCurrent);
    document.getElementById(mnCurrentHov).className = mnCurrentHov + 'Hov';
    document.getElementById(mnCurrentHov).className = 'hover';
    document.getElementById('menu2BoxBgColor').className = 'menu2Box menu2BoxGrey';
    $("#" + menuid).parent().css("border-bottom", "5px solid #5A656F");
}

function mnHide(millis) {
    mnMillis = millis;
    mnTimeout = setTimeout('mnTimeoutHide()', mnMillis);
    
}

function mnTimeoutHide() {
    mnObjHide(mnCurrent);    
    document.getElementById(mnCurrentHov).className = mnCurrentHov;
    mnCurrent = '';
    mnCurrentHov = '';
    mnTimeout = 0;
    document.getElementById('menu2BoxBgColor').className = 'menu2Box';    
}

