imgNumber = 0;      //    <-- indicateur de l'image courante   
  imgNumber2 = 0;      //    <-- indicateur de l'image courante   


// +---------------------------+
// | 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("animation","V2.0");

// +-----------------------------------+

// +------------------------+
// | Gestion des animations |
// +------------------------+

// fonctions privées

var AL_calques;

if (AL_calques==undefined)
  AL_calques = new Array();

// Gestion des animations d'un calque

function AL_Animer_deplacer(Indice)
{
  AL_Deplacer_zone(this.Nom_objet,this.PosX[Indice],this.PosY[Indice]);
  return(!(Indice==(this.PosX.length-1)));
}

function AL_Definir_animation_segment(Nom_objet,X1,Y1,X2,Y2,Nb_increments)
{
  if (Nb_increments<=0)
    return(null);
    
  this.Nom_objet = Nom_objet;
  this.X1 = X1;  this.Y1 = Y1;
  this.X2 = X2;  this.Y2 = Y2;
  this.Nb_increments = Nb_increments;
  this.Attendre=true;
  this.Boucle = null;
  
  this.PosX = new Array();
  this.PosY = new Array();
  
  for (var i=0;i<Nb_increments;i++)
  {
    this.PosX[i] = X1 + Math.floor(i*((X2-X1)/Nb_increments));
    this.PosY[i] = Y1 + Math.floor(i*((Y2-Y1)/Nb_increments));
  }
  
  this.Animer=AL_Animer_deplacer;

  return(this);
}

function AL_Definir_animation_ellipse(Nom_objet,CX,CY,RX,RY,Angle_debut,Angle_fin,Nb_increments)
{
  if (Nb_increments<=0)
    return(null);
    
  this.Nom_objet = Nom_objet;
  this.CX = CX;  this.CY = CY;
  this.RX = RX;  this.RY = RY;
  this.Angle_debut = Angle_debut;
  this.Angle_fin = Angle_fin;
  this.Nb_increments = Nb_increments;
  this.Attendre=true;
  this.Boucle = null;
  
  this.PosX = new Array();
  this.PosY = new Array();
  
  for (var i=0;i<Nb_increments;i++)
  {
    var Angle = (Angle_debut+i*(Angle_fin-Angle_debut)/Nb_increments)*Math.PI/180;
    
    this.PosX[i] = Math.floor(CX + RX*Math.cos(Angle));
    this.PosY[i] = Math.floor(CY + RY*Math.sin(Angle));
  }
  
  this.Animer=AL_Animer_deplacer;
  
  return(this);
}

function AL_Definir_animation_cercle(Nom_objet,CX,CY,R,Angle_debut,Angle_fin,Nb_increments)
{
  return new AL_Definir_animation_ellipse(Nom_objet,CX,CY,R,R,Angle_debut,Angle_fin,Nb_increments);
}

function AL_Animer_pause(Indice)
{
  return(!(Indice==(this.Nb_increments-1)));
}

function AL_Definir_animation_pause(Nb_increments)
{
  if (Nb_increments<=0)
    return(null);
    
  this.Nb_increments=Nb_increments;
  this.Attendre=true;
  this.Boucle = null;
  
  this.Animer=AL_Animer_pause;
  
  return(this);
}

function AL_Animer_clipping(Indice)
{
  AL_Definir_clip(this.Nom_objet,this.PosX1[Indice],this.PosY1[Indice],
                                 this.PosX2[Indice],this.PosY2[Indice]);

  return(!(Indice==this.Nb_increments));
}

function AL_Definir_animation_clipping(Nom_objet,X11,Y11,X21,Y21,X12,Y12,X22,Y22,Nb_increments)
{
  if (Nb_increments<=0)
    return(null);
    
  this.Nom_objet = Nom_objet;
  this.X11 = X11;  this.Y11 = Y11;
  this.X21 = X21;  this.Y21 = Y21;
  this.X12 = X12;  this.Y12 = Y12;
  this.X22 = X22;  this.Y22 = Y22;
  this.Nb_increments = Nb_increments;
  this.Attendre = true;
  this.Boucle = null;
  
  this.PosX1 = new Array(); this.PosY1 = new Array();
  this.PosX2 = new Array(); this.PosY2 = new Array();
  
  for (var i=0;i<=Nb_increments;i++)
  {
    this.PosX1[i] = Math.floor(X11 + i*((X12-X11)/Nb_increments));
    this.PosY1[i] = Math.floor(Y11 + i*((Y12-Y11)/Nb_increments));
    this.PosX2[i] = Math.floor(X21 + i*((X22-X21)/Nb_increments));
    this.PosY2[i] = Math.floor(Y21 + i*((Y22-Y21)/Nb_increments));
  }
  
  this.Animer=AL_Animer_clipping;
  
  return(this);
}

