/*
Codice Blastness che controlla il formato della mail e se è vuota
*/
 
function controlla() {
	var campi = '';			
	if(document.mymod.email.value == "") {
	campi += "- Email \n";
	document.getElementById('email').style.border = '1px solid #ff0000';
	} else {
	var str=document.mymod.email.value
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(str) || str=="x" || str=="X") {
	document.getElementById('email').style.border = '1px solid #aeaaa1';
	} else {
	document.getElementById('email').style.border = '1px solid #ff0000';
	campi += "- Email non valida \n";
	
	}
	}
	if(!(document.mymod.trattamento.checked)) {
	campi += "- Autorizzazione al trattamento dati personali\n";
	document.getElementById('msgtrattamento').innerHTML = 'Accetta il trattamento dei dati';	
	} else {
	document.getElementById('msgtrattamento').innerHTML = '';	
	}
	if (campi == "") document.mymod.submit(); 
	else alert(campi);
}

