var xmlHttpModAut

function aggiornaModAut(mar, mod) { 
	if (mar != "") {
		xmlHttpModAut=GetXmlHttpObjectModAut();
		if (xmlHttpModAut==null) {
			alert("Il tuo browser non supporta AJAX!");
			return;
		} 
		var url="ajax_modaut.asp";
		url=url+"?MarId="+mar;
		url=url+"&ModId="+mod;
		//parametro utile per non prendere i risultati in caching
		url=url+"&Id="+Math.random();
	
		xmlHttpModAut.onreadystatechange=stateChangedMod;
		xmlHttpModAut.open("GET",url,true);
		xmlHttpModAut.send(null);
	}
	else {
		document.getElementById("txtHint").innerHTML="<select class=\"combobox\" disabled=\"disabled\" name=\"Aut_ModAut_ID\" id=\"Aut_ModAut_ID\" style=\"width:203px\"><option value=\"\">Tutti</option></select>";
	}
}

function stateChangedMod() { 
	if (xmlHttpModAut.readyState==1) {
		document.getElementById("txtHint").innerHTML="<select class=\"combobox\" disabled=\"disabled\" style=\"width:203px;\"><option>Caricamento..</option></select>";
	}
	if (xmlHttpModAut.readyState==4) { 
		document.getElementById("txtHint").innerHTML=xmlHttpModAut.responseText;
	}
}

function GetXmlHttpObjectModAut() {
	var xmlHttpModAut=null;
	try {
  		// Firefox, Opera 8.0+, Safari
  		xmlHttpModAut=new XMLHttpRequest();
  	}
	catch (e) {
  		// Internet Explorer
  		try {
    		xmlHttpModAut=new ActiveXObject("Msxml2.XMLHTTP");
    	}
  		catch (e) {
			xmlHttpModAut=new ActiveXObject("Microsoft.XMLHTTP");
    	}
  	}
	return xmlHttpModAut;
}
