// JavaScript Document
//=======================================================
//函数名称：showClassList()
//函数功能：隐藏-显示级分类列表框（class_cnt1）
//返 回 值：无
//=======================================================
function showClassList(divname,hegith){
   // 如果内容容器为不可见的display:none
   if(getObject(divname).style.display == "none"){ 
       displayList(divname,hegith); // 显示内容框
   }
   else{ // 如果内容容器为可见的display:block
	     hiddenList(divname); // 隐藏内容框
	 }
}

// 隐藏列表框
function hiddenList(divname){
       var h = getObject(divname).offsetHeight; // 内容容器class_cnt1的初始高度（这时高度为：287px）
		   var anim = function(){
			     h -= 30; // 每次递减50像素
			     
			     if(h <= 5){
	             getObject(divname).style.display="none"; // 内容容器不可见（当容器高度小于5px）
		           getObject('tabclass1').style.backgroundImage="url(http://www.east-dragon.cn/files/sw/images/tab_drop2.gif)"; 
		           if(tt){window.clearInterval(tt);}
		       }
		       else{
		           getObject(divname).style.height = h + "px"; // // 容器高度不断的以50px递减 
		       }
		   }
		     
		   var tt = window.setInterval(anim,2); // 设置每2毫秒循环一次（每2毫秒，运行一次anim[容器的高度递减50px]）
}

function displayList(divname,hegith){    
  	    var h = getObject(divname).offsetHeight;  // 内容容器class_cnt1的初始高度（这时高度为：0）
	    var max_h; // 容器的最大高度
		if(hegith){max_h = parseInt(hegith);}
		else {max_h = 287; }
	      var anim = function(){			
				    h += 30; // 每次递增50像素
				    //如果增加的高度开始超过容的最大高度
				    if(h >= max_h){ 
		            getObject(divname).style.height = max_h + "px"; // 工期高度为287px(因为我们只希望容器这么高)
		            getObject('tabclass1').style.backgroundImage="url(http://www.east-dragon.cn/files/sw/images/tab_drop1.gif)"; // 让图片标签改变背景	       
		            if(tt){window.clearInterval(tt);} // 如果高度在每2毫秒递减，则清楚改行为（如果不清楚，程序将一直自动运行高度每2毫秒递减）
				    }
				    else{ // 如果增加中的容器高度没有超过287px
                getObject(divname).style.display="block"; // 让容器可见（这样我们才能够看到容器在增高的效果）
                getObject(divname).style.height = h + "px"; // 容器高度不断的以50px递增
				    }
		    }
		   	
			  var tt = window.setInterval(anim,2);  // 设置每2毫秒循环一次（每2毫秒，运行一次anim[容器的高度递减50px]）	
}

function nTabs(thisObj,Num){
if(thisObj.className == "active")return;
var tabObj = thisObj.parentNode.id;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=tabList.length-1; i >=0; i--)
{
  if (i == Num)
  {
       thisObj.className = "active"; 
       document.getElementById(tabObj+"_Content"+i).style.display = "block";
  }else{
      tabList[i].className = "normal"; 
      document.getElementById(tabObj+"_Content"+i).style.display = "none";
  }
} 
}

function nTabsa(thisObj,Num){
var tabObj = thisObj;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{
  if (i == Num)
  {
   tabList[i].className = "active"; 
  }else{
   tabList[i].className = "normal"; 
  }
} 
}

function nTabsaM(thisObj,Num,curcss,basecss){
var tabObj = thisObj;
var tabList = document.getElementById(tabObj).getElementsByTagName("li");
for(i=0; i <tabList.length; i++)
{
  if (i == Num)
  {
   tabList[i].className = curcss; 
  }else{
   tabList[i].className = basecss; 
  }
} 
}