function patriaSlideShow()
{

	this.fadeInImage = 0;		// the image that's fading In
	this.fadeOutImage = -1;		// the image that's fading out
	this.interval = 3.0;		// the fade time in seconds
	this.intVal = null;
	this.intervalPause = 2000;	// how long to display the image before the next fade (in milliseconds)
	
	this.numOfImgs = 1;
	
	// set the interval between fades
	this.setInterval = function()
	{
		if(this.intVal)
			window.clearInterval(this.intVal);
		this.intVal = window.setInterval('slideShow.doSlideShow(' + this.numOfImgs +')', ((this.interval * 1000) + this.intervalPause));
	}

	// execute the fade
	this.doSlideShow = function(numOfImgs)
	{
        this.numOfImgs = numOfImgs;

		this.setInterval();

		this.fadeInImage == this.numOfImgs ? this.fadeInImage = 1 : ++this.fadeInImage;
		this.fadeOutImage == this.numOfImgs ? this.fadeOutImage = 1 : ++this.fadeOutImage;
	
		var fadeInId = this.fadeInImage < 10 ? 'slideshow_image_0' + this.fadeInImage : 'slideshow_image_' + this.fadeInImage;
		var fadeOutId = this.fadeOutImage < 10 ? 'slideshow_image_0' + this.fadeOutImage : 'slideshow_image_' + this.fadeOutImage;

		$(fadeOutId).fade({ duration: this.interval, from: 1, to: 0 });
		$(fadeInId).appear({ duration: this.interval});

		return false;
	}
	
}

// create the fader object
var slideShow = new patriaSlideShow();
