var _active=0,enabl=true;
var _activesub=0;
                     
activecolor='#6C8AC4';
passivecolor='#2E5799';
activetextcolor='#ffffff';
passivetextcolor='#D6D6D6';




function showmenu(lay){
if (enabl&&(_active!=lay))
{ 

 if (oldlink=getObject("rootlink"+_active)) oldlink.style.color=passivetextcolor
 if (anch=getObject("rootlink"+lay))  anch.style.color=activetextcolor;

 lOld=getObject("rootmen"+_active)
 lNew=getObject("rootmen"+lay)

 dvst=getLayerStyle(getObject("divmen"+_active));
 if (dvst) dvst.background=passivecolor;
 if (dvst) dvst.color=passivetextcolor;

 dvn=getLayerStyle(getObject("divmen"+lay));
 if (dvn) dvn.background=activecolor;
 if (dvn) dvn.color=activetextcolor;


 if (lOld)
 {
    st=getLayerStyle(lOld);
    st.left=-1600;
 }

 if (lNew)
 {
    st=getLayerStyle(lNew);
    if (dv=getObject("divmen"+lay))
    { 
       if (isMSIE)
       {
        maxw=document.body.clientWidth
        scr=document.body.scrollLeft
       }
       else
       {
        maxw=innerWidth-18
        scr=pageXOffset
       }
       x=dv.offsetLeft;
       if ((x+lNew.offsetWidth-scr)>maxw) x=maxw-lNew.offsetWidth+scr;
       if (x<0) x=0;
       st.left=x;

    }
    else st.left=0;
 }
 
 }
   _active=lay;  
}

function normalize()
{
  showmenu(onloaddiv);
  setsubcolor(currsub);
}

function setsubcolor(nsub)
{
 if (_activesub!=nsub)
 {
     if (oldlink=getObject("sublink"+_activesub)) oldlink.style.color=passivetextcolor
     if (anch=getObject("sublink"+nsub))  anch.style.color=activetextcolor;

    spo=getObject("subspan"+_activesub);
    if (spo) spo.style.background=passivecolor;
    if (spo) spo.style.color=passivetextcolor;
   
    spn=getObject("subspan"+nsub);
    if (spn) spn.style.background=activecolor;
    if (spn) spn.style.color=activetextcolor;
     _activesub=nsub;
 }
}
//////////////////////////////////////////////////

