﻿function createFlashImage(imgs, lnks, wid, hei, interval, seed, needFlash, NOImg){
    this.adImg = new Array();
    for(i=0;i<imgs.length;i++) this.adImg[i] = imgs[i];
    this.adLink = new Array();
    for(i=0;i<lnks.length;i++) this.adLink[i] = lnks[i];
    this.cID = 0;
    this.timeout = interval;
    this.SEED = seed;

    this.preImgs = new Array();
    for(i=0;i<this.adImg.length;i++){
        this.preImgs[i] = new Image();
        this.preImgs[i].src = this.adImg[i];
    }
    if (!NOImg)
        document.write('<img id="_imgAD_'+this.SEED+'" onclick="imgAD_'+this.SEED+'.Go2Url()" style="cursor:Pointer;FILTER: revealTrans(duration=2,transition=20);" border="0" width="'+wid+'" height="'+hei+'" hspace="0" />');
    if(needFlash){}
    this.NextAd = function(){
        if(this.cID>=this.adImg.length) this.cID=0;
        if(document.all){
            var imgAD = $('_imgAD_'+this.SEED);
            imgAD.filters.revealTrans.Transition=Math.floor(Math.random()*23);
            imgAD.filters.revealTrans.apply();
            imgAD.src = this.adImg[this.cID];
            imgAD.filters.revealTrans.play();
            this.cID++;setTimeout("imgAD_"+this.SEED+".NextAd()", this.timeout);
        }
    }
    this.Go2Url = function(){window.open(this.adLink[this.cID-1]);}
    this.NextAd();
}
