function attiva() {
	ok = document.info.accettazione
	send = document.info.invia
	if(ok[0].checked == true) {
		send.disabled = true;
	}
	else {
		send.disabled = false;
	}
}

function checkFormCome() {
	error = 0;
	msg = '';
	if (document.info.azienda.value == "") { 
		msg = msg + 'Il campo "Azienda" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.indirizzo.value == "") {
		msg = msg + 'Il campo "Indirizzo" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.cap.value == "") {
		msg = msg + 'Il campo "CAP" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.citta.value == "") {
		msg = msg + 'Il campo "Città" non può essere vuoto.\n';
		error = 1; 
	}
	var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
	var regex = new RegExp(emailReg);
	
	if (document.info.email.value == "") {
		msg = msg + 'Il campo "e-mail" non può essere vuoto.\n';
		error = 1; 
	}
	else {
		if (!(regex.test(document.info.email.value)))
		{
			msg = msg + 'Il campo "e-mail" non è corretto\n';
			error = 1; 
		} 
	}

	if (document.info.referente.value == "") {
		msg = msg + 'Il campo "Referente" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.posizione.value == "") {
		msg = msg + 'Il campo "Posizione aziendale" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.testo.value == "") {
		msg = msg + 'Il campo "Richiesta" non può essere vuoto.\n';
		error = 1; 
	}

	if (error == 1) {
		alert (msg);
		return false;
	}
	else {
		document.info.submit();
		return true;
	}
}

function checkFormPassword() {
	error = 0;
	msg = '';
	if (document.info.azienda.value == "") { 
		msg = msg + 'Il campo "Azienda" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.indirizzo.value == "") {
		msg = msg + 'Il campo "Indirizzo" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.cap.value == "") {
		msg = msg + 'Il campo "CAP" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.citta.value == "") {
		msg = msg + 'Il campo "Città" non può essere vuoto.\n';
		error = 1; 
	}
	var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
	var regex = new RegExp(emailReg);
	
	if (document.info.email.value == "") {
		msg = msg + 'Il campo "e-mail" non può essere vuoto.\n';
		error = 1; 
	}
	else {
		if (!(regex.test(document.info.email.value)))
		{
			msg = msg + 'Il campo "e-mail" non è corretto\n';
			error = 1; 
		} 
	}

	if (document.info.referente.value == "") {
		msg = msg + 'Il campo "Referente" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.posizione.value == "") {
		msg = msg + 'Il campo "Posizione aziendale" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.testo.value == "") {
		msg = msg + 'Il campo "Richiesta" non può essere vuoto.\n';
		error = 1; 
	}

	if (error == 1) {
		alert (msg);
		return false;
	}
	else {
		document.info.submit();
		return true;
	}
}

function checkFormIscrizione() {
	error = 0;
	msg = '';
	if (document.info.nome.value == "") { 
		msg = msg + 'Il campo "Nome" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.cognome.value == "") { 
		msg = msg + 'Il campo "Cognome" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.indirizzo.value == "") {
		msg = msg + 'Il campo "Indirizzo" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.cap.value == "") {
		msg = msg + 'Il campo "CAP" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.citta.value == "") {
		msg = msg + 'Il campo "Città" non può essere vuoto.\n';
		error = 1; 
	}
	if (document.info.provincia.value == "") {
		msg = msg + 'Il campo "Provincia" non può essere vuoto.\n';
		error = 1; 
	}
	var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
	var regex = new RegExp(emailReg);	
	if (document.info.email.value == "") {
		msg = msg + 'Il campo "e-mail" non può essere vuoto.\n';
		error = 1; 
	}
	else {
		if (!(regex.test(document.info.email.value)))
		{
			msg = msg + 'Il campo "e-mail" non è corretto\n';
			error = 1; 
		} 
	}
	if (document.info.telefono.value == "") {
		msg = msg + 'Il campo "Telefono" non può essere vuoto.\n';
		error = 1; 
	}

	if (error == 1) {
		alert (msg);
		return false;
	}
	else {
		document.info.submit();
		return true;
	}
}

