/*
Steps to add 1 update element in this section
1. Add case whenever needed. eg if there are 3 events, then there shud be 3 cases.
2. For every new case added add(+)290 for the left: property  in the javascript
3. Ensure that the last case's lleft property is "0"
4. Ensure the timer values at 2 place in this file are 1500*no. of cases at one place and double at the second location
*/

$(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;
	
	$.timer(7500, function (timer) {
		//Determine the current location, and transition to next panel
		switch(current_panel){
			case 1:
				$("#slideshow").stop().animate({left: "-290px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 2;
			break;
			case 2:
				$("#slideshow").stop().animate({left: "-580px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 3;
			break;
			case 3:
				$("#slideshow").stop().animate({left: "-870px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 4;
			break;
			/*case 4:
				$("#slideshow").stop().animate({left: "-1160px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 5;
			break;*/
			case 4:
				$("#slideshow").stop().animate({left: "0px", top: "0px"}, {easing: 'easeOutBack', duration: animation_duration});
				current_panel = 1;
			break;	
	  		timer.reset(15000);
		}
	});
	
});