function AL_Animer_afficher(Indice)
{
  if ((this.X)&&(this.Y))
    AL_Deplacer_zone(this.Nom_objet,this.X,this.Y);
    
  AL_Afficher_zone(this.Nom_objet);
  return(false);
}

function AL_Definir_animation_afficher(Nom_objet,X,Y)
{
  this.Nom_objet = Nom_objet;
  this.X=X; this.Y=Y;
  this.Attendre = false;
  this.Boucle = null;
  
  this.Animer=AL_Animer_afficher;
  
  return(this);
}

function AL_Animer_cacher(Indice)
{
  AL_Cacher_zone(this.Nom_objet);
  return(false);
}

function AL_Definir_animation_cacher(Nom_objet)
{
  this.Nom_objet = Nom_objet;
  this.Attendre = false;
  this.Boucle = null;
  
  this.Animer=AL_Animer_cacher;
  
  return(this);
}

function AL_Animer_modifier(Indice)
{
  AL_Modifier_zone(this.Nom_objet,this.Valeur);
  return(false);
}

function AL_Definir_animation_modifier(Nom_objet,Valeur)
{
  this.Nom_objet = Nom_objet;
  this.Valeur = Valeur;
  this.Attendre = false;
  this.Boucle = null;
  
  this.Animer=AL_Animer_modifier;
  
  AL_Declarer_valeur_zone(Nom_objet,Valeur);

  return(this);
}

function AL_Definir_animation_debut_boucle(Nb_iterations)
{
  this.Iteration_courante = 0;
  this.Nb_iterations=Nb_iterations;
  this.Fin_boucle=-1;
  this.Attendre = false;
  this.Boucle = "Debut";

  return(this);
}

function AL_Definir_animation_fin_boucle(Retour)
{
  this.Retour = Retour;
  this.Attendre = false;
  this.Boucle = "Fin";

  return(this);
}

function AL_Tracer_trajectoire_polygone()
{
  // calcule la taille de la trajectoire
  
  var Taille = 0;
  var Pas = 0;
  var j;
  var k;
  var Ecart=0;
  var Coef;
  
  var Debut = new Array();
  Debut[0] = 0;
  
  for (var i=1;i<this.X.length;i++)
  {
    if (Math.abs(this.X[i-1]-this.X[i])>Math.abs(this.Y[i-1]-this.Y[i]))
      Taille+=Math.abs(this.X[i-1]-this.X[i]);
    else
      Taille+=Math.abs(this.Y[i-1]-this.Y[i]);
      
    Debut[i]=Taille;
  }
  
  // calcule de la distance entre 2 points de l'animation
  
  Pas=Taille/this.Nb_increments;
  
  // Trace.Ecrire('Polygone :<BR>');
  
  Taille=0;
  j=0;
  k=0;
  for (var i=0;i<=this.Nb_increments;i++)
  {
    while (Taille>=Debut[j+1])
      j++;

    if (Math.abs(this.X[j]-this.X[j+1])>Math.abs(this.Y[j]-this.Y[j+1]))
      Ecart=Math.abs(this.X[j]-this.X[j+1]);
    else
      Ecart=Math.abs(this.Y[j]-this.Y[j+1]);

    if (Ecart>0)
    {
      Coef=(Taille-Debut[j])/Ecart;

      this.PosX[k] = this.X[j] + Math.floor(Coef*(this.X[j+1]-this.X[j]));
      this.PosY[k] = this.Y[j] + Math.floor(Coef*(this.Y[j+1]-this.Y[j]));
      k++;
    }
  
    Taille+=Pas;
  }
  
}

