//<!-- J.BLONDEL 07/99 EMAIL spillane.blondel@wanadoo.fr-->
//lit ou cree une couleur*****************************
function DefinitCodes()
{
  this[1] =0;
  this[2] = GetCookie("gateaufg");
  this[3] = GetCookie("gateaubg");
  this[4] = (Math.ceil(Math.random()*255*255*255));
  this[5] = (Math.ceil(Math.random()*255*255*255));
  this[6] = "31/12/2000";
  this[7] = GetCookie("deminffg");
  this[8] = GetCookie("deminfbg");
  this[9] = GetCookie("cadreht");
  this[10] = GetCookie("cadrebs");
  i=2; //fg
  return(this);
}

// V‚rifie un formulaire *****************************
function verif()
{
  for (var i=0; i<=9;i++)
      {
       if (document.FORMUL1.elements[i].value=="")
          {document.FORMUL1.elements[i].focus()}   // doit rmettre le curseur au début car rien rentré.
          if (i==09){document.FORMUL1.submit()}  // pour autoriser l'envoi
       } //fin du FOR
} //fin de fonction verif


// pointe le curseur sur un champ faux ****************
function charnum(nb)
{
         var saisie= document.FORMUL1.elements[nb].value 
            for (var i=0;i<=saisie.lenght;i++)   
               {
            if ((saisie.substring[i,i+1]<"0")||(saisie.substring[i,i+1]>"9"))
               { alert ("Uniquement des CHIFFRES");
                 document.FORMUL1.elements[nb].focus()
               }  // fin du if    
               }// fin du for       
} // de la fonction


// Change de couleurs***********************

function Boutona(a,b,f)        // a & b =nø de frames, f= fond ou lettres
{
 for (var dk=0;dk<1;dk++)   // pour changer 10 fois
     { c = new DefinitCodes();
        i=4;  //pour lire l'al‚atoire !
      for (var j=a;j<=b;j++)
        {
    if (f==0){parent.frames[j].document.fgColor=c[i];}
    if (f==1){parent.frames[j].document.bgColor=c[i+1];}
    if (f==8){parent.frames[j].document.linkColor=c[i];}
    if (f==9){parent.frames[j].document.alinkColor=c[i];}
    if (f==10){parent.frames[j].document.vlinkColor=c[i];}
        } //des frames a,b
       SetCookie("gateaufg",parent.frames[j-1].document.fgColor,expdate,"/");
       SetCookie("gateaubg",parent.frames[j-1].document.bgColor,expdate,"/");
       SetCookie("deminfbg",parent.frames[j-1].document.linkColor,expdate,"/");
       SetCookie("cadreht",parent.frames[j-1].document.alinkColor,expdate,"/");
       SetCookie("cadrebs",parent.frames[j-1].document.vlinkColor,expdate,"/");
        } //de fordk
}            //fin de fonction boutona

//*********************************


function Bta(a,b)
       { 
        var newwin = window.open("../couleur.htm","","status=no,height=a,width=b,resizable=NO")
       }//fin de fonction bouton1

function Btb()
       {
//        var newwin = window.open("../present.htm","","status=no,height=a,width=b,resizable=yes")
        parent.frames[1].location="../present.htm";
  
       }
function Btc()
       {parent.frames[1].location = "defil.htm" ;
       }//fin de fonction btc
function Btd()
       {
   //     var newwin = window.open("presite.htm","","status=no,height=a,width=b,resizable=yes")
        parent.frames[1].location="../presite.htm";
       }
function Bte()
       {
//        var newwin = window.open("gessite.htm","","status=no,height=a,width=b,resizable=yes")
        parent.frames[1].location="../gessite.htm";
       }//fin de fonction bouton1

function Btf(a,b)
       { 
   var newwin = window.open("logofram.htm","","status=no,height=a,width=b,resizable=yes")
       }//fin de fonction bouton1

function Btg()
       {parent.frames[1].location = "implantation.htm";
        }

function Bth()
       {parent.frames[1].location = "sons.htm";
       }
function Bti()
       {parent.frames[1].location = "sonsjava.htm";
       }

function Btq(a,b)
       { 
   var newwin = window.open("animat.htm","","status=no,height=a,width=b,resizable=no")
       }//fin de fonction bouton1


function Btx(a)
       {parent.frames[a].location ="deminf.htm";
       }
function Btz(a)
       {parent.frames[a].location ="MailTo:spillane.blondel@wanadoo.fr";
       }

//
// Fonctions Cookie (21 jan 99)
// Les fonctions suivantes font partie du domaine public.
//
// Fonctiion "interne" pour retourner la valeur décodée d'un cookie
//
function getCookieVal (offset)
 {
 var endstr = document.cookie.indexOf (";", offset);
 if (endstr == -1)
 endstr = document.cookie.length; //longueur totale cookie
 return unescape(document.cookie.substring(offset, endstr));//
 }

//
// Fonction pour retourner la valeur du cookie indiqué par
// le paramètre "name".
// name - chaîne comportant le nom du cookie.
// returns - chaîne contenant la valeur du cookie
// ou la valeur null si le cookie n'existe pas.
//

function GetCookie (name)
 {
 var arg = name + "=";
 var alen = arg.length;//longueur du nom du cookie + separateur
 var clen = document.cookie.length;//longueur du fichier
 var i = 0;
 while (i < clen)
 {
	 var j = i + alen;// demarre sur le séparateur
	 if (document.cookie.substring(i, j) == arg) //nom & separateur?
       var k = getCookieVal (j);
         i = document.cookie.indexOf(" ", i) + 1;
         if (i == 0) break;
 } //du while
 return (k);
 } //de la fonction

function SetCookie (name, value)
{
 var argv = SetCookie.arguments;
 var argc = SetCookie.arguments.length;
 var expires = (argc > 2) ? argv[2] : null;
 var path = (argc > 3) ? argv[3] : null;
 var domain = (argc > 4) ? argv[4] : null;
 var secure = (argc > 5) ? argv[5] : false;
 document.cookie = name + "=" + escape (value) +
 ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
 ((path == null) ? "" : ("; path=" + path)) +
 ((domain == null) ? "" : ("; domain=" + domain)) +
 ((secure == true) ? "; secure" : "");
}

// Fonction pour détruire un cookie (lui affecte une date
// d'expiration égale à la date et l'heure actuelles
// name - chaîne contenant le nom du cookie
//
function DeleteCookie (name)
{
 var exp = new Date();
 exp.setTime (exp.getTime() - 1); // Ce cookie est maintenant
                                  // de l'histoire ancienne
 var cval = GetCookie (name);
 if (cval != null)
 document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}


//
// Exemple
//
var expdate = new Date ();
expdate.setTime (expdate.getTime() + (90 * 24 * 60 * 60 * 1000)); // 90jours 24 hrs from now


// Effacement d'un cookie
//

