function check() {
var stato = true;
		//CAMPI OBBLIGATORI COPIARE QUESTE RIGHE
	
	if ((stato == true)&&(document.theform.compilatore_annunci.value == "")) {
		testo = "Campo nome compilatore obbligatorio";
		stato = false; 
		theform.compilatore_annunci.focus();    
	}
		
	if ((stato == true)&&(document.theform.provincia.value == "")) {
		testo = "Campo provincia obbligatorio";
		stato = false; 
		theform.provincia.focus();    
	}

	if ((stato == true)&&(document.theform.nazione_annunci.value == "")) {
		testo = "Campo nazione obbligatorio";
		stato = false; 
		theform.nazione_annunci.focus();    
	}
	
	if ((stato == true)&&(document.theform.email_annunci.value == "")) {
		testo = "Campo email obbligatorio";
		stato = false; 
		theform.email_annunci.focus();    
	}

//privacy	
	if ((stato == true)&&(document.theform.privacy[1].checked)) {
		testo = "Per proseguire e' necessario\nacconsentire al trattamento dei dati\n(consenso privacy).";
		stato = false;     
	}
//privacy / fine
	
	//VALIDAZIONE E-MAIL
	if (theform.email_annunci.value!="")	{
		if ((theform.email_annunci.value.length<6)&&(stato==true)) {
			testo = "L'email inserita e' troppo corta.\n";
			stato = false;
			theform.email_annunci.focus();    	
		}
		if ((theform.email_annunci.value.indexOf('.')==-1)&&(stato==true)) {
			testo = "L'email inserita non e' valida.\n(es: nome@nomeweb.com)";
			stato = false;
			theform.email_annunci.focus();    	
		}
		if ((theform.email_annunci.value.indexOf('@')==-1)&&(stato==true)) {
			testo = "L'email inserita non e' valida.\n(es: nome@nomeweb.com)";
			stato = false;
			theform.email_annunci.focus();    	
		}
		if ((theform.email_annunci.value.indexOf('@')!=theform.email_annunci.value.lastIndexOf('@'))&&(stato==true)) {
			testo = "L'email inserita non e' valida.\n(es: nome@nomeweb.com)";
			stato = false;
			theform.email_annunci.focus();    	
		}
		if ((theform.email_annunci.value.indexOf(':')!=-1)&&(stato==true)) {
			testo = "L'email inserita non e' valida.\n(es: nome@nomeweb.com)";
			stato = false;
			theform.email_annunci.focus();    	
		}
		if ((theform.email_annunci.value.indexOf(' ')!=-1)&&(stato==true)) {
			testo = "L'email inserita non e' valida.\nNon utilizzare spazi.\n(es: nome@nomeweb.com)";
			stato = false;
			theform.email_annunci.focus();    	
		} 
	}
	
	if ((stato == true)&&(document.theform.categoria_annuncio.value == "")) {
		testo = "Campo categoria annuncio obbligatorio";
		stato = false; 
		theform.categoria_annuncio.focus();    
	}
	
	if ((stato == true)&&(document.theform.tipo_annuncio.value == "")) {
		testo = "Campo tipo annuncio obbligatorio";
		stato = false; 
		theform.tipo_annuncio.focus();    
	}
	
	if ((stato == true)&&(document.theform.descrizione_annunci.value == "")) {
		testo = "Campo descrizione annunci obbligatorio";
		stato = false; 
		theform.descrizione_annunci.focus();    
	}
	
	
	
	
	if (stato == false){
		alert(" "+testo+" ")	}
		
		
		
return (stato)
}



function toggleField(fieldID,trggr) {
brwsRowStyle=(navigator.appName.indexOf('Microsoft')>-1)?'inline':'table-row';
fStyle=(trggr=='1' && trggr!='')?'none':'';
if (trggr!=''){
theform.azienda_annunci.value='';
document.getElementById(fieldID).style.display=fStyle;
}
}
