<!--
function removeAllOptions(obj)
{
  obj.innerHTML = null;
  oOption = document.createElement('OPTION');
  oOption.text = "Scegli un hotel...";
  oOption.value = "";
  obj.appendChild(oOption);
}

function createRequestObject()
{
		var request_o; //declare the variable to hold the object.
		var browser = navigator.appName; //find the browser name
		if (browser == "Microsoft Internet Explorer")
		{
			request_o = new ActiveXObject("Microsoft.XMLHTTP");
 		}
 		else
 		{
			request_o = new XMLHttpRequest();
		}
		return request_o;
}


function cercaHotelRegione(lang)
{
		var params = new Array();
		var mySelect = document.getElementById("scelta_hotel");
		mySelect.style.display = "none";
		removeAllOptions(mySelect);
		if (document.ricerca_hotel.regione.value == "")
    {
   		mySelect.style.display = "block";
      return;
    }
		params.push('regione=' + document.ricerca_hotel.regione.value);
		http.open('POST', '/ajax.ricerca_hotel.html');
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http.onreadystatechange = esitoRicercaHotel;
		var strParams = params.join("&");
		http.send(strParams);
}

function esitoRicercaHotel()
{
	if (http.readyState == 4)
	{
			var xmlDocument = http.responseXML;
      var citta = xmlDocument.getElementsByTagName("citta");
      no_citta = citta.length;
			var mySelect = document.getElementById("scelta_hotel");
			for (var i = 0; i < no_citta; i++)
			{
          var record = citta[i];
          var nomeCitta = record.getElementsByTagName("nome")[0].firstChild.nodeValue;
          oOptgroup = document.createElement('OPTGROUP');
          oOptgroup.label = nomeCitta;
          mySelect.appendChild(oOptgroup);
          var hotels = record.getElementsByTagName("hotel");
          var no_hotels = hotels.length;
          for(j = 0; j < no_hotels; j++)
          {
            var record = hotels[j];
       			var nomeHotel = record.getElementsByTagName("nome")[0].firstChild.nodeValue;
       			var linkHotel = record.getElementsByTagName("link")[0].firstChild.nodeValue;
            oOption = document.createElement('OPTION');
            oOptgroup.appendChild(oOption);
            oOption.text = nomeHotel;
            oOption.value = linkHotel;
            mySelect.appendChild(oOption);
         }
  		}
      oOption = document.createElement('OPTION');
      oOption.text = "BAU";
      oOption.value = "CIAO";

			mySelect.style.display = "block";
  }
}

function goToHotel(link, lang)
{
   if (link == "") return;
   if (lang == "en")
   {
      indirizzo = "/en/hotels/" + link;
   }
   else
   {
      indirizzo = "/hotels/" + link;
   }
   document.location.href = indirizzo;
}

var http = createRequestObject();
-->