/***********************************************
* DHTML slideshow script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice must stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

// Transition - Integer that specifies one of the following values:
// 0 Box in.
// 1 Box out.  
// 2 Circle in.  
// 3 Circle out.  
// 4 Wipe up.  
// 5 Wipe down.  
// 6 Wipe right.  
// 7 Wipe left.  
// 8 Vertical blinds.  
// 9 Horizontal blinds.  
// 10 Checkerboard across.  
// 11 Checkerboard down.  
// 12 Random dissolve. 
// 13 Split vertical in. 
// 14 Split vertical out.  
// 15 Split horizontal in.  
// 16 Split horizontal out.  
// 17 Strips left down.  
// 18 Strips left up.  
// 19 Strips right down.  
// 20 Strips right up.  
// 21 Random bars horizontal.  
// 22 Random bars vertical.  
// 23 Random.  
// Duration - Floating-point value that specifies the length of time to complete the transition.
//          The value is specified in seconds.milliseconds format (0.0000).

var player = []
function playerobj(imgs) {
   var ie = document.all
   var dom = document.getElementById
   if (!ie && !dom) return

   this.imgs = imgs
   if (this.imgs.length < 1) return
   if (!this.imgs.id) return

   this.id = this.imgs.id
   player[this.id] = this

   if (!this.imgs.pausebetweenimages) this.imgs.pausebetweenimages = 5000
   if (!this.imgs.duration) this.imgs.duration = 2

   this.toMax = 23

   if (typeof(this.imgs.transition)=="undefined") this.imgs.transition = this.toMax
   if (this.imgs.transition=="cycle" || this.imgs.transition=="random") {
      this.moveTo = this.toMax
   } else {
      this.moveTo = this.imgs.transition
   }

   var htmlobjid = "play" + this.id
   document.writeln('<img src="' + this.imgs[0] + '" id="' + htmlobjid +
                          '" style="filter: revealTrans(duration=' + this.imgs.duration +
                          ', transition=' + this.moveTo + ')" border=0>')
   this.htmlobj = ie ? document.all[htmlobjid] : document.getElementById(htmlobjid)

   this.currentImage = (this.imgs.length<=1)? 0 : 1
}

playerobj.prototype.playeffect = function() {
   var objfilter = this.htmlobj.filters.revealTrans
   objfilter.stop()
   objfilter.apply()
   this.htmlobj.src = this.imgs[this.currentImage]
   objfilter.play()
   switch (this.imgs.transition) {
   case "cycle" :
        this.moveTo++
        if (this.moveTo>=this.toMax) this.moveTo=0
        objfilter.Transition = this.moveTo
        break
   case "random" :
        this.moveTo = this.to[Math.floor(this.toMax * Math.random())]
        objfilter.Transition = this.moveTo
        break
   }
   if (this.currentImage==this.imgs.length - 1) this.currentImage = 0; else this.currentImage++;
   setTimeout("player['" + this.id + "'].playeffect()", this.imgs.pausebetweenimages)
}


playerobj.prototype.startit = function() {
   setTimeout("player['" + this.id + "'].playeffect()", this.imgs.pausebetweenimages-this.imgs.duration*1000)
}


