if(window.kwait && kwait.deps && kwait.deps["gnn_js"] && kwait.deps["gnn_js"].length){ kwait.push([kwait.deps["gnn_js"], function(){ delete kwait.deps["gnn_js"]; var s = document.createElement("script"); s.src="\/\/www.repstatic.it\/minify\/sites\/gelocal\/2018-v1\/config.cache.php?name=gnn_js"; document.head.appendChild(s); }]); } else {(function(){window.footer=function(){utils.init();console.log('library caricata');}})();var utils={init:function(){this.jsDetect();},jsDetect:function(){$('html').removeClass('no-js');}} var longform={init:function(){longform.sticky();var w=Math.max(document.documentElement.clientWidth,window.innerWidth||0);if(w<767){longform.mobileMenu();longform.smoothScroll(45);}else{longform.smoothScroll(60);}},smoothScroll:function(distance){$("#longform-navigation a").on('click',function(event){if(this.hash!==""){event.preventDefault();var hash=this.hash;$('html, body').animate({scrollTop:$(hash).offset().top-distance},500,function(){history.pushState({},'',hash);});}});},sticky:function(){var longformNav=$("#longform-navigation");var longformWrapper=$("#longform-wrapper");var longformStickyClass="longform-sticky";var longformNavContainer=$("#longform-navigation-container");$(window).on("scroll",function(){longformNavOffset=longformNavContainer.offset().top;if($(this).scrollTop()>longformNavOffset){longformWrapper.addClass(longformStickyClass);}else{longformWrapper.removeClass(longformStickyClass);}});},mobileMenu:function(){var longformNav=$("#longform-navigation");var longformMobMenu=$("#longform-mobilemenu");longformNav.add(longformMobMenu).on('click',function(event){longformNav.toggleClass('is-active');})}};var tabber={init:function(id){var tabberId=$(id);var allTabs=tabberId.find('.tab-nav a');console.log();allTabs.each(function(index){$(this).on('click',function(){tabberId.find('.is-active').removeClass('is-active');$(this).addClass('is-active');tabberId.find('.tab-pane').eq(index).addClass('is-active');})});}};var setEdizione={init:function(){if($('#chooseEditionPlaceholder').length){var site=$('meta[name=siteBrand]').attr("content");var a=site.replace(/\s/g,'').toLowerCase()+"-edizionepreferita";var edition=$('meta[name=edition]').attr("content");var editionLabel=$('meta[name=editionLabel]').attr("content");var siteLabel=$('meta[name=siteLabel]').attr("content");var domain=site+".gelocal.it";var getCookie=function(name){var value="; "+document.cookie;var parts=value.split("; "+name+"=");if(parts.length==2)return parts.pop().split(";").shift();};var editionCookie=getCookie(a);console.log(editionCookie+edition);if(editionCookie==null||(editionCookie!=null&&editionCookie!=edition)){$('body').append('

Vuoi scegliere '+edition+' come homepage de Il Tirreno?

');if($('#set-edition').size()){$('#set-edition-confirm').on('click',function(e){e.preventDefault();var expirationDate=new Date();var currentTimeInMs=expirationDate.getTime();var yearInMs=365*24*60*60*1000;var expirationDateInMs=currentTimeInMs+yearInMs;expirationDate.setTime(expirationDateInMs);var expires="expires="+expirationDate.toUTCString();document.cookie=a+"="+edition+";"+expires+";path=/";$(".set-edition_content").remove();$("#set-edition").append('

Complimenti!
Hai impostato '+edition+' come homepage

');});$('#set-edition-close').on('click',function(){$(this).parent().remove();});}}}}}; ;window.kwait=window.kwait||[];kwait.push(['call',"gnn_js"]); }