function scroll_to(selector){if($("body").hasClass("menu_opened"))$("body").removeClass("menu_opened");var match=selector.match(/data-dest='([^']+)'/);if(!$(selector).length)window.location.href="?page=home&data-dest="+match[1];var offset=0;if($("header").attr('data-type')=="sticky"){offset=$("header").height(); var params={'page':'home','data-dest':match[1] };var queryString=$.param(params);var baseUrl=window.location.href.split('?')[0];var newUrl=baseUrl+'?'+queryString;console.log(newUrl);window.history.pushState({path:newUrl},'',newUrl); }$('html,body').animate({scrollTop:$(selector).offset().top-offset},1000);}$("document").ready(function(){ var url=new URL(window.location.href);var params=new URLSearchParams(url.search);var data_dest=params.get('data-dest');if(data_dest !=null){var selector="[data-dest='"+data_dest+"']";if($(selector).length)scroll_to(selector); }$(".comune_italiano").autocomplete({source:"js/autocomplete.php?tipo=comuni_italiani",minLength:2,select:function(event,ui){console.log("Value:"+ui.item.value+" id "+ui.item.id+" provincia "+ui.item.provincia); } });Swal.fire({title:'La prossima Cena in Perfetta Compagnia è in preparazione!',html:` <p>Resta connesso sui nostri social:lì troverai tutte le novità.</p> <p><strong>Instagram</strong>:imperfettisconosciuti_</p> <p><strong>Facebook</strong>:IMPerfetti Sconosciuti</p> <p>✨ I dettagli stanno per arrivare anche qui… non mancare!</p>`,allowOutsideClick:false,allowEscapeKey:false,allowEnterKey:false,showConfirmButton:false,didOpen:()=>{setTimeout(()=>{Swal.update({showConfirmButton:true}); },6000);} });});function iscriviti(){Swal.fire({icon:'info',title:"Attendere",allowOutsideClick:false,allowEscapeKey:false,allowEnterKey:false,showConfirmButton:false}); var url="ajax.php?OP=iscriviti";console.log($("#form1").serialize());$.post(url,$("#form1").serialize(),function(json){json=JSON.parse(json);console.log(json);if(json.ret==true){Swal.fire({icon:'success',title:"Ci sei quasi...",html:"Stiamo apparecchiando anche per te...",showCancelButton:false,allowOutsideClick:false,confirmButtonText:'Continua e completa',}).then((result)=>{;if(!result.isConfirmed)return;console.log(json);window.location.href="/pay/?uid="+json.uid;});}else{Swal.fire({icon:'error',title:json.err});}});}$(window).on("load",function(){$('#video_home').get(0).play();});