/* SLIDESHOW */
$(document).ready(function() {
	rotatePics(1);	
}
)

function rotatePics(currentPhoto) {
	var numberOfPhotos = $('#slideshow img').length;
	currentPhoto = currentPhoto % numberOfPhotos;	


$('#slideshow img').eq(currentPhoto).fadeOut(function() {
	// réorganise les Z
	$('#slideshow img').each(function(i) {
		$(this).css(
			'zIndex', ((numberOfPhotos - i) + currentPhoto) % numberOfPhotos
			);
	});
	
	$(this).show();
	setTimeout(function() {rotatePics(++currentPhoto);},8000);
});
}

