// JavaScript Document

var ricerca_pro;
   
function cerca() 
{
    var valorecampo = document.formCerca.zona.options[document.formCerca.zona.selectedIndex].value;
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        ricerca_pro = new XMLHttpRequest();
        ricerca_pro.onreadystatechange = ricevi;
        ricerca_pro.open("GET", "/include/cercalocalita.asp?reg="+valorecampo,true);
        ricerca_pro.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        ricerca_pro = new ActiveXObject("Microsoft.XMLHTTP");
        if (ricerca_pro) {
            ricerca_pro.onreadystatechange = ricevi;
            ricerca_pro.open("GET", "/include/cercalocalita.asp?reg="+valorecampo,true);
            ricerca_pro.send();
        }
    }
}

     
  function ricevi() {   
    var strRes; 
	var stringaRes;      
    var arrValori;    
	var arrValue;  
	  if (ricerca_pro.readyState == 4) {	    
		  strRes=ricerca_pro.responseText;
   		  arrValori=strRes.split("|");
		  document.formCerca.localita.options.length=0;	
		  for(i=0;i<arrValori.length;i++)
		  {
		    document.formCerca.localita.options[document.formCerca.localita.options.length]= new Option(arrValori[i].split("|")); 
		  }
		 }
	}

