function checkInput(theForm) {
	if ((theForm.nome.value==0) && (theForm.nome.value.length<=0)) {
		alert("Non hai inserito il nome !");
		theForm.nome.focus();
		return false
	}

	if ((theForm.cogno.value==0) && (theForm.cogno.value.length<=0)) {
		alert("Non hai inserito il cognome !");
		theForm.cogno.focus();
		return false
	}
	
	if ((theForm.paswd.value==0) && (theForm.paswd.value.length<=0)) {
		alert("Non hai inserito la password !");
		theForm.paswd.focus();
		return false
		}

	if (theForm.paswd.value.length<5) {
		alert("La password deve essere di almeno 5 caratteri !");
		theForm.paswd.focus();
		return false
		}

	if ((theForm.paswdck.value==0) && (theForm.paswdck.value.length<=0)) {
		alert("Inserire la password di conferma !");
		theForm.paswdck.focus();
		return false
		}

	if (theForm.paswd.value!=theForm.paswdck.value) {
		alert("La password non č corretta !");
		theForm.paswd.focus();
		return false
		}

//	if ((theForm.pariva.value==0) && (theForm.pariva.value.length<=0) && (theForm.codfisc.value==0) && (theForm.codfisc.value.length<=0)) {
//		alert("Non hai inserito la partita IVA !");
//		theForm.pariva.focus();
//		return false
//		}

//	else if ((theForm.pariva.value.length>0) && (theForm.pariva.value.length<11)) {
//		alert("Non hai inserito una partita IVA valida !");
//		theForm.pariva.focus();
//		return false
//	}
	
//	else if ((theForm.pariva.value.length>0) && (!checkPiva(theForm.pariva.value))) {
//		alert("La partita IVA non č valida !");
//		theForm.pariva.focus();
//		return false
//	}
	
//	if ((theForm.indir.value==0) && (theForm.indir.value.length<=0)) {
//		alert("Non hai inserito l'indirizzo !");
//		theForm.indir.focus();
//		return false
//		}

	if ((theForm.comun.value==0) && (theForm.comun.value.length<=0)) {
		alert("Non hai inserito la cittā !");
		theForm.comun.focus();
		return false
		}

//	if ((theForm.cap.value==0) && (theForm.cap.value.length<=0)) {
//		alert("Non hai inserito il C.A.P. !");
//		theForm.cap.focus();
//		return false
//		}

	if ((theForm.prov.value==0) && (theForm.prov.value.length<=0)) {
		alert("Non hai inserito la provincia !");
		theForm.prov.focus();
		return false
		}

	if ((theForm.telef.value==0) && (theForm.telef.value.length<=0)) {
		alert("Non hai inserito il numero di telefono !");
		theForm.telef.focus();
		return false
		}

	if ((theForm.email.value==0) && (theForm.email.value.length<=0)) {
		alert("Non hai inserito l'e-mail !");
		theForm.email.focus();
		return false
		}

	if ((theForm.annolaurea.value==0) && (theForm.annolaurea.value.length<=0)) {
		alert("Non hai inserito l'anno di laurea !");
		theForm.annolaurea.focus();
		return false
		}

	if ((theForm.specializ.value==0) && (theForm.specializ.value.length<=0)) {
		alert("Non hai inserito la specializzazione !");
		theForm.specializ.focus();
		return false
		}

	if ((theForm.numiscralbo.value==0) && (theForm.numiscralbo.value.length<=0)) {
		alert("Non hai inserito il numero di iscrizione all'Albo !");
		theForm.numiscralbo.focus();
		return false
		}

	if (!theForm.privacy.checked) {
		alert("Non hai dato il consenso per la privacy !");
		return false
		}

}


function checkPiva(IVA)
{
checkIVA=true
numdis=0
numpar=0
temppar=0
tot=0
lastnum=parseInt(IVA.slice(10,11))

for (i=0;i<9;i+=2) {
	numdis+=parseInt(IVA.slice(i,i+1))
	}

for (i=1;i<10;i+=2) {
	temppar=parseInt(IVA.slice(i,i+1))*2
	if (temppar<10) {
		numpar+=temppar
		}
	else {
		numpar+=(temppar-10)+1
		}
	}

tot=parseInt(numdis)+parseInt(numpar)

while (tot>=10) {
	tot=10-(tot%10)
	}

if (lastnum!=tot)
	checkIVA=false

return checkIVA
}
