$(document).ready(function(){
  var currentPosition = 0;
  var slideWidth = 450;
  var slides = $('#slideshow #slidesContainer .slide');
  var numberOfSlides = slides.length;

  $('#slideshow #slidesContainer').css('width', slideWidth * numberOfSlides);

  window.setInterval(function(){
	currentPosition++;
	if(currentPosition>=numberOfSlides){
		currentPosition = 1;
		$('#slideshow #slidesContainer').css('marginLeft', 0);
	}

	$('#slideshow #slidesContainer').animate({
		'marginLeft' : slideWidth*(-currentPosition)
	});
  }, 4000);
});
