function aggiornaProduttori(idCategoria, boolNuovo) { 
	var xmlHttpStc = new GetXmlHttpObjectStc();
	if (xmlHttpStc==null) {
		alert ("il tuo browser non supporta AJAX!");
		return;
	} 
	var url = "/caricaProduttori.asp";
	url = url + "?idCat=" + idCategoria;
	url = url + "&Nuovo=" + boolNuovo;
	//parametro utile per non prendere i risultati in caching
	url = url + "&sid=" + Math.random();
	
	xmlHttpStc.onreadystatechange=function() { stateChangedStc( xmlHttpStc, "txtHintProd" ) };
	xmlHttpStc.open("GET", url, true);
	xmlHttpStc.send(null);
}

function aggiornaCategorie(boolNuovo, bitProvenienza) { 
	var xmlHttpStc = new GetXmlHttpObjectStc();
	if (xmlHttpStc==null) {
		alert ("il tuo browser non supporta AJAX!");
		return;
	} 
	var url = "/caricaCategorie.asp?Nuovo=" + boolNuovo;
	//parametro utile per non prendere i risultati in caching
	url = url + "&sid=" + Math.random();
	
	xmlHttpStc.onreadystatechange=function() { stateChangedStc( xmlHttpStc, "txtHintCat" ) };
	xmlHttpStc.open("GET", url, true);
	xmlHttpStc.send(null);
	
	if( bitProvenienza == 1 )
		aggiornaProduttori(0, boolNuovo);
}

function stateChangedStc( xmlHttpStc, nomeDiv ) { 
	if (xmlHttpStc.readyState==1)
		document.getElementById(nomeDiv).innerHTML="<select class=\"blu11b\" disabled=\"disabled\" style=\"width: 200px;\"><option>Caricamento..</option></select>";
		
	if (xmlHttpStc.readyState==4)
		document.getElementById(nomeDiv).innerHTML = xmlHttpStc.responseText;
}

function GetXmlHttpObjectStc() {
	if ( window.XMLHttpRequest ) { return new XMLHttpRequest(); }
	else if ( window.ActiveXObject ) {
   		try { return new ActiveXObject("Msxml2.XMLHTTP"); } 
		catch(e) { return new ActiveXObject("Microsoft.XMLHTTP"); }
 	 }
	return null;
}
