function slideShow( Obj ){
	// Version 0.2; Created by Kow, 2008; http://skyweb.hu/kow
	var pass = this;
	// initializing
	this.curImg = 0;
	this.slides = Obj;
	this.slides.each( function( img, index ){ 
		if( index > 0 ) img.fade(); 
		img.set('morph', { duration: 'long' });
	}, this);
	this.next = function(){
		pass.curImg++;
		this.slides.each( function( img, index ){ 
			img.morph({ opacity: 0 });
		}, this);
		if( pass.curImg == this.slides.length ) pass.curImg = 0;
		this.slides[ pass.curImg ].morph({ opacity: 1 });
	}
	this.prev = function(){
		pass.curImg--;
		this.slides.each( function( img, index ){ 
			img.morph({ opacity: 0 });
		}, this);
		if( pass.curImg < 0 ) pass.curImg = this.slides.length - 1;
		this.slides[ pass.curImg ].morph({ opacity: 1 });
	}
}

window.addEvent('domready', function() {	
	
	var loader = new Asset.images(images, {
		onComplete: function() {
			//Insert the image elements after the initial one
			images.each(function(im,i) {
				new Element('img',{ src:im, width:994, height:430, alt:alts[i] }).inject($('starter'), 'after');
			});
			
			//Start the show once all loaded
			var sshow = new slideShow($$('#slides img'));
			sshow.next.periodical(4000, sshow);
		}
	});

});