//*******************************
//* Script generali i siti      *
//*******************************
	function PopSingoloHotelTiscover(idpagina) {
	    var GiornoArrivo=document.getElementById("<%=ddGiornoInizio.ClientID%>").value + '/'+document.getElementById("<%=ddMeseInizio.ClientID%>").value+'/'+document.getElementById("<%=ddAnnoInizio.ClientID%>").value;
	    var GiornoPartenza=document.getElementById("<%=ddGiornoFine.ClientID%>").value + '/'+document.getElementById("<%=ddMeseFine.ClientID%>").value+'/'+document.getElementById("<%=ddAnnoFine.ClientID%>").value;
	    var Camere=document.getElementById("<%=txtNCamere.ClientID%>").value;
	    var Adulti=document.getElementById("<%=txtPersone.ClientID%>").value;
	    var Bimbi01=document.getElementById("<%=txtBambini25.ClientID%>").value;
	    var Bimbi02=document.getElementById("<%=txtBambini68.ClientID%>").value;
	    
	    //var Bimbi01 = "0";
	    //var Bimbi02 = "0";
	    
	    window.open('<%=UiUtils.GetPath%>/popup/Tiscover.aspx?ID=' + idpagina + '&GiornoArrivo=' + GiornoArrivo + '&GiornoPartenza=' + GiornoPartenza + '&Camere=' + Camere + '&Adulti=' + Adulti + '&Bimbi01=' + Bimbi01 + '&Bimbi02=' + Bimbi02+ '&Bimbi03=' + '','HotelLuise','scrollbars=yes,resizable=no,width=900,height=700,status=no,location=no,toolbar=no');   
    }
 
	visibile = 1;
	
	function illumina(id)
	{
		old = document.getElementById("img_" + id).src;
		src_nuovo = old.substring(0, old.length - 4) + "_sel" + old.substring(old.length - 4);
		document.getElementById("img_" + id).src = src_nuovo;
	}

	function spegni(id)
	{
		old = document.getElementById("img_" + id).src;
		src_nuovo = old.substring(0, old.length - 8) + ".jpg";
		document.getElementById("img_" + id).src = src_nuovo;
	}

	function ShowPage(numero)
	{
		try{
			document.getElementById("page_Descrizione_" + visibile).style.visibility = "hidden";
			document.getElementById("pager_" + visibile).style.fontWeight = "normal";
		}catch(e){}
		
		try{
			document.getElementById("page_Descrizione_" + numero).style.visibility = "visible";
			document.getElementById("pager_" + numero).style.fontWeight = "bold";
		}catch(e){}
		
		visibile = numero;
	}
	
	function ShowPage2(numero, id)
	{
	    try
	    {
	        document.getElementById("pager_" + id + "_" + visibile).style.fontWeight = "normal";
	    }	 
	    catch(e){}
	    
	    try
	    {
	        //contenuto nuovo
	        temp = eval("listaContenuti_" + id + "[" + (numero - 1) + "]").replace(/''/g,'"');
	        //alert(temp);
	        document.getElementById(id).innerHTML = temp;
	        document.getElementById("pager_" + id + "_" + numero).style.fontWeight = "bold";	        
	    }	 
	    catch(e){}
	    
	    visibile = numero;
	}
	
	roll_mostrato = ""
	function mostra_roll(id)
	{
	    document.getElementById("rollover_" + id).style.visibility = "visible";
	    roll_mostrato = id
	}
	
	function nascondi_roll(id)
	{
	    if(roll_mostrato != "")
	        document.getElementById("rollover_" + roll_mostrato).style.visibility = "hidden";
	}
	
	
	nascosto = "";
	
	function nascondi_layer(id)
	{
		if(document.getElementById(id) != null)
			document.getElementById(id).style.visibility = "hidden";
	}
	
	function visualizza_layer(id)
	{
		if(nascosto != id){
			document.getElementById(id).style.visibility = "visible";
		}
	}

	function PopGallery(path, num) {

		if(path == '')
			return;
			
	    //document.getElementById("img_testata").src = path;
	    window.open('<%=UiUtils.GetPath%>/popup/popgallery.aspx?ID=<%=m_oPagina.UniqueID%>&Path=' + path,'Photogallery','scrollbars=no,resizable=no,status=no,location=no,toolbar=no,width=400,height=400,top=0,left=0');
        return;
        
		temp = nascosto;
		nascosto = "layer_trasp_" + num;
		nascondi_layer(nascosto);
		if(temp != ""){
			visualizza_layer(temp);
			//document.getElementById(temp).innerHTML = "<img src=" + path + ">";
		}
	}
	
	function show_photo(path, id)
	{
	    location.href = "gallery.aspx?ID=<%=m_oPagina.UniqueID%>&path=" + path + "&IDF=" + id
	}

    function check_sel(obj)
    {
	    m_oggetto = document.getElementById(obj);
	    if(!m_oggetto.checked)
	    {
		    alert("Devi accettare la nota informativa");
		    return false;
	    }
	    else
	    {
		    return true;
	    }
    }
    
    //script per la vignetta
	function showhint(hint){
		//hint non deve contenere '  ,usare il carattere ^
		//per le " usare il carattere \"
		document.getElementById("hint_div").style.visibility = "visible";
		document.getElementById("hint_div").style.top = window.event.clientY + document.body.scrollTop - 34 + "px";
		document.getElementById("hint_div").style.left = window.event.clientX + document.body.scrollLeft - 6 + "px";
		document.getElementById("hint_div_text").innerHTML = "<nobr>" + hint.replace(/"^"/g,"'") + "</nobr>";
	}
	
	function hidehint(){
		document.getElementById("hint_div").style.visibility = "hidden";
		document.getElementById("hint_div_text").innerHTML = "";
	}
	//---

	function popfiera(id){
		window.open('<%=UiUtils.GetPath%>/popup/pop_fiere.aspx?ID=' + id,'Fiere','scrollbars=no,resizable=no,status=no,location=no,toolbar=no,width=380,height=400,top=0,left=0');
	}

	function pop_evento(id){	    
		window.open('<%=UiUtils.GetPath%>/popup/popEvento.aspx?ID=' + id,'Evento','scrollbars=no,resizable=no,status=no,location=no,toolbar=no,width=400,height=450,top=0,left=0');
	}


    function popnota() {
	    window.open('<%=UiUtils.GetPath%>/popup/NotaInfo.htm','NotaInformativa','scrollbars=no,resizable=no,width=300,height=300,status=no,location=no,toolbar=no');
    }

    function PopMarcialonga() {
	    window.open('<%=UiUtils.GetPath%>/popup/Marcialonga.htm','Marcialonga','scrollbars=no,resizable=no,width=600,height=400,status=no,location=no,toolbar=no');
    }
    
     function PopMichelin(UrlDestinazione) {
	    window.open(UrlDestinazione,'Michelin','scrollbars=yes,resizable=no,width=500,height=650,status=no,location=no,toolbar=no');
    }

	function pop_layer(){
	    return;
		document.getElementById("div_layer").style.visibility = "visible";
	}
	
	function chiudi_layer()
	{
		document.getElementById("div_layer").style.visibility = "hidden";
	}
	
	
    //funzioni per i meni a sparizione
	var v_TimeOutID;
	var aperto = "";
	var da_non_chiudere = "";
	
	function apri_menu(menu)
	{
	    //if(aperto != "" && aperto != da_non_chiudere)
	    //    chiudi_menu(aperto);
	    //alert(menu + "-" + da_non_chiudere);
	    if(aperto != "")
	        chiudi_menu(aperto);	    
	    if(da_non_chiudere != "" && menu != da_non_chiudere)
	        chiudi_menu(da_non_chiudere);
	        
	    ferma_timer();
	    document.getElementById(menu).style.display = "inline";
	    aperto = menu;
	    
	    temp_menu = menu.substring(8);
	    //alert(temp_menu);
	    document.getElementById('menu_' + temp_menu).style.backgroundColor = "";
	    document.getElementById('menu_' + temp_menu).style.color = "#907436";
	}
	
	function chiudi_menu(menu)
	{
	    document.getElementById(menu).style.display = "none";
	    temp_menu = menu.substring(8);
	    //alert(temp_menu);
	    document.getElementById('menu_' + temp_menu).style.color = "";
	    document.getElementById('menu_' + temp_menu).style.backgroundColor = "";
	    
	    aperto = "";
	    
	    if(da_non_chiudere != "" && da_non_chiudere != menu)
	        apri_menu(da_non_chiudere);
	}
	
	function avvia_timer(menu)
	{
	    v_TimeOutID = setTimeout("chiudi_menu('" + menu + "')",250);
	}
	
	function ferma_timer()
	{
	    window.clearTimeout(v_TimeOutID);
	}

    function load()
    {
    }

    function GUnload()
    {
    }