var WebPic_APP = 
{
     adNum : "",
     preloadedimages: null,
     webAD: new Array(),
     theTimer: null,
    
      GetInitialVal : function(picsValue){
        this.adNum=0;
        this.preloadedimages=new Array();
        //this.webAD = new Array(); 
        
        var arr = null;
        var i=0;
        for(i=0; i< picsValue.split("|").length; i++)
        {
            arr = picsValue.split("|")[i];
            if (arr.length != 0)
            {
                this.webAD[i] = arr;
            }
        }
        
        for (i=1;i<this.webAD.length;i++)
        { 
            this.preloadedimages[i]=new Image(); 
            this.preloadedimages[i].src=this.webAD[i];
        } 
    } ,
    
    GetPicFirst : function(){
        document.getElementById("webADrush").src=this.webAD[0];
    },
    
    setTransition : function(){ 
        if (document.all){ 
        document.getElementById("webADrush").filters.revealTrans.Transition=23; 
        document.getElementById("webADrush").filters.revealTrans.apply(); 
        } 
    },

    playTransition : function(){ 
        if (document.all) 
        document.getElementById("webADrush").filters.revealTrans.play(); 
    },

    nextAd: function(){ 
        if(this.adNum<this.webAD.length-1)this.adNum++ ; 
        else this.adNum=0; 

        this.setTransition(); 
        document.getElementById("webADrush").src=this.webAD[this.adNum]; 

        this.playTransition(); 
        theTimer=setTimeout("WebPic_APP.nextAd()", 5000); 
    }, 

    goNext: function(){
        window.clearTimeout(theTimer);

        if(this.adNum<this.webAD.length-1)this.adNum++ ; 
        else this.adNum=0; 

        this.setTransition(); 
        document.getElementById("webADrush").src=this.webAD[this.adNum]; 
        imgNo = this.adNum+1;
        
        this.playTransition(); 
        theTimer=setTimeout("WebPic_APP.nextAd()", 5000); 
    },

    goPrevious : function(){
        window.clearTimeout(theTimer);
        if(this.adNum==0) this.adNum=this.webAD.length-1; 
        else this.adNum--; 
        this.setTransition(); 
        document.getElementById("webADrush").src=this.webAD[this.adNum]; 
        imgNo = this.adNum+1;
        
        this.playTransition(); 
        theTimer=setTimeout("WebPic_APP.nextAd()", 5000); 
    }
}