function trackGA(n,t,i,r,u){var f=r;typeof i!="undefined"&&(f=i+" "+f);u!=null&&(f=(u?"Obrázek":"Článek")+" "+f);f=f.replace(/&shy;/igm,"");try{dataLayer.push({event:"ga.event",eCategory:n,eAction:t,eLabel:f,eValue:1});console.log("GAEvent\nKategorie: "+n+"\nAkce: "+t+"\nŠtítek: "+f)}catch(e){}}function TriggerLazyLoad(){var n=[].slice.call(document.querySelectorAll("img.lazy"));if("IntersectionObserver"in window){let t=new IntersectionObserver(function(n){n.forEach(function(n){if(n.isIntersecting){let i=n.target;i.addEventListener("load",function(){i.classList.add("loaded");i.parentNode.classList.add("loaded")});i.src=i.dataset.src;i.classList.remove("lazy");t.unobserve(i)}})});n.forEach(function(n){t.observe(n)})}else{let i=!1;const t=function(){i===!1&&(i=!0,setTimeout(function(){n.forEach(function(i){if(i.getBoundingClientRect().top<=window.innerHeight&&i.getBoundingClientRect().bottom>=0&&window.getComputedStyle(i).display!=="none"){i.addEventListener("load",function(){i.classList.add("loaded");i.parentNode.classList.add("loaded")});i.src=i.dataset.src;i.dataset.srcset!=undefined&&(i.srcset=i.dataset.srcset);try{n=n.filter(function(n){return n!==i})}catch(r){}n.length===0&&(document.removeEventListener("scroll",t),window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t))}});i=!1},200))};document.addEventListener("scroll",t);window.addEventListener("resize",t);window.addEventListener("orientationchange",t)}}var layout={menu:{isOpen:!1,pageY:0,toggle:function(){layout.user.hide();$("#site-search").val("");layout.menu.isOpen?(layout.menu.isOpen=!1,$("body").toggleClass("menu-open"),window.scrollTo(0,layout.menu.pageY)):(layout.menu.isOpen=!0,layout.menu.pageY=window.pageYOffset,window.scrollTo(0,0),$("body").toggleClass("menu-open"))}},user:{toggle:function(){$(".user-logged").toggleClass("open")},hide:function(){$(".user-logged").removeClass("open")}},search:{run:function(){var n=$("#site-search").val();n!=""&&(document.location="/?search="+encodeURIComponent(n))}},theme:{"switch":function(){$("body").hasClass("mode-dark")?(trackGA("Navigace","Dark/Light Mode","","Light",null),$.cookie("modedark","0",{expires:90,path:"/",domain:"zive.cz"}),$("body").removeClass("mode-dark")):(trackGA("Navigace","Dark/Light Mode","","Dark",null),$.cookie("modedark","1",{expires:90,path:"/",domain:"zive.cz"}),$("body").addClass("mode-dark"));layout.menu.toggle()}},consult:{toggleReply:function(n){var t=$(n).parent();t.hide();t.parent().find(".f-list-reply-t-h").removeClass("f-list-reply-t-h")}}},premium={showInfo:function(n,t){typeof spsid!="undefined"&&t.replace(/{sid}/,spsid);var i='<div class="premium-info-modal" onclick="premium.hideInfo();">';i+='<div class="premium-info fs-os">';i+='<a href="#" onclick="premium.hideInfo();return false" class="premium-info-close" title="Zavřít upozornění">×<\/a>';i+='<div class="premium-info-header">';i+='<a class="sidlink logo" href="'+t+'" rel="nofollow" rel="nofollow" title="Chci předplatné"><\/a>';i+='<a class="sidlink logo-premium" href="'+t+'" rel="nofollow" rel="nofollow" title="Chci předplatné"><\/a>';i+="<\/div>";i+="<p><b>Tato funkce je součástí předplatného Živě Premium<\/b><\/p>";i+="<p>Získejte neomezený přístup a Živě bez reklam už za <b>41&nbsp;Kč<\/b> měsíčně<\/p>";i+='<div class="premium-info-btn">';i+='<a class="sidlink" href="'+t+'" rel="nofollow" rel="nofollow" title="Chci předplatné">Chci předplatné<\/a>';i+="<\/div>";i+='<div class="premium-info-footer">';i+='Už mám předplatné – <a rel="nofollow" href="//klub.ikiosek.cz/Login.aspx?backSite='+window.location.hostname+"&amp;redirect="+n+'" title="Přihlásit se">Přihlásit se<\/a>';i+="<\/div>";i+="<\/div>";i+="<\/div>";$("body").append(i)},hideInfo:function(){$(".premium-info-modal").remove()},toggleTypesPreview:function(n){var t=$(".premium-content:first"),i=$(n);t.hasClass("p-hidden")?(t.removeClass("p-hidden"),i.text("Skrýt typy předplatného").removeClass("p-hidden")):(t.addClass("p-hidden"),i.text("Ukázat typy předplatného").addClass("p-hidden"))}},CustomDataLayer;jQuery.cookie=function(n,t,i){var f,r,e,o,u,s;if(typeof t!="undefined"){i=i||{};t===null&&(t="",i.expires=-1);f="";i.expires&&(typeof i.expires=="number"||i.expires.toUTCString)&&(typeof i.expires=="number"?(r=new Date,r.setTime(r.getTime()+i.expires*864e5)):r=i.expires,f="; expires="+r.toUTCString());var h=i.path?"; path="+i.path:"",c=i.domain?"; domain="+i.domain:"",l=i.secure?"; secure":"";document.cookie=[n,"=",encodeURIComponent(t),f,h,c,l].join("")}else{if(e=null,document.cookie&&document.cookie!="")for(o=document.cookie.split(";"),u=0;u<o.length;u++)if(s=jQuery.trim(o[u]),s.substring(0,n.length+1)==n+"="){e=decodeURIComponent(s.substring(n.length+1));break}return e}};$.fn.enterKey=function(n){return this.each(function(){$(this).on("keypress",function(t){var i=t.keyCode?t.keyCode:t.which;i=="13"&&(t.preventDefault(),t.stopPropagation(),n.call(this))})})};CustomDataLayer={SetupComplete:!1,Article:0,Page:{types:["Homepage","Article","Gallery","Forum","Article List","Other","Catalogue","Consult","Bazar"],type:"Other",category:""},User:{types:["Anonymous","Logged in","Subscriber"]},SetUp:function(n,t){CustomDataLayer.SetupComplete||(CustomDataLayer.GetCategory(t),window.dataLayer.push({pageType:CustomDataLayer.Page.type,pageCategory:CustomDataLayer.Page.category,visitorLoginState:CustomDataLayer.User.types[n],articleID:String(CustomDataLayer.Article),webType:"Mobile"}),CustomDataLayer.SetupComplete=!0)},GetCategory:function(n){CustomDataLayer.Page.category=typeof CustomDataLayer.Page.category=="object"?n+","+CustomDataLayer.Page.category.join(","):CustomDataLayer.Page.category==""?n+","+CustomDataLayer.Page.type:n+","+CustomDataLayer.Page.category}};$(document).ready(function(){$('[data-ga!=""][data-ga]').each(function(){var t=$(this),n=t.attr("data-ga").split(";");n.length<2&&(n=t.attr("data-ga").split(","));t.find("a.ga-label").bind("click",function(){trackGA(n[0],n[1],n[2],$(this).text(),null)});t.find("a.ga-link").bind("click",function(){trackGA(n[0],n[1],n[2],$(this).attr("href"),null)});t.find("a.ga-title").bind("click",function(){trackGA(n[0],n[1],n[2],$(this).attr("title"),$(this).find("img").length>0)});t.find("a.ga-plain-title").bind("click",function(){trackGA(n[0],n[1],n[2],$(this).data("title"),null)});t.find("a.ga-full").bind("click",function(){trackGA(n[0],n[1],n[2],$(this).text()+"|"+$(this).attr("href"),null)})})});document.addEventListener("DOMContentLoaded",function(){TriggerLazyLoad()})