// set the starting image.
var i = 0;			

// The array of div names which will hold the images.
var image_slide = new Array('image-10', 'image-30','image-40', 'image-50', 'image-60','image-70', 'image-80', 'image-90','image-100', 'image-110', 'image-120','image-130', 'image-140', 'image-150', 'image-160', 'image-170','image-180', 'image-190', 'image-200', 'image-210', 'image-220','image-230', 'image-240', 'image-250', 'image-260', 'image-270','image-280', 'image-290', 'image-300', 'image-310', 'image-320','image-330');

// The number of images in the array.
var NumOfImages = image_slide.length;

// The time to wait before moving to the next image. Set to 4 seconds by default.
var wait = 3000;

// The Fade Function
function SwapImage(x,y) {		
	$(image_slide[x]).appear({ duration: 0.5 });
	$(image_slide[y]).fade({duration: 0.5});
}

// the onload event handler that starts the fading.
function StartSlideShow() {
	play = setInterval('Play()',wait);
								
}

function Play() {
	var imageShow, imageHide;

	imageShow = i+1;
	imageHide = i;
	
	if (imageShow == NumOfImages) {
		SwapImage(0,imageHide);	
		i = 0;					
	} else {
		SwapImage(imageShow,imageHide);			
		i++;
	}
	
}
