var ricerca_pro;
function caricaSottoCat(){
			var valorecampo = document.theform.categoria.options[document.theform.categoria.selectedIndex].value;
			// per l'oggetto nativo XMLHttpRequest
			if (window.XMLHttpRequest) {
				ricerca_pro = new XMLHttpRequest();
				ricerca_pro.onreadystatechange = riceviSottoCat;
				ricerca_pro.open("GET", "combosottocat.php?categoria="+valorecampo,true);
				ricerca_pro.send(null);
				// per IE
			} else if (window.ActiveXObject) {
			ricerca_pro = new ActiveXObject("Microsoft.XMLHTTP");
				if (ricerca_pro) {
					ricerca_pro.onreadystatechange = riceviSottoCat;
					ricerca_pro.open("GET", "combosottocat.php?categoria="+valorecampo,true);
					ricerca_pro.send();
				}
			}
}


function caricaDettaglio(){
			var valorecampo = document.theform.categoria_content.options[document.theform.categoria_content.selectedIndex].value;
			// per l'oggetto nativo XMLHttpRequest
			if (window.XMLHttpRequest) {
				ricerca_pro = new XMLHttpRequest();
				ricerca_pro.onreadystatechange = riceviDettaglio;
				ricerca_pro.open("GET", "combodett.php?categoria_content="+valorecampo,true);
				ricerca_pro.send(null);
				// per IE
			} else if (window.ActiveXObject) {
			ricerca_pro = new ActiveXObject("Microsoft.XMLHTTP");
				if (ricerca_pro) {
					ricerca_pro.onreadystatechange = riceviDettaglio;
					ricerca_pro.open("GET", "combodett.php?categoria_content="+valorecampo,true);
					ricerca_pro.send();
				}
			}
//			caricaDiscipline();
}

function caricaDiscipline(){
			var valorecampo = document.theform.categoria_content.options[document.theform.categoria_content.selectedIndex].value;
			// per l'oggetto nativo XMLHttpRequest
			if (window.XMLHttpRequest) {
				ricerca_pro = new XMLHttpRequest();
				ricerca_pro.onreadystatechange = riceviDiscipline;
				ricerca_pro.open("GET", "combodisc.php?categoria_content="+valorecampo,true);
				ricerca_pro.send(null);
				// per IE
			} else if (window.ActiveXObject) {
			ricerca_pro = new ActiveXObject("Microsoft.XMLHTTP");
				if (ricerca_pro) {
					ricerca_pro.onreadystatechange = riceviDiscipline;
					ricerca_pro.open("GET", "combodisc.php?categoria_content="+valorecampo,true);
					ricerca_pro.send();
				}
			}
}

function riceviSottoCat() {
var strRes;
var arrValori;
	if (ricerca_pro.readyState == 4) {
		if (ricerca_pro.status == 200){
				document.getElementById('sottocat').innerHTML=ricerca_pro.responseText;
			} else {
				document.getElementById('sottocat').innerHTML="<select><option>ERRORE "+ricerca_pro.status+"</option></select>";
			}
	}
}

function riceviDettaglio() {
var strRes;
var arrValori;
	if (ricerca_pro.readyState == 4) {
		if (ricerca_pro.status == 200){
				document.getElementById('dett').innerHTML=ricerca_pro.responseText;
			} else {
				document.getElementById('dett').innerHTML="<select><option>ERRORE "+ricerca_pro.status+"</option></select>";
			}
	}
}

function riceviDiscipline() {
var strRes;
var arrValori;
	if (ricerca_pro.readyState == 4) {
		if (ricerca_pro.status == 200){
				document.getElementById('disc').innerHTML=ricerca_pro.responseText;
			} else {
				document.getElementById('disc').innerHTML="<select><option>ERRORE "+ricerca_pro.status+"</option></select>";
			}
	}
}