﻿//选项卡函数
function showout(obj) {
  var objEle,showEle,ele,count,obj;
  ele = obj.parentNode;
  objEle = ele.getElementsByTagName("a");
  count = objEle.length;
  var showElementsName = ['showout1','showout2','showout3'];
  for(j=0;j<showElementsName.length;j++)
  {
  if(ele.getAttribute("id")==showElementsName[j])
  {
  for(i=0;i<count;i++)
  {
     var className = "show"+objEle[i].getAttribute("id");
	 var showEle = document.getElementById(className);
	   if(objEle[i] == obj)
	   {
	     showEle.style.display = "block";
		 objEle[i].className = "color_bc0001";
	   }
	   else 
	   {
	     showEle.style.display = "none";
		 objEle[i].className = "";
	   }
  }
  }
  }
}

function display(id,state) {
	var ele = document.getElementById(id);
	if(state=="show")
	{
		ele.style.display = "block";
	}
	if(state=="close")
	{
		ele.style.display = "none";
	}
}


    function toggleEvent(ruleName,type,time,multi)   
    {
        var type=type;
        var time=Number(time);
        
        
        function display() 
        {
            if(multi!="" && multi=="single")
            {
                $(ruleName).find(".toggle").not(this).next().hide(time);
            }
            switch (type)
            {
              case "normal":
              $(this).next().toggle(time);
              break;
              
              case "advance":
              $(this).parents(".toggle").next().toggle(time);
              break;
            }
        }
        
            switch (type)
            {
              case "normal":
              $(ruleName).find(".toggle").click(display);
              break;
              
              case "advance":
              $(ruleName).find(".clickhere").click(display);
              break;
            }
               
        
        $(ruleName).find(".toggle").next().hide();
        $(ruleName).find(".toggle:first").next().show();
    }


$(document).ready(function() {
    $(function() {
		 toggleEvent("#list_hot","normal","800","single");
	});
});

