function convalida(modulo){
	var messaggio="";
	var range_numerico;
	var complete=true;
	var color="#ffa0a0";
	
	document.getElementById("input_nome").style.background='#fff';
	document.getElementById("input_telefono").style.background='#fff';
	document.getElementById("input_citta").style.background='#fff';
	document.getElementById("input_email").style.background='#fff';
	document.getElementById("input_azienda").style.background='#fff';
	document.getElementById("input_consenso").style.background='#f0f0f0';
	
	if (modulo.nome.value==""){
		messaggio+="inserire il nome \n";
		document.getElementById("input_nome").style.background=color;
	}
	
	if (modulo.telefono.value==""){
		messaggio+="inserire il numero di telefono \n";
		document.getElementById("input_telefono").style.background=color;
	}
	else{
		range_numerico=/\D/;              // lettera
		numero=modulo.telefono.value;
		if (range_numerico.test(numero)){
			messaggio+="INSERISCI UN NUMERO DI TELEFONO CORRETTO \n";
			document.getElementById("input_telefono").style.background=color;
		}
		else{
			range_numerico=/\d{8,}/;
			if (!(range_numerico.test(numero))){
				messaggio+="NUMERO TELEFONICO TROPPO CORTO\n";
				document.getElementById("input_telefono").style.background=color;
			}
		}
	}		
	
	if (modulo.citta.value==""){
		messaggio+="inserire la citta' \n";
		document.getElementById("input_citta").style.background=color;
	}
	
	if (modulo.email.value==""){
		messaggio+="inserire un indirizzo mail \n";
		document.getElementById("input_email").style.background=color;
	}
	else{
		var indirizzo_mail=modulo.email.value
		if ((indirizzo_mail.indexOf("@")==-1)||(indirizzo_mail.indexOf(".")==-1)){
			messaggio+=" INSERIRE UNA MAIL VALIDA \n";
			document.getElementById("input_email").style.background=color;
		}
	}
		
	if (modulo.azienda.value==""){
		messaggio+="inserire la ragione sociale \n";
		document.getElementById("input_azienda").style.background=color;
	}
	
	if (!modulo.consenso.checked){
		messaggio+="E' necessario autorizzare il trattamento dei dati personali\n";
		document.getElementById("input_consenso").style.background=color;
	}

	if (messaggio!=""){
		alert(messaggio);
		complete=false;
	}
	
	return complete;
}