if(!Toolbox){var Toolbox = {};}
Toolbox.Slideshow = {
	version:'1.0',
	index:0,
	images:[],
	slide:function(){
		this.index = (this.index>=this.images.length-1)?0:this.index+1;
		this.image.src = this.images[this.index].src;
	},
	initialize:function(parent,options){
		parent = $(parent);
		this.options = options || {};
		//hide all of our images from display
		parent.getElements('img').each(function(item){
			this.images.push(item);
			item.setStyle('display','none');
		},this);
		
		//create a blank image holder
		this.image = new Element('img').injectInside(parent);
		this.image.alt = this.images[0].alt;
		this.image.src = this.images[0].src;
		this.slide.periodical(this.options.duration || 10000,this);
	}
};

Toolbox.Slideshow = new Class(Toolbox.Slideshow);