// JavaScript Document
$(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 = 2500;
	
	var timer_value = 3000;

	$.timer(300, function (timer) {
		//Determine the current location, and transition to next panel
		switch(current_panel){
			case 1:
				$("#slideshow").stop().animate({left: "0px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 2;
			timer_value = 6000;
			timer.reset(6000);
			break;
			case 2:
				$("#slideshow").stop().animate({left: "-581px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 3;
			break;
			case 3:
				$("#slideshow").stop().animate({left: "-1162px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 4;
			break;
			case 4:
				$("#slideshow").stop().animate({left: "-1743px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 5;
			break;
			case 5:
				$("#slideshow").stop().animate({left: "-2324px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 6;
			break;
			case 6:
				$("#slideshow").stop().animate({left: "-2905px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 1;
			break;
	  		timer.reset(6000);
		}
	});

});
