// +---------------------------+
// | Liste des modules chargés |
// +---------------------------+

var AL_Liste_librairie;

if (AL_Liste_librairie!=undefined)
  AL_Liste_librairie[AL_Liste_librairie.length]=new AL_Definir_module_librairie("galerie","V2.0");

// +-----------------------------------+

function AL_Ecrire_miniature_photo()
{
  var Texte='';
      
  if (this.Normale!=null)
    Texte+='<a href="JavaScript:Afficher_image(\''+this.Normale+'\','+
                (this.Longueur+20)+','+(this.Hauteur+20)+',\''+this.Libelle+'\');">';

  Texte+='<img src=\''+this.Miniature+'\' border=0 alt=\''+this.Libelle+'\' title=\''+this.Libelle+'\'>';

  if (this.Normale!=null)
    Texte+='</a>';

  Texte+='<br>'+this.Libelle;
      
  return(Texte);
}

function AL_Definir_photo(Miniature,Normale,Longueur,Hauteur,Libelle)
{
  this.Miniature=Miniature;
  this.Normale=Normale;
  this.Longueur=Longueur;
  this.Hauteur=Hauteur;
  this.Libelle=Libelle;
      
  this.Ecrire_miniature=AL_Ecrire_miniature_photo;

  return(this);
}
    
function AL_Ajouter_galerie(Miniature,Normale,Longueur,Hauteur,Libelle)
{
  this.Photos[this.Photos.length]=new AL_Definir_photo(Miniature,Normale,Longueur,Hauteur,Libelle);
  return;
}

function AL_Ecrire_galerie(Longueur,Nb_colonnes,Bord)
{
  var Texte='<table';
  var i=0,j=0;

  if (this.Nom_classe!=null)
    Texte+=' class="'+this.Nom_classe+'"';

  Texte+=' width="'+Longueur+'%"';
  if (Bord!=null)
    Texte+=' border="'+Bord+'"';
    
  Texte+='>';
  while (i<this.Photos.length)
  {
    if (j==0) Texte+='<tr>';
    Texte+='<td ';
    if (this.Nom_classe!=null)
      Texte+='class="'+this.Nom_classe+'" ';
    Texte+='width="'+(Longueur/Nb_colonnes)+'%">'+this.Photos[i].Ecrire_miniature()+'</td>';
    if (j==Nb_colonnes-1)
    {
      j=0;
      Texte+='</tr>';
    }
    else
      j++;
    i++;
  }
      
  if (j>0)
  {
    while (j<Nb_colonnes)
    {
      Texte+='<td>&nbsp;</td>';
      j++;
    }
  }
      
  Texte+='</table>';
  return(Texte);
}
    
function AL_Definir_galerie(Nom_classe)
{
  this.Photos=new Array();
  this.Nom_classe=Nom_classe;
      
  this.Ajouter=AL_Ajouter_galerie;
  this.Ecrire=AL_Ecrire_galerie;
      
  return(this);
}