/* auteur: elk */
/* date de creation: 17/08/2004 */

<!-- Begin
var expDays = 30;
var exp = new Date();


exp.setTime(exp.getTime() + (expDays*24*60*60*1000));




function InitCookie(){
var InitName = GetCookie('VisitorName')
if (InitName==null) InitName=""
return InitName;
}
function Who(Nm){
var VisitorName = GetCookie('VisitorName')
if (VisitorName != Nm) {
VisitorName=Nm;
SetCookie ('VisitorName', VisitorName, exp);
}
return VisitorName;
}

function When(info){
var WWHText
var HTime = GetCookie('WWhenH'+info)
WWHText=HTime
if (HTime ==null)
{WWHText="cet instant"
}
SetCookie ("WWhenH"+info, Get_Date(), exp)
return WWHText
}

function Count(info){
var WWHCount = GetCookie('WWHCount'+info)
if (WWHCount == null) {
WWHCount = 0;
}
else{
WWHCount++;
}
SetCookie ('WWHCount'+info, WWHCount, exp);
return WWHCount;
}
function set(){
VisitorName = prompt("Who are you?");
SetCookie ('VisitorName', VisitorName, exp);
SetCookie ('WWHCount', 0, exp);
SetCookie ('WWhenH', 0, exp);
}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
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" : "");
}
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
//  End -->

function emailCheck(txt) {
  if (txt.indexOf("@")<3){
   alert("Je suis désolé. Cette adresse courriel semble mauvaise."
   +"\nCes renseignements restront confidentiels.\nIndiquez votre E-mail, Merci...");
  document.forms[0].elements[1].focus();
return false;
  }
  
return true;
 }
function Download(adresse){
// Donne l'url du fichier ici :
document.writeln('<HTML><HEAD><META HTTP-EQUIV="Refresh" CONTENT="1;URL=' + adresse + '"></HEAD><BODY>Downloading...</BODY></HTML>');
}

function Dload(val)
{
SetCookie ('FT', val, exp)
res=window.open("telechargement.htm","telechargement","width=600,height=550,scrollbars=yes,status=no,resizable=yes,menubar=no,toolbar=no") 
//res.document.Frm.Fichier.selectedIndex=val
 
}
function fermer()
{close()
}
var ok=false

function verifier()

{for (n=0;n<5;n++)
 
{if (document.forms[0].elements[n].value.length==0 && (n!=2))
{alert("Indiquez votre " + document.forms[0].elements[n].name + ".\nMerci...")
document.forms[0].elements[n].focus()
if (document.forms[0].elements[4].value.length==0) document.Frm.Fichier.selectedIndex=0
return false
break
}

else 
ok=true 

}

if ( IsSelectFichier()==false)
 {ok=false;
 return false;}
if (emailCheck(document.forms[0].elements[1].value)==false)
 {ok=false;
 return false;}
if  (ok==true)

{res=window.open(document.Frm.Fichier.value,"","scrollbars=yes,status=no,resizable=yes,menubar=no,toolbar=no,height=400")  

//setTimeout("close()",100)

}
}
function IsSelectFichier() {
if (document.Frm.Fichier.selectedIndex!=0)

    return true 
else
alert ("Selectionner le fichier que voulez télécharger...");document.forms[0].elements[4].focus(); return false; }

function IsAroThere (Email) {
    var test = "" + Email;
    for (var k = 0; k < test.length; k++) 
    {
        var c = test.substring(k, k+1);
        if(c == "@") { 
    return true; } 
    }
alert ("Ces renseignement restront confidentiel.\nIndiquez votre E-mail, Merci...");document.forms[0].elements[1].focus(); return false; 

}


function Get_Date()
{mois=["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]
jour=["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]
date_heure=new Date()
if ((leJour=date_heure.getDate())==1) leJour+="er"
leMois=mois[date_heure.getMonth()]
lAnnee= date_heure.getFullYear()
lHeure=date_heure.getHours()
lesMinutes=date_heure.getMinutes()
lesSecondes=date_heure.getSeconds()
return jour[date_heure.getDay()] + " " + leJour + " " +
        leMois + " " + lAnnee + ", " + lHeure + "h " +
	lesMinutes + "mn " +
	lesSecondes +"s"
}
function debuteDate() {
  var adate, date, amois,str;
   adate = new Date();
  date = adate.getDate();
  amois = adate.getMonth()+1;

  if (amois == 1) date += " janvier";
  else if (amois == 2) date += " février";
  else if (amois == 3) date += " mars";
  else if (amois == 4) date += " avril";
  else if (amois == 5) date += " mai";
  else if (amois == 6) date += " juin";
  else if (amois == 7) date += " juillet";
  else if (amois == 8) date += " août";
  else if (amois == 9) date += " septembre";
  else if (amois == 10) date += " octobre";
  else if (amois == 11) date += " novembre";
  else if (amois == 12) date += " décembre";
  date += " " + adate.getFullYear();
  
  return date
  
  }
