	var i = 0;
	var slide; //setup array

	function SlideShow() {
		//fade out the current slide
		$( slide[i] ).fade({ duration:5 });
		//add 1 to i 
		i++;		
		//check if we've reached the end of our slides, if so, rewind i to 0		
		if (i == slide.length) i = 0; 
		//fade in the next slide and after it's finished, loop this function
		$( slide[i] ).appear({ duration:5, afterFinish: function () { SlideShow(); } });
//		$( slide[i] ).appear.delay(10, 'foo', 'bar');
	} 

	//start my functions after the document has loaded
	document.observe('dom:loaded', function () {
		//hide all of the slideshow images	
		$$('#myslideshow img').each(function(image){
			$(image).hide();
		});
		//dump the images into an array
		slide =  $('myslideshow').childElements();
		//fade in the first slide and after it's finished, start the slideshow
		$( slide[0] ).appear({ duration:1, afterFinish: function () { SlideShow(); } });
	});