
/****************************************
* Javascript de Jean-Philippe Sarrosquy *
* visiter : http://www.itssystem.com    *
* Pour des JavaScripts gratuits         *
****************************************/

<!--

function FocusText(BoxName)
{
if (BoxName.value == BoxName.defaultValue)
{
BoxName.value = '';
}
}
function BlurText(BoxName)
{
if (BoxName.value == '')
{
BoxName.value = BoxName.defaultValue;
}
}


// Fonction pour valider un email-----------------------------------------------
function check_email(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

for(i=0; i < e.length ;i++){
if(ok.indexOf(e.charAt(i))<0){ 
return (false);
		}	
	  } 

if (document.images) {
re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
if (!e.match(re) && e.match(re_two)) {
return (-1);		
		} 
	  }
	}
// End--------------------------------------------------------------------------


// Fonction pour valider un formulaire--------------------------------------------
function Verif(){     

var Courriel = document.form.Email.value
var emailFilter=/^.+@.+\..{2,3}$/;
var illegalChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var strError = "";
var strCountError = 0;

		if (Courriel == ""){         
		strError = "Email is required<BR>"  
		strCountError = strCountError + 1;      
	}

// ? la boite de texte Email contient un @ et un . ------------------------------------------------------------

		// Verification plus simple
		if ((!check_email(Courriel)) && (document.form.Email.value != "")) {      
		strError = ""+ strError +"Your Email is required<BR>" 
		strCountError = strCountError + 1;             
	}    

// Formulaire valide -----------------------------------------------------------------------------------------
	if (strError != "" )  {
	document.form.Email.focus();  
	ErrorMessage(strError,strCountError);
	return false; 
	}
	else
	//document.form.btn.disabled = true
	//document.form.btn.value = "Patience..."
	return true;   
}
// End----------------------------------------------------------------------------------------------------------------

// --> 