function AL_Tracer_trajectoire_bezier()
{
  // calcule la taille de la trajectoire

  var C=new Array();
  var F=new Array();
  
  F[0]=1;
  for (var i=1;i<this.X.length;i++)
    F[i]=F[i-1]*i;
  
  for (var i=0;i<this.X.length;i++)
    C[i]=F[this.X.length-1]/(F[i]*F[this.X.length-1-i]);

  var j=0;    
  for (var t=0;t<=1;t+=(1/(this.Nb_increments-1)))
  {
    var t1=1;
    var t2=1;
    
    for (var i=1;i<this.X.length;i++)
      t2*=(1-t);

    var X=0;
    var Y=0;

    for (var i=0;i<this.X.length;i++)
    {
      var Coef=C[i]*t1*t2;
      
      X+=Coef*this.X[i];
      Y+=Coef*this.Y[i];
      
      t1*=t;
      if (t!=1)
        t2/=(1-t);
      else if (i==this.X.length-2)
        t2=1;
    }
    
    this.PosX[j]=Math.floor(X);
    this.PosY[j]=Math.floor(Y);
    
    j++;
  }
}

function AL_Tracer_trajectoire_spline()
{
  // calcule la taille de la trajectoire
  
  if (this.X.length<=3)
    return;
  
  var Pas=(this.X.length-3)/(this.Nb_increments-1);
  var j=0;
  
  for (var t=0;t<=this.X.length-3;t+=Pas)
  {
    var i=Math.floor(t);
    
    var t0=1;
    var t1=(t-i);
    var t2=t1*t1;
    var t3=t2*t1;
    
    var X1=-1*this.X[i]+3*this.X[i+1]-3*this.X[i+2]+this.X[i+3];
    var X2= 3*this.X[i]-6*this.X[i+1]+3*this.X[i+2];
    var X3=-3*this.X[i]              +3*this.X[i+2];
    var X4=   this.X[i]+4*this.X[i+1]+  this.X[i+2];
    
    var Y1=-1*this.Y[i]+3*this.Y[i+1]-3*this.Y[i+2]+this.Y[i+3];
    var Y2= 3*this.Y[i]-6*this.Y[i+1]+3*this.Y[i+2];
    var Y3=-3*this.Y[i]              +3*this.Y[i+2];
    var Y4=   this.Y[i]+4*this.Y[i+1]+  this.Y[i+2];
    
    this.PosX[j]=Math.floor((X1*t3+X2*t2+X3*t1+X4*t0)/6);
    this.PosY[j]=Math.floor((Y1*t3+Y2*t2+Y3*t1+Y4*t0)/6);
    
    j++;
  }
}

function AL_Tracer_trajectoire_catmull()
{
  // calcule la taille de la trajectoire
  
  if (this.X.length<=3)
    return;
  
  var Pas=(this.X.length-3)/(this.Nb_increments-1);
  var j=0;
  
  for (var t=0;t<=this.X.length-3;t+=Pas)
  {
    var i=Math.floor(t);
    
    var t0=1;
    var t1=(t-i);
    var t2=t1*t1;
    var t3=t2*t1;
    
    var X1=-1*this.X[i]+3*this.X[i+1]-3*this.X[i+2]+this.X[i+3];
    var X2= 2*this.X[i]-5*this.X[i+1]+4*this.X[i+2]-this.X[i+3];
    var X3=-1*this.X[i]              +  this.X[i+2];
    var X4=             2*this.X[i+1];
    
    var Y1=-1*this.Y[i]+3*this.Y[i+1]-3*this.Y[i+2]+this.Y[i+3];
    var Y2= 2*this.Y[i]-5*this.Y[i+1]+4*this.Y[i+2]-this.Y[i+3];
    var Y3=-1*this.Y[i]              +  this.Y[i+2];
    var Y4=             2*this.Y[i+1];
    
    this.PosX[j]=Math.floor((X1*t3+X2*t2+X3*t1+X4*t0)/2);
    this.PosY[j]=Math.floor((Y1*t3+Y2*t2+Y3*t1+Y4*t0)/2);
    
    j++;
  }
}

function AL_Definir_animation_trajectoire(Nom_objet,Effet,X,Y,Nb_increments)
{
  if ((Nb_increments<=1)||(X.length!=Y.length)||(X.length<=1))
    return(null);
    
  this.Nom_objet = Nom_objet;
  this.Effet = Effet;
  this.Nb_increments = Nb_increments;
  this.Attendre=true;
  this.Boucle = null;
  
  this.PosX = new Array();
  this.PosY = new Array();
  
  this.X = new Array();
  this.Y = new Array();
  
  this.X[0]=X[0]; this.Y[0]=Y[0];
  this.X[1]=X[0]; this.Y[1]=Y[0];
  for (var i=0;i<X.length;i++)
  {
    this.X[i+2]=X[i]; this.Y[i+2]=Y[i];
  }
  this.X[i+2]=X[i-1]; this.Y[i+2]=Y[i-1];
  this.X[i+3]=X[i-1]; this.Y[i+3]=Y[i-1];
    
  this.Animer=AL_Animer_deplacer;
  
  if (Effet=="Polygone")
    this.Tracer=AL_Tracer_trajectoire_polygone;
  else if (Effet=="Bezier")
    this.Tracer=AL_Tracer_trajectoire_bezier;
  else if (Effet=="B-Spline")
    this.Tracer=AL_Tracer_trajectoire_spline;
  else if (Effet=="Spline")
    this.Tracer=AL_Tracer_trajectoire_catmull;
  else
  {
    alert('Effet inconnu : '+Effet);
    return(null);
  }
  
  this.Tracer();
  
  return(this);
}

