// JavaScript Document
var timing = 1000;
var currentSlide = 1;
var t;
var nextframe = 0;
var nextframedelay = 5000;

$(document).ready(function () {
			
		
	

			showFrameAnimation(currentSlide);
        
});

function showFrameAnimation(startframe)
{
	//fadeOut the other items
	for (x=1;x<=4;x=x+1)
	{
		
		$("#slide" + x).fadeOut("slow");
	}

	
	//fade in the next frame, with a delay
	nextframe = startframe + 1;
	if (nextframe == 5) {
             nextframe = 1;
	}

	$("#slide" + startframe).queue(function()
		{
			$(this).fadeIn("slow");
			t = setTimeout( "showFrameAnimation(nextframe)", nextframedelay);
			$(this).dequeue();
		});
}

