function slideShow(id, imgName, pic) {
	
	this.speed = 4000; //ms
	this.fadeDuration = 1; //s
	this.doFade = false;
	this.t = null;
	this.j = 0;
	this.pos = this.j;
	this.preload  = new Array()
	this.imgName = imgName;
	//this.imgObj = document.getElementById(this.imgName);
	//if (!this.imgObj) {
		this.imgObj = eval("document.images." + this.imgName);
	//}
	this.pic = pic;
	
	
	// adds 'Var' to the object variable and creates a global variable for the setTimeout...
	this.name = id + "Var";
  	eval(this.name + " = this"); 
	
	
	this.preloadPic = function(index) 
	{
		if (this.pic[index] != ''){
			//window.status='Loading : ' + this.pic[index];
			this.preload[index] = new Image()
			this.preload[index].src = this.pic[index];
			this.pic[index] = '';
			//window.status='';
		}
		
	}
	/* alternative; loads all images at once
	for (i = 0; i < this.pic.length; i++){
	   this.preload[i] = new Image()
	   this.preload[i].src = this.pic[i]
	   this.pic[i] = '';
	}
	*/
	this.preloadPic(0); //preload the first one...
	
	
	
	
	this.start = function(nuTime,nuFade) 
	{
	   if (nuTime) this.setInterval(nuTime);
	   if (nuFade) this.setInterval(nuTime);
	   
	   if (document.all) {
			this.imgObj.style.filter = "blendTrans(duration=" + this.fadeDuration + ")";
			if (this.imgObj.filters.blendTrans) this.doFade = true;
			if (this.doFade) this.imgObj.filters.blendTrans.Apply()
		}
		
		this.imgObj.src = this.preload[this.j].src;
		if (this.doFade) this.imgObj.filters.blendTrans.Play();
		
		this.pos = this.j;
		this.j++;
		if (this.j > (this.pic.length - 1)) this.j = 0;
		this.t = setTimeout(this.name + ".start()",this.speed);
		this.preloadPic(this.j);
	}
	
	this.stop = function() {
		clearTimeout(this.t);
		this.t = null;
	}
	
	this.toggle = function() {
		(this.t == null) ? this.start() : this.stop();
	}
	
	this.setInterval = function(t) 	{this.speed = t;}
	this.setFade = function(t) 		{this.fadeDuration = t;}	 
	
	//autostart??
	//this.startSlideShow();
	
}