i need help with this code
am trying to create a photobox where one image fadeout and another in
<div id="photo">i have couple of images here</div>
the problem is that all my images are displayed in the box at a time

as if this code is not doing anything

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

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

$('#photo img').eq(currentPhoto).fadeout(function() {

//
$('#photo img').each(function(i) {
$(this).css('zIndex', ((numberOfPhotos - i) + currentPhoto) % numberOfPhotos);
});

$(this).show();
setTimeout(function() {rotatePics(++currentPhoto);}, 4000);
});
}