
var subcomunediv = document.getElementById("subcomune_div");
var sublocalitadiv = document.getElementById("sublocalita_div");

function getSelect(selType,str, destination){
	
	if(str!=''){

	 var doc = null; 

// Make a new XMLHttp object

   if (typeof window.ActiveXObject != 'undefined' ) 
   { 
       doc = new ActiveXObject("Microsoft.XMLHTTP"); 
   } 
   else 
   { 
       doc = new XMLHttpRequest(); 
   }
	 
// Load the result from the response page
// Note the response page can be any page that returns the right result. 
// I used ASP. PHP, PERL... etc could acheive the same result

// ** As far a I know firefox will only load a document on the SAME domain!!

		if (doc){ 	 
		 doc.open("GET", "/js/response_richiesta.asp?search="+selType+"&str=" + str+"&rnd="+(Math.random()), false);
	   doc.send(null);

// Write the response to the div 		
			destination.innerHTML = doc.responseText;

		}else{
		
			destination.innerHTML = 'Browser unable to create XMLHttp Object';
		}
		
}else{
// Return the next select box back to the default
		destination.innerHTML= '<select name="CLIPVT_ADCOMUNE" id="CLIPVT_ADCOMUNE" ><option value="0" selected="selected">Qualsiasi</option></select>' ;
}


}