function AL_Animer_synchroniser(Indice)
{
  var Calque = AL_Rechercher_calque(this.Nom_calque);
  
  if (!Calque)
    return(false);
    
  if (this.Action=="Activer")
  {
    Calque.Activer(this.Temps);
  }
  else if (this.Action=="Pause")
  {
    Calque.Pauser();
  }
  else if (this.Action=="Arreter")
  {
    Calque.Arreter();
  }
    
  return(false);
}

function AL_Definir_animation_synchroniser(Action,Nom_calque,Temps)
{
  this.Nom_calque = Nom_calque;
  this.Action = Action;
  this.Temps = Temps;
  
  this.Attendre=false;
  this.Boucle=null;

  if ((this.Action!="Activer")&&(this.Action!="Pause")&&(this.Action!="Arreter"))
  {
    alert('Action inconnue : '+this.Action);
    return(null);
  }
  
  this.Animer=AL_Animer_synchroniser;
  
  return(this);
}

// Declare une séquence d'animation

function AL_Creer_animation(Action,Args)
{
  var Animation = null;
  
  if (Action=="Segment")
  {
    Animation = new AL_Definir_animation_segment(Args[0],Args[1],Args[2],Args[3],Args[4],Args[5]);
  }
  else if (Action=="Ellipse")
  {
    Animation = new AL_Definir_animation_ellipse(Args[0],Args[1],Args[2],Args[3],Args[4],Args[5],Args[6],Args[7]);
  }
  else if (Action=="Cercle")
  {
    Animation = new AL_Definir_animation_cercle(Args[0],Args[1],Args[2],Args[3],Args[4],Args[5],Args[6]);
  }
  else if (Action=="Pause")
  {
    Animation = new AL_Definir_animation_pause(Args[0]);
  }
  else if (Action=="Clipping")
  {
    Animation = new AL_Definir_animation_clipping(Args[0],Args[1],Args[2],Args[3],Args[4],Args[5],Args[6],Args[7],Args[8],Args[9]);
  }
  else if (Action=="Afficher")
  {
    Animation = new AL_Definir_animation_afficher(Args[0],Args[1],Args[2]);
  }
  else if (Action=="Cacher")
  {
    Animation = new AL_Definir_animation_cacher(Args[0]);
  }
  else if (Action=="Modifier")
  {
    Animation = new AL_Definir_animation_modifier(Args[0],Args[1]);
  }
  else if (Action=="Debut")
  {
    if (!Compatible_internet)
      this.Pile_boucle.push(this.Animation.length);
    else
      this.Pile_boucle[this.Pile_boucle.length]=this.Animation.length;
    
    Animation = new AL_Definir_animation_debut_boucle(Args[0]);
  }
  else if (Action=="Fin")
  {
    if (this.Pile_boucle.length>0)
    {
      var Retour;
      
      if (!Compatible_internet)
        Retour = this.Pile_boucle.pop();
      else
      {
        Retour = this.Pile_boucle[this.Pile_boucle.length-1];
        this.Pile_boucle.length--;
      }
      
      this.Animation[Retour].Fin_boucle=this.Animation.length;
      
      Animation = new AL_Definir_animation_fin_boucle(Retour);
    }
  }
  else if (Action=="Trajectoire")
  {
    Animation = new AL_Definir_animation_trajectoire(Args[0],Args[1],Args[2],Args[3],Args[4]);
  }
  else if (Action=="Synchroniser")
  {
    Animation = new AL_Definir_animation_synchroniser(Args[0],Args[1]?Args[1]:this.Nom,Args[2]);
  }
  else
  {
    alert('Type d animation : '+Action+' inconnu');
    return(false);
  }
  
  if (Animation)
    this.Animation[this.Animation.length] = Animation;
  
  return(true);
}

