<!-- Fonction ajoutant le site dans la liste des favoris du navigateur
function AjoutFavoris() {
	Event.observe('favoris', 'click', function favoris(){
		if ( navigator.appName != 'Microsoft Internet Explorer' )
			 window.sidebar.addPanel("Madame Irma","http://madameirma.com/",""); 
		else window.external.AddFavorite("http://madameirma.com/","Madame Irma"); 
	} // Fin function favoris
	); // Fin Event.observe
}//-->
function AjoutFavoris2() {
	Event.observe('favoris2', 'click', function favoris(){
		if ( navigator.appName != 'Microsoft Internet Explorer' )
			 window.sidebar.addPanel("Madame Irma","http://madameirma.com/",""); 
		else window.external.AddFavorite("http://madameirma.com/","Madame Irma"); 
	} // Fin function favoris
	); // Fin Event.observe
}//-->

<!-- Fonction vérifiant les différents champs du formulaire de contact
function ValidationContact(){
	Event.observe('contacter', 'submit',function(event) {
		var test =document.contacter.nom.value;
		var test1=document.contacter.prenom.value;
		var test2=document.contacter.email.value; //format mail
		var test3=document.contacter.telephone.value; // chiffre + ()
		var test4=document.contacter.demande.value;
		var verif_mail = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]{2,}[.][a-zA-Z]{2,3}$/
		var verif_tel = /[0-9\+\(\)]/	
		if (test.length==0)	{
			alert("Veuillez indiquer votre nom !");
			Event.stop(event);
		}
		else if (test1.length==0)	{
			alert("Veuillez indiquer votre pr&eacute;nom !");
			Event.stop(event);
		}
		else if (verif_mail.exec(test2) == null)	{
			alert("Votre adresse e-mail est incorrect !");
			Event.stop(event);													
		} 
		else if (verif_tel.exec(test3) == null)		{
			alert("Votre numero de t&eacute;l&eacute;phone est incorrect !");
			Event.stop(event);
		}
		else if (test4.length==0)	{
			alert("Veuillez formuler votre demande !");
			Event.stop(event);
		}							  
	} // Fin function(event)
	); // Fin Event.observe
}//-->

<!-- Fonctions vérifiant la validité d'une date soumise (JJ/MM/AAAA) dans les modules "module1"
function ValidationDate(){
	Event.observe('module1', 'submit',function(event) {
		var amin=1999;
		var amax=2007;
		var j=document.module1.jour.value;  
		var m=document.module1.mois.value;  
		var a=document.module1.annee.value;  
		var d2=new Date(a,m-1,j);
		j2=d2.getDate();
		m2=d2.getMonth()+1;
		a2=d2.getFullYear();
		if (a2<=100)	a2=1900+a2;
		if ( (j!=j2)||(m!=m2)||(a!=a2) ) 	{
			alert("La date du "+j+"/"+m+"/"+a+" n'existe pas !");
			Event.stop(event);
		}				  
	} // function(event)
	); // Fin Event.observe
}//--> 

<!-- Fonctions vérifiant la validité d'une date soumise (JJ/MM) dans les modules "module2"
function ValidationDate2(){
	Event.observe('module2', 'submit',function(event) {		
		var j=document.module2.jour.value;  
		var m=document.module2.mois.value; 
		if ((j>29) && (m==2)) 	{
			alert("Il y a au maximum 29 jours dans ce mois !");
			Event.stop(event);
		}
		if ((j==31) && ((m==4)||(m==6)||(m==9)||(m==11)))	{
			alert("Il y a au maximum 30 jours dans ce mois !");
			Event.stop(event);
		}									  
	} // Fin function(event)
	); // Fin Event.observe
}//-->

<!-- Fonctions vérifiant la validité d'une chaine de caracteres dans les modules "module3"
function ValidationTexte(){
	Event.observe('module3', 'submit',function(event) {		
		var name=document.module3.nom.value;
		var verif_name = /[a-zA-Z\-][^0-9]/
		if (name.length==0)	{
			alert("Veuillez entrer un nom");
			Event.stop(event);
		}
		else if (verif_name.exec(name) == null)	{
			alert("Veuillez entrer un nom valide");
			Event.stop(event);
		}									  
	} // Fin function(event)
	); // Fin Event.observe
}//-->

<!-- Fonctions vérifiant la différence de sexes dans le "module4"
function ValidationSexe(){
	Event.observe('module4', 'submit',function(event) {		
		var un=document.module4.sex1.value;
		var deux=document.module4.sex2.value;
		if (un==deux){
			alert("Veuillez choisir deux sexes diff&eacute;rents !");
			Event.stop(event);
		}								  
	} // Fin function(event)
	); // Fin Event.observe
}//-->

<!-- Chargement des scripts 
Event.observe(window, "load", AjoutFavoris);
Event.observe(window, "load", AjoutFavoris2);
Event.observe(window, "load", ValidationContact);
Event.observe(window, "load", ValidationDate);
Event.observe(window, "load", ValidationDate2);
Event.observe(window, "load", ValidationTexte);
Event.observe(window, "load", ValidationSexe);
//-->