slideshow = {
	orig_slide: false,
	cur_slide: false,
	slide_timeout: 5000,
	init: function(){
		$$('.slideshow-container .slide.first').each(function(s){
			s.appear();
			this.cur_slide = s;
			this.orig_slide = s;
		});
		setTimeout(slideshow.load_next,slideshow.slide_timeout);
	},
	load_next: function(){
		var c = this.cur_slide;
		var n = c.next();
		if(!n){ n = this.orig_slide; }
		c.fade({
			afterFinish: function(){
				n.appear();
			}
		});
		this.cur_slide = n;
		setTimeout(slideshow.load_next,slideshow.slide_timeout);
	}
}

Element.observe(window,'load',function(){
	slideshow.init();
});