var xhr;
var nomeDiv;
/*====================================================
====================================================*/
function cambiaStato(urlString, urlPaginaAsp, div){
  //alert("ci sono");
  if (window.XMLHttpRequest) {
	xhr = new XMLHttpRequest();
  } else {
	xhr = new ActiveXObject("Microsoft.XMLHTTP");
  }
  
  p_url = urlPaginaAsp+'?'+urlString;
  nomeDiv = div;
  //alert(p_url + ' ' + nomeDiv)
  xhr.open("GET",p_url);
  try {
	//alert('sto per applicare il cambiamento')    
	xhr.onreadystatechange = applicaCambiamento;			
	xhr.send(null);		//su questa istruzione, selezionando l'ultima voce
  } catch (err) {
	//alert("errore 1");
  }
}
/*====================================================
====================================================*/
function applicaCambiamento() {
  //alert(xhr.readyState)    
  if (xhr.readyState == 4) {
    //alert(xhr.status)    
	if (xhr.status == 200 || xhr.status == 0) {
	  //alert(xhr.responseText);
	  testoHTML = xhr.responseText;
	  //Update HTML into the DIV
	  //alert(document.getElementById(nomeDiv))
	  //alert(document.getElementById(nomeDiv).innerHTML)
	  document.getElementById(nomeDiv).innerHTML = testoHTML
    }
  }
}
/*====================================================
====================================================*/
function apriDialog(destinazione) {
	window.open('/it/popup_login.asp?to=' + destinazione,'login','width=250,height=180');
}
