﻿var imgUrl=new Array();
var imgLink=new Array();
var adNum=0;
var path="/";
var dt = location.href;
if(dt.indexOf("18tan")!=-1)
{path="/";}
imgUrl[1]=path+"UploadImages/dynamic01.jpg";//图片地址
imgLink[1]="http://www.baidu.com";//链接地址
imgUrl[2]=path+"UploadImages/dynamic02.jpg";//图片地址
imgLink[2]="http://www.baidu.com";//链接地址
imgUrl[3]=path+"UploadImages/dynamic03.jpg";//图片地址
imgLink[3]="http://www.baidu.com";//链接地址
imgUrl[4]=path+"UploadImages/dynamic04.jpg";//图片地址
imgLink[4]="http://www.baidu.com";//链接地址

var imgPre=new Array();
var j=0;
for (i=1;i<=4;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="") ) {
j++;
} else {
break;
}
}
function playTran(){
if (document.all){
document.imgInit.filters[0].play();
}
}
function nextAd(){
if(adNum<j)adNum++ ;
else adNum=1;
      
if (document.all){
document.imgInit.filters[0].Transition=26;
document.imgInit.filters[0].apply();
}
document.images.imgInit.src=imgUrl[adNum];
playTran();
theTimer=setTimeout("nextAd()", 3000);
}
function goUrl(){
jumpUrl=imgLink[adNum];
jumpTarget='_parent';
if (jumpUrl != ''){
if (jumpTarget != '') 
window.open(jumpUrl,jumpTarget);
else
location.href=jumpUrl;
}
}
