// JavaScript 

$(document).ready(function() {
		var maxCount= $('#image > *').length;
		var count=2;
		var previous=1;
		
		if(!($.browser.msie)){
			$('#image').children('img:first').load(function(){
				window.setInterval(function(){imageRotation();},5000); //animation speed this is set to 5 seconds at the moment
			});
		}
		else{
			window.setInterval(function(){imageRotation();},5000); //animation speed this is set to 5 seconds at the moment
		}
		
		
function imageRotation() {
		$('#image-'+previous).animate({"left":"625px"}, 1000).fadeOut(1000, function(){
			$(this).animate({"left": "0px"});
		}); //fade out speed this is set to 0.5 seconds at the moment
		$('#image-'+count).fadeIn(1000); //fade in speed this is set to 0.5 seconds at the moment
		previous = count;
		count ++;
		if(count==maxCount+1) {
			count=1;
		}
	};
});
