function setTimer(){var u=new Date,n=new Array(7);n[0]="Chủ nhật";n[1]="Thứ hai";n[2]="Thứ ba";n[3]="Thứ tư";n[4]="Thứ năm";n[5]="Thứ sáu";n[6]="Thứ bảy";var f=n[u.getDay()],t=new Date,e=t.getDate(),o=t.getMonth()+1,i=t.getHours(),r=t.getMinutes();return f+", "+e+"/"+o+"/"+t.getFullYear()+", "+(i>=10?i:"0"+i)+":"+(r>=10?r:"0"+r)+" (GMT+7)"}var elementPosition,pickerTime,goTop;tempC={boxNewsSuggession:function(){return'<div class="box-container pd10"><span class="btn-hide-box-news"><i class="icon-up-open-1"><\/i><\/span><div class="main grid grid-4 gap-10 relative"><\/div><\/div>'}};tempA={imgDefault:function(){return"data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="},ar1:function(){return'<article class="clearfix"><figure class="figure-fit w100 fl mr10"><a href="{{href}}" title="{{title}}"><img data-src="{{data-src}}" alt="{{title}}" src="{{src}}"><\/a><\/figure><h4><a class="inherit font14" href="{{href}}" title="{{title}}">{{title}}<\/a><\/h4><\/article>'}};quizz={init:function(){if(document.querySelectorAll(".quizz").length>0){let n=document.querySelector(".result-quizz");n!=undefined&&(n.innerHTML='<header><span>Kết quả<\/span><\/header><div><label class="text-rs"><\/label><label class="text-notice">Hãy trả lời các câu hỏi để biết kết quả của bạn<\/label><\/div>');let t=document.querySelectorAll(".quizz").length;document.querySelectorAll(".quizz li").forEach(function(i){i.addEventListener("click",function(){let r=i.closest(".quizz:not(.active)");if(r!=undefined){i.classList.add("selected");r.classList.add("active");let u=document.querySelectorAll(".quizz.active").length;if(u==t){let i=n.querySelector(".text-rs"),r=n.querySelector(".text-notice"),u=document.querySelectorAll(".quizz .selected.true-value").length;i!=null&&i!=undefined&&(i.innerHTML=u+"/"+t);r!=null&&r!=undefined&&(r.innerHTML=u==t?"Bạn thật xuất sắc":"Bạn có thể làm tốt hơn thế")}}})})}else{let n=document.querySelector(".result-quizz");n!=undefined&&n.parentElement.removeChild(n)}}};quizz.init();zoom={init:function(){let t=document.querySelectorAll(".edittor-content figure.expNoEdit img"),n=0;t.forEach(function(t){n++;t.style.cursor="zoom-in";t.setAttribute("data-index",n);t.addEventListener("click",function(){zoom.loadZoomImage(zoom.getIndex(t))})})},getIndex:function(n){return n.getAttribute("data-index")},loadZoomImage:function(n,t){let i=document.querySelector('.edittor-content figure.expNoEdit img[data-index="'+n+'"');if(i!=undefined){let e=i.getAttribute("data-src").replaceAll("resize/th/",""),f=document.querySelectorAll(".edittor-content figure.expNoEdit img").length,u="",o=i.closest(".div-mb-editor");if(o!=undefined){let n=o.querySelector(".ctmb");n!=undefined&&(u=n.innerHTML)}else{let n=i.closest("figure");if(n!=undefined){let t=n.querySelector("figcaption");t!=undefined&&(u=t.textContent)}}let s=n==f?1:parseInt(n)+1,h=n==1?f:parseInt(n)-1,r=document.querySelector(".zoom-image");if(r==undefined){let c=document.createElement("div");c.innerHTML='<div class="zoom-image fixed-full z-100 grid grid-zoom-img bg-black-0"><div class="relative zoom-div-img"><span class="btn-right-image cursor prevent-select" data-index="{{next}}"><\/span><span class="btn-left-image cursor prevent-select"  data-index="{{pre}}"><\/span><img src="{{src}}" class="abs-center prevent-select"><\/div><div class="zoom-div-cap"><p class="white cap-show lh-25">{{cap}}<\/p><\/div><span class="btn-close-image cursor prevent-select">X<\/span><span class="num-of-img cursor prevent-select">{{index}}/{{count}}<\/span><\/div>'.replaceAll("{{src}}",e).replaceAll("{{cap}}","").replaceAll("{{next}}",s).replaceAll("{{pre}}",h).replaceAll("{{count}}",f).replaceAll("{{index}}",n);let a=document.querySelector("body");a.append(c.firstChild);r=document.querySelector(".zoom-image");let t=r.querySelector(".btn-right-image"),i=r.querySelector(".btn-left-image"),v=r.querySelector(".btn-close-image"),o=r.querySelector(".cap-show");o.innerHTML=zoom.getTextCap(u);let l=o.querySelector(".view-more-cap");l!=undefined&&l.addEventListener("click",function(){o.innerHTML=u});v.addEventListener("click",function(){r.remove()});t.addEventListener("click",function(){let n=t.getAttribute("data-index");zoom.loadZoomImage(n,"next")});i.addEventListener("click",function(){let n=i.getAttribute("data-index");zoom.loadZoomImage(n,"pre")});r.addEventListener("swiped-left",function(){let n=t.getAttribute("data-index");zoom.loadZoomImage(n,"next")});r.addEventListener("swiped-right",function(){let n=i.getAttribute("data-index");zoom.loadZoomImage(n,"pre")})}else{let c=r.querySelector("img");c.outerHTML=t=="next"?'<img src="{{src}}" class="abs-center prevent-select goRight">'.replaceAll("{{src}}",e):'<img src="{{src}}" class="abs-center prevent-select goLeft">'.replaceAll("{{src}}",e);aLazyLoad.update();let i=r.querySelector(".cap-show");i.innerHTML=zoom.getTextCap(u);let o=i.querySelector(".view-more-cap");o!=undefined&&o.addEventListener("click",function(){i.innerHTML=u});let l=r.querySelector(".btn-right-image");l.setAttribute("data-index",s);let a=r.querySelector(".btn-left-image");a.setAttribute("data-index",h);let v=r.querySelector(".num-of-img");v.innerHTML=n+"/"+f}}},getTextCap:function(n){if(window.matchMedia("(max-width: 767px)").matches){function t(n,i){const u=t.canvas||(t.canvas=document.createElement("canvas")),r=u.getContext("2d");r.font=i;const f=r.measureText(n);return f.width}let r=document.querySelector(".cap-show"),i=r.offsetWidth;if(t(n,"16px arial")>2*i){let r=n.split(" "),u=0;for(let n=u;n<r.length;n++){let f=r.slice(u,n).join(" ");if(t(f,"16px arial")>i){u=n-1;break}}for(let n=u;n<r.length;n++){let f=r.slice(u,n).join(" ");if(t(f,"16px arial")>i)return r.slice(0,n).join(" ")+"... <span class='view-more-cap bold'>Xem thêm<\/span>"}}}return n}};zoom.init();interact={init:function(){let n=document.querySelector("#idAricle"),t=n!=undefined?n.value:"";interact.getListInteraction(t)},getListInteraction:function(n){if(n!=undefined){url="/Interaction/GetListArticleInteraction?ArticleId="+n;var t=new XMLHttpRequest;t.open("GET",url,!0);t.setRequestHeader("Content-Type","application/x-www-form-urlencoded");t.responseType="json";t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){var i=this.response.list;if(i.length>0){let u=document.getElementsByClassName("div-interaction")[0];u.classList.remove("hide");let r=document.getElementById("list_interaction");r.classList.add("list-interaction_"+i.length);let t="";for(let n=0;n<i.length;n++){let r=i[n];t=t+'<span class="btn-set-status" data-value="'+r.Interaction+'"><i class="'+r.IconClass+'"><\/i><span>'+r.CountShow+"<\/span><br>"+r.Name+"<\/span>"}t=t+'<span class="total-interaction"><\/span>';r.innerHTML=t;document.querySelectorAll(".btn-set-status").forEach(function(t){t.addEventListener("click",function(){if(!t.classList.contains("active")){let u,i=document.querySelector(".btn-set-status.active");if(i!=undefined){i.classList.remove("active");let n=i.querySelector("span");n!=undefined&&(n.innerText=parseInt(n.innerText)>1?parseInt(n.innerText)-1:"");u=i.getAttribute("data-value")}t.classList.add("active");let r=t.querySelector("span");r!=undefined&&(r.innerText=parseInt(r.innerText)>0?parseInt(r.innerText)+1:1);let f=t.getAttribute("data-value");interact.changeInteractionArticle(n,f,u);interact.setTotalInteract()}})})}interact.getInteractStorage(n);interact.setTotalInteract()}};t.send()}},changeInteractionArticle:function(n,t,i){if(n!=undefined&&t!=undefined){url="/Interaction/ChangeInteractionArticle";var r=new XMLHttpRequest;r.open("POST",url,!0);r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");r.responseType="json";r.onreadystatechange=function(){r.readyState==4&&r.status==200&&this.response.code>0&&interact.changeStorageInteract(n,t)};r.send("&ArticleId="+n+"&NewInteraction="+t+"&OldInteraction="+i)}},changeStorageInteract:function(n,t){let i=JSON.parse(localStorage.getItem("itr_"));if(t!=undefined)if(i!=null){let r=i[n];if(r!=undefined)i[n]=t,localStorage.setItem("itr_",JSON.stringify(i));else{let r="{"+JSON.stringify(i).replaceAll("{","").replaceAll("}","")+',"'+n+'":"'+t+'"}';localStorage.setItem("itr_",r)}}else{let i='{"'+n+'":"'+t+'"}';localStorage.setItem("itr_",i)}},getInteractStorage:function(n){let t=JSON.parse(localStorage.getItem("itr_"));if(t!=null){let i=t[n];if(i!=undefined){let n=document.querySelector('.btn-set-status[data-value="'+i+'"]');n!=undefined&&n.classList.add("active")}}},setTotalInteract:function(){let t="",n=0;document.querySelectorAll(".btn-set-status span").forEach(function(t){n+=parseInt(t.innerText)>0?parseInt(t.innerText):0});n>1&&(t=document.querySelector(".btn-set-status.active")!=undefined?'<i class="icon-cake "><\/i> Bạn và '+(n-1)+" người khác":'<i class="icon-cake "><\/i>'+n+" đã tặng");document.querySelector(".total-interaction").innerHTML=t}};interact.init();cmtjson={init:function(){var i="",r=document.querySelectorAll('.cout-cmt:not([data-set="1"])[data-articleid]'),t,n;for(let n=0;n<r.length;n++)t=r[n].getAttribute("data-articleid"),t!=null&&t!="{{id}}"&&(i=i+t+",");let u=qs("body").getAttribute("data-api");n=new XMLHttpRequest;n.open("POST",u+"/Home/GetJsonPageHome?ids="+i,!0);n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");n.onreadystatechange=function(){var r,t,i;if(n.readyState==4&&n.status==200&&(r=JSON.parse(this.responseText),t=r.pageHomeJson.listComment,t!=null))for(i=0;i<t.length;i++)document.querySelectorAll(".cout-cmt[data-articleid='"+t[i].articleId+"']").forEach(function(n){n.setAttribute("data-set",1);t[i].count>0&&(n.querySelector(".c-comment").innerText=t[i].count,n.style.display="inline-block")})};n.send()}};detail_={init:function(){window.onscroll=function(){let n=detail_.getCookie("bns_");if(n==undefined){let n=document.querySelector(".div-interaction");if(n!=undefined){let t=n.getBoundingClientRect().bottom;if(t<500){let n=document.querySelector(".box-news-suggession");if(n!=undefined){let t=n.querySelector(".box-container");if(t==undefined){n.innerHTML=tempC.boxNewsSuggession();detail_.setCookie("bns_","1");setTimeout(()=>{n.classList.add("hide")},3e4);let t=new XMLHttpRequest;t.open("GET","/NewsV2/GetDetailNewsSuggession",!0);t.setRequestHeader("Content-Type","application/x-www-form-urlencoded");t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){let i=JSON.parse(this.responseText),t=i.ListNews;if(t.length>0){let i=n.querySelector(".grid"),r=t.map(n=>tempA.ar1().replaceAll("{{id}}",n.Id).replaceAll("{{title}}",n.Title).replaceAll("{{href}}",n.DetailURL).replaceAll("{{data-src}}",n.Image.Medium).replaceAll("{{src}}",tempA.imgDefault())).join("");i.innerHTML=r;n.classList.remove("hide");aLazyLoad.update();let u=n.querySelector(".btn-hide-box-news");u.addEventListener("click",function(){n.classList.add("hide")})}}};t.send()}}}}}}},getCookie:function(n){let t={};return document.cookie.split(";").forEach(function(n){let[i,r]=n.split("=");t[i.trim()]=r}),t[n]},setCookie:function(n,t){var i=new Date,r;i.setTime(i.getTime()+36e5);r="expires="+i.toUTCString();document.cookie=n+"="+t+"; "+r+";path=/;"}};detail_.init(),function(n,t){"use strict";function h(n){var a;if(i===n.target){var h=parseInt(s(i,"data-swipe-threshold","20"),10),v=s(i,"data-swipe-unit","px"),y=parseInt(s(i,"data-swipe-timeout","500"),10),p=Date.now()-o,c="",l=n.changedTouches||n.touches||[];v==="vh"&&(h=Math.round(h/100*t.documentElement.clientHeight));v==="vw"&&(h=Math.round(h/100*t.documentElement.clientWidth));Math.abs(f)>Math.abs(e)?Math.abs(f)>h&&p<y&&(c=f>0?"swiped-left":"swiped-right"):Math.abs(e)>h&&p<y&&(c=e>0?"swiped-up":"swiped-down");c!==""&&(a={dir:c.replace(/swiped-/,""),touchType:(l[0]||{}).touchType||"direct",xStart:parseInt(r,10),xEnd:parseInt((l[0]||{}).clientX||-1,10),yStart:parseInt(u,10),yEnd:parseInt((l[0]||{}).clientY||-1,10)},i.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:a})),i.dispatchEvent(new CustomEvent(c,{bubbles:!0,cancelable:!0,detail:a})));r=null;u=null;o=null}}function c(n){n.target.getAttribute("data-swipe-ignore")!=="true"&&(i=n.target,o=Date.now(),r=n.touches[0].clientX,u=n.touches[0].clientY,f=0,e=0)}function l(n){if(r&&u){var t=n.touches[0].clientX,i=n.touches[0].clientY;f=r-t;e=u-i}}function s(n,i,r){while(n&&n!==t.documentElement){var u=n.getAttribute(i);if(u)return u;n=n.parentNode}return r}typeof n.CustomEvent!="function"&&(n.CustomEvent=function(n,i){i=i||{bubbles:!1,cancelable:!1,detail:undefined};var r=t.createEvent("CustomEvent");return r.initCustomEvent(n,i.bubbles,i.cancelable,i.detail),r},n.CustomEvent.prototype=n.Event.prototype);t.addEventListener("touchstart",c,!1);t.addEventListener("touchmove",l,!1);t.addEventListener("touchend",h,!1);var r=null,u=null,f=null,e=null,o=null,i=null}(window,document);box_wiki={initMenuContentWiki:function(){var t=document.getElementsByClassName("quick-view")[0],r,f;if(t!=undefined||t!=null){r=document.querySelectorAll(".edittor-content h3,.edittor-content h4");t.innerHTML='<div class="quick-view-menu"><div class="cursor-pointer quick-view-click"><a>Xem nhanh<\/a><a class="collapse-180 load-collapse"><\/a><\/div><div class="boxmenu-index"><\/div><\/div>';var u=document.getElementsByClassName("boxmenu-index")[0],n=1,i=1;r.forEach(t=>{t.tagName=="H3"?(t.setAttribute("id","section"+n),u.innerHTML+='<a class="wiki-menu parent_menu_'+n+'"  href="#section'+n+'">'+n+". "+t.innerText+"<\/a><br />",n++):(t.setAttribute("id","s"+n+"child"+i),u.innerHTML+='<a class="wiki-menu child-menu"  href="#s'+n+"child"+i+'">'+t.innerText+"<\/a><br />",i++);var r=document.querySelectorAll(".wiki-menu");r.forEach(n=>{n.addEventListener("click",t=>{t.preventDefault();var i=n.getAttribute("href"),r=document.querySelector(i);window.scrollTo(0,r.offsetTop-50)})})});f=document.getElementsByClassName("quick-view-click")[0];f.addEventListener("click",function(){var n=document.getElementsByClassName("load-collapse")[0],t=document.getElementsByClassName("boxmenu-index")[0];let i=document.querySelectorAll(".quick-view .collapse-180");i.length>0?(t.classList.add("hide"),n.classList.remove("collapse-180"),n.classList.add("collapse-0")):(t.classList.remove("hide"),n.classList.remove("collapse-0"),n.classList.add("collapse-180"))})}}};detail={init:function(){function r(){document.getElementById("txt_content").focus()}var f=document.querySelector('meta[name="tt_category_id"]').getAttribute("value"),e=qs("body").getAttribute("data-contenttype"),o=document.querySelector("#idAricle").value,n=document.querySelector(".widget_vote"),t,i,u;if(n!=null&&(t=n.getAttribute("data-id")),i=Array.from(document.querySelectorAll(".cout-cmt")).map(function(n){return n.getAttribute("data-articleid")}).join(","),AjaxGet("/NewsV2/GetDetail?aid="+o+"&pid="+t+"&cateCode="+f+"&ids="+i,function(n){var t=JSON.parse(n),i,r;typeof template_poll!="undefined"&&(i=template_poll.template_poll_detail(t.PollShowModel),r=document.querySelector(".widget_vote"),r!=null&&(document.querySelector(".widget_vote").innerHTML=i));let u=document.querySelector("body").getAttribute("data-tracking");AjaxPost(u+"/Tracking/Track","&se="+encodeURIComponent(t.SessionTracking))}),document.querySelector(".btn-sharefb").addEventListener("click",function(){var n=window.location.href;window.open("http://facebook.com/sharer/sharer.php?u="+encodeURIComponent(n),"","left=50%,top=50%,width=650,height=420,personalbar=0,toolbar=0,scrollbars=0,resizable=0")}),document.querySelector(".btn-copy-link").addEventListener("click",function(){var n=this.getAttribute("data-href");navigator.clipboard.writeText(n)}),document.querySelector(".btn-shareTwitter").addEventListener("click",function(){var n=document.querySelector('meta[name="twitter:url"]').getAttribute("content"),t=document.querySelector('meta[name="twitter:title"]').getAttribute("content"),i="https://twitter.com/intent/tweet?original_referer="+encodeURIComponent(n)+"&ref_src=twsrc%5Etfw&text="+t+"&tw_p=tweetbutton&url="+encodeURIComponent(n);window.open(i,"","left=50%,top=50%,width=650,height=420,personalbar=0,toolbar=0,scrollbars=0,resizable=0")}),document.querySelector(".act-comment").addEventListener("click",function(){document.getElementById("txt_content").focus()}),u=location.hash,u=="#cmt"&&r(),window.addEventListener("hashchange",function(){var n=location.hash;n=="#cmt"&&r()},!1),e=="2"){let n=qa(".edittor-content .video-element:not([data-poster])");n.length>0?(detail.loadVideo(),detail.bindEventScrollVideo()):detail.initVideoEvent()}else detail.loadVideo(),detail.bindEventScrollVideo();detail.bindEventScroll();document.addEventListener("keydown",function(n){n.key==="Escape"&&qs(".zoom-image")!=undefined&&qs(".zoom-image").remove()});typeof box_wiki!="undefined"&&box_wiki.initMenuContentWiki()},loadIframeFix:function(n){var i,f;let r='<div class="div-video"><div class="pic-news relative w-full"><iframe src="'+n+'" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" class="isvideoplayer"><\/iframe><\/div><\/div>',u=qs(".show-video .div-video");if(u==null){i=document.createElement("div");i.innerHTML='<div class="full-video show-video"><div class="overlay"><\/div><span class="btn-close cursor">X<\/span><a href="/"><img class="img-zoom-logo" src="/Content/Emagazine/theme/images/logo.png" alt="Báo điện tử VTC News"><\/a>{{iframe}}<\/div>'.replaceAll("{{iframe}}",r);f=qs("body");f.append(i.firstChild);var t=qs(".show-video"),e=t.querySelector(".overlay"),o=t.querySelector(".btn-close");e.addEventListener("click",function(){t.classList.remove("full-video");t.classList.add("min-video")});window.addEventListener("scroll",()=>{t.classList.remove("full-video"),t.classList.add("min-video")});o.addEventListener("click",function(){t.remove()})}else{u.outerHTML=r;let n=qs(".show-video.min-video");n!=null&&(n.classList.add("full-video"),n.classList.remove("min-video"))}},loadVideoById:function(n){var i,u;let r=qs(".show-video");r!=null&&r.remove();i=document.createElement("div");i.innerHTML='<div class="full-video show-video"><div class="overlay"><\/div><span class="btn-close cursor">X<\/span><a href="/"><img class="img-zoom-logo" src="/Content/Emagazine/theme/images/logo.png" alt="Báo điện tử VTC News"><\/a><div class="div-video"><div class="div-fill-video w-full relative pic-news"><\/div><\/div><\/div>';u=qs("body");u.append(i.firstChild);let t=qs(".show-video"),f=t.querySelector(".overlay"),e=t.querySelector(".btn-close");f.addEventListener("click",function(){t.classList.remove("full-video");t.classList.add("min-video")});window.addEventListener("scroll",()=>{t.classList.remove("full-video"),t.classList.add("min-video")});e.addEventListener("click",function(){t.remove()});AjaxGet("/WatchAjax/"+n,function(t){var f=JSON.parse(t),s,i,r,e,u,h,a;f=JSON.parse(f);s=[];let o=n.replaceAll("=[]=","/");if(i=null,f.hasOwnProperty(o)){if(r=qs(".show-video .div-fill-video"),r!=null&&(r.innerHTML=f[o],o=="AdsVideo"))for(e=JSON.parse(f[o]),u=0;u<e.length;u++)s.push({offset:e[u].Offset,tag:e[u].Tag,type:e[u].Type});if(h=350,i=r.querySelector("div.video-ajax"),i!=null){var c=i.getAttribute("data-isBlockAds"),v=i.getAttribute("data-geo"),l={};(c==undefined||c==null||c=="False")&&(l={admessage:"This video will resume in xx seconds",adscheduleid:"IIXD2Cza",client:"googima",cuetext:"Advertisement",preloadAds:!0,rules:{startOnSeek:"pre",timeBetweenAds:0},schedule:s,skipmessage:"Skip ad in xx seconds",vpaidcontrols:!1,vpaidmode:"insecure"});v!=""?(a=jwplayer(i.getAttribute("id")).setup({image:i.getAttribute("poster"),file:i.getAttribute("vfile"),height:h,width:"100%",autostart:!0,advertising:l}),r.setAttribute("data-loaded","done")):(a=jwplayer(i.getAttribute("id")).setup({image:i.getAttribute("poster"),file:i.getAttribute("vfile"),height:h,width:"100%",autostart:!0,advertising:l}),r.setAttribute("data-loaded","done"))}}})},loadScript:function(n,t,i){var r=document.createElement("script");r.type="text/javascript";r.readyState?r.onreadystatechange=function(){(r.readyState=="loaded"||r.readyState=="complete")&&(r.onreadystatechange=null,t(),i&&r.remove())}:r.onload=function(){t();i&&r.remove()};r.src=n;document.getElementsByTagName("head")[0].appendChild(r)},loadVideo:function(){var f=qa(".edittor-content iframe.isvideoplayer"),i,t,n,r,u;for(f.forEach(function(n){var t=350;let i=n.getAttribute("data-width"),r=n.getAttribute("data-height"),u=1;i!=undefined&&r!=undefined&&(u=i/r,t=Math.round(qs(".edittor-content").clientWidth/u));n.setAttribute("width","100%");n.setAttribute("height",t)}),i=document.querySelectorAll('.video-element:not([data-loaded="done"]):not([data-status="running"]):not([data-onscreen="true"])'),n=0;n<i.length;n++)isInViewport(i[n])&&i[n].setAttribute("data-onscreen","true");for(t=document.querySelectorAll('.video-element[data-onscreen="true"]:not([data-loaded="done"]):not([data-status="running"])'),n=0;n<t.length;n++)t[n].setAttribute("data-status","running");r=document.querySelector("body").getAttribute("data-cache");r==undefined&&(r=1111);t.length>0&&(u="/Content/plugin/jw/HAHlWoBL.js?v="+r,detail.loadScript(u,function(){for(var n,i=0;i<t.length;i++)n=t[i].getAttribute("data-id"),n!==null&&n!==undefined&&n.length>0&&(n=n.replace(/\//g,"=[]="),AjaxGet("/WatchAjax/"+n,function(n){var i=JSON.parse(n),o,t,f,r,s,e,u,h,a;i=JSON.parse(i);o=[];for(r in i)if(i.hasOwnProperty(r)&&(s=document.querySelector('.video-element[data-id="'+r+'"]'),s!=null&&(f=s,f.innerHTML=i[r],t=f.querySelector("div.video-ajax")),r=="AdsVideo"))for(e=JSON.parse(i[r]),u=0;u<e.length;u++)o.push({offset:e[u].Offset,tag:e[u].Tag,type:e[u].Type});if(h=350,t!=null){var c=t.getAttribute("data-isBlockAds"),v=t.getAttribute("data-geo"),l={};(c==undefined||c==null||c=="False")&&(l={admessage:"This video will resume in xx seconds",adscheduleid:"IIXD2Cza",client:"googima",cuetext:"Advertisement",preloadAds:!0,rules:{startOnSeek:"pre",timeBetweenAds:0},schedule:o,skipmessage:"Skip ad in xx seconds",vpaidcontrols:!1,vpaidmode:"insecure"});v!=""?(a=jwplayer(t.getAttribute("id")).setup({image:t.getAttribute("poster"),file:t.getAttribute("vfile"),height:h,width:"100%",advertising:l}),f.setAttribute("data-loaded","done")):(a=jwplayer(t.getAttribute("id")).setup({image:t.getAttribute("poster"),file:t.getAttribute("vfile"),height:h,width:"100%",advertising:l}),f.setAttribute("data-loaded","done"))}}))},!1))},initVideoEvent:function(){let i=qa(".edittor-content iframe.isvideoplayer");i.forEach(function(n){let t=n.getAttribute("src"),i="https://img.youtube.com/vi/"+t.substring(t.lastIndexOf("/")+1)+"/0.jpg";n.outerHTML='<figure class="w-full pic thumbs-video lh0 relative"><a data-iframe="'+t+'" class="w-full pic-iframe" href="javascript:;" ><img src="'+i+'"  style="width: 100%;cursor:pointer;"><span class="video-play btn-vi03 w50 h50 lh-48 font14 tc" href="#"><i class="icon-play-4"><\/i><\/span><\/a><\/figure>'});let r=qa(".pic-iframe");r.forEach(function(n){n.addEventListener("click",function(){console.log("e_imgThumb");detail.loadIframeFix(n.getAttribute("data-iframe"))})});let t=qa(".edittor-content .video-element");if(t.length>0){let t=document.querySelector("body").getAttribute("data-cache");t==undefined&&(t=1111);let i="/Content/plugin/jw/HAHlWoBL.js?v="+t;var n=document.createElement("script");n.type="text/javascript";n.src=i;document.getElementsByTagName("head")[0].appendChild(n)}t.forEach(function(n){let t=n.getAttribute("data-poster");t!=null&&(t=t.replaceAll("vtc16","vtc"));let i=n.getAttribute("data-id").replace(/\//g,"=[]=");n.outerHTML='<figure class="lh0 clearfix w-full"><a class="w-full fl pic-news relative pic-video-play" data-id="'+i+'" href="javascript:;"><img style="cursor: pointer;"  src="'+t+'" ><span class="video-play btn-vi03 w50 h50 lh-48 font14 tc"><i class="icon-play-4"><\/i><\/span><\/a><\/figure>'});let u=qa(".pic-video-play");u.forEach(function(n){n.addEventListener("click",function(){let t=n.getAttribute("data-id");detail.loadVideoById(t)})})},bindEventScrollVideo:function(){window.addEventListener("scroll",()=>{const n=window.pageYOffset;if(n<=0){body.classList.remove(scrollUp);return}detail.loadVideo();lastScroll=n})},bindEventScroll:function(){var i=document.querySelector(".is-footer"),t=[],r=window,n=!1;window.addEventListener("scroll",()=>{var f,r;const o=window.pageYOffset;if(f=qs(".trend-detail section.list-trend"),r=qs("div.view-more"),r!=null){var u=r.querySelector("a").getAttribute("href"),s=isInViewport(r),e=r;u!=null&&u!=""?s&&(n||u==this.undefined||(n=!0,r.remove(),AjaxGet(u,function(i){var r=document.createElement("html"),u,o;r.innerHTML=i.trim();t=r.querySelectorAll("section article,section .sys-ads");t.forEach(n=>{f.appendChild(n)});u=r.querySelector(".view-more a");u!=null&&(o=u.getAttribute("href"),e.querySelector("a").setAttribute("href",o),f.appendChild(e));aLazyLoad.update();t=[];n=!1}))):n||(i.style.display="none")}lastScroll=o})}};detail.init();news_detail={init:function(){var t,i,n;let r=news_detail.tempWaitingAreal("Cùng chuyên mục","samecateid"),u=news_detail.tempWaitingAreal("Tin mới","trendid"),f=document.getElementsByClassName("same-cate")[0],e=document.getElementsByClassName("trend-detail")[0],o=document.getElementById("hotid");f.innerHTML=r;e.innerHTML=u;t=document.getElementById("samecateid");i=document.getElementById("trendid");for(let i=0;i<5;i++)n=document.createElement("div"),n.innerHTML=news_detail.templateItemsEmpty(),t.appendChild(n.firstChild);for(let t=0;t<30;t++)n=document.createElement("div"),n.innerHTML=news_detail.templateItemsEmpty(),i.appendChild(n.firstChild);for(let t=0;t<5;t++)n=document.createElement("div"),n.innerHTML=news_detail.templateItemsEmptyHot(),n.childNodes.forEach(function(n){o.appendChild(n)});news_detail.loadData()},templateListImage:function(n){var f,t,i;let r='<span class="w167 h109 fl mr10 {{lastimage}}"> <img alt="{{title}}" class="lazy" data-src="{{src}}" src="data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs="> <\/span>',u="";for(f=n.split(";"),t=0;t<4;t++)i="",i=t==3?r.replaceAll("{{lastimage}}","last"):r.replaceAll("{{lastimage}}",""),u+=i.replaceAll("{{src}}",f[t]);return'<article class="items-photo bor-bot-e5 pb15 mb15 clearfix {{last}}"> <div class="mb5"><h3 class="font18 bold lh-1-3"> <a href="{{href}}" title="{{title}}"><i class="icon-camera mr5 gray-91"><\/i>{{title}}<\/a><\/h3> <\/div> <div class="mb10 gray-91 font12"> <span class="mt-category red uppercase semibold font11 relative pr10">{{catename}}<\/span> <span class="time-update mr10">{{datetime}}<\/span> <span class="cout-cmt red font13" data-articleId="{{id}}"><i class="icon-comment-6 mr2"><\/i> <span class="c-comment">{{countcomment}}<\/span> <\/span> <\/div> <figure class="relative lh0"> <a class="pic w-full clearfix" href="{{href}}" title="{{title}}"> {{listimage}} <\/a> <\/figure> <\/article>'.replaceAll("{{listimage}}",u)},templateListNomal:function(){return'<article class="ar1 clearfix fadeInUp pr10 pl10"><figure class="figure-fit"><a href="{{href}}"><img alt="{{title}}" data-src="{{src}}" src="data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACwAAAAAAQABAEACAkQBADs="><\/a><\/figure><h3><a data-icon="{{icon}}" href="{{href}}" title="{{title}}">{{title}}<span class="cout-cmt red font13 ml5" data-articleid="{{id}}" data-set="0"><i class="icon-comment-6"><\/i><span class="c-comment"><\/span><\/span><\/a><\/h3><footer class="not-hide"><span class="mt-category red uppercase semibold font11 relative pr10">{{catename}}<\/span><span class="time-update mr10">{{datetime}}<\/span><\/footer><p>{{des}}<\/p><\/article>'},tempWaitingAreal:function(n,t){let i='<section class="list-trend clearfix list-articles mt20 last-bor-bot" id="'+t+'" data-page="1"><header class="title relative mb10 bg-gray-f0 bor-2top-red font15 uppercase bold lh-38 pl10 pr10 red">{{title}}<\/header><\/section>';return i.replace("{{title}}",n)},templateItemsEmpty:function(){return'<article class="items bor-bot-e5 pb15 mb15 clearfix" style="height: 170px;"> <figure class="pic lh0 w240 h157 relative fl thumb emline" style="float: left;width: 33%;height: 100%;display: block;"> <\/figure><div class="pl255 mb5"><div class="font18 bold lh-1-3 emline w-90-100"> <a href=""><\/a><\/div><\/div><div class="pl255 mb5"><div class="font18 bold lh-1-3 emline w-50-100"> <a href=""><\/a><\/div><\/div><div class="pl255 mb5"><div class="font18 bold lh-1-3 emline w-60-100"> <a href=""><\/a><\/div><\/div><div class="pl255 mb5"><div class="font18 bold lh-1-3 emline w-90-100"> <a href=""><\/a><\/div><\/div> <\/article>'},templateItemsEmptyHot:function(){return'<article class="items pb7 mb7 pl40 relative clearfix"> <span class="red font-clasic font40 lh-60 abs35 emline"><\/span><div class="pl10 bor-left-e5"><div class="font18 bold font-clasic lh-1-3 emline w-70-100"><\/div><div class="font18 bold font-clasic lh-1-3 emline w-40-100"><\/div><div class="mt5 gray-91 font12"> <span class="time-update mr10 emline w-50-100"><\/span> <span class="cout-cmt red font13"> <i class="icon-comment-6 mr2"><\/i> <\/span><\/div><\/div> <\/article>'},templateHot:function(){return'<article class="items pb7 mb7 pl40 relative clearfix fadeInUp"> <span class="red font-clasic font40 lh-60 abs35">{{number}}<\/span><div class="pl10 bor-left-e5"><h3 class="font18 bold font-clasic lh-1-3"> <a href="{{href}}" title="{{title}}">{{title}}<\/a><\/h3><div class="mt5 gray-91 font12"> <span class="time-update mr10">{{datetime}}<\/span> <span class="cout-cmt red font13" data-articleid="{{id}}"> <i class="icon-comment-6 mr2"><\/i> <span class="c-comment">{{countcomment}}<\/span> <\/span><\/div><\/div> <\/article>'},loadData:function(){let t=document.querySelector("meta[name='tt_category_id']").getAttribute("content"),i=document.querySelector("meta[name='tt_category_id']").getAttribute("value"),r=document.getElementById("idAricle").getAttribute("value");var n=new XMLHttpRequest;return n.open("POST","chi-tiet",!0),n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.onreadystatechange=function(){if(n.readyState==4&&n.status==200){var t=JSON.parse(this.responseText).DetailListItemModel,i=document.querySelector("section#samecateid"),r=document.querySelector("section#trendid"),u=document.querySelector("section#hotid");news_detail.appendContent(i,t.ListSameCate.ListItem);news_detail.appendContent(r,t.ListTrend.ListItem,t.ListTrend.Page);news_detail.appendContentHot(u,t.ListHot.ListItem);cmtjson.init()}},n.send("categoryId="+t+"&articleId="+r+"&parentCateId="+i),n.responseText},appendContent:function(n,t){var u=n.querySelectorAll("article"),r,i;u.forEach(function(n){n.parentNode.removeChild(n)});for(let u=0;u<t.length;u++){let f="";f=news_detail.templateListNomal();r=new Date(parseInt(t[u].PublishedDate.substr(6)));i=document.createElement("div");f=f.replaceAll("{{src}}",t[u].Image.Medium).replaceAll("{{title}}",t[u].Title).replaceAll("{{catename}}",t[u].CategoryName).replaceAll("{{des}}",t[u].Description).replaceAll("{{datetime}}",news_detail.formatdatetime(r)).replaceAll("{{href}}",t[u].DetailURL).replaceAll("{{id}}",t[u].Id).replaceAll("{{icon}}",t[u].IconType).replaceAll("{{countcomment}}","").replaceAll("{{last}}","");i.innerHTML=f;n.appendChild(i.firstChild)}try{aLazyLoad.update()}catch(f){}},appendContentHot:function(n,t){var u=n.querySelectorAll("article"),r,i;u.forEach(function(n){n.parentNode.removeChild(n)});n.innerHTML='<header class="font15 uppercase bold lh-38 pl10 pr10 white bg-red mb15"><i class="icon-target-3 mr2"><\/i>Xem nhiều<\/header>';for(let u=0;u<t.length;u++){let f="";f=news_detail.templateHot();r=new Date(parseInt(t[u].PublishedDate.substr(6)));i=document.createElement("div");f=f.replaceAll("{{title}}",t[u].Title).replaceAll("{{catename}}",t[u].CategoryName).replaceAll("{{des}}",t[u].Description).replaceAll("{{datetime}}",news_detail.formatdatetime(r)).replaceAll("{{href}}",t[u].DetailURL).replaceAll("{{id}}",t[u].Id).replaceAll("{{countcomment}}","").replaceAll("{{number}}",u+1);i.innerHTML=f;n.appendChild(i.firstChild)}try{aLazyLoad.update()}catch(f){}},formatdatetime:function(n){var t=new Date(n),i=t.getHours(),r=t.getMinutes(),u=t.getDate(),f=t.getMonth()+1,e=t.getFullYear();return(i<=9?"0"+i:i)+":"+(r<=9?"0"+r:r)+" "+(u<=9?"0"+u:u)+"/"+(f<=9?"0"+f:f)+"/"+e}};news_detail.init();template_poll={template_poll_detail:function(n){var t="",i="",r;if(n.PollInfo!=null){for(t='<aside class="box-prob border pd15 w-50-100 fl mr15 bg-gray-f9 relative tl">    <header class="mb5 bold tile-subbox fix-tile-subbox relative inline font14">Thăm dò ý kiến<\/header>    <input type="hidden" class="key" value="{{Token}}">    <div class="font22 lh-1-2 mb15 font-clasic">        <sup><i class="icon-quote-left-1 gray-51 font18"><\/i><\/sup>{{Title}}    <\/div>{{SubItem}}    <div class="mt15 font14">        <a class="bg-red lh-35 pl15 pr15 white cursor bold inline po-action" style="display: inline-block; color:#fff;">Bỏ phiếu<\/a>        <a class="lh-35 gray-51 cursor ml10 underline po-show" style="display: inline-block; color:#515151;">Xem kết quả<\/a>    <\/div><\/aside>'.replace("{{Token}}",n.Token),t=t.replace("{{Title}}",n.PollInfo.Title),r=0;r<n.PollObtionInfo.length;r++)i=i+'<label class="cho-option relative pl30 gray-51 font15 mb5 pt5 pb5 pr5 bg-gray-e5">            <input type="radio" class="abs31" value="{{Id}}" name="vote">{{OptionDetails}}        <\/label>'.replace("{{Id}}",n.PollObtionInfo[r].id),i=i.replace("{{OptionDetails}}",n.PollObtionInfo[r].OptionDetails);t=t.replace("{{SubItem}}",i)}return t}};elementPosition=function(n){var t=$(n),i=t.offset();return{top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),left:i.left,height:parseFloat(getComputedStyle(t.get(0),null).height.replace("px",""))}};pickerTime=qs(".picker-time");setInterval(function(){pickerTime.innerHTML=setTimer()},1e3);goTop=qs(".gotop");setTimeout(function(){window.pageYOffset>0&&(goTop.style.display="block");goTop.addEventListener("click",function(){window.scrollTo(0,0)});document.addEventListener("scroll",()=>{goTop.style.display=window.pageYOffset>0?"block":"none"},{passive:!0})});const body=document.body;poll={getResult:function(n){url="/Poll/GetResult";var t=new XMLHttpRequest;t.open("POST",url,!0);t.setRequestHeader("Content-Type","application/x-www-form-urlencoded");t.onreadystatechange=function(){if(t.readyState==4&&t.status==200){var i=this.response,n=document.createElement("div");n.innerHTML='<div class="div-pool">'+i+"<\/div>";qs("body").append(n.firstChild);qs(".mfp-close").addEventListener("click",function(){qs(".div-pool").remove()});qs(".mark").addEventListener("click",function(){qs(".div-pool").remove()})}};t.send(n)},init:function(){var n=qs(".widget_vote"),t;n!=null&&(t=n.getAttribute("data-id"),n.addEventListener("click",i=>{var f,o,s,r,u;let e=i.target;if(e.classList.contains("po-action")){if(f=n.querySelector('input[name="vote"]:checked'),f==null){alert("Hãy chọn một mục trước khi biểu quyết");return}o=f.value;s=qs(".key").value;url="/Poll/Vote";u="&id="+t+"&option="+o+"&key="+s;r=new XMLHttpRequest;r.open("POST",url,!0);r.setRequestHeader("Content-Type","application/x-www-form-urlencoded");r.onreadystatechange=function(){if(r.readyState==4&&r.status==200){var n=JSON.parse(this.response);(n.Code==2||n.Code==1)&&poll.getResult(u)}};r.send(u)}e.classList.contains("po-show")&&(u="&id="+t,poll.getResult(u))}))}};poll.init();templateDetail={topnewshot:function(n){var i,r;if(n==null)return"";var t="";for(i=0;i<n.length;i++)r=templateDetail.formatdatetime(n[i].PublishedDate),t=t+'<article class="items pb7 mb7 pl40 relative clearfix" > <span class="red font-clasic font40 lh-60 abs35">{{stt}}<\/span><div class="pl10 bor-left-e5" > <header> <h2 class="font18 bold font-clasic lh-1-3"> <a href="{{url}}" title="{{title}}">{{title}}<\/a> <\/h2> <\/header> <footer class="mt5 gray-91 font12"> <span class="time-update mr10">{{datetime}}<\/span><span class="cout-cmt red font13" data-articleid="{{ArticleId}}" ><i class="icon-comment-6 mr2"><\/i><span class="c-comment">0<\/span><\/span> <\/article>'.replace("{{stt}}",i+1),t=t.replace("{{url}}","/"+n[i].SEOSlug+"-ar"+n[i].Id+".html"),t=t.replace("{{title}}",n[i].Title).replace("{{title}}",n[i].Title),t=t.replace("{{datetime}}",r),t=t.replace("{{ArticleId}}",n[i].Id);return'<header class="title mb15 relative bg-red bor-3top-yellow"> <h3 class="font15 uppercase bold lh-38 pl10 pr10 white"><i class="icon-target-3 mr2"><\/i>Đọc nhiều<\/h3> <\/header>'+t},formatdatetime:function(n){var t=new Date(n),i=t.getHours(),r=t.getMinutes(),u=t.getDate(),f=t.getMonth()+1,e=t.getFullYear();return(i<=9?"0"+i:i)+":"+(r<=9?"0"+r:r)+" "+(u<=9?"0"+u:u)+"/"+(f<=9?"0"+f:f)+"/"+e},slidetemplate:function(){return'<div class="col-xs-6 col-sm-4 col-md-3 items" data-responsive="{{responsive}}" data-src="{{url}}" data-sub-html="{{description}}"><a href=""><img class="img-responsive" src="{{thumb_image}}"> <\/a><\/div>'}}