function gElId(elId) {
    return ((document.getElementById)?document.getElementById(elId):((document.all)?document.all[elId]:null));
}
var sTm=null,overMenu=false;
function hideSubm(sw) {//thisEl) {
    var colULs=document.getElementsByTagName('UL');
    for(i=0;colULs && i<colULs.length && i<50000;i++)
    {
        if(colULs[i].className=='showSubm') {if(overMenu && (colULs[i]==lastEl || colULs[i].parentNode==null || colULs[i].parentNode==lastEl || colULs[i].parentNode.parentNode==lastEl)) {
            if(sTm!=null) {clearTimeout(sTm); sTm=null;}
            sTm=setTimeout('hideSubm(1);',1000);
        } else colULs[i].className='showSubm0';}
    }
    overMenu=false;
    lastEl=null;
}
var lastEl=null;
function showSubm(thisEl,sw) {
    if(thisEl==-1) thisEl=gElId('menuline1');
    mLn=thisEl;
    if(!sw) {
        if(sTm!=null) {clearTimeout(sTm); sTm=null;}
        sTm=setTimeout('showSubm(-1,'+((sw)?sw:-1)+');',1000);
        return;
    } else if(sw<0) {
        hideSubm(thisEl);
        return;
    }
    for(i=0;mLn.childNodes && i<mLn.childNodes.length && i<50000;i++)
    {
        if(mLn.childNodes[i].tagName.toLowerCase()=='ul') {
            overMenu=true;
            if(thisEl.parentNode.className=='showSubm0' || thisEl.parentNode.className=='showSubm') {
                if(sTm!=null) {clearTimeout(sTm); sTm=null;}
                sTm=setTimeout('hideSubm(1);',500);
                mLn.childNodes[i].className='showSubm';
            } else {
                if(sTm!=null) {clearTimeout(sTm); sTm=null;}
                sTm=setTimeout('hideSubm(1);',80);
            }
            lastEl=mLn.childNodes[i];
            mLn.childNodes[i].className='showSubm';
            return;
        }
    }
}