function initialize()
{
    //hide all of the slideshow images	
    if($('slideshow'))
    {
        $$('#slideshow img').each(function(image){
            $(image).hide();
        });
        //dump the images into an array
        slide =  $('slideshow').childElements();
        
        //fade in the first slide and after it's finished, start the slideshow
        $( slide[0] ).appear({ duration: 3, afterFinish: function () { SlideShow(2, 6); } });
    }
}

var i = 0;
var slide;

function SlideShow() {
    $( slide[i] ).fade({ duration: 2 });
    i++;            
    if (i == slide.length) i = 0; 
    $( slide[i] ).appear({ duration: 6, afterFinish: function () { SlideShow(); } });
} 
