

$(document).ready(function () {
	
	  rotatePics(4);
	
	$('#check-in').simpleDatepicker({ x: 105, y: 3 });
	$('#check-out').simpleDatepicker({ x: 105, y: 3 });
	
	
	
	
	
	
	
	
});


function rotatePics(currentPhoto) {
  var numberOfPhotos = $('#photos img').length;
  currentPhoto = currentPhoto % numberOfPhotos;
	
  $('#photos img').eq(currentPhoto).fadeOut('slow', function() {
		// re-order the z-index
    $('#photos img').each(function(i) {
      $(this).css(
        'zIndex', ((numberOfPhotos - i) + currentPhoto) % numberOfPhotos
      );
    });
    $(this).fadeIn('slow');
    setTimeout(function() {rotatePics(++currentPhoto);}, 5500);
  });
}

