/**
 *	Slideshow Object for Thickbox+SS
 *
 *	Principle
 *
 */

function SlideShow() {
	/* Properties
	 ----------------------------------------------------------------------*/
	 
	this.delay = 5000;				// default delay between slides
	this.name = 'SlideShow';		// default title
	this.isPaused = false;			// (intial) state of playback
	
	/* Methods */
	this.start = function(nextFunc) {
		this.isPaused = false;
		this.timeoutId = setTimeout(nextFunc, this.delay);
	}
	this.stop = function() {
		clearTimeout (this.timeoutId);
	}
	this.togglePlayback = function(nextFunc) {
		if (this.isPaused) {
			this.isPaused = false;
			this.start(nextFunc);
			$('a#pauseButton').text('Pause');
		} else {
			this.stop();
			this.isPaused = true;
			$('a#pauseButton').text('Resume');
		}
	}
}
