
		
	function chiffres(event) {
		// Compatibilité IE / Firefox
		if(!event&&window.event) {
			event=window.event;
		}
		// IE
		if(event.keyCode < 48 || event.keyCode > 57) {
			event.returnValue = false;
			event.cancelBubble = true;
		}
		// DOM
		if(event.which < 48 || event.which > 57) {
			event.preventDefault();
			event.stopPropagation();
		}
	}

	function Verifier_Numero_Telephone(num_tel)
	{
		// Definition du motif a matcher
		var regex = new RegExp(/^(01|02|03|04|05|06|08)[0-9]{8}/gi);
		
		// Definition de la variable booleene match
		var match = false;
		
		// Test sur le motif
		if(regex.test(num_tel))
		{
			match = true;
		}
		  else
		{
			document.forms[0].Telephone.focus();match = false;
		}
		
		// On renvoie match
		//if(match==true)	{ document.forms[0].submit(); 							return match;	}
		//else			{ alert("Le numéro de téléphone n'est pas valide !");	return false;	}
		return match;
	}

	function Verif()
	{
		//var i = 1;

		if 		(document.forms[0].Nom.value == "")	{ i=0;  alert("Le Champ 'Nom' est  obligatoire !");    document.forms[0].Nom.focus(); return false;    }
		else if 		(document.forms[0].Message.value == "")	{ i=0;  alert("Le Champ 'Message' est  obligatoire !");    document.forms[0].Message.focus(); return false;    }
		else 
		{ 		
			//alert(document.forms[0].Telephone.value);
			//var toto;					toto=Verifier_Numero_Telephone(document.forms[0].Telephone.value);
			if(Verifier_Numero_Telephone(document.forms[0].Telephone.value))	{ document.forms[0].submit(); 							return true;	}
			else				{ alert("Le numéro de téléphone n'est pas valide !");	return false;	}

			//return true; 
		}			

	}




function checkEmail(emailAddr) {
 // Cette fonction vérifie la bon format d'une adresse e-mail.
 // Comme :
 // user@domain.com ou user.perso@domain.com
 
 var i;
 
  if (emailAddr.length==0) {
  return false;
 }
 
 
 
 // Recherche de @
 i = emailAddr.indexOf("@");
 if (i == -1) {
  return false;
 }
 
 // Séparation du nom de l'utilisateur et du nom de domaine.
 var username = emailAddr.substring(0, i);
 var domain = emailAddr.substring(i + 1, emailAddr.length)
 
 // Recherche des espaces au début du nom de l'utilisateur.
 i = 0;
 while ((username.substring(i, i + 1) == " ") && (i < username.length)) {
  i++;
 }
 // Les enlève s'il en trouve.
 if (i > 0) {
  username = username.substring(i, username.length);
 }
 
 // Recherche d'espaces à la fin du nom de domaine.
 i = domain.length - 1;
 while ((domain.substring(i, i + 1) == " ") && (i >= 0)) {
  i--;
 }
 // Les enlève s'il en trouve.
 if (i < (domain.length - 1)) {
  domain = domain.substring(0, i + 1);
 }
 
 // Vérifie que le nom de l'utilisateur et du domaine ne soit pas vide.
 if ((username == "") || (domain == "")) {
  return false;
 }
 
 // Vérifie s'il n'y a pas de caractères interdits dans le nom de l'utilisateur.
 var ch;
 for (i = 0; i < username.length; i++) {
  ch = (username.substring(i, i + 1)).toLowerCase();
  if (!(((ch >= "a") && (ch <= "z")) || 
   ((ch >= "0") && (ch <= "9")) ||
   (ch == "_") || (ch == "-") || (ch == "."))) {
    return false;
  }
 }
 
 // Vérifie s'il n'y a pas de caractères interdits dans le nom de domaine
 for (i = 0; i < domain.length; i++) {
  ch = (domain.substring(i, i + 1)).toLowerCase();
  if (!(((ch >= "a") && (ch <= "z")) || 
   ((ch >= "0") && (ch <= "9")) ||
   (ch == "_") || (ch == "-") || (ch == "."))) {
    return false;
  }
 }
 
// Ajouter ci-dessous de nouveaux noms de domaine.
// Voir tous les noms de domaine sur http://www.toulouse-renaissance.net/c_outils/c-nom-domaine.htm
//
var aSuffix = new Array("com","net","int","aero","biz","museum","name","info","coop","pro","eu","edu","org","gov","mil","bj","dz","de","ad","be","ca","bf","bi","cm","cf","cg","cd","ci","dj","fr","ga","gp","gf","lu","mg","ml","ma","mq","mr","mc","nc","pf","re","pm","sn","ch","td","tf","tn");
 var bFoundSuffix = false;
 i = 0;
 while (i < aSuffix.length) {
  if (("." + aSuffix[i]) == domain.substring(domain.length - aSuffix[i].length - 1, domain.length)) {
   return true;
  }
  i++;
 }
 // Si le nom de domaine est inconnu  : return false
 return false;
 
} 
 
 
function emailOK(emailAddr) {
 if (!(checkEmail(emailAddr))) {
  return false;
 }
 else return true;
}


function ValidMail(mail_address)
{
	return mail_address.match(/^([\w]+)@([\w]+)\.([\w]+)$/);
}






function afficheMaxi(chemin)
{
i1 = new Image;
i1.src = chemin;
html = '<HTML><HEAD><title>Hub environnement L\'expérience de grands chantiers de dépollution</title></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0><CENTER><IMG SRC="'+chemin+'" BORDER=0 NAME=imageTest onLoad="window.resizeTo(document.imageTest.width+14,document.imageTest.height+32)"></CENTER></BODY></HTML>';
popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=1,resizable=1');
popupImage.document.open();
popupImage.document.write(html);
popupImage.document.close()
};












