$(document).ready(function(){  
	//新书快递
	$(".main .jCarouselLite").jCarouselLite({
		btnNext: ".main .next",
	    btnPrev: ".main .prev",
	    speed: 500,
	    visible : 4
	});
  
  //新书快递上面的书的转换
  //setInterval(function(){$(".main .prev").click();},1500);
  	
  //图书分类颜色变化
	$(".bookClass .block").hover(
		function () {  			
	    if($(this).is(".last")){
	    		$(this).removeClass("final");
	    		$(this).addClass("hover2");
	    }
	    else{
	    	$(this).addClass("hover");
	    }
	  },
	  function () {
	    if($(this).is(".last")){
	    		$(this).removeClass("hover2");
	    		$(this).addClass("final");
	    }else{
	    	$(this).removeClass("hover");
	    }
	  }
	);
	
	//影音世界
	$(".yysj .top").find('p').mouseover(
		function(){
			$(".yysj .top").find('p').removeClass("hover");
			$(this).addClass("hover");
			//隐藏所有的层
			$(".yysj .box6").hide();
			//获取所有P的集合
			var $p = $(".yysj .top").find('p');
			//获取P的索引号，去显示相应的层
			var index = $p.index(this);
			$(".yysj .box6").eq(index).show();
		}
	);
	
	//热销榜
	$(".rxb .top").find("p").mouseover(
		function(){
			$(".rxb .top").find("p").removeClass("hover");
			$(this).addClass("hover");
			//隐藏所有的层
			$(".rxb .box6").hide();
			//获取所有P的集合
			var $p = $(".rxb .top").find('p');
			//获取P的索引号，去显示相应的层
			var index = $p.index(this);
			$(".rxb .box6").eq(index).show();
		}	
	);
	
	//新书热卖
	$(".xsrm .top").find("p").mouseover(
		function(){
			$(".xsrm .top").find("p").removeClass("hover");
			$(this).addClass("hover");
			//隐藏所有的层
			$(".xsrm .box6").hide();
			//获取所有P的集合
			var $p = $(".xsrm .top").find('p');
			//获取P的索引号，去显示相应的层
			var index = $p.index(this);
			$(".xsrm .box6").eq(index).show();
		}	
	);
	
	//月畅销
	$(".ycx .top").find("p").mouseover(
		function(){
			$(".ycx .top").find("p").removeClass("hover");
			$(this).addClass("hover");
			//隐藏所有的层
			$(".ycx .box6").hide();
			//获取所有P的集合
			var $p = $(".ycx .top").find('p');
			//获取P的索引号，去显示相应的层
			var index = $p.index(this);
			$(".ycx .box6").eq(index).show();
		}	
	);
	
	//季畅销
	$(".jcx .top").find("p").mouseover(
		function(){
			$(".jcx .top").find("p").removeClass("hover");
			$(this).addClass("hover");
			//隐藏所有的层
			$(".jcx .box6").hide();
			//获取所有P的集合
			var $p = $(".jcx .top").find('p');
			//获取P的索引号，去显示相应的层
			var index = $p.index(this);
			$(".jcx .box6").eq(index).show();
		}	
	);
	
	//年畅销
	$(".ncx .top").find("p").mouseover(
		function(){
			$(".ncx .top").find("p").removeClass("hover");
			$(this).addClass("hover");
			//隐藏所有的层
			$(".ncx .box6").hide();
			//获取所有P的集合
			var $p = $(".ncx .top").find('p');
			//获取P的索引号，去显示相应的层
			var index = $p.index(this);
			$(".ncx .box6").eq(index).show();
		}	
	);
	
	//媒体聚焦
	$(".mtjj .top").find("p").mouseover(
		function(){
			$(".mtjj .top").find("p").removeClass("hover");
			$(this).addClass("hover");
			//隐藏所有的层
			$(".mtjj .box6").hide();
			//获取所有P的集合
			var $p = $(".mtjj .top").find('p');
			//获取P的索引号，去显示相应的层
			var index = $p.index(this);
			$(".mtjj .box6").eq(index).show();
		}	
	);
});