function controlla(){
	var frmRegistrati = document.getElementById('frmRegistrati');
	var btn = document.getElementById('btn');
	var femail = document.getElementById('femail');
	var femail2 = document.getElementById('femail2');
	var fpassword = document.getElementById('fpassword');
	var fcondizioniuso = document.getElementById('fcondizioniuso');
	var fconsenso = document.getElementById('fconsenso');
	btn.disabled=true;
	femail.style.color="";
	femail.style.fontWeight="";
	femail2.style.color="";
	femail2.style.fontWeight="";
	fpassword.style.color="";
	fpassword.style.fontWeight="";
	fpassword2.style.color="";
	fpassword2.style.fontWeight="";
	fcondizioniuso.style.color="";
	fcondizioniuso.style.fontWeight="";
	fconsenso.style.color="";
	fconsenso.style.fontWeight="";
	if(frmRegistrati.txtemail.value==''){
		alert("Inserire Indirizzo E-Mail");
		femail.style.color="red";
		femail.style.fontWeight="bold";
		frmRegistrati.txtemail.focus();
		frmRegistrati.btn.disabled=false;
		return;
	} else {
		if(frmRegistrati.txtemail2.value==''){
			alert("Ripetere E-Mail");
			femail2.style.color="red";
			femail2.style.fontWeight="bold";
			frmRegistrati.txtemail2.focus();
			frmRegistrati.btn.disabled=false;
			return;
		} else {
			if(frmRegistrati.txtemail.value!=frmRegistrati.txtemail2.value){
				alert("I due campi e-mail devono essere uguali");
				femail.style.color="red";
				femail.style.fontWeight="bold";
				femail2.style.color="red";
				femail2.style.fontWeight="bold";
				frmRegistrati.txtemail.focus();
				frmRegistrati.btn.disabled=false;
				return;
			}
		}
	}
	if(frmRegistrati.txtpassword.value==''){
		alert("Inserire Password \nMassimo 10 caratteri");
		fpassword.style.color="red";
		fpassword.style.fontWeight="bold";
		frmRegistrati.txtpassword.focus();
		frmRegistrati.btn.disabled=false;
		return;
	} else {
		if(frmRegistrati.txtpassword2.value==''){
			alert("Ripetere Password");
			fpassword2.style.color="red";
			fpassword2.style.fontWeight="bold";
			frmRegistrati.txtpassword2.focus();
			frmRegistrati.btn.disabled=false;
			return;
		} else {
			if(frmRegistrati.txtpassword2.value!=frmRegistrati.txtpassword.value){
				alert("I due campi password devono essere uguali \nMassimo 10 caratteri");
				fpassword.style.color="red";
				fpassword.style.fontWeight="bold";
				fpassword2.style.color="red";
				fpassword2.style.fontWeight="bold";
				frmRegistrati.txtpassword.focus();
				frmRegistrati.btn.disabled=false;
				return;
			}
		}
	}
	if(frmRegistrati.hdncontrollaannuncio.value=='on'){
		fTitolo.style.color="";
		fTitolo.style.fontWeight="";
		fRegione.style.color="";
		fRegione.style.fontWeight="";
		fTesto.style.color="";
		fTesto.style.fontWeight="";
		if(frmRegistrati.txttitolo.value==''){
			alert("Inserire il Titolo dell'annuncio");
			frmRegistrati.txttitolo.focus();
			fTitolo.style.color="red";
			fTitolo.style.fontWeight="bold";
			frmRegistrati.btn.disabled=false;
			return;
		}
		if(frmRegistrati.selregione.value==''){
			alert("Selezionare la Regione di pubblicazione");
			frmRegistrati.selregione.focus();
			fRegione.style.color="red";
			fRegione.style.fontWeight="bold";
			frmRegistrati.btn.disabled=false;
			return;
		}
		if(frmRegistrati.txttesto.value==''){
			alert("Inserire il Testo dell'annuncio");
			frmRegistrati.txttesto.focus();
			fTesto.style.color="red";
			fTesto.style.fontWeight="bold";
			frmRegistrati.btn.disabled=false;
			return;
		} else {
				if(frmRegistrati.txttesto.value.length>1000){
					alert("Il testo dell'annuncio non puo' superare i 1000 caratteri");
					frmRegistrati.txttesto.focus();
					fTesto.style.color="red";
					fTesto.style.fontWeight="bold";
					frmRegistrati.btn.disabled=false;
					return;
				}
		}
	}
	if(frmRegistrati.hdncondizioni.value=='Non Accetto'){
		alert("E' necessario accettare le CONDIZIONI GENERALI D'USO");
		fcondizioniuso.style.color="red";
		fcondizioniuso.style.fontWeight="bold";
		frmRegistrati.btn.disabled=false;
		return;
	}
	if(frmRegistrati.hdnprivacy.value=='Non Accetto'){
		alert("E' necessario accettare le condizioni sulla PRIVACY");
		fconsenso.style.color="red";
		fconsenso.style.fontWeight="bold";
		frmRegistrati.btn.disabled=false;
		return;
	}
	frmRegistrati.action="/public/registrati_.asp";
	frmRegistrati.submit();
}
function caratteri(num){
	var frmRegistrati = document.getElementById('frmRegistrati');
	var divCaratteri = document.getElementById('divCaratteri');
	numcar=frmRegistrati.txttesto.value.length;
	divCaratteri.innerHTML=frmRegistrati.hdnnumerocaratteri.value - numcar
	if(frmRegistrati.txttesto.value.length>1000){
		frmRegistrati.txttesto.value = frmRegistrati.txttesto.value.substr(0,1000);
		return;
	}
}
function rad(cosa,che){
	var frmRegistrati = document.getElementById('frmRegistrati');
	frmRegistrati['hdn'+cosa].value=che
}
//-->