$(document).ready(function(){
						   
	
		$(".fade1").delay(1000).fadeIn(500);
		$(".fade2").delay(1400).fadeIn(500);
		$(".fade3").delay(1800).fadeIn(800);
		$(".fade4").delay(2600).fadeIn(500);
		$(".fade5").delay(3000).fadeIn(500);


  
  rotatePics(1);
});

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

