rollOb="1";
activItem="";
subRoll="";
forIE=0;
activOne="";
function dd(i){
   
   document.getElementById(rollOb).style.height=i+"PX";
   document.getElementById(rollOb).style.display="block";
}

function roll(){     
    if(rollOb=="s2"){
      document.getElementById(rollOb).style.display="block"; 
    }
    else{
     

    document.getElementById(rollOb).style.display="block"; 
    var t=document.getElementById(rollOb).scrollHeight;
    document.getElementById(rollOb).style.height=1;
	document.getElementById(rollOb).style.display="none"; 
      for (var i=0;i<t+1;i++){
                  setTimeout('dd('+i+')',2*i);
      }
    }
}

function show(ob){
  
	var showId=ob.substr(1);
   
	$('li.menucontainer').hide();
	$('li.menu2container').hide();
   
	ch="s"+showId;
   
	if(rollOb==ch){
     
	   if(forIE==1){
		   forIE=0;
	   } else {
         
		   m=rollOb.substr(1);
		   hide="s"+m;
		   change="m"+m;
		   document.getElementById(ch).style.display="none";
		   document.getElementById(change).className="none";
		   rollOb="1";
		   
		   if(subRoll!=""){
			   whatHide=subRoll.substr(1);
			   whatHide="k"+whatHide;
			   hideSub(whatHide);
          }
		   
      }
	   
	} else {
	   
	   if(rollOb=="1"){
	   
		   $('#m' + showId).next().show();
	   
		   document.getElementById(ob).className=ob;
		   activItem=ob;
		   rollOb=ch;
		   roll(); 
	   }
   }
	
   if((rollOb!=ch)&&(rollOb!="1")){
    
	   if(rollOb!="1"){
		   
		   m=rollOb.substr(1);
		   hide="s"+m;
		   change="m"+m;
		   document.getElementById(hide).style.display="none";
		   document.getElementById(change).className="none";
		   
		   if(subRoll!=""){
			   whatHide=subRoll.substr(1);
			   whatHide="k"+whatHide;
			   hideSub(whatHide);
          }
	   }
      
	   $('#m' + showId).next().show();
	  
	   document.getElementById(ob).className=ob;
	   activItem=ob;
	   rollOb=ch;
	   roll();
	   forIE=0;  
   }
   
}


function showSub(ob){
   
	var showId=ob.substr(1);
	ch="r"+showId;
	showel="k"+showId;
   
   $('li.menu2container').hide();
   
   if((ch!=subRoll)&&(subRoll!="")){
       m=subRoll.substr(1);
       hide="k"+m;
       document.getElementById(hide).style.display="none";   
   }
   
   m=subRoll.substr(1);
   hide="k"+m;
   
   if((ch==subRoll)&&(document.getElementById(hide).style.display=="block")){
	   
       document.getElementById(hide).style.display="none";
       forIE=1;
       
   } else {
	   
	   $('#r' + showId).next().show();
	   
	   document.getElementById(showel).style.display="block";
	   subRoll=ch;
	   forIE=1;
   }
}



function hideSub(ob){
   document.getElementById(ob).style.display="none";  
}

function onMouse(ob){
   document.getElementById(ob).className=ob;
}
function outMouse(ob){
   
   if(ob!=activItem){
      if(ob==activOne){
         document.getElementById(ob).className="showOne";
      }
      else{
      document.getElementById(ob).className="";
      }
   }
}

function showOne(ob){
   activOne=ob;
   document.getElementById(ob).className="showOne";
      
}
function outMouseOne(ob){
   
      document.getElementById(ob).className="showOne";
   
}
