function ControllaCampi(frm) {
	if (arguments.length == 0) {
		var frm = document.forms.f0;
		if (frm.nomecliente.value.length == 0) {
			frm.nomecliente.focus();
			alert('Campo \'Nome\' obbligatorio.');
			return false;
		} else if (frm.email.value.length == 0) {
			frm.email.focus();
			alert('Campo \'E-mail\' obbligatorio.');
			return false;
		} else if (frm.citta.value.length == 0) {
			frm.citta.focus();
			alert('Campo \'Cittą\' obbligatorio.');
			return false;
		} else if (frm.provincia.selectedIndex < 1) {
			frm.provincia.focus();
			alert('Campo \'Provincia\' obbligatorio.');
			return false;
		} else if (frm.telefono.value.length == 0) {
			frm.telefono.focus();
			alert('Campo \'Telefono\' obbligatorio.');
			return false;
		} else if (frm.note.value.length == 0) {
			frm.note.focus();
			alert('Campo \'Note\' obbligatorio.');
			return false;
		} else if (!frm.accetto.checked) {
			frm.accetto.focus();
			alert('Prima dell\'invio devi accettare le condizioni.');
			return false;
		}
	} else {
		if (frm.name == 'f0') {
			if (frm.nome.value.length == 0) {
				frm.nome.focus();
				alert('Campo \'Nome\' obbligatorio.');
				return false;
			} else if (frm.cognome.value.length == 0) {
				frm.cognome.focus();
				alert('Campo \'Cognome\' obbligatorio.');
				return false;
			} else if (frm.citta.value.length == 0) {
				frm.citta.focus();
				alert('Campo \'Cittą\' obbligatorio.');
				return false;
			} else if (frm.provincia.selectedIndex < 1) {
				frm.provincia.focus();
				alert('Campo \'Provincia\' obbligatorio.');
				return false;
			} else if (frm.telefono.value.length == 0) {
				frm.telefono.focus();
				alert('Campo \'Telefono\' obbligatorio.');
				return false;
			} else if (frm.note.value.length == 0) {
				frm.note.focus();
				alert('Campo \'Note\' obbligatorio.');
				return false;
			} else if (!frm.accetto.checked) {
				frm.accetto.focus();
				alert('Prima dell\'invio devi accettare le condizioni.');
				return false;
			}
		} else if (frm.name == 'f1') {
			if (frm.ragionesociale.value.length == 0) {
				frm.ragionesociale.focus();
				alert('Campo \'Ragione sociale\' obbligatorio.');
				return false;
			} else if (frm.citta.value.length == 0) {
				frm.citta.focus();
				alert('Campo \'Cittą\' obbligatorio.');
				return false;
			} else if (frm.provincia.selectedIndex < 1) {
				frm.provincia.focus();
				alert('Campo \'Provincia\' obbligatorio.');
				return false;
			} else if (frm.referente.value.length == 0) {
				frm.referente.focus();
				alert('Campo \'Referente\' obbligatorio.');
				return false;
			} else if (frm.telefono.value.length == 0) {
				frm.telefono.focus();
				alert('Campo \'Telefono\' obbligatorio.');
				return false;
			} else if (frm.presentazione.value.length == 0) {
				frm.presentazione.focus();
				alert('Campo \'Presentazione\' obbligatorio.');
				return false;
			} else if (!frm.accetto.checked) {
				frm.accetto.focus();
				alert('Prima dell\'invio devi accettare le condizioni.');
				return false;
			}
		}
	}

	return true;
}
