var Custom={amountLaprap:50,player:null,init:function(){Custom.handlerWhenScroll(),Custom.handlerFilterAnchorWhenScroll(),Custom.handlerClickViewmore(),Custom.handlerSlideCommon(),$(".icon-playing").length>0&&Custom.handlerClickVideoEmbed(),$(".banner-sticky-mobile-image").length>0&&$(".cpn-floaticon-container").length>0&&$(".cpn-floaticon-container").hide()},handlerslideAutoVideo:function(){},tableTamtinhchiphilanbanh:function(){$(".tblnormal").length>0&&null!=$(".tblnormal")&&$(".tblnormal").each((function(){$(this).attr("data-classificationname"),$(this).attr("data-numberofseat");var e="Laprap"==$(this).attr("data-xuatxu");if("undefined"!=typeof arrRegistrationFeeReduction&&!e){var t=$("input[name='modelId']").val();-1!=arrRegistrationFeeReduction.indexOf(t)&&(e=!0)}if(e){var n=$(this).find(".phitruocbaHN"),a=$(this).find(".phitruocbaTPHCM"),o=$(this).find(".phiTruocBaQN"),i=$(this).find(".phiTruocBaHT"),r=$(this).find(".phiTruocBaOther"),d=$(this).find(".tongcartongHN"),l=$(this).find(".tongcartongTPHCM"),s=$(this).find(".tongcartongQN"),h=$(this).find(".tongcartongHT"),c=$(this).find(".tongcartongOther");Custom.handlerLaprap(n,d),Custom.handlerLaprap(a,l),Custom.handlerLaprap(o,s),Custom.handlerLaprap(i,h),Custom.handlerLaprap(r,c)}}))},handlerLaprap:function(e,t){var n,a=e.text().replace(/[^0-9]/g,""),o=a*Custom.amountLaprap/100;n=t.text().replace(/[^0-9]/g,"")-a+o,e.text(Custom.handerFormatNumber(o)),t.text(Custom.handerFormatNumber(n))},handerFormatNumber:function(e){return(e=-1!=e.toString().indexOf(".")?e.toFixed(2):e).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1.")},handlerWhenScroll:function(){var e=parseInt($("#header .head-top").height()),t=$(window).scrollTop()+parseInt($("#header .head-top").height());$(window).scroll((function(){var n=$(window).scrollTop();n>e?(n>t?$("#header").stop().addClass("hide-header"):$("#header").stop().removeClass("hide-header"),t=n):$("#header").stop().removeClass("hide-header")}))},handlerFilterAnchorWhenScroll:function(){var e=parseInt($("#menu-neo").height()),t=$(window).scrollTop()+parseInt($("#head-mobile").height());$(window).scroll((function(){var n=$(window).scrollTop();n>e?(n>t?$("#menu-neo").stop().addClass("not-fixed-head-top"):$("#menu-neo").stop().removeClass("not-fixed-head-top"),t=n):$("#menu-neo").stop().removeClass("not-fixed-head-top")}))},handlerClickViewmore:function(){var e=$(".btn-viewmore-link a");objCusor=e.data("obj"),e.on("click",(function(){event.preventDefault(),$("."+objCusor).toggleClass("hidden"),$("."+objCusor).hasClass("hidden")?e.text("Xem thêm"):e.text("Thu gọn")}))},handlerSlideCommon:function(){$(".box_banner_slider_mobile").length>0&&"undefined"!=typeof Swiper&&new Swiper(".box_banner_slider_mobile .swiper-container",{slidesPerView:"auto",preloadImages:!1,lazyLoadingInPrevNext:!0,lazyLoading:!0,lazy:{loadPrevNext:!0},paginationClickable:!1,spaceBetween:10,loop:!0,paginationType:"bullets",autoplayDisableOnInteraction:!1,autoplay:1e4,pagination:".box_banner_slider_mobile .swiper-pagination"})},handlerLoadMoreAutoVideo:function(e){this.urlAction="/load-list-auto-chunk";var t=$(e),n=t.attr("data-index"),a=t.attr("data-pagesize"),o=t.attr("data-notid"),i=t.attr("data-outsize");t.attr("data-index",parseInt(n)+1),i<parseInt(n)+1&&t.addClass("hidden"),$.ajax({type:"POST",cache:!1,url:this.urlAction,data:{pageIndex:n,pageSize:a,notID:o},beforeSend:function(){t.addClass("btn-loading")},success:function(e){if(""!=e)if($("#list-auto-video").append(e),$("#list-auto-video").find(".page-"+n).length>0){var a=$("#list-auto-video").find(".page-"+n).offset().top;document.documentElement.scrollTop=a}else t.addClass("hidden");else t.addClass("hidden");t.removeClass("btn-loading"),event.preventDefault(),lazyLoading.init()}})},handlerClickVideoEmbed:function(e){$(".video-mb-click").off().on("click",(function(){$(this).children("img").hide(),$(this).children(".icon-playing").hide();var e=$(this).children("img").height(),t=$(this).attr("data-youtubeid");return $(this).children(".video-embed").addClass("open"),t=$(this).attr("data-youtubeid"),Custom.player=new YT.Player("ytplayer",{height:e,width:"100%",videoId:t,playerVars:{autoplay:1},events:{onReady:Custom.handerCallbackVideoPlayer}}),$(".video-embed iframe").css("min-height",e),!1})),$(".btn-next, .btn-prev").on("click",(function(){Custom.player.pauseVideo()}))},handerCallbackVideoPlayer:function(e){e.target.playVideo()}},FAQBox={handlerOpenFAQ:function(e){var t=$(e),n=t.parent().children(".box-content"),a=t.children(".icon-sub");n.hasClass("in")?n.removeClass("in"):n.addClass("in"),a.hasClass("up")?a.removeClass("up"):a.addClass("up")}},cookieJS={setCookie:function(e,t,n){var a=new Date;a.setTime(a.getTime()+60*n*1e3);var o="expires="+a.toUTCString();document.cookie=e+"="+t+";; domain="+domainOfCookieName+";"+o+";path=/"},getCookie:function(e){for(var t=e+"=",n=document.cookie.split(";"),a=0;a<n.length;a++){for(var o=n[a];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},checkCookie:function(e){return""!=getCookie(e)}};function setCookie(e,t,n){var a=new Date;a.setTime(a.getTime()+1*n*1*60*1e3);var o="expires="+a.toUTCString();document.cookie=e+"="+t+";"+o+";path=/"}function getCookie(e){for(var t=e+"=",n=document.cookie.split(";"),a=0;a<n.length;a++){for(var o=n[a];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""}