$(document).ready(function(){

	$("#pysort li").mouseover(function() {
		$(this).children("span").addClass("fox");
		$(this).children("div").show();
		
	});
	$("#pysort li").mouseout(function() {
		$(this).children("span").removeClass("fox");
		$(this).children("div").hide();
		
	});
	
});
$(document).ready(function(){

	$(".more").toggle(function() {	    
		$(this).children("span").addClass("morecat");
		$(this).children("div").show();
		
	},function() {
		$(this).children("span").removeClass("morecat");
		$(this).children("div").hide();
		
	});
	
});
//轮播广告
$(function(){
     var len  = $("#idNum > li").length;
	 var index = 0;
	 $("#idNum li").mouseover(function(){
		index  =   $("#idNum li").index(this);
		showImg(index);
	});	
	 //滑入 停止动画，滑出开始动画.
	 $('#topbanner').hover(function(){
			  if(MyTime){
				 clearInterval(MyTime);
			  }
	 },function(){
			  MyTime = setInterval(function(){
			    showImg(index)
				index++;
				if(index==len){index=0;}
			  } , 5000);
	 });
	 //自动开始
	 var MyTime = setInterval(function(){
		showImg(index)
		index++;
		if(index==len){index=0;}
	 } , 6000);
})
// Demo1 : 关键函数：通过控制top ，来显示不通的幻灯片
function showImg(i){
		$("#idSlider").stop(true,false).animate({top : -130*i},350);
		 $("#idNum li")
			.eq(i).addClass("on")
			.siblings().removeClass("on");
}

//Tabs 滑动
function nTabs(thisObj,Num){
	if(thisObj.className == "focus")return;
	var tabObj = thisObj.parentNode.id;
	var tabList = document.getElementById(tabObj).getElementsByTagName("li");
	for(i=0; i <tabList.length; i++)
	{
		if (i == Num)
		{
			thisObj.className = "focus"; 
    		document.getElementById(tabObj+"_Content_"+i).style.display = "block";
		}else{
			tabList[i].className = ""; 
			document.getElementById(tabObj+"_Content_"+i).style.display = "none";
		}
	} 
}
//promotion
//sidebar
$(document).ready(function(){
	$("#sideNav dd").mouseover(function() {
		$(this).addClass("over");		
	});
	$("#sideNav dd").mouseout(function() {
		$(this).removeClass("over");
	});
	
});