﻿var ZY_ADNum=1;
var ZY_ADTime;
var ZY_ADTimes=4000;
ShowAdPic(0);
$("#trendNum span").mouseover(function(){
		 ZY_ADNum=$(this).attr("AID");
		 clearInterval(ZY_ADTime); 
		 ShowAdPic(1);
      }).mouseout(function(){
		  ZY_ADTime = setInterval("ShowAdPic(0)",ZY_ADTimes);
      })

$("#trendimg").mouseover(function(){
		 clearInterval(ZY_ADTime); 
      }).mouseout(function(){
		  ZY_ADTime = setInterval("ShowAdPic(0)",ZY_ADTimes);
      })

function ShowAdPic(type){
	  var adtext;
	   $("#trendNum span").each(function(){
				if($(this).attr("AID")==ZY_ADNum){
					var adtext=$(this).attr("txt");
					$(this).css({background: "#FFF",color:"#000"}); 
					$("#trendtxt").html(adtext)
					$("#trendimg li").hide()
					$("#Timg"+ZY_ADNum).animate({opacity: 'show' },500); 
					$("#trendNum").css("z-index","9"); 
				}else{
					$(this).css({background: "#333",color:"#fff"}); 
				  }
          })
					 
			if(type==0){
				 clearInterval(ZY_ADTime); 
				 ZY_ADNum++;
				 if(ZY_ADNum>4){ZY_ADNum=1}
				 ZY_ADTime = setInterval("ShowAdPic(0)",ZY_ADTimes);
			}
}
