var $=jQuery.noConflict(); $(document).ready(function(){new Menu().init("#menu",{allclick:!1}),$("#menu a").on("click",function(s){window.innerWidth<1050&&0===$(this).next(".sub-menu").length&&$("#btn-menu").prop("checked",!1)})});var Menu=function(){var s=null,e=null,i=!1;function l(s,l,n){if($(l).parent("ul").hasClass("showback")&&!$(l).hasClass("iconselect")&&($(l).parent("ul").removeClass("showback"),$(l).parent("ul").addClass("show"),$(l).parent("ul").find("li").each(function(){$(this).children("ul").removeClass("show")})),$(l).parent("ul").hasClass("show")&&!$(l).hasClass("iconselect")&&$(l).parent("ul").find("li").removeClass("selected"),$(l).hasClass("selected")||!$(l).hasClass("iconselect"))return!1;s.each(function(){$(this).children("ul").removeClass("show"),$(this).parents("ul").removeClass("showback"),$(this).removeClass("selected")}),n?$(l).children("ul").addClass("show"):$(l).children("ul").show(),i&&n&&$(e+" > ul > li").each(function(){var s=$(l).children("ul").children("li:visible").length;$(l).children("ul").css("max-height",$(l).height()*s+100);var e=$(l).parents("ul"),i=0;e.each(function(){i+=parseInt($(this).css("max-height")),$(this).css("max-height",i+$(l).height()*s+100)})}),n?$(l).hasClass("iconselect")&&$(l).parents("ul").addClass("showback"):$(l).parents("ul").show(),$(l).addClass("selected"),$(l).parents("li").addClass("selected");var h=$(l).children("ul");return h.length&&$(window).width()>1050&&($(l).parents("ul").length>1?t(h)?$(l).children("ul").css("left",-h.outerWidth()):($(l).children("ul").css("left","100%"),t(h)&&$(l).children("ul").css("left",-h.outerWidth())):t(h)?($(l).children("ul").css("left","initial"),$(l).children("ul").css("right","0")):($(l).children("ul").css("left","initial"),$(l).children("ul").css("right","0"),t(h)&&($(l).children("ul").css("left","initial"),$(l).children("ul").css("right","0")))),i&&$("#menu ul > li").each(function(){$(this).hasClass("selected")||$(this).children("ul").css("max-height",0)}),!0}function t(s){var e=$(window).width();return s.offset().left+s.width()>e}return{init:function(n,h){e=n,s=$(n).find("ul").find("li");var c=!1;h&&void 0!==h.allclick&&(c=h.allclick),1050>=$(window).width()&&(i=!0),$(document).on("click",function(){s.each(function(){$(this).removeClass("selected"),$(this).children("ul").removeClass("show"),$(this).children("ul").removeClass("showback")})}),$(window).resize(function(){1050>=$(window).width()?(i||(i=!0,$("#menu").find("ul").find(".iconselect").each(function(){$(this).find("ul").css("max-height",0)})),s.each(function(){$(this).children("ul").css("left","0")})):(i&&(i=!1,$("#menu .iconselect").each(function(){$(this).find("ul").css("max-height","initial"),l(s,this,!1)})),s.each(function(){var s=$(this).children("ul");s.length&&$(this).parents("ul").length>1&&(t(s)?$(this).children("ul").css("left",-s.outerWidth()):($(this).children("ul").css("left","100%"),t(s)&&$(this).children("ul").css("left",-s.outerWidth())))}))}),$(document).on("mouseover",function(s){$(window).width()>1050&&!c&&$("#menu").find("ul").find(".menu-item-has-children").each(function(){$(this).removeClass("selected"),$(this).children("ul").removeClass("show"),$(this).children("ul").removeClass("showback"),i&&$(this).find("ul").css("max-height",0)})}),s.on("mouseover",function(e){$(window).width()>1050&&!c&&(l(s,this,!0),e.stopPropagation())}),s.on("click",function(e){(1050>=$(window).width()||c)&&(l(s,this,!0)||$(this).hasClass("selected")&&($(this).removeClass("selected"),$(this).find("ul").removeClass("showback"),$(this).find("li").removeClass("selected"),$(this).find("ul").removeClass("show"),i&&$(this).find("ul").css("max-height",0)),e.stopPropagation())}),s.each(function(){$(this).find("ul").length>0&&$(this).addClass("iconselect"),l(s,this,!1)})},updateMenu:l,isOutScreen:t}};$("#nav-icon").click(function(){$(".post-index").toggleClass("asap-back"),$(".nav-icon").toggleClass("close")}); $(document).ready(function(){$(".go-top").click(function(){$("body, html").animate({scrollTop:"0px"},300)}),$(window).scroll(function(){$(this).scrollTop()>500?$(".go-top").fadeIn(300):$(".go-top").fadeOut(300)})}); function checkCookies(){"true"!=localStorage.aceptaCookies&&$("#cookiesbox").addClass("cookiesblock")}function allowCookies(){localStorage.aceptaCookies="true",$("#cookiesbox").removeClass("cookiesblock")}$(document).ready(function(){checkCookies()}); $(document).ready(function(){$(".check-table").on("click",function(){$("#index-table").toggle(100)})}); $(document).ready(function(){$(".the-content ol:not(.post-index ol)").each(function(){var t=$(this).attr("start")||1;$(this).css("counterReset","li "+(t-1))})});