function months(){
	this[0]="janvier";
	this[1]="février";
	this[2]="mars";
	this[3]="avril";
	this[4]="mai";
	this[5]="juin";
	this[6]="juillet";
	this[7]="août";
	this[8]="septembre";
	this[9]="octobre";
	this[10]="novembre";
	this[11]="décembre";
}

function days(){
	this[0]="Dimanche";
	this[1]="Lundi";
	this[2]="Mardi";
	this[3]="Mercredi";
	this[4]="Jeudi";
	this[5]="Vendredi";
	this[6]="Samedi";
}

var mois=new months();
var jour=new days();

var time=new Date();

var fr_jour_s=jour[time.getDay()];	//Jour de la semaine
var jour_m=time.getDate();	//Jour du mois
var fr_mois=mois[time.getMonth()]; //le mois
var annee=time.getYear();// annee de forme XXXX

if (eval(navigator.appVersion.substring(0,1))>3) {
annee=time.getFullYear();
};

var whitespace = " \t\n\r";
var defaultEmptyOK = false;

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

function isDigit (c)
{   return ((c >= "0") && (c <= "9"))
}

function isInteger (s)
{   var i;

    if (isEmpty(s)) 
       if (isInteger.arguments.length == 1) return defaultEmptyOK;
       else return (isInteger.arguments[1] == true);

    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (!isDigit(c)) return false;
    }
    return true;
}

function isWhitespace (s)
{   var i;

    if (isEmpty(s)) return true;

    for (i = 0; i < s.length; i++)
    {   
        var c = s.charAt(i);
        if (whitespace.indexOf(c) == -1) return false;
    }

    return true;
}

function isEmail (s)
{   if (isEmpty(s)) 
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
   
    if (isWhitespace(s)) return false;
    
    var i = 1;
    var sLength = s.length;

    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }

    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}

function DefinirCookie(nom, valeur, nbjours, chemin)
{
   var Jours = nbjours * 24 * 60 * 60 * 1000;
   var dateFin = new Date();
   var chaineChemin = ((chemin != null) ? "" : ("; path=/")); 
   dateFin.setTime(dateFin.getTime() + Jours);
	document.cookie = nom + "=" + escape(valeur) + "; expires=" + dateFin.toGMTString() 
	+ chaineChemin;
}

function ObtenirCookie(nom) {
   var resultat = "";
   var monCookie = " " + document.cookie + ";";
   var nomRecherche = " " + nom + "=";
   var debutDuCookie = monCookie.indexOf(nomRecherche)
   var finDuCookie;
   if (debutDuCookie != -1) {
      debutDuCookie += nomRecherche.length; // ignorer le nom du cookie
      finDuCookie = monCookie.indexOf(";",debutDuCookie);
      resultat =
         unescape(monCookie.substring(debutDuCookie,finDuCookie));
   }
   return resultat;
}

function Creepub() {
	this.nb_pubs=0;
	this.AddPubl=AddPub;
}

function AddPub(nompub,nomlien,nomalt) {
	var pub = new Object;
	pub.pub=nompub;
	pub.lien=nomlien;
	pub.alt=nomalt;
	this[this.nb_pubs]=pub;
	this.nb_pubs++;
}
var pubT;
 var publi = 0;
		 function AfficherPub(pubs,pubDelai1) {
		// if (pubs!=null) {
		   pubDelai = pubDelai1;					
		   if (publi == pubs.nb_pubs) publi = 0;
		   document.pubImg.src = pubs[publi].pub;		  
		   document.pubImg.alt = pubs[publi].alt;		   
		  // document.pubLien.location.href= pubs[publi].lien;		   
		   publi++;
		 //  alert('"AfficherPub("'&idpub&'", pubDelai)"');
		   pubT = setTimeout('AfficherPub('+idpub+', pubDelai)', pubDelai1);//}
		}
		function ouvrirlien(pubs,i)
		{
			 //if (pubs!=null) {
			//location= pubs[i].lien;
			window.open(pubs[i].lien);
			//alert(pubs[i].lien);
			//}
		}
var pubTListe;
 var publiliste = 0;
		 function AfficherPubliste(pubs,pubDelai1) {
		// if (pubs!=null) {
		   pubDelai = pubDelai1;					
		   if (publiliste == pubs.nb_pubs) publiliste = 0;
		   document.pubImg.src = pubs[publiliste].pub;		  
		   document.pubImg.alt = pubs[publiliste].alt;		   
		  // document.pubLien.location.href= pubs[publi].lien;		   
		   publiliste++;
		 //  alert('"AfficherPub("'&idpub&'", pubDelai)"');
		   pubTListe = setTimeout('AfficherPubliste('+idpubliste+', pubDelai)', pubDelai1);//}
		}
		function ouvrirlienliste(pubs,i)
		{
			 //if (pubs!=null) {
			//location= pubs[i].lien;
			window.open(pubs[i].lien);
			//alert(pubs[i].lien);
			//}
		}
function Charger(nomcookie,tpubs)
{	
	var p = ObtenirCookie(nomcookie);
	if (p=="") p=0;
	if (p>=tpubs.nb_pubs) p=0;
	if (tpubs[p].lien!="") document.write('<a href="' + tpubs[p].lien + '" target="_blank">');
	document.write('<img src="' + tpubs[p].pub + '" border="0" alt="' + tpubs[p].alt + '">');	
	if (tpubs[p].lien!="") document.write('</a>');
	p++;
	if (p>=tpubs.nb_pubs) p=0;
	DefinirCookie(nomcookie, p, 1, "false");
}
function CreerMenu(ColFerme,ColOuvert,imgO,imgF,imgOption,hauteur) {
	this.nb_rub=0;
	this.colF=ColFerme;
	this.colO=ColOuvert;
	this.imgO=imgO;
	this.imgF=imgF;
	this.imgOpt=imgOption;
	this.hauteur=hauteur;
	this.AddRub=AddRubrique;
	this.AddLien=AddLink;
}
function AddRubrique(txt,aff,page) {
	var rub = new Object;
		rub.txt=txt;
		rub.aff=aff;
		rub.page=page;
		rub.nb_lien=0;
	this[this.nb_rub]=rub;
	this.nb_rub++;
}
function AddLink(txt,page) {
	var no_rub = this.nb_rub-1;
	var no_lien= this[no_rub].nb_lien;
	var lien = new Object;
		lien.txt=txt;
		lien.page=page;
	this[no_rub][no_lien]=lien;
	this[no_rub].nb_lien++;
}