var imageIndex=0;
var NUM_IMAGES;

function doSlideShow() {
	fadeOutCurrentImage();
	imageIndex++;
	if(imageIndex>=NUM_IMAGES) imageIndex=0;
	fadeInCurrentImage();
}

function fadeOutCurrentImage() {
	$($(".slideshow img").get(imageIndex)).fadeOut("slow");
}

function fadeInCurrentImage() {
	$($(".slideshow img").get(imageIndex)).fadeIn("slow");
}

$(document).ready(function() { 
	NUM_IMAGES=$(".slideshow img").size();
	setInterval("doSlideShow()", 5000);
});
