function controllo()
{

var Contatore=0
var Contatore1=0
var StrControllo=" "
var StrControllo1=""
var StrControllo3

StrControllo2="Hai dimenticato di compilare ";
StrControlloS="il Campo: ";
StrControlloP="i Campi: ";

if (document.FormControllo1.nome.value.length<1) {
    Contatore=Contatore+1;
	StrControllo+= String.fromCharCode(13) + "*  Nome";
    //window.alert(Contatore);
}
if (document.FormControllo1.cognome.value.length<1){
    Contatore=Contatore+1;
	StrControllo+= String.fromCharCode(13) + "*  Cognome";
	//window.alert(Contatore);
}
if (document.FormControllo1.indirizzo.value.length<1) {
    Contatore=Contatore+1;
	StrControllo+= String.fromCharCode(13) + "*  Indirizzo ";
//	window.alert(Contatore+"c"+Contatore1);
}
else if (document.FormControllo1.indirizzo.value.length>100) {
    Contatore1=Contatore1+1;
	StrControllo1+= String.fromCharCode(13) + "*  Indirizzo con oltre 100 caratteri";
//	window.alert(Contatore+"c"+Contatore1);
}
if (document.FormControllo1.citta.value.length<1) {
    Contatore=Contatore+1;
	StrControllo+= String.fromCharCode(13) + "*  Città";
	//window.alert(Contatore);
}
if (document.FormControllo1.cell.value.length<1) {
    Contatore=Contatore+1;
	StrControllo+= String.fromCharCode(13) + "*  Cellulare";
	//window.alert(Contatore);
}
else if (document.FormControllo1.citta.value.length>50) {
    Contatore1=Contatore1+1;
	StrControllo1+= String.fromCharCode(13) + "*  Nome della città con oltre 50 caratteri";
	//window.alert(Contatore);
}
else if (document.FormControllo1.cell.value.length>50) {
    Contatore1=Contatore1+1;
	StrControllo1+= String.fromCharCode(13) + "*  Numero di cellulare con oltre 50 caratteri";
	//window.alert(Contatore);
}



if (FormControllo1.email.value.length<1)
						 	{Contatore++;
							StrControllo+=String.fromCharCode(13) + "*  Email"
							}	
						else{
						var regMail,MailPresente
						regMail=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); 
						MailPresente=FormControllo1.email.value;
							if (!regMail.test(MailPresente))
								{
								Contatore1++;
								StrControllo1+=String.fromCharCode(13) +"* L'email deve essere nel formato xxxxxx@xxx.xx"
								}
							}
if (document.FormControllo1.password.value.length<1){
    Contatore=Contatore+1;
	StrControllo+= String.fromCharCode(13) + "*  Password";
	//window.alert(Contatore);
}
else if (document.FormControllo1.password.value.length<4){
    Contatore1=Contatore1+1;
	StrControllo1+= String.fromCharCode(13) + "*  La password deve essere di almeno 4 caratteri";
	//window.alert(Contatore);
}


if (document.FormControllo1.password.value.length>50){
    Contatore1=Contatore1+1;
	StrControllo1+= String.fromCharCode(13) + "*  La password eccede i 50 caratteri";
	//window.alert(Contatore);
}


if (document.FormControllo1.note.value.length>500){
    Contatore1=Contatore1+1;
	StrControllo1+= String.fromCharCode(13) + "*  Il campo note non può eccedere i 500 caratteri";
	//window.alert(Contatore);
}
if (Contatore!=0) {
    if (Contatore>1) {
		StrControllo3=StrControllo2 + StrControlloP + String.fromCharCode(13);
	    StrControllo3+= StrControllo;
	
	}
	else {
		StrControllo3=StrControllo2 + StrControlloS + String.fromCharCode(13);
	    StrControllo3+= StrControllo;
    }
}
if (Contatore1>0 && Contatore!=0) 

StrControllo3+= String.fromCharCode(13) + String.fromCharCode(13) + "ed inoltre" + String.fromCharCode(13) + StrControllo1; 


if (Contatore1>0 && Contatore==0) 
StrControllo3="ATTENZIONE:" + StrControllo1;

if (Contatore1>0 || Contatore!=0)
{window.alert(StrControllo3);
return false;
}
else 
{
return true;
}
}

