function contaBanner(idcliban,idcliente,idbanner,pagina){
    window.open("http://www.info-alberghi.com/contaclick_banner_2010.php?idcliban="+idcliban+"&idcliente="+idcliente+"&idbanner="+idbanner+"&pagina="+pagina+"","_blank");
}

$(document).ready(function() {
    $("a[rel='lightbox']").colorbox();
    $(".youtube").colorbox({
        iframe:true,
        width:600,
        height:450
    });
    
    // scritta sul campo ricerca //
	
    $("#textCerca").focus(function () {
        $(this).val("");
    });
    
    //$("#body_center").before("<div id='luigi'>&nbsp;</div>");
	
    $.ajax({
        type: "GET",
        url: "http://www.info-alberghi.com/~trebmeteo/meteo_localita_0.xml",
        dataType: "xml",
        success: function(xml) {
            $(xml).find('localita').each(function(){
                var id = $(this).find('id').text();
                var nome = $(this).find('nome').text();
                var prov = $(this).find('prov').text();
                //$('<div class="items" id="loc_'+id+'"></div>').html(nome+'('+prov+')').appendTo('#page-wrap');
                $('<div class="items" id="loc_'+id+'"></div>').html('').appendTo('#page-wrap');
                $(this).find('previsione').each(function(){
                    var ora_prev = $(this).attr('time');
                    var ora=ora_prev.slice(11,13);
                    var ora_int=parseInt(ora);
                    var ora_int_succ=ora_int+6;
                    var ora_riferimento=5;
                    var id_tempo = $(this).find('id_tempo').text();
                    var desc_tempo = $(this).find('desc_tempo').text();
                    var temp = $(this).find('temp').text();
                    var um_rel = $(this).find('um_rel').text();
                    if(ora_int<=ora_riferimento && ora_riferimento<ora_int_succ && id==5740){
                        $('<div class="desc_tempo_'+ora_prev+'_'+nome+'></div>').html('Temp: '+temp+'°<br>Umidità: '+um_rel+'%').appendTo('#loc_'+id);
                    }
                });
            });
        }
    });
	
    $(".container_vetrina a").tooltip({
        track: true,
        delay: 0,
        fixPNG: true,
        top: 15,
        showURL: false,
        left: 5
    });
	
});


// funzione che fa il refresh del div id="center_hotel" 
// per aggiornare l'elenco degli hotel'

//function reload_hotels() {
//alert('ciao');
//  $("#center_hotel").load("/ricarica_ricerca.php",function(){
//    $('#center_hotel').fadeIn(2000);
//});
//}

/**
function reload_hotels() {
    //alert($.browser.msie);
    //alert($.browser.version);
    if($.browser.msie && $.browser.version == '8.0') {
        //URL provides the request path, without the query string
        var init_url = "<?php echo $_SERVER['PHP_SELF'] ?>";
        var final_url = "<?php echo '?' . rand() . '#H2' ?>";
        var url = init_url + final_url;
        //window.alert(url);
        //window.alert('sono IE 8');
        // window.location.href = url;
    } else {
        // per prima cosa nascondo 
        // gli hotel che ci sono e dopo chiamo la funzione loadContent
				var ricerca = "<?php echo $ricerca_piatt_1 ?>";	
				// window.alert('ricerca = '+ricerca);
        $('#center_hotel').fadeOut('fast',loadContent(ricerca));
    }
}

function loadContent(r) {
    // window.alert('Sono la funz js loadContent');
    // window.alert('ricerca = '+r);
    $("#center_hotel").load("/ricarica_ricerca.php", {"ricerca":r} ,showNewContent());
}

function loadContent() {
    // window.alert('Sono la funz js loadContent');
    // window.alert('ricerca = '+r);
    $("#center_hotel").load("/ricarica_ricerca.php", '' ,showNewContent());
}


function showNewContent() {
    $('#center_hotel').fadeIn(900);
}
*/

