//*******************************
//* Script generali i siti      *
//*******************************

//vartiabili
    
    IDDropCategorie = "ctl00_Fascia1_OffertaTuristica1_ddCategorie";

//--


	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
	        document.getElementById(id).innerHTML = eval("listaContenuti_" + id + "[" + (numero - 1) + "]").replace("''","");
	        document.getElementById("pager_" + id + "_" + numero).style.fontWeight = "bold";	        
	    }	 
	    catch(e){}
	    
	    visibile = numero;
	}
	
	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,id)
	{
		window.open('<%=UiUtils.GetPath%>/popup/gallery.aspx?ID=<%=m_oPagina.UniqueID%>&path=' + path + '&IDA=' + id,'Gallery','scrollbars=no,resizable=no,status=no,location=no,toolbar=no,width=600,height=600,top=0,left=0');                
	}
	
	
	function PopEvento(idevento, path)
	{
		window.open('<%=UiUtils.GetPath%>/popup/gallery.aspx?ID=<%=m_oPagina.UniqueID%>&path=' + path + "&IDE=" + idevento,'Gallery','scrollbars=no,resizable=no,status=no,location=no,toolbar=no,width=650,height=550,top=0,left=0');                
	}
	
	function PopNews(idnews)
	{
		window.open('<%=UiUtils.GetPath%>/popup/news.aspx?ID=<%=m_oPagina.UniqueID%>&IDN=' + idnews,'News','scrollbars=no,resizable=no,status=no,location=no,toolbar=no,width=650,height=550,top=0,left=0');                
	}
	
	function PopStiamoLavorando()
	{
		window.open('<%=UiUtils.GetPath%>/popup/StiamoLavorando.aspx','StiamoLavorando','scrollbars=no,resizable=no,status=no,location=no,toolbar=no,width=650,height=550,top=0,left=0');                
	}
	
	function PopEvento(idevento)
	{
		window.open('<%=UiUtils.GetPath%>/popup/news.aspx?ID=<%=m_oPagina.UniqueID%>&IDE=' + idevento,'News','scrollbars=no,resizable=no,status=no,location=no,toolbar=no,width=650,height=550,top=0,left=0');                
	}
	
	function show_photo(path,IDFoto)
	{
	    location.href = "gallery.aspx?ID=<%=m_oPagina.UniqueID%>&path=" + path + "&IDA=" + IDFoto
	}

	


    function check_sel(obj)
    {
	    m_oggetto = document.getElementById(obj);
	    if(!m_oggetto.checked)
	    {
		    alert("Devi accettare la nota informativa");
		    return false;
	    }
	    else
	    {
		    return true;
	    }
    }
    
    function login()
    {
        alert("User o Password errati!");
    }
    
    //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 - 32 + "px";
		document.getElementById("hint_div").style.left = window.event.clientX + document.body.scrollLeft - 6 + "px";
		document.getElementById("hint_div_text").innerHTML= "<nobr>" + hint.replace("^","'") + "</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('/popup/notainfo.aspx', 'NotaInformativa', 'scrollbars=no,resizable=no,width=500,height=450,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";
}

function load() {
}

function GUnload() {
}