var images = new Array();
images[0] = '#';





//**IMAGE URL LIST - CONTINUE NUMBERIC ORDER WHEN ADDING LINES TO ARRAY**\\
images[1] = '/stage/splash/assets/images/01.jpg';
images[2] = '/stage/splash/assets/images/02.jpg';
images[3] = '/stage/splash/assets/images/03.jpg';
images[4] = '/stage/splash/assets/images/04.jpg';
images[5] = '/stage/splash/assets/images/05.jpg';
images[6] = '/stage/splash/assets/images/06.jpg';
images[7] = '/stage/splash/assets/images/07.jpg';
images[8] = '/stage/splash/assets/images/08.jpg';
images[9] = '/stage/splash/assets/images/09.jpg';
images[10] = '/stage/splash/assets/images/10.jpg';
images[11] = '/stage/splash/assets/images/11.jpg';
images[12] = '/stage/splash/assets/images/12.jpg';
images[13] = '/stage/splash/assets/images/13.jpg';
images[14] = '/stage/splash/assets/images/14.jpg';
images[15] = '/stage/splash/assets/images/15.jpg';
images[16] = '/stage/splash/assets/images/16.jpg';
images[17] = '/stage/splash/assets/images/17.jpg';
images[18] = '/stage/splash/assets/images/18.jpg';
images[19] = '/stage/splash/assets/images/19.jpg';
images[20] = '/stage/splash/assets/images/20.jpg';
images[21] = '/stage/splash/assets/images/21.jpg';
images[22] = '/stage/splash/assets/images/22.jpg';


//****************************END OF IMAGE LIST**************************\\


















var loop = 7;

function swapImages(){
	if (loop < images.length-1){
		var imgwidth = $('.firstimg').width() +10;
		$('.firstimg').remove();
		$('#moving-rotator img').first().addClass('firstimg');
		$('#moving-rotator').css({left: "0"});
		 var checkposition = $('#moving-rotator').position();
		// alert(checkposition.left);
		$('#moving-rotator').append('<img src="'+images[loop]+'"/>');
		loop++;
		imgwidth = $('.firstimg').width();
		$('#moving-rotator').animate({left: '-='+(imgwidth+10)}, imgwidth*10, 'linear', function(){ swapImages(); });
	}else{
		loop = 1;
		var imgwidth = $('.firstimg').width() +10;
		$('.firstimg').remove();
		$('#moving-rotator img').first().addClass('firstimg');
		$('#moving-rotator').css({left: "0"});
		$('#moving-rotator').append('<img src="'+images[loop]+'"/>');
		loop++;
		imgwidth = $('.firstimg').width();
		$('#moving-rotator').animate({left: '-='+(imgwidth+10)}, imgwidth*10, 'linear', function(){ swapImages(); });
	}
}

$(document).ready(function() {
	$('#moving-rotator img').first().addClass('firstimg');
	$('#moving-rotator').animate({left: '-=361'}, 3510, 'linear', function(){ swapImages(); });
});
