 
  tag   =   0; //tag本标记用于初始化所有子菜单的状态，使其隐藏。  
  startList   =   function(rootObj) {   
  var   navRoot,i=0;   
  if(rootObj   ==   ''   ||   rootObj   ==   null) rootObj=getObjectById('navleft');    

  try{   
  navRoot   =   rootObj;   
  if(navRoot==null){alert('null   a   wrong   accoured');}   
  else     
  {   
  for   (i=0;   i<navRoot.childNodes.length;   i++)   {   
  node   =   navRoot.childNodes[i];   
  if   (node.nodeName=="LI")   {  
      node.onmouseover=function()     
      {   
      this.className   ="over";   

      }   
      node.onmouseout=function()     
      {   
      this.className="out";   

       }   
   
  if(tag==1){   
  node.className   =   "out";   
  }   
  startList(node);   //递归给li赋予鼠标动作

  }   
  else   if   (node.nodeName=="UL")   
  {    //标记为1，说明到了二级菜单以后，所以要给所有的赋隐藏属性。                 
  tag   =1;   
  startList(node);   
  }   
  }//for   end   
  }   
  }//try   end   
  catch(e){   
  alert("error   by   catch   throw");   
  }//catch   end   
  }//</startList>   
 
 //兼容ie ff
 getObjectById = function(id)   
 {   
      if   (typeof(id)   !=   "string"   ||   id   ==   "")   return   null;   
      if   (document.getElementById)   return   document.getElementById(id);   
      if   (document.all)   return   document.all(id);   
      try   {return   eval(id);}   catch(e){   return   null;}   
  }   


function menuFix() {
 var sfEls = document.getElementById("nav").getElementsByTagName("li");
 for (var i=0; i<sfEls.length; i++) {
  sfEls[i].onmouseover=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseDown=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseUp=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onmouseout=function() {
  this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), 

"");
  }
 }
}

/*更换显示样式*/
function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}
//-->
  
  
  function startup(){
    menuFix()
  	startList();
  }
setInterval("document.getElementById('aa').innerHTML=new Date().toLocaleString();",500);					 
 // window.onload   =   startup;   
 if (document.all){ 
window.attachEvent('onload',startup)//对于IE 

} 
else{ 
window.addEventListener('load',startup,false);//对于FireFox 
}

