//-------------------- Gestion de la liste des affiches --------------------//

function PosterList(){
  var c=this, a=arguments;
  c.poster=new Array();    // Les affiches
  c.nbrPoster=0;           // Nombre d'affiches
  return;
}

PosterList.prototype.AddPoster=function(){
  var c=this, a=arguments, numPoster=c.nbrPoster;
  c.nbrPoster++;
  p=c.poster[numPoster]=new Object();
  p.src=a[0];              // Chemin d'accès à l'image
  p.alt=a[1]||null;        // Commentaire de l'image
  p.link=a[2]||null;       // Lien lors du clic de l'image
  return;
}

PosterList.prototype.RandomPoster=function(){
  var c=this, a=arguments, chaine="";
  var randomNumber=Math.floor(Math.random() * c.nbrPoster);
  var p=c.poster[randomNumber];
  if (p.link != null){
    chaine+="<a href=\""+p.link+"\">";
  }
  chaine+="<img src=\""+p.src+"\"";
  if (p.alt != null){
    chaine+=" alt=\""+p.alt+"\"";
  }
  chaine+=" height=\"363\" width=\"272\" border=\"0\">";
  if (p.link != null){
    chaine+="</a>";
  }
  document.write(chaine);
  return;
}


