function slide() {
  this.Im=new Array();
  this.nb=null;
  this.names=null;
  this.path=null;
  this.current=0;
  this.imge=null;

  function init(s, path, iname) {
    this.imge=iname;
    this.path=path;
    this.names= s.split(/\s/g);
    this.nb = new Array();
    for(var i=0;i<this.names.length;i++) {
     this.nb[this.names[i]]=i;
    }
  }
  this.init=init;

  function preload(k) {
    if (this.Im[k]==null) {
     this.Im[k]=new Image();
     this.Im[k].src=this.path+"/"+this.names[k];
    }
  }
  this.preload=preload;

  function suivant(x) {
    this.current += x+this.names.length;
    this.current = this.current%this.names.length;
    this.setimg(this.current);
  }
  this.suivant=suivant;

  function setimg(k) {
    this.preload(k);
    this.current = k;
    document.images[this.imge].src=this.Im[k].src;
    this.preload(k+1);
  }
  this.setimg=setimg;

  function set(sn) {
    this.setimg(this.nb[sn]);
  }
  this.set=set;

  function extrem(x) {
    var k;
    if(x==0) k = 0;
    else k= this.names.length-1;
    this.setimg(k);
  }
  this.extrem=extrem;

  function loadexple(s) {
    this.setimg[nb[s]]; 
    document.location.href="#SL";
  }
  this.loadexple=loadexple;
}


