function archivio(){var a=document.getElementById("archivio").selectedIndex,b=document.getElementById("archivio").options;document.location.href="all_news.php?tipo="+b[a].value}function expandingMenu(a){var b=$("#menu ul").eq(a).children(":first"),d=$("#menu ul").eq(a).children().filter(function(a){return 0<a});!1==d.is(".active")&&d.hide();b.css({cursor:"pointer"}).toggle(function(){d.show(500)},function(){d.hide(500)})}
function execJS(a){var b=0,d=0,e=0,f=0,b=a.indexOf("<script",0);if(-1==b)return a;d=a.indexOf(">",b+7)+1;e=a.indexOf("<\/script>",d);f=e+9;d=a.substring(d,e);e=document.createElement("script");e.type="text/javascript";e.text=d;document.getElementsByTagName("head")[0].appendChild(e);a=a.substring(0,b)+a.substr(f);return execJS(a)}function e_mail(){args=e_mail.arguments;document.MM_returnValue=!1;eval("parent.location='mailto:"+args[0]+"@"+args[1]+"'")}
function go_login(){ricorda=document.getElementById("ricorda").checked?1:0;var a="uname="+$("#uname").val()+"&passw="+$("#passw").val()+"&ricorda="+ricorda;jqxhr=$.ajax({type:"POST",url:"login.php",cache:!1,contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:a,success:function(a){obj=jQuery.parseJSON(a);if(!0==obj.status)window.location.reload();else switch(obj.status){case "aggiorna":$("#login").hide();$("#failed").hide();$("#logout").show();$("#gestione").show();window.location.assign("mdp.php?a=1");
break;case "sospeso":$("#login").hide();$("#failed").hide();$("#logout").show();$("#gestione").show();window.location.assign("mdp.php?active_code="+obj.active_code);break;case "fallito":$("#failed").show().html("Accesso fallito");$("#uname").css("background-color","red");$("#passw").css("background-color","red");$("#uname").val("");$("#passw").val("");$("#ricorda").val([""]);break;case "disattivato":$("#failed").show().html("Utente disattivato"),$("#uname").css("background-color","red"),$("#passw").css("background-color",
"red"),$("#uname").val(""),$("#passw").val(""),$("#ricorda").val([""])}}},"json");jqxhr.error(function(){alert(jqxhr.responseText)})}function reslogin(){$("#uname").css("background-color","white");$("#passw").css("background-color","white");$("#failed").hide()}function go_logout(){location="logout.php"}function ShowHide(a){$("#info_"+a).slideToggle()}
function show_it(a){0<a?$("#dettaglio").fadeOut(1E3,function(){$(this).fadeIn(1E3).load("gita.php?ID="+a)}):$("#dettaglio").fadeOut(1E3,function(){$.ajax({type:"POST",url:"inc/search_gite.php",contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:params,success:function(a){$("#dettaglio").fadeIn(1E3).html(a)}})})}
function go_gite(a,b){$.ajax({type:"GET",url:"inc/ultime_gite.php",contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:"pageNum_rs="+a+b,success:function(a){$("#u_gite").html(a)}})}function go_news(a,b){$.ajax({type:"GET",url:"inc/news.php",contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:"pageNum_rs="+a+b,success:function(a){$("#news").html(a)}})}
function go_commentate(a){jqxhr=$.ajax({type:"GET",url:"inc/lista_vie_commentate.php",contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:a,success:function(a){$("#u_commentate").html(a);$("#comment_via_l").html('<span id="comment_via_l">Vie commentate </span><a href="javascript:void(0);" onclick="go_commentate(\'\');"><img src="image_site/reload.gif" alt="Ricarica" style="cursor:pointer;left:940px; position:absolute;" title="Ricarica" class="tooltip" /></a></span>')}})}
function selProvCom(a){$.get("inc/select_form.php",{regione:a,requestItems:"provincia"},function(a){$("select[id='provincia']").empty();var d='<option value="">seleziona ...</option>',a=a.split("||");for(i in a)d+='<option value="'+a[i]+'">'+a[i]+"</option>";$("select[id='provincia']").html(d)})}
$(document).ready(function(){$("#w").bind("click",function(){window.location.assign("gite.php?modulo=project")});$("#add_sug").fancybox({transitionIn:"elastic",transitionOut:"elastic",width:460,height:380,overlayColor:"#000",type:"iframe",overlayOpacity:0.9});$(".foto").fancybox({transitionIn:"elastic",transitionOut:"elastic",titlePosition:"over",overlayColor:"#000",overlayOpacity:0.9});$("#sondaggio").html('<iframe src="sondaggi/test_poll.php?ID=2" id="sond" style="width:200px;height:255px;margin-left:4px;" frameborder="0" scrolling="no"></iframe>');
$(".tooltip").each(function(){$(this).qtip({content:{url:"inc/tooltip_txt.php?id="+$(this).attr("rel")},position:{corner:{target:"bottomMiddle",tooltip:"topMiddle"},adjust:{screen:!0}},show:{when:"mouseenter",solo:!0},hide:"mouseout",style:{tip:!0,border:{width:0,radius:4},width:{min:200},name:"dark"}})})});
function BBtag(a,b,d){x=b.form.name;tag1=a;tag2=1<a.length?a.substring(0,5):a;var e=-1!=navigator.userAgent.toLowerCase().indexOf("gecko")?!0:!1,b=RegExp("[\r]","gi");if(e)oField=document.forms[x].elements[d],objectValue=oField.value,deb=oField.selectionStart,fin=oField.selectionEnd,objectValueDeb=objectValue.substring(0,oField.selectionStart),objectValueFin=objectValue.substring(oField.selectionEnd,oField.textLength),objectSelected=objectValue.substring(oField.selectionStart,oField.selectionEnd),
oField.value=objectValueDeb+"["+tag1+"]"+objectSelected+"[/"+tag2+"]"+objectValueFin,oField.selectionStart=strlen(objectValueDeb),oField.selectionEnd=strlen(objectValueDeb+"["+tag1+"]"+objectSelected+"[/"+tag2+"]"),oField.focus(),oField.setSelectionRange(objectValueDeb.length+a.length+2,objectValueDeb.length+a.length+2);else if(oField=document.forms[x].elements[d],d=document.selection.createRange().text,0<d.length)a=document.selection.createRange(),a.text="["+tag1+"]"+d+"[/"+tag2+"]",a.collapse(),
a.select();else{oField.focus(oField.caretPos);oField.focus(oField.value.length);oField.caretPos=document.selection.createRange().duplicate();e=oField.value;oField.caretPos.text="%~%";d=oField.value.search("%~%");oField.value=e.substr(0,d)+"["+tag1+"][/"+tag2+"]"+e.substr(d,oField.value.length);for(n=e=0;n<d;n++)!0==b.test(oField.value.substr(n,2))&&e++;pos=d+2+a.length-e;e=oField.createTextRange();e.moveStart("character",pos);e.collapse();e.select()}}
function MM_openBrWindow(a,b,d){window.open(a,b,d)}var _gaq=_gaq||[];_gaq.push(["_setAccount","UA-6753369-1"]);_gaq.push(["_trackPageview"]);(function(){var a=document.createElement("script");a.type="text/javascript";a.async=!0;a.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)})();
function archivio(){var a=document.getElementById("archivio").selectedIndex,b=document.getElementById("archivio").options;document.location.href="all_news.php?tipo="+b[a].value}function search_falesie(a,b){""==a&&(a="n="+b);$.ajax({type:"GET",url:"inc/search_falesie.php?"+a,contentType:"application/x-www-form-urlencoded; charset=UTF-8",cache:!1,success:function(a){$("#list_falesie").dialog({width:370,title:"Falesie presenti",create:$("#falesie_dati").html(a)})}})}
function search_route(a,b){if(""==a&&(""!=document.getElementById("nome_via"+b).value||""!=document.getElementById("falesia"+b).value||""!=document.getElementById("grado").value))a="n="+b+"&nome="+encodeURIComponent(document.getElementById("nome_via"+b).value),""!=document.getElementById("falesia"+b).value&&(a=a+"&falesia="+encodeURIComponent(document.getElementById("falesia"+b).value)),""!=document.getElementById("grado").value&&(a=a+"&diff="+encodeURIComponent(document.getElementById("grado").value));
jqxhr=$.ajax({type:"GET",url:"include/r.php",contentType:"application/x-www-form-urlencoded; charset=UTF-8",cache:!1,success:function(b){r=b;a=a+"&r="+r;$("#ID_via").val("");$.ajax({data:a,type:"GET",url:"inc/search_route.php",contentType:"application/x-www-form-urlencoded; charset=UTF-8",cache:!1,success:function(a){$("#list_vie").dialog({width:640,title:"Vie presenti",create:$("#vie_dati").html(a)})}})}})}
function sel_fal(a,b){switch(b){case "1":$("#falesia").val(a);break;case "2":$("#falesia2").val(a);break;case "3":$("#falesia_a").val(a)}$("#list_falesie").dialog("destroy")}function commenti(a){$.ajax({data:"ID="+a,type:"GET",url:"inc/commenti_inc.php",contentType:"application/x-www-form-urlencoded; charset=UTF-8",cache:!1,success:function(a){$("#commento").dialog({resizable:!1,height:360,width:640,title:"Commenti",create:$("#commenti_dati").html(a)})}})}
function commenti_list(a,b,d,e){$.ajax({data:"ID="+a+"&c=1&pag_num="+b+"&x="+e,type:"GET",url:"inc/commenti_inc.php",contentType:"application/x-www-form-urlencoded; charset=UTF-8",cache:!1,success:function(a){$("#u_commentate").html(a);$("#comment_via_l").html(d+' <a href="javascript:void(0);" onclick="go_commentate(\'pageNum_rs='+b+'\');"><img src="image_site/indietro.gif" alt="Indietro" style="cursor:pointer;left:940px; position:absolute;" title="Indietro" class="tooltip" /></a>')}})}
function add_commento(){var a=document.getElementById("add_comm");$("#add_commento").show().html('<p align="center" style="font-size:80%"><img src="image_site/loading1.gif" /><br>Inserimento in corso ...</p>');""!=a.txt_commento.value&&(c=a.c.value,nome=a.nome.value,pag_num=a.pag_num.value,params="ID_route="+a.ID.value,params=params+"&commento="+encodeURIComponent(a.txt_commento.value),params=params+"&nome="+encodeURIComponent(a.nome.value),params=params+"&x="+encodeURIComponent(a.x.value),params+=
"&ins=17",jqxhr=$.ajax({type:"POST",url:"inc/ins_itinerario.php",contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:params,success:function(){""==c?commenti(a.ID.value+"&x="+a.x.value):commenti_list(a.ID.value,pag_num,nome,a.x.value)}}))}
function edit_commento(a){""!=eval("document.getElementById('commento"+a+"').value")&&(ID_route=eval("document.getElementById('ID_route"+a+"').value"),c=eval("document.getElementById('c"+a+"').value"),x=eval("document.getElementById('x').value"),nome=eval("document.getElementById('nome"+a+"').value"),pag_num=eval("document.getElementById('pag_num"+a+"').value"),params="ID="+eval("document.getElementById('ID"+a+"').value"),params=params+"&commento="+encodeURIComponent(eval("document.getElementById('commento"+
a+"').value")),params+="&ins=20",jqxhr=$.ajax({type:"POST",url:"inc/ins_itinerario.php",contentType:"application/x-www-form-urlencoded; charset=UTF-8",data:params,success:function(){""==c?commenti(ID_route):commenti_list(ID_route,pag_num,nome,x)}}))};
