
$(function(){
	$('#number li').mouseover(function(){
		$("#"+this.id).addClass("selected").siblings().removeClass("selected");
		$('.slider1 li img').fadeIn(4000).attr("src","images/"+(this.id)+".jpg");
		});
	});
	
/*首页广告效果*/
$(function(){
     var len  = $(".num > li").length;
	 var index = 0;
	 var adTimer;
	 $(".num li").mouseover(function(){
		index  =   $(".num li").index(this);
		showImg(index);
		showtext(index);
	 }).eq(0).mouseover();	
	 //滑入 停止动画，滑出开始动画.
	 $('.ad').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			 adTimer = setInterval(function(){
			    showImg(index);
				showtext(index);
				index++;
				if(index==len){index=0;}
			  } , 4000);
	 }).trigger("mouseleave");
})
// 通过控制top ，来显示不同的幻灯片
function showImg(index){
	 $(".num li").removeClass("on").eq(index).addClass("on");
	 $(".slider li").hide();
	  $(".slider li").eq(index).show();
       // var adHeight = $(".content_right .ad").height();
		//$(".slider").stop(true,false).animate({bottom : -adHeight*index},1000);
		//$(".num li").removeClass("on").eq(index).addClass("on");
}
function showtext(index){
	 // alert(index);
        var adHeighttext = $(".content_right .titleg").height();
		$(".textg li").hide();
	    $(".textg li").eq(index).show();
		//$(".textg").stop(true,false).animate({top : -adHeighttext*index},1000);
		//$(".num li").removeClass("on").eq(index).addClass("on");
}
	

