/*******************************************************************
* File : JSFX_SimpleSlideShow.js © JavaScript-FX.com
* Created : 2002/08/04
* Author : Roy Whittle (Roy@Whittle.com) www.Roy.Whittle.com
* Purpose : To create a dynamic slide show.
*
* History
* Date Version Description
* 2002-08-04 1.0 First test version
* 2003-01-14 1.1 Remove all the extra fluff and make it a
* simple "Automatic" slideshow
***********************************************************************/
if(!window.JSFX)
JSFX = new Object();
document.write('');
document.write('');
JSFX.SimpleSlide = function(theImg)
{
this.theImg = theImg;
this.loadImg = new Image();
}
JSFX.SimpleSlideShow = function()
{
this.id = JSFX.SimpleSlideShow.getId();
this.timeId = null;
this.imgName = this.id + "_I";
this.currSlide = 0;
this.slides = new Array();
this.startDelay = 0;
this.slideDelay = 4000;
this.transType = 24;
this.transDuration= 1;
window[this.id] = this;
}
JSFX.SimpleSlideShow.slideNo = 0;
JSFX.SimpleSlideShow.getId = function() {return "JSFX_ss_" + JSFX.SimpleSlideShow.slideNo++;}
JSFX.SimpleSlideShow.prototype.addSlide = function(theImg) {this.slides[this.slides.length]=new JSFX.SimpleSlide(theImg);}
JSFX.SimpleSlideShow.prototype.setStartDelay = function(startDelay) {this.startDelay = startDelay*1000;}
JSFX.SimpleSlideShow.prototype.setSlideDelay = function(slideDelay) {this.slideDelay = slideDelay*1000;}
JSFX.SimpleSlideShow.prototype.setTransType = function(transType) {this.transType = transType;}
JSFX.SimpleSlideShow.prototype.setTransDuration = function(transDuration) {this.transDuration = transDuration;}
JSFX.SimpleSlideShow.prototype.setTimeout = function(f, t) {return setTimeout("window."+this.id+"."+f, t);}
JSFX.SimpleSlideShow.prototype.toHtml = function(offImg) {
return('
');
}
JSFX.SimpleSlideShow.prototype.setSlide = function()
{
var img = document.images[this.imgName];
if(img.filters != null)
{
if(this.transType < 24) img.filters[0].Transition=this.transType;
img.filters[0].Duration = this.transDuration;
img.filters[0].apply();
}
img.src = this.slides[ this.currSlide ].theImg;
if(img.filters != null)
img.filters[0].play();
}
JSFX.SimpleSlideShow.prototype.animate = function()
{
this.currSlide = (this.currSlide + 1) % this.slides.length;
this.setSlide();
this.timeId = this.setTimeout("animate()", this.slideDelay);
}
JSFX.SimpleSlideShow.prototype.start = function()
{
for(var i=0 ; i