function AL_Creer_animation_segment()
{
  return(this.Creer("Segment",AL_Creer_animation_segment.arguments));
}

function AL_Creer_animation_ellipse()
{
  return(this.Creer("Ellipse",AL_Creer_animation_ellipse.arguments));
}

function AL_Creer_animation_cercle()
{
  return(this.Creer("Cercle",AL_Creer_animation_cercle.arguments));
}

function AL_Creer_animation_pause()
{
  return(this.Creer("Pause",AL_Creer_animation_pause.arguments));
}

function AL_Creer_animation_clipping()
{
  return(this.Creer("Clipping",AL_Creer_animation_clipping.arguments));
}

function AL_Creer_animation_afficher()
{
  return(this.Creer("Afficher",AL_Creer_animation_afficher.arguments));
}

function AL_Creer_animation_cacher()
{
  return(this.Creer("Cacher",AL_Creer_animation_cacher.arguments));
}

function AL_Creer_animation_modifier()
{
  return(this.Creer("Modifier",AL_Creer_animation_modifier.arguments));
}

function AL_Creer_animation_debut_boucle()
{
  return(this.Creer("Debut",AL_Creer_animation_debut_boucle.arguments));
}

function AL_Creer_animation_fin_boucle()
{
  return(this.Creer("Fin",AL_Creer_animation_fin_boucle.arguments));
}

function AL_Creer_animation_trajectoire()
{
  return(this.Creer("Trajectoire",AL_Creer_animation_trajectoire.arguments));
}

function AL_Creer_animation_synchroniser()
{
  return(this.Creer("Synchroniser",AL_Creer_animation_synchroniser.arguments));
}

// +----------------------------------+
// | Réalise une image de l'animation |
// +----------------------------------+

function AL_Animer(Nom_calque)
{
  var Calque = AL_Rechercher_calque(Nom_calque);
  var Attendre = false;
  
  if (!Calque)
    return(false);
  
  while (!Attendre)
  {
    if (Calque.Numero_animation<Calque.Animation.length)
    {
      var Animation = Calque.Animation[Calque.Numero_animation];
      Attendre=Animation.Attendre;
      
      if (Animation.Boucle)
      {
        if (Animation.Boucle=="Debut")
        {
          Animation.Iteration_courante = 0;
          if (Animation.Nb_iterations==0)
          {
            Calque.Numero_animation=Animation.Fin_boucle+1;
            Calque.Indice=0;
          }
          else
          {
            Calque.Numero_animation++;
            Calque.Indice=0;
          }
        }
        else if (Animation.Boucle=="Fin")
        {
          Calque.Animation[Animation.Retour].Iteration_courante++;
          if ((Calque.Animation[Animation.Retour].Iteration_courante<Calque.Animation[Animation.Retour].Nb_iterations)||
              (Calque.Animation[Animation.Retour].Nb_iterations==null))
          {
            Calque.Numero_animation=Animation.Retour+1;
            Calque.Indice=0;
          }
          else
          {
            Calque.Numero_animation++;
            Calque.Indice=0;
          }
        }
        else
        {
          Calque.Numero_animation++;
          Calque.Indice=0;
        }
      }
      else
      {
        if (Calque.Animation[Calque.Numero_animation].Animer(Calque.Indice))
          Calque.Indice++;
        else
        {
          Calque.Numero_animation++;
          Calque.Indice=0;
        }
      }
    }
    else
    {
      Calque.Arreter();
      Attendre=true;
    }
  }

  return(true);
}

// +--------------------------------------+
// | Fonctions de contrôle de l'animation |
// +--------------------------------------+

function AL_Activer_animation(Temps)
{
  if (this.Minuterie)
  {
    clearInterval(this.Minuterie);
    this.Minuterie = null;
  }
  this.Temps=Temps;
    
  this.Minuterie=setInterval('AL_Animer("'+this.Nom+'")',Temps);
}
    
function AL_Arreter_animation()
{
  if (this.Minuterie)
  {
    clearInterval(this.Minuterie);
    this.Minuterie = null;
  }

  this.Numero_animation=0;
  this.Indice=0;
}

function AL_Pauser_animation()
{
  if (this.Minuterie)
  {
    clearInterval(this.Minuterie);
    this.Minuterie = null;
  }
}

function AL_Est_anime()
{
  return(this.Minuterie);
}

