/* author: HISSON Paul */
/* Generated by AceHTML Freeware http://freeware.acehtml.com */
/* Creation date: 27/08/02 */

function AjouteCookie(nom,valeur)
{
  delais = new Date(2100,11,11);
  delais = delais.toGMTString();
  document.cookie = nom + '=' + valeur + '; expires=' + delais + ';';
}

function Cookie()
{
  var c = document.cookie;
  var arg = new Array(2);
  this.nom = c.split(";");
  this.valeur = new Array(this.nom.length);
  for(var i=0;i<this.nom.length;i++)
  {
    arg = this.nom[i].split("=");
	this.valeur[i]=arg[1];
	this.nom[i]=arg[0].match(/\S.+/); //Enlève l'espace qui traine au début
  }

  this.initialise = readCookies;
  this.get = getCookie;
  this.existe = searchCookie;
}

function readCookies()
{
  var c = document.cookie;
  var arg = new Array(2);
  this.nom = c.split(";");
  this.valeur = new Array(this.nom.length);
  for(var i=0;i<this.nom.length;i++)
  {
    arg = this.nom[i].split("=");
	this.valeur[i]=arg[1];
	this.nom[i]=arg[0].match(/\S.+/); //Enlève l'espace qui traine au début;
  }
}

function searchCookie(nom)
{
  var i=0;
  while((this.nom[i]!=nom)&&(i<this.nom.length)) i++;
  return(i);  //si i==this.nom.length alors n'existe pas.
}

function getCookie(nom)
{
  var i=0;
  while((this.nom[i] != nom)&&(i<this.nom.length)) i++;
  if(i==this.nom.length) return("");
  return(this.valeur[i]);
}
