function OpenCloseRicAvan(){
    if( document.getElementById('panRicAvanzata').style.height == '0px' ){
        document.getElementById('panRicAvanzata').style.height = '220px'; 
        document.getElementById('panRicAvanzata').style.visibility="visible";
    }               
    else{
        document.getElementById('panRicAvanzata').style.height = '0px';                
        document.getElementById('panRicAvanzata').style.visibility="hidden";
    }
}
        
function CreateBookmarkLink(){ 
  title = "Hotel-di-Rimini.com";   
  url = "http://www.hotel-di-rimini.com";   
  if (window.sidebar)
    window.sidebar.addPanel(title, url,""); 
  else if( window.external )
    window.external.AddFavorite( url, title);                       
}

function CreateXmlHttpReq() {
    var xmlhttp = null;
    try {
        xmlhttp = new XMLHttpRequest();
    } catch(e) {
        try {
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch(e) {
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }       
    return xmlhttp;
}


function AddHotelStat( hotel,tipo )
{            
    // Istanzio l'oggetto per effettuare la richiesta
    var sender = CreateXmlHttpReq();
    if( sender != null ){
        // Apro la Connessione
        sender.open("POST", "stat.aspx", true );        
        // Preparo i parametri da inviargli
        var params = "idHotel="+hotel+"&type="+tipo;
        sender.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        sender.setRequestHeader("Content-length", params.length);
        sender.setRequestHeader("Connection", "close");

        sender.send(params);
    }
}