function AL_Effacer_animation()
{
  delete this.Animation;
  this.Animation = new Array();
  
  delete this.Pile_boucle;
  this.Pile_boucle = new Array();
}

// +-----------------------------+
// | Gestion de la classe calque |
// +-----------------------------+

function AL_Definir_calque(Nom)
{
  this.Nom=Nom;
  this.Minuterie=null;
  this.Temps=null;

  this.Animation=new Array();
  this.Pile_boucle=new Array();
  
  this.Indice=0;
  this.Numero_animation=0;
  
  // gestion de l'animation
  
  this.Est_anime = AL_Est_anime;
  this.Pauser = AL_Pauser_animation;
  this.Arreter = AL_Arreter_animation;
  this.Activer = AL_Activer_animation;
  this.Effacer = AL_Effacer_animation;

  // creation de l'animation
  
  this.Creer = AL_Creer_animation;
  
  this.Creer_segment = AL_Creer_animation_segment;
  this.Creer_ellipse = AL_Creer_animation_ellipse;
  this.Creer_cercle = AL_Creer_animation_cercle;
  this.Creer_pause = AL_Creer_animation_pause;
  this.Creer_clipping = AL_Creer_animation_clipping;
  this.Creer_afficher = AL_Creer_animation_afficher;
  this.Creer_cacher = AL_Creer_animation_cacher;
  this.Creer_modifier = AL_Creer_animation_modifier;
  this.Commencer_boucle = AL_Creer_animation_debut_boucle;
  this.Finir_boucle = AL_Creer_animation_fin_boucle;
  this.Creer_trajectoire = AL_Creer_animation_trajectoire;
  this.Creer_synchroniser = AL_Creer_animation_synchroniser;
  
  return(this);
}

// fonctions publiques

function AL_Rechercher_calque(Nom)
{
  for (var i=0;i<AL_calques.length;i++)
    if (AL_calques[i].Nom==Nom)
      return(AL_calques[i]);

  return(null);
}

function AL_Creer_calque(Nom)
{
  var Calque = AL_Rechercher_calque(Nom);
  
  if (Calque)
    return(Calque);
    
  AL_calques[AL_calques.length]=new AL_Definir_calque(Nom);
  
  return(AL_calques[AL_calques.length-1]);
}



var destination_link = new Array();

destination_link['annonce'] = 'www.cyber-ads.net/index.php';
destination_link['glossaire'] ='glossaire.anuel.cm/index.php';
destination_link['date_historic'] ='historical.anuel.cm/date/index.php';
destination_link['day_historic'] ='historical.anuel.cm/day/index.php';
destination_link['lexique'] ='lexique.anuel.cm/index.php';
destination_link['diconame'] ='diconame.anuel.cm/index.php';
destination_link['sagesse'] ='datafrica.anuel.cm/sagesse/index.php';
destination_link['sigle'] ='sigle.anuel.cm/index.php';
destination_link['netlink'] ='link.anuel.cm/index.php';


function affiche_lien_image(lien_img)
{
	url=lien_img.split('___');
	url=format_url(url[0]);
	//alert(url)
window.open(url,"_banner_partner");
}

function Switch(repertoire,lang,totalimgNumber,anim,img_size,id_image,id_lien_image) {   


temp=img_size[imgNumber].split("__");

hauteur="";
largeur="";
if(temp[0]!=0)
{
	hauteur=' height="'+temp[0]+'" ';
}
if(temp[1]!=0)
{
	largeur=' width="'+temp[1]+'" ';
	
}


       image_src=anim[imgNumber].src;
	
var image_anim    = get_element(id_image);
var lien_img    = get_element(id_lien_image);


		lien_img.value =_lien_image(repertoire,imgNumber+1,lang);

image_anim.innerHTML='<a  href="#"  onclick="affiche_lien_image(\''+ lien_img.value +'\')"><img  border="0" src="'+image_src+'" '+hauteur + largeur +'></a>';
		

        imgNumber++;
        if(imgNumber >= totalimgNumber) imgNumber = 0;


}


