  slideShow=function(img1,img2,imgs,rep){
  this.img1=document.getElementById(img1);
  this.img2=document.getElementById(img2);
  this.imgs=imgs; //tableau avec les noms d'images
  this.opacite=0;
  this.n=1;
  this.rep=rep;
  //this.shuffle();
  for(var i=0; i < this.imgs.length;i++){
    this.imgs[i]=this.rep+this.imgs[i];
  }
  this.img1.src=imgs[0];
  this.img2.src=imgs[1];
  
};

slideShow.prototype.fadepic=function(){
  var IsIE=!!document.all;
  
  this.opacite-=2;
  if(this.opacite<0){
    this.img1.src=this.img2.src;
    IsIE?this.img1.filters[0].opacity=100:this.img1.style.opacity=1;
    this.n=this.n==(this.imgs.length-1)?0:this.n+=1;
    this.img2.src=this.imgs[this.n];
    this.opacite=102;
    //setTimeout(function(thisObj){thisObj.fadepic();},3000,this);
    setTimeout(createFadePic(this),2000);
  } else {
    IsIE?this.img1.filters[0].opacity=this.opacite:this.img1.style.opacity=this.opacite/100;
    setTimeout(createFadePic(this),50);
    //setTimeout(function(thisObj){thisObj.fadepic();},50,this);
  }  
}
slideShow.prototype.shuffle=function(){
  var o=this.imgs;
  for(var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
  return o;
}

function createFadePic(o){
  return function() {o.fadepic();};
};

