function controllaCommento(form){	var profIstruzione = document.getElementById('profIstruzione');	var profAltro = document.getElementById('profAltro');	var username = document.getElementById('username');	var password = document.getElementById('password');	var nome = document.getElementById('nome');	var email = document.getElementById('email');	if((profIstruzione.checked == false)&&(profAltro.checked == false)){		alert('Selezionare un profilo');		return false;	}	if(profIstruzione.checked){		if(trim(form.username.value) == ""){			alert("Inserire l'username.");			form.username.focus();			return false;		}/*else{			if(!checkEmail(trim(form.username.value))){				alert("Inserire un indirizzo email valido.");				form.username.focus();				return false;			}		}*/		if(trim(form.password.value) == ""){			alert("Inserire la password");			form.password.focus();			return false;		}	}	if(profAltro.checked){		if(trim(form.nome.value) == ""){			alert("Inserire il nome");			form.nome.focus();			return false;		}		if(trim(form.email.value) == ""){			alert("Inserire l'email.");			form.email.focus();			return false;		}else{			if(!checkEmail(trim(form.email.value))){				alert("Inserire un indirizzo email valido.");				form.email.focus();				return false;			}		}	}	if(trim(form.commento.value) == ""){		alert("Inserire il commento");		form.commento.focus();		return false;	}return true;}function enableProfile(){	var profIstruzione = document.getElementById('profIstruzione');	var profAltro = document.getElementById('profAltro');	var username = document.getElementById('username');	var password = document.getElementById('password');	var nome = document.getElementById('nome');	var email = document.getElementById('email');	if(profIstruzione.checked){		username.disabled=false;		password.disabled=false;		nome.disabled=true;		email.disabled=true;	}	if(profAltro.checked){		username.disabled=true;		password.disabled=true;		nome.disabled=false;		email.disabled=false;	}}function controllaFaq(form){   if(form.argomento.value == ""){       alert("Inserire il campo argomento ");       form.argomento.focus();       return false;   }   if(trim(form.nome.value) == ""){       alert("Inserire il nome ");       form.nome.focus();       return false;   }   if(trim(form.email.value) == ""){       alert("Inserire l'indirizzo email della scuola.");       form.email.focus();       return false;   }else{       if(!checkEmail(trim(form.email.value))){           alert("Inserire un indirizzo email valido.");           form.email.focus();           return false;       }   }   if(trim(form.messaggio.value) == ""){       alert("Inserire il messaggio ");       form.messaggio.focus();       return false;   }   return true;}function checkEmail(email) {   var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;   if (!filter.test(email)) {       return false;   }else{       return true;   }}function trim(stringa){	while (stringa.substring(0,1) == ' '){		stringa = stringa.substring(1, stringa.length);	}	while (stringa.substring(stringa.length-1, stringa.length) == ' ')	{		stringa = stringa.substring(0,stringa.length-1);	}	return stringa;}
