//set inputs:
function mainInit( ){
    setInputButtons( );
}

//drop down menus ##################################################
var CurMenu = null;
var isDropped = false;
var isHideCheck = false;

function pageON(index){
    if(document.getElementById){
        var cInd = "top_" + index;
        var cCell = document.getElementById(cInd);
        var mInd = "tdiv_" + index;

        show(cCell, mInd);
    }
}

function pageOFF(index){
    if(document.getElementById){
        var cInd = "top_" + index;
        var cCell = document.getElementById(cInd);
        var mInd = "tdiv_" + index;

        if(!isHideCheck){
            hideMenu( );
        }
    }
}

function subPageON(index){
    var cInd = "top_" + index;
    var cCell = document.getElementById(cInd);
    var mInd = "tdiv_" + index;

    isDropped = true;
}

function subPageOFF(index){
    var cInd = "top_" + index;
    var cCell = document.getElementById(cInd);
    var mInd = "tdiv_" + index;

    if(!isHideCheck){
        hideMenu( );
    }
}

function show(pMenu, menuID) {
    if(CurMenu){
        CurMenu.style.visibility = "hidden";
    }

    var temp = 0;

    menu = document.getElementById(menuID);
    menu.style.left = "0px";
    menu.style.top = "24px";
    menu.style.visibility = "visible";

    isDropped = true;
    CurMenu = menu;
}

function setIsDropped( ){
    isDropped = true;
}

function hideMenu( ) {
   if(CurMenu){
     isDropped = false;
     isHideCheck = true;
     setTimeout('checkDropped( );', 500);
     isHideCheck = false;
   }
}

function checkDropped( ) {
     if(!isDropped){
          CurMenu.style.visibility = "hidden";
     }
}
//############################################################