// This is a script file

jQuery(document).ready(function(){
  rotatePics(1);
});

function rotatePics(currentPhoto) {
  var numberOfPhotos = jQuery('#slideshow_images img').length;
  currentPhoto = currentPhoto % numberOfPhotos;
	
  jQuery('#slideshow_images img').eq(currentPhoto).fadeOut(function() {
		// re-order the z-index
    jQuery('#slideshow_images img').each(function(i) {
      jQuery(this).css(
        'zIndex', ((numberOfPhotos - i) + currentPhoto) % numberOfPhotos
      );
    });
    jQuery(this).show();
    setTimeout(function() {rotatePics(++currentPhoto);}, 10000);
  });
}



