function formValidate(theForm){
// ------------------------------------------------------------------------------------------------
// funzione di controllo per i campi del modulo Registra.htm e Modifica.htm del servizio SrvAccount
// ------------------------------------------------------------------------------------------------	
  
	// Controlla che il campo E-mail non sia vuoto
	if (theForm.email.value.replace(/^\s+|\s+$/,'') == "") {
		alert("Inserire il campo \"E-mail\".");
		theForm.email.focus();
		return (false);
	}else{
		Filtro = /^([a-zA-Z0-9&_\.\-]{2,})+\@(([a-zA-Z0-9&\-]{2,})+\.)+(([a-zA-Z]{2,2})|([0-9]{2,3})|(com)|(net)|(edu)|(mil)|(gov)|(org)|(biz)|(mp3)|(law)|(ltd)|(inc)|(xxx)|(med)|(info)|(name)|(club)|(shop)|(tech)|(sport)|(family)|(travel))$/;
		if (!Filtro.test(theForm.email.value.replace(/(\s+)$/,'').replace(/^(\s+)/,''))){
			alert("L'indirizzo E-mail inserito non è valido!");
			theForm.email.focus();
			return (false);
		 }else{
			theForm.email.value = theForm.email.value.replace(/(\s+)$/,'').replace(/^(\s+)/,'')
		 }
	}
	// Controlla che il campo Password non sia vuoto
	if (theForm.password.value.replace(/^\s+|\s+$/,'') == ""){
		alert("Inserire il campo \"Password\".");
		theForm.password.focus();
		return (false);
	}
}