<!--

function cambiaStatoTendinaHotel()
{
   var riga = document.getElementById("riga_hotel");
   if (document.lascia_un_commento.oggetto.value == "gen")
   {
      riga.style.display = "none";
   }
   else
   {
      riga.style.display = "block";
   }
}



function inviaFormCommento()
{
		var params = new Array();
		params.push('nome=' + document.lascia_un_commento.nome.value);
		params.push('cognome=' + document.lascia_un_commento.cognome.value);
		params.push('email=' + document.lascia_un_commento.email.value);
		params.push('commento=' + document.lascia_un_commento.commento.value);
		params.push('oggetto=' + document.lascia_un_commento.oggetto.value);
		params.push('hotel_id=' + document.lascia_un_commento.hotel_id.value);
    if (document.lascia_un_commento.privacy.checked === true)
    {
		  params.push('privacy=1');
    }
    else
    {
      params.push('privacy=0');
    }
		params.push('lang=' + document.lascia_un_commento.lang.value);
		http.open('POST', '/ajax.lascia_un_commento.html');
		http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		http.onreadystatechange = esitoLasciaUnCommento;
		var strParams = params.join("&");
		http.send(strParams);
}

function esitoLasciaUnCommento()
{
	if (http.readyState == 4)
	{
			var xmlDocument = http.responseXML;
      var stato = xmlDocument.getElementsByTagName("stato")[0].firstChild.nodeValue;
      var messaggio = xmlDocument.getElementsByTagName("messaggio")[0].firstChild.nodeValue;
      alert(messaggio);
      if (stato == 1)
      {
        document.lascia_un_commento.nome.value = "";
        document.lascia_un_commento.cognome.value = "";
        document.lascia_un_commento.email.value = "";
        document.lascia_un_commento.oggetto.selectedIndex = 0;
        document.lascia_un_commento.hotel_id.selectedIndex = 0;
        document.lascia_un_commento.commento.value = "";
        document.lascia_un_commento.privacy.checked = false;
        cambiaStatoTendinaHotel();
      }

  }
}
-->
