function emailValidation(frm){
	var esito = true;
	var Lang = frm.ver.value;
	with (frm.txtMail){
		if (value.length > 0){
			apos=value.indexOf("@"); 
			dotpos=value.lastIndexOf(".");
			lastpos=value.length-1;
			spacepos=value.indexOf(" ");
			if (apos<1 || dotpos-apos<2 || lastpos-dotpos>4 || lastpos-dotpos<2 || spacepos>-1) {esito = false}
		}
	}
	if (esito == false) {
		switch (Lang) {
			case "it":
				alert("Indirizzo e-mail non valido");
				break;
			case "en":
				alert("E-mail address not valid");
				break;
			case "de":
				alert("E-mail unzulässig");
				break;
		}
	}
	return esito
}

function NewWindow(oggetto,h){
	var win2 = window.open(oggetto,"NewWindow","toolbar=no,directories=no,menubar=0,scrollbars=0,width=400,height="+h+",top=50,left=50")
}

function checkSpam(frm){
	var check_form = true;
   var EmailAddr = frm.txtMail.value;
   var Filtro = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
   if (!Filtro.test(EmailAddr)) { check_form=false }	
   var Utente = frm.txtNominativo.value;	
	Filtro = /^([a-zA-Z0-9_\s\'\’\´\à\ä\è\é\ê\á\ñ\ù\ú\û\ü\ò\ó\ì\ô\ç\À\Á\Â\Ã\Ç\È\É\Ê\Ò\Ö\Ô\Ó\Ü\Û\Ñ])+$/;	
   if (!Filtro.test(Utente)) { check_form=false }
	
	if (frm.txtMessaggio.value.length > 0) {
	   var Messaggio = frm.txtMessaggio.value;	
		Filtro = /^([a-zA-Z0-9_\.\-\s\Ø\%\'\"\|\´\’\–\?\!\+\=\(\)\[\]\*\°\¼\½\¾\±\®\©\£\$\€\à\ä\è\é\ê\á\ñ\ù\ú\û\ü\ò\ó\ì\ô\ç\;\:\,\À\Á\Â\Ã\Ç\È\É\Ê\Ò\Ö\Ô\Ó\Ü\Û\Ñ\“\”\/])+$/;
   	if (!Filtro.test(Messaggio)) { check_form=false }  	 	
	}		
	return check_form;
}
