t_u = null;
t_u_old = null;
showPic = -1;
//显示对应的层内容
function switchPic(curPic)
{ 
 var aa=document.getElementById("num").getElementsByTagName("a");
 if(curPic == aa.length-1)
  {showPic = 0;}
 else
  {showPic = showPic + 1;}
 for(j=0; j < aa.length; j++)
 {
  if(j == showPic)
  { 
   aa[j].className = "li_num2";
   document.getElementById("product"+j).style.display = "block";
  }
  else
  { 
   aa[j].className = "li_num";
   document.getElementById("product"+j).style.display = "none";
  }
 }
}

function reSwitchPic()
{ 
 clearTimeout(t_u);
 switchPic(showPic);
 t_u = setTimeout('reSwitchPic();', 5000);
}

//停止滚动
function pauseSwitch()
{ 
 clearTimeout(t_u);
 t_u_old = t_u;
}

//单击后选择对应栏目显示
function ntab(thisObj,Num){
showPic=Num;
if(thisObj.className == "li_num2")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("a");
for(i=0; i <tabList.length; i++)
{
  if (i == Num)
  {
   thisObj.className = "li_num2"; 
      document.getElementById("product"+i).style.display = "block";
  }else{
   tabList[i].className = "li_num"; 
   document.getElementById("product"+i).style.display = "none";
  }
} 
}


//开始滚动
function goonSwitch()
{
 clearTimeout(t_u);
 t_u = setTimeout("reSwitchPic();", 5000);
}
