topo=new Array();indi=new Array();civi=new Array();comu=new Array();

function PopolaIndirizzoFrom(sel){
	i=sel.selectedIndex-1
	if (i==-1){
		with (sel.form){
			Xcityfrom.value=''
			Xnumberfrom.value=''
			Xaddressfrom.value=''
			//for (j=0;j<sel.options.length;j++){if (sel.options[j].defaultSelected) sel.selectedIndex=j}
		}
	}
	else {
		with (sel.form){
			Xcityfrom.value=comu[i].toUpperCase();
			Xnumberfrom.value=civi[i].toUpperCase();
			Xaddressfrom.value=topo[i].toUpperCase() + " " + indi[i].toUpperCase();
			//for (j=0;j<sel.options.length;j++){if (sel.options[j].value.toUpperCase()==topo[i].toUpperCase()) sel.selectedIndex=j}
		}
	}
}

function PopolaIndirizzoTo(sel){
	i=sel.selectedIndex-1
	if (i==-1){
		with (sel.form){
			Xcityto.value=''
			Xnumberto.value=''
			Xaddressto.value=''
			//for (j=0;j<sel.options.length;j++){if (sel.options[j].defaultSelected) sel.selectedIndex=j}
		}
	}
	else {
		with (sel.form){
			Xcityto.value=comu[i].toUpperCase();
			Xnumberto.value=civi[i].toUpperCase();
			Xaddressto.value=topo[i].toUpperCase() + " " + indi[i].toUpperCase();
			//for (j=0;j<sel.options.length;j++){if (sel.options[j].value.toUpperCase()==topo[i].toUpperCase()) top.selectedIndex=j}
		}
	}
}

function PopolaIndirizzo(){
	var theForm = document.indirizzo;
	var sel = theForm.indirizzi;
	i=sel.selectedIndex-1
	if (i==-1){
		with (sel.form){
			Xcityfrom.value=''
			Xnumberfrom.value=''
			Xaddressfrom.value=''
			//for (j=0;j<sel.options.length;j++){if (sel.options[j].defaultSelected) sel.selectedIndex=j}
		}
	}
	else {
		with (sel.form){
			Xcityfrom.value=comu[i].toUpperCase();
			Xnumberfrom.value=civi[i].toUpperCase();
			Xaddressfrom.value=topo[i].toUpperCase() + " " + indi[i].toUpperCase();
			//for (j=0;j<sel.options.length;j++){if (sel.options[j].value.toUpperCase()==topo[i].toUpperCase()) sel.selectedIndex=j}
		}
	}
	
	theForm.submit();
}
