function Valide() {
var strEmail;
var checkflag1 = "false";
var checkflag2 = "false";
var checkflag3 = "false";
var checkflag4 = "false";
var checkflag5 = "false";
var checkflag6 = "false";
var checkflag7 = "false";
var checkflag8 = "false";
var checkflag9 = "false";
var checkflag10 = "false";
var checkflag11 = "false";
var checkflag12 = "false";
var checkflag13 = "false";
var checkflag14 = "false";
var checkTLD=1;
var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var day;
var mnth;
var yr;
var ladate;

ladate = window.document.FEnregistre.month.options[window.document.FEnregistre.month.selectedIndex].value + "/" + window.document.FEnregistre.day.options[window.document.FEnregistre.day.selectedIndex].value + "/" + window.document.FEnregistre.year.value;

day = eval(ladate.charAt(3)+ladate.charAt(4));
day = parseInt(day);
mnth = eval(ladate.charAt(0)+ladate.charAt(1));
mnth = parseInt(mnth);

if (isNaN(window.document.FEnregistre.year.value)==false)
	{
	yr = eval(ladate.charAt(6)+ladate.charAt(7)+ladate.charAt(8)+ladate.charAt(9));
	yr = parseInt(yr);
	}

// mnthArray[0] is january, mnthArray[11] is december
mnthArray = new Array(31,29,31,30,31,30,31,31,30,31,30,31);

// netscape/IE number months starting with january = 0
mnth = mnth-1;

if (window.document.FEnregistre.title[5].checked==true)
	{
	while(''+window.document.FEnregistre.title_other.value.charAt(0)==' ')
		{
    	window.document.FEnregistre.title_other.value=window.document.FEnregistre.title_other.value.substring(1,window.document.FEnregistre.title_other.value.length);
		}
	if (window.document.FEnregistre.title_other.value=="")
		{
		checkflag4 = "true"
		}
	}

while(''+window.document.FEnregistre.namefirst.value.charAt(0)==' ')
	{
    window.document.FEnregistre.namefirst.value=window.document.FEnregistre.namefirst.value.substring(1,window.document.FEnregistre.namefirst.value.length);
	}	
	
if(window.document.FEnregistre.namefirst.value=="")
	{
	checkflag5 = "true"
	}	
	
while(''+window.document.FEnregistre.namelast.value.charAt(0)==' ')
	{
    window.document.FEnregistre.namelast.value=window.document.FEnregistre.namelast.value.substring(1,window.document.FEnregistre.namelast.value.length);
	}	
if(window.document.FEnregistre.namelast.value=="")
	{
	checkflag6 = "true"
	}	
	


if((window.document.FEnregistre.year.value.length!=4)||(isNaN(window.document.FEnregistre.year.value)==true))
{
checkflag12 = "true"
}




if(day > parseInt(mnthArray[parseInt(mnth)]))
	{
	checkflag1 = "true"
	}


strEmail=window.document.FEnregistre.EMAIL_ADDR.value;
if (strEmail=="")
	{
	checkflag3 = "true";
	}

if (strEmail!="")
	{

	var matchArray=strEmail.match(emailPat);
	
	if (matchArray==null)
		 {
		alert("Your email address is invalid");
		checkflag2 = "true";
	     }
	if (matchArray!=null)	
		{
		var user=matchArray[1];
		var domain=matchArray[2];
	
		for (i=0; i<user.length; i++)
			{
			if (user.charCodeAt(i)>127)
				{
				alert("Your email address is invalid");
				checkflag2 = "true";
		    	}
			}
		for (i=0; i<domain.length; i++)
			{
			if (domain.charCodeAt(i)>127) 
				{
				alert("Your email address is invalid");
				checkflag2 = "true";
		    	}
			}
		if (user.match(userPat)==null)
			{
			alert("Your email address is invalid");
			checkflag2 = "true";
			}
	
		var IPArray=domain.match(ipDomainPat);
		if (IPArray!=null)
			{
			for (var i=1;i<=4;i++)
				{
				if (IPArray[i]>255)
			   		{
					alert("Your email address is invalid");
					checkflag2 = "true";
	  					}
				}
			}
	
		var atomPat=new RegExp("^" + atom + "$");
		var domArr=domain.split(".");
		var len=domArr.length;
		for (i=0;i<len;i++)
			{
			if (domArr[i].search(atomPat)==-1)
				{
				alert("Your email address is invalid");
				checkflag2 = "true";
	  				}
			}
	
		if (checkTLD && domArr[domArr.length-1].length!=2 && domArr[domArr.length-1].search(knownDomsPat)==-1)
			{
			alert("Your email address is invalid");
			checkflag2 = "true";
			}
	
		if (len<2) 
			{
			alert("Your email address is invalid");
			checkflag2 = "true";
			}
	}			

}


if (checkflag4 == "true")
	{
	alert("You must enter an other title")
	window.document.FEnregistre.title_other.focus()	
	}
	
else if (checkflag5 == "true")
	{
	alert("You must enter your first name")
	window.document.FEnregistre.namefirst.focus()
	}	
	
else if (checkflag6 == "true")
	{
	alert("You must enter your last name")
	window.document.FEnregistre.namelast.focus()
	}	
	
	
else if (checkflag3 == "true")
	{
	alert("Your email address is invalid")
	window.document.FEnregistre.EMAIL_ADDR.focus()	
	}	
	
else if (checkflag2 == "true")
	{

	}	

	
else if (checkflag1 == "true")
	{
	alert("The day enter for this month is invalid")
	window.document.FEnregistre.day.focus()
	}	
	
else if (checkflag12 == "true")
	{
	alert("The year for your birth date is invalid")	
	window.document.FEnregistre.year.focus()
	}	

else
	{
	window.document.FEnregistre.submit();		
	}
}