Slideshow = function() {
	this.play_button = new Object();
	this.play_button.play = "play";
	this.play_button.pause = "pause";
	this.play_button.type = "class";
	
	this.next = function() {
		if(this.run == true) {
			this.timeout = window.setTimeout(methodize(this.next,this), this.speed);
			gallery.next('show');
		}
		else clearTimeout(gallery.timeout);
	}
	this.play = function() {
		this.run = true;
		this.setPlayButton(this.play_button.pause);
		this.next();
	}
	this.pause = function() {
		this.run = false;
		this.setPlayButton(this.play_button.play);
		clearTimeout(this.timeout);
	}
	
	this.setPlayButton = function(val) {
		if(this.play_button.id){
			if(this.play_button.type == "class") document.getElementById(this.play_button.id).className = val;
			else if(this.play_button.type == "text") document.getElementById(this.play_button.id).innerHTML = val;
		}
	}
	
	this.run = false;
	this.speed = 3000;
	
	return this;
}
