/*首页广告效果*/
//$(function(){
//     var len  = $(".num > li").length;
//	 var index = 0;
//	 var adTimer;
//	 $(".num li").mouseover(function(){
//		index  =   $(".num li").index(this);
//		showImg(index);
//	 }).eq(0).mouseover();	
//	 //滑入 停止动画，滑出开始动画.
//	 $('.ad').hover(function(){
//			 clearInterval(adTimer);
//		 },function(){
//			 adTimer = setInterval(function(){
//			    showImg(index)
//				index++;
//				if(index==len){index=0;}
//			  } , 3000);
//	 }).trigger("mouseleave");
//})
//// 通过控制top ，来显示不同的幻灯片
//function showImg(index){
//        var adHeight = $(".zhongshang_left .ad").height();
//		$(".ad_tu").stop(true,false).animate({top : -adHeight*index},1000);
//		$(".num li").removeClass("on")
//			.eq(index).addClass("on");
//}

$(function(){
     var len  = $("#txt-pic > li").length;
	 var index = 3;
	 var adTimer;
	 $("#txt-pic li").mouseover(function(){
		index  =   $("#txt-pic li").index(this);
		showImg(index);
	 }).eq(0).mouseover();	
	 //滑入 停止动画，滑出开始动画.
	 $('#big-pic').hover(function(){
			 clearInterval(adTimer);
		 },function(){
			 adTimer = setInterval(function(){
			    showImg(index)
				index++;
				if(index==len){index=0;}
			  } , 3000);
	 }).trigger("mouseleave");
})
// 通过控制top ，来显示不同的幻灯片
function showImg(index){
        var fbHeight = $("#flash-box").height();
		$("#big-pic").stop(true,false).animate({top : -fbHeight*index},1000);
		$("#txt-pic li").removeClass("on")
			.eq(index).addClass("on");
}
