var timing = 500;
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<=3;x=x+1)
	{
		
		$("#slide" + x).fadeOut("slow");
	}

	
	//fade in the next frame, with a delay
	nextframe = startframe + 1;
	if (nextframe == 4) {
             nextframe = 1;
	}
	$("#slide" + startframe).queue(function()
		{
			$(this).fadeIn("slow");
			t = setTimeout( "showFrameAnimation(nextframe)", nextframedelay);
			$(this).dequeue();
		});

}