function Switch2(repertoire,lang,totalimgNumber,anim,img_size,id_image,id_lien_image) {   

temp=img_size[imgNumber2].split("__");
hauteur="";
largeur="";
if(temp[0]!=0)
{
	hauteur=' height="'+temp[0]+'" ';
}
if(temp[1]!=0)
{
	largeur=' width="'+temp[1]+'" ';
	
}
   image_src=anim[imgNumber2].src;


var image_anim2    = get_element(id_image);
var lien_img2     = get_element(id_lien_image);


image_anim2.innerHTML='<a  href="#"  onclick="affiche_lien_image(2)"><img  border="0" src="'+image_src+'"  '+hauteur + largeur +'></a>';


lien_img2.value =_lien_image(repertoire,imgNumber2+1,lang);

        imgNumber2++;
        if(imgNumber2 >= totalimgNumber) imgNumber2 = 0;
	  }

 

    function fast(delay) {
       delay-=10; // decremente delay de .1 secondes
       if(delay < 0) delay = 0;
	   return delay;

   
    }

    function slow(delay,limit) {
       delay+=10; // incremente delay de .1 secondes
       if(delay >limit) delay = limit;
	   return delay;
	}




function affiche_animation(lang,speed,totalimgNumber,repertoire, text_image,id_image,id_lien_image)
{


limit=speed;
  anim = new Array();  //   <-- tableau d'IMG
  img_size = new Array();  //   <-- tableau taille d'IMG



    for (i = 0; i < totalimgNumber; i++) {
	  chaine="deb"+(i+1)+"(\\w+)fin"+(i+1);
  	  re = new RegExp(chaine);
	  result=text_image.match(re);
      img_size[i]=result[1];
	  temp=img_size[i].split("_");
	  anim[i] = new Image (temp[1], temp[0]);
      anim[i].src = repertoire +  (i + 1)  + '.gif';

    } 
	
 
	
 	   Switch(repertoire,lang,totalimgNumber,anim,img_size,id_image,id_lien_image);

	   fonction="affiche_animation('"+lang+"','"+speed+"','"+totalimgNumber+"','"+repertoire+"','"+text_image+"','"+id_image+"','"+id_lien_image+"')";

       setTimeout(fonction,speed)

	
}

function affiche_animation2(lang,speed,totalimgNumber,repertoire, text_image,id_image,id_lien_image)
{

limit=speed;
  anim = new Array();  //   <-- tableau d'IMG
  img_size = new Array();  //   <-- tableau taille d'IMG
  totalimgNumber=9;
  largeur_image=60;
  hauteur_image=40;

    for (i = 0; i < totalimgNumber; i++) {
	  chaine="deb"+(i+1)+"(\\w+)fin"+(i+1);
  	  re = new RegExp(chaine);
	  result=text_image.match(re);
      img_size[i]=result[1];
	  temp=img_size[i].split("_");
	  anim[i] = new Image (temp[1], temp[0]);
      anim[i].src = repertoire +  (i + 1)  + '.gif';


    } 
	

 	   Switch2(repertoire,lang,totalimgNumber,anim,img_size,id_image,id_lien_image);

	   fonction="affiche_animation2('"+lang+"','"+speed+"','"+totalimgNumber+"','"+repertoire+"','"+text_image+"','"+id_image+"','"+id_lien_image+"')";

       setTimeout(fonction,speed)

	
}
function _lien_image(repertoire,num,lang)
{
	
	var retour=["",""];
	local_repertory1=repertoire;
	local_repertory2=repertoire;
	base_dir="http://";  
	

					

		        switch(num)
				{
					case 1 : 
						switch(repertoire)
	 {
		
		case local_repertory1: retour[0]=  destination_link['annonce'] ; 
					          retour[1]="index.php";    
				
				 break;
 		case local_repertory2:retour[0]=   destination_link['annonce'] ; 
					          retour[1]="index.php";
		      
				
				 break;

	 };

							
							  break;


					case 2 : 
						switch(repertoire)
	 {
		
		case local_repertory1: retour[0]=base_dir + destination_link['glossaire'] ; 
					          retour[1]="index.php";    
				
				 break;
 		case local_repertory2:retour[0]=base_dir + destination_link['glossaire'] ; 
					          retour[1]="index.php";
		      
				
				 break;

	 };

							
							  break;



					case 3 : 
						switch(repertoire)
	 {
		
		case local_repertory1: retour[0]=base_dir + destination_link['date_historic'] ;
					          retour[1]="index.php";    
				
				 break;
 		case local_repertory2:retour[0]=base_dir +destination_link['date_historic'] ;
					          retour[1]="index.php";
		      
				
				 break;

	 };

							
							  break;

					case 4 : 
						switch(repertoire)
	 {
		
		case local_repertory1: retour[0]=base_dir + destination_link['day_historic'];				          retour[1]="index.php";    
				
				 break;
 		case local_repertory2:retour[0]=base_dir + destination_link['day_historic'],				          retour[1]="index.php";
		      
				
				 break;

	 };

							
							  break;

					case 5 : 
						switch(repertoire)
	 {
		
		case local_repertory1: retour[0]=base_dir + destination_link['lexique'] ;				          retour[1]="index.php";    
				
				 break;
 		case local_repertory2:retour[0]=base_dir + destination_link['lexique'] ;				          retour[1]="index.php";
		      
				
				 break;

	 };

							
							  break;

					case 6 : 
						switch(repertoire)
	 {
		
		case local_repertory1: retour[0]=base_dir +destination_link['diconame'];				          retour[1]="index.php";    
				
				 break;
 		case local_repertory2:retour[0]=base_dir + destination_link['diconame'];				          retour[1]="index.php";
		      
				
				 break;

	 };

							
							  break;

					case 7 : 
						switch(repertoire)
	 {
		
		case local_repertory1: retour[0]=base_dir +destination_link['sagesse'];				          retour[1]="index.php";    
				
				 break;
 		case local_repertory2:retour[0]=base_dir + destination_link['sagesse'];				          retour[1]="index.php";
		      
				
				 break;

	 };

							
							  break;

					case 8 : 
						switch(repertoire)
	 {
		
		case local_repertory1: retour[0]=base_dir + destination_link['sigle']; 					          retour[1]="index.php";    
				
				 break;
 		case local_repertory2:retour[0]=base_dir + destination_link['sigle'];					          retour[1]="index.php";
		      
				
				 break;

	 };

							
							  break;

					case 9 : 
						switch(repertoire)
	 {
		
		case local_repertory1: retour[0]=base_dir + destination_link['netlink'];					          retour[1]="index.php";    
				
				 break;
 		case local_repertory2:retour[0]=base_dir + destination_link['netlink'];					          retour[1]="index.php";
		      
				
				 break;

	 };

							
							  break;


				}

	
	return retour[0]+"___"+retour[1];
}












