<!--
function IsNumeric(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }


function emailCheck (w) {

 if ( (w.pseudo.value == "" ) || (w.pseudo.value == " " ) || (w.txtUserKeyWord.value == "" ) || (w.txtUserKeyWord.value == " " ) ||  (w.note1.value == "" ) || (w.note1.value == " " ) || (w.note2.value == "" ) || (w.note2.value == " " ) || (w.note3.value == "" ) || (w.note3.value == " " ) || (w.note4.value == "" ) || (w.note4.value == " " ) || (w.note5.value == "" ) || (w.note5.value == " " ) )
	 {
       alert("Tous les champs sont obligatoires !"); return false;   
	 } 

if( (!IsNumeric(w.note1.value)) || (!IsNumeric(w.note2.value)) || (!IsNumeric(w.note3.value)) || (!IsNumeric(w.note4.value)) || (!IsNumeric(w.note5.value)) 
|| (w.note1.value > 10 ) || (w.note2.value > 10 ) || (w.note3.value > 10 ) || (w.note4.value > 10 ) || (w.note5.value > 10 )
)
	 {
       alert("Veuillez insérer un nombre de 0 à 10 pour les notes !"); return false;   
	 } 

/*emailStr=w.email.value; */
emailStr=w.email.value.toLowerCase();

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 matchArray=emailStr.match(emailPat);

if (matchArray==null) {
alert("Votre adresse E-mail n'est pas valide !");
return false;
}

var user=matchArray[1];
var domain=matchArray[2];

for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Votre adresse E-mail n'est pas valide !");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Votre adresse E-mail n'est pas valide !");
return false;
   }
}

if (user.match(userPat)==null) {

alert("Votre adresse E-mail n'est pas valide !");
return false;
}


var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {

for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Votre adresse E-mail n'est pas valide !");
return false;
   }
}
return 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("Votre adresse E-mail n'est pas valide !");
return false;
   }
}

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("Votre adresse E-mail n'est pas valide !");
return false;
}

if (len<2) {
alert("Votre adresse E-mail n'est pas valide !");
return false;
}
return true;
}
//  End -->
