// JavaScript Document

  
  var ajax = new Array();
   
 function SelChTipologia_3(sel)
{
	var SelTipologia = sel.options[sel.selectedIndex].value;
	document.getElementById('QueryProvincia3').options.length = 0;	// Empty city select box
	var SelNaz = document.forms[0].QueryNazione.value;
        // var selIdx = sel.options[sel.selectedIndex].value;
        // var obj = document.getElementById("Q_query");			//
        // obj.options[obj.options.length] = new Option(selIdx,'1');

	if(SelTipologia.length>0){            
		var index = ajax.length;
		ajax[index] = new sack();
		ajax[index].requestFile = 'getQueryRicerca3.asp?QTipo='+SelTipologia+'&QNaz='+SelNaz+'&QInc=2';	// Specifying which file to get
		ajax[index].onCompletion = function(){ createProvincia3(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createProvincia3(index)
{
	var obj = document.getElementById("QueryProvincia3");
	eval(ajax[index].response);	// Executing the response from Ajax as Javascript code
}  
   

function SelChProvincia_3(sel)
{
	var SelProvincia = sel.options[sel.selectedIndex].value;
	document.getElementById('QueryComune3').options.length = 0;	// Empty city select box
	var SelTipologia =document.forms[4].queryTipo3.value;
        // var selIdx = sel.options[sel.selectedIndex].value;
        // var obj = document.getElementById("Q_query");			//
        // obj.options[obj.options.length] = new Option(selIdx,'1');

	if(SelProvincia.length>0){            
		var index = ajax.length;
		ajax[index] = new sack();
		ajax[index].requestFile = 'getQueryRicerca3.asp?QProv='+SelProvincia+'&QTipo='+SelTipologia+'&QInc=2';	// Specifying which file to get
		ajax[index].onCompletion = function(){ createComune3(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createComune3(index)
{
	var obj = document.getElementById("QueryComune3");
	eval(unescape(ajax[index].response));// Executing the response from Ajax as Javascript code
}  

 function SelChTipologia2_3(sel)
{
	var SelTipologia = sel.options[sel.selectedIndex].value;
	document.getElementById('QueryPrezzo3').options.length = 0;	// Empty city select box
	var SelNaz = document.forms[0].QueryNazione.value;
	        // var selIdx = sel.options[sel.selectedIndex].value;
        // var obj = document.getElementById("Q_query");			//
        // obj.options[obj.options.length] = new Option(selIdx,'1');

	if(SelTipologia.length>0){            
		var index = ajax.length;
		ajax[index] = new sack();
		ajax[index].requestFile = 'getQueryRicerca3.asp?QTipo2='+SelTipologia+'&QNaz='+SelNaz+'&QInc=2';	// Specifying which file to get
		ajax[index].onCompletion = function(){ createPrezzo3(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}


function SelChProvincia2_3(sel)
{
	var SelProvincia = sel.options[sel.selectedIndex].value;
	document.getElementById('QueryPrezzo3').options.length = 0;	// Empty city select box
	var SelTipologia =document.forms[4].queryTipo3.value;
        // var selIdx = sel.options[sel.selectedIndex].value;
        // var obj = document.getElementById("Q_query");			//
        // obj.options[obj.options.length] = new Option(selIdx,'1');

	if(SelProvincia.length>0){            
		var index = ajax.length;
		ajax[index] = new sack();
		ajax[index].requestFile = 'getQueryRicerca3.asp?QProv2='+SelProvincia+'&QTipo2='+SelTipologia+'&QInc=2';	// Specifying which file to get
		ajax[index].onCompletion = function(){ createPrezzo3(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}


function SelChComune_3(sel)
{
	var SelComune = sel.options[sel.selectedIndex].value;
	document.getElementById('QueryPrezzo3').options.length = 0;	// Empty city select box
	var SelProvincia = document.forms[4].QueryProvincia3.value;
	 var SelTipologia =document.forms[4].queryTipo3.value;
        // var selIdx = sel.options[sel.selectedIndex].value;
        // var obj = document.getElementById("Q_query");			//
        // obj.options[obj.options.length] = new Option(selIdx,'1');

	if(SelComune.length>0){            
		var index = ajax.length;
		ajax[index] = new sack();
		ajax[index].requestFile = 'getQueryRicerca3.asp?QCom='+SelComune+'&QProv2='+SelProvincia+'&QTipo2='+SelTipologia+'&QInc=2';	// Specifying which file to get
		ajax[index].onCompletion = function(){ createPrezzo3(index) };	// Specify function that will be executed after file has been found
		ajax[index].runAJAX();		// Execute AJAX function
	}
}

function createPrezzo3(index)
{
	var obj = document.getElementById("QueryPrezzo3");
	eval(unescape(ajax[index].response));// Executing the response from Ajax as Javascript code
}  


