function setCookie(n,t,i){var r=new Date,u;r.setTime(r.getTime()+i*864e5);u="expires="+r.toUTCString();document.cookie=n+"="+t+";"+u+";path=/"}function getCookie(n){for(var r=n+"=",f=decodeURIComponent(document.cookie),u=f.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return""}function GTMInit(n){var t=[],i,r;t.push({Device:"Desktop"});t.push({PageURL:window.location.href.toLowerCase()});t.push({Country:n}),function(n,t,i,r,u){n[r]=n[r]||[];n[r].push({"gtm.start":(new Date).getTime(),event:"gtm.js"});var e=t.getElementsByTagName(i)[0],f=t.createElement(i),o=r!="dataLayer"?"&l="+r:"";f.async=!0;f.src="https://www.googletagmanager.com/gtm.js?id="+u+o;e.parentNode.insertBefore(f,e)}(window,document,"script","dataLayer","GTM-NBQG46X");r=!1;i=document.createElement("noscript");i.innerHTML='<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NBQG46X" height = "0" width = "0" style = "display:none;visibility:hidden" ><\/iframe >';document.getElementsByTagName("body")[0].appendChild(i)}var General={MenuStorage:"YKMenu",FooterStorage:"YKFooter",TopReadStorage:"TKTopRead",ArticleAdsStorage:"ArticleAdsDetails",TopReadDiv:".topRead",MenuDiv:"#Menu",FooterDiv:"#Footer",TopReadGetUrl:AppPath+"/General/GetTopRead",GetMenuUrl:AppPath+"/General/GetMenu",GetFooterUrl:AppPath+"/General/GetFooter",TopReadParams:{count:10},LocalStorageTimeSeparator:"#LocalStorageTime#",GetTopRead:function(){var n=General.GetTopReadContent();n!=null&&n!=undefined?$(General.TopReadDiv).append(n):$.ajax({type:"GET",dataType:"html",contentType:"application/json; charset=utf-8",url:General.TopReadGetUrl,data:{count:10},success:function(n){$(General.TopReadDiv).append(n);General.SetTopReadContent(n)},error:function(){}})},GetMenu:function(){var n=General.GetMenuContent();n!=null&&n!=undefined?$(General.MenuDiv).append(n):$.ajax({type:"GET",dataType:"html",contentType:"application/json; charset=utf-8",url:General.GetMenuUrl,cache:!0,success:function(n){$(General.MenuDiv).append(n);General.SetMenuContent(n)},error:function(){}})},GetFooter:function(){var n=General.GetFooterContent();n!=null&&n!=undefined?$(General.FooterDiv).append(n):$.ajax({type:"GET",dataType:"html",contentType:"application/json; charset=utf-8",url:General.GetFooterUrl,cache:!0,success:function(n){$(General.FooterDiv).append(n);General.SetFooterContent(n)},error:function(){}})},SetCookie:function(n,t,i){var r=new Date,u;r.setTime(r.getTime()+i*864e5);u="expires="+r.toUTCString();document.cookie=n+"="+t+";"+u+";path=/"},GetCookie:function(n){for(var r=n+"=",f=decodeURIComponent(document.cookie),u=f.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return""},DeleteCookie:function(n){document.cookie=n+"= ;expires = Thu, 01 Jan 1970 00: 00: 00 UTC;path=/"},SetSessionStorage:function(n,t){sessionStorage.setItem(n,t)},SetLocalStorage:function(n,t,i){i!=undefined&&i!=null&&(t=t+General.LocalStorageTimeSeparator+i);localStorage.setItem(n,t,i)},GetSessionStorage:function(n){return sessionStorage.getItem(n)},GetLocalStorage:function(n){return localStorage.getItem(n)},GetMenuContent:function(){var n=General.GetLocalStorage(General.MenuStorage);if(n!=null&&n!=undefined){var t=n.split(General.LocalStorageTimeSeparator)[1],i=new Date,r=new Date(t);return r.getTime()<i.getTime()?null:n.split(General.LocalStorageTimeSeparator)[0]}return null},SetMenuContent:function(n){var t=new Date;t.setHours(t.getHours()+1);General.SetLocalStorage(General.MenuStorage,n,t)},GetFooterContent:function(){var n=General.GetLocalStorage(General.FooterStorage);if(n!=null&&n!=undefined){var t=n.split(General.LocalStorageTimeSeparator)[1],i=new Date,r=new Date(t);return r.getTime()<i.getTime()?null:n.split(General.LocalStorageTimeSeparator)[0]}return null},SetFooterContent:function(n){var t=new Date;t.setHours(t.getHours()+1);General.SetLocalStorage(General.FooterStorage,n,t)},GetTopReadContent:function(){var n=General.GetLocalStorage(General.TopReadStorage);if(n!=null&&n!=undefined){var t=n.split(General.LocalStorageTimeSeparator)[1],i=new Date,r=new Date(t);return r.getTime()<i.getTime()?null:n.split(General.LocalStorageTimeSeparator)[0]}return null},SetTopReadContent:function(n){var t=new Date;t.setHours(t.getMinutes()+5);General.SetLocalStorage(General.TopReadStorage,n,t)}},IP2Location,loc;$(document).ready(function(){$(General.TopReadDiv).length>0&&(IsGoRealTimeApiApplied==="True"||IsGoRealTimeApiApplied==="true")&&General.GetTopRead()});$.fn.isOnScreen=function(){var i=$(window),t={top:i.scrollTop(),left:i.scrollLeft()},n;return t.right=t.left+i.width(),t.bottom=t.top+i.height(),n=this.offset(),n.right=n.left+this.outerWidth(),n.bottom=n.top+this.outerHeight(),!(t.right<n.left||t.left>n.right||t.bottom<n.top||t.top>n.bottom)};IP2Location={GetLocation:function(){var n="";$.ajax({type:"GET",dataType:"json",contentType:"application/json; charset=utf-8",url:AppPath+"/General/GetLocation",success:function(t){t.CountryLong!==""&&t.CountryLong!==null&&t.CountryLong.length>3?(setCookie("Location",t.CountryLong,7),n=t.CountryLong):n="NoCountry";GTMInit(n)},error:function(){n="NoCountryError";console.log("error geting location");GTMInit(n)}})}};getCookie("Location")===""||getCookie("Location")==="null"||getCookie("Location")===undefined||getCookie("Location").length<=3?IP2Location.GetLocation():(loc=getCookie("Location"),GTMInit(loc))