 function info(sd)
 {
  alert(sd);
   return false;
 }
 
 function checkAll(etatFutur)
 {
// var actuel = document.FormTableau.Cocher.value;
// var but = false;
// if (actuel=="Cocher") {but=true; document.FormTableau.Cocher.value="Décocher tout";}
 
 var test = document.FormTableau.elements.length;
    
 for (var i=1;i<test;i++){  document.FormTableau.elements[i].checked=etatFutur; } 

// alert("Vous avez tapé : " + actuel);
 
 return false;
}

 function datesPlausibles()
 {
  var probleme=""; var bizarre="";
  var dateNaissance = document.FormDates.F_dnLib.value;
  var anneeNaissance = dateNaissance.substr(0,4);
  if (dateNaissance.substr(2,1)=="-" || dateNaissance.substr(2,1)=="/") anneeNaissance = dateNaissance.substr(6,4);
  var dnType = document.FormDates.F_dnType.value;
  var dateDeces = document.FormDates.F_ddLib.value;
  var anneeDeces = dateDeces.substr(0,4);
  if (dateDeces.substr(2,1)=="-" || dateDeces.substr(2,1)=="/") anneeDeces = dateDeces.substr(6,4);
  var ddType = document.FormDates.F_ddType.value;
  var nom = document.FormDates.F_nom.value;
  var prenom = document.FormDates.F_prenom.value;
  
  var today = new Date();
  today=today.getFullYear();
  
  if (dnType=="DATE" && dateNaissance!="") {
  					if (anneeNaissance>today) probleme="Année de naissance incorrecte.";
  					if (anneeNaissance<"1000" && anneeNaissance!="0000") probleme="Année de naissance incorrecte.";
					  }
  if (ddType=="DATE" && dateDeces!="") {
  					if (anneeDeces>today) probleme="Année de décès incorrecte.";
 					if (anneeDeces<"1000" && anneeDeces!="0000") probleme="Année de décès incorrecte.";
					  }
  if (dnType=="DATE" && ddType=="DATE" && dateNaissance!="" && dateDeces!="") if (anneeNaissance>anneeDeces && anneeDeces!="0000") probleme="Dates incompatibles.";
  
  if (nom=="" && prenom=="") probleme="Saisissez au moins le nom ou le prénom.";

  if (probleme!="") {alert(probleme); return false;}
   return true;
 }
 
 function datesND()
 {
 
 } 
 
 function setZoom(img, dir, width, height, margin, zIndex, delay) {
  setTimeout(function() {
    if (img.dir==dir) {
      img.style.width=width;
      img.style.height=height;
//      img.style.margin=margin;
      img.style.zIndex=zIndex;
    }
  }, delay);
}

function larger(img, width, height) {
  img.dir='rtl';
  now=parseInt(img.style.zIndex);
  for (i=now+1; i<=10; i++) {
    w=(width*(10+i))/20+'px';
    h=(height*(10+i))/20+'px';
    m=(-i)+'px 0 0 '+(-width*i/40)+'px';
    setZoom(img, 'rtl', w, h, m, i, 20*(i-now));
  }
}

function smaller(img, width, height) {
  img.dir='ltr';
  now=parseInt(img.style.zIndex);
  for (i=now-1; i>=0; i--) {
    w=(width*(10+i))/20+'px';
    h=(height*(10+i))/20+'px';
    m=(-i)+'px 0 0 '+(-width*i/40)+'px';
    setZoom(img, 'ltr', w, h, m, i, 20*(now-i));
  }
}
