		//slide show script
		function swapImages(direction){
		
		  var $active = $('#slidesContainer .active');
	
		  if(direction == 'next'){
		  var $next = ($('#slidesContainer .active').next().length > 0) ? $('#slidesContainer .active').next() : $('#slidesContainer img:first');
			}else{
			 var $next = ($('#slidesContainer .active').prev().length > 0) ? $('#slidesContainer .active').prev() : $('#slidesContainer img:last');
		  }
		  $active.fadeOut('fast', function(){
		  $active.removeClass('active');
		  $next.fadeIn('fast').addClass('active');
		  });
	   }


		$(document).ready(function(){
		 
		  // Remove scrollbar in JS
		  $('#slidesContainer').css('overflow', 'hidden');
		
		  // Insert controls in the DOM
		  $('#slideshow')
			.prepend('<span class="control" id="leftControl">Clicking moves left</span>')
			.append('<span class="control" id="rightControl">Clicking moves right</span>');
		
		  // Create event listeners for .controls clicks
		  $('.control')
			.bind('click', function(){
		   
				if($(this).attr('id')=='rightControl'){
					swapImages('next');
				}else{
					swapImages('prev');
				}
		  });
	
		 interval = setInterval( "swapImages('next')", 5000 );
		 
		 $('#slidesContainer').hover(function () {
			clearInterval(interval);
		}, function () {
			interval = setInterval( "swapImages('next')", 5000 );
		});


		});
