$(document).ready(function(){
	
	//This keeps track of the slideshow's current location
	var current_panel = 1;
	//Controlling the duration of animation by variable will simplify changes
	var animation_duration = 1500;
	
	$.timer(6000, function (timer) {
		//Determine the current location, and transition to next panel
		switch(current_panel){
			case 1:
				$("#slideshow").stop().animate({right: "983px", top: "0px"}, {duration: animation_duration});
				current_panel = 2;
			break;
			case 2:
				$("#slideshow").stop().animate({right: "1966px", top: "0px"}, {duration: animation_duration});
				current_panel = 3;
			break;
			case 3:
				$("#slideshow").stop().animate({right: "2949px", top: "0px"}, {duration: animation_duration});
				current_panel = 4;
			break;
			case 4:
				$("#slideshow").stop().animate({right: "3932px", top: "0px"}, {duration: animation_duration});
				current_panel = 5;
			break;
			case 5:
				$("#slideshow").stop().animate({right: "0px", top: "0px"}, {duration: animation_duration});
				current_panel = 1;
			break;	
	  		timer.reset(18000);
		}
	});
	
});
