// JavaScript Document

//QUERY COMUNI
function getSelect(what,value,stile){
	if(what=='provincia'){
		AyaxRequest('ajax_request.php', 'POST', 'filetocall=query_comuni&what='+what+'&value='+value+'&class='+stile, SelectProvincia_html);
	}
	if(what=='citta'){
		document.getElementById('provincia').value=value;
		AyaxRequest('ajax_request.php', 'POST', 'filetocall=query_comuni&what='+what+'&value='+value+'&class='+stile, SelectCitta_html);
	}
	if(what=='cap'){
		document.getElementById('citta').value=value;
		AyaxRequest('ajax_request.php', 'POST', 'filetocall=query_comuni&what='+what+'&value='+value+'&class='+stile, SelectCAP_html);
	}
}
function SelectProvincia_html(){
	document.getElementById('provincia_container').innerHTML=this.req.responseText;
	document.getElementById('citta').value='';
	document.getElementById('citta_dyn').value='';
	document.getElementById('citta_dyn').disabled=true;
	document.getElementById('cod_postale').disabled=true;
	document.getElementById('cod_postale').value='';
}
function SelectCitta_html(){
	document.getElementById('citta_dyn').disabled=false;
	document.getElementById('cod_postale').disabled=false;
	document.getElementById('cod_postale').value='';
	document.getElementById('citta_container').innerHTML=this.req.responseText;
}
function SelectCAP_html(){
	document.getElementById('cod_postale').disabled=false;
	document.getElementById('cod_postale').value=this.req.responseText;
}
