			function checkform(theForm,checkpass)
			{
                var message='';
                var retour=false;
                // email
                if((theForm.email.value == '')||(theForm.confirm_email.value == '') ||(theForm.email.value != theForm.confirm_email.value))  message += "- Vous devez indiquer votre email de facon identique dans les deux zones de saisie.\n";
                else if(checkMail(theForm.email.value) == false){
                    message += "- L'email que vous avez saisi n'est pas valide\n";
                }
                if( (checkpass) && (theForm.password.value == '')){
                    message += "- Vous devez fournir un mot de passe\n";
                }
                if(message != ""){
                    retour = ('Erreur(s) :\n' + message)
                } else retour=true;
    			  return(retour);
			}// end checkform


			//**************************************************************************************************
			//                                       Auxiliary functions
			//**************************************************************************************************

			// ********************* checkMail ************************
			/**
			 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
			 */
			function checkMail(str) {
			  var at="@"
			  var dot="."
			  var lat=str.indexOf(at)
			  var lstr=str.length
			  var ldot=str.indexOf(dot)
			  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) return false
			  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) return false
			  if (str.indexOf(at,(lat+1))!=-1) return false
			  if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) return false
			  if (str.indexOf(dot,(lat+2))==-1) return false
			  if (str.indexOf(" ")!=-1) return false
			  tld = str.substr(str.lastIndexOf(dot) + 1)
			  if(
			    tld != 'com'
			    && tld != 'net'
			    && tld != 'org'
			    && tld != 'fr'
			    && tld != 'info'
			    && tld != 'int'
			    && tld != 'name'
			    && tld != 'be'
			    && tld != 'it'
			  ) return false
			  return true
			}// end checkMail