function _lien_text(num,nom_link)
{
	var retour=["",""];

		       if(nom_link=="regle_net")
			   {
			   switch(num)
				{
					case 1 : retour[0]="infos_site";
					          retour[1]="index.php";
							
							  break;
					case 2 : retour[0]="inscrire_site";
					          retour[1]="index.php";break;
					 case 3 : retour[0]="referencement_site";
					          retour[1]="index.php";break;
					 case 4 : retour[0]="forum_site";
					          retour[1]="index.php";break;
					 case 5 : retour[0]="livredor_sitep";
					          retour[1]="index.php";break;
				}
			   }
	
//	return retour[0]+"___"+retour[1];
	return retour[0];
}


function Switch_text(nom_banner,nom_link,param,totalimgNumber,fond1,fond2) {   

font_debut1='<font color="#336699" size="3"  face="Verdana, Arial, Helvetica, sans-serif"><b>';
font_debut2='<font color="#FFFFFF" size="3"  face="Verdana, Arial, Helvetica, sans-serif"><b>';
font_fin='</b> </font>';

        elt_banner=get_element(nom_banner);
		
		if(imgNumber==0)elt_banner.style.background=fond1;
		else elt_banner.style.background=fond2;
		
		if(imgNumber==0)elt_banner.innerHTML= font_debut1+param[imgNumber]+font_fin
		else elt_banner.innerHTML= font_debut2+param[imgNumber]+font_fin;

		elt_link=get_element(nom_link);
		elt_link.value =_lien_text(imgNumber+1,nom_link);
		
        imgNumber++;
        if(imgNumber >= totalimgNumber) imgNumber = 0;
	

	}

function affiche_animation_text(nom_banner,nom_link,speed,text1,text2,text3,text4,text5,totalimgNumber,fond1,fond2)
{

var param = new Array(text1,text2,text3,text4,text5);

 	   Switch_text(nom_banner,nom_link,param,totalimgNumber,fond1,fond2);

	   fonction="affiche_animation_text('"+nom_banner+"','"+nom_link+"','"+speed+"','"+text1+"','"+text2+"','"+text3+"','"+text4+"','"+text5+"','"+totalimgNumber+"','"+fond1+"','"+fond2+"')";
	
       setTimeout(fonction,speed)
    
	
}

function affiche_lien_text(nom_link)
{
url_link=get_element(nom_link);
url=url_link.value;

affiche_page("anuelcm","","op",url,"_self");

}
