/*var current=1;
var nbImg=6;
function next(){     
if(this.current>nbImg)
    this.current=1; 
this.current++;
$('#img'+(this.current)).fadeIn(500);
$('#img'+(this.current-1)).fadeOut(500);
}
$(function(){
  $('#diapo img').hide();
  $('#img1').show();
  setInterval('next()',1000);
});*/
function slideSwitch() {
    active = $('#diapo img.active');
    newActive = $('#diapo img:eq('+((active.index()+1)%nbImage)+')');
    newActive.show();
    active.delay(1000).hide();
    active.removeClass('active');
    newActive.addClass('active');
}
var nbImage=0;
$(function(){
    $('#diapo img').hide();
    $('#diapo img.active').show();
    nbImage = $('#diapo img').length;
    setInterval("slideSwitch()", 2000);
});
