function slideSwitch() {
    active = $('#diapo img.active');
    newActive = $('#diapo img:eq('+((active.index()+1)%nbImage)+')');
    newActive.fadeIn(1000);
    active.fadeOut(1000);
    
    active.removeClass('active');
    newActive.addClass('active');
}
var nbImage=0;
$(function(){
    $('#diapo img').hide();
    $('#diapo img.active').show();
    nbImage = $('#diapo img').length;
    setInterval("slideSwitch()", 5000);
});
