function handleCredentialResponse(n){let t=n.credential;console.log("Encoded JWT ID token: "+t);$.ajax({type:"POST",url:"/Account/GoogleLoginCallback",data:{id_token:t},dataType:"JSON",beforeSend:function(){typeof CommonsEvent!="undefined"&&typeof CommonsEvent.Loading=="function"&&CommonsEvent.Loading()},success:function(n){if(n.ErrorCode=="success"){var t=$("#hddSocialReturnUrl").val();location.href=t!=""?t:location.href}else alert("Not login. Please login late.")},complete:function(){typeof CommonsEvent!="undefined"&&typeof CommonsEvent.Loaded=="function"&&CommonsEvent.Loaded()}})}var initEventLoginSocial={initEventGoogle:!1,client_id:$("#hddSocialGoogleClientId").val(),loadGoogleClientId:function(){const n=this;google.accounts.id.initialize({client_id:n.client_id,callback:globalThis.handleCredentialResponse})},renderLoginGoogleButton:function(){const n=this;n.loadGoogleClientId();google.accounts.id.renderButton(document.getElementById("btn_google_login"),{theme:"outline",size:"large",locale:"en_US",width:window.innerWidth-20});n.displayOneTapGoogleDialog();$(".box-fb-google .btn-fb").css("width",$(".box-fb-google #btn_google_login").width())},renderLoginGoogleButtonInPopup:function(){const n=this;n.loadGoogleClientId();google.accounts.id.renderButton(document.getElementById("btn_google_login_in_popup"),{theme:"outline",size:"large",locale:"en_US"});n.displayOneTapGoogleDialog()},displayOneTapGoogleDialog:function(){google.accounts.id.prompt()}},CompareCar,AutoSavingWeb;$(function(){window.location.hash&&window.location.hash=="#_=_"&&(window.location.hash="");$("#btn_google_login").length>0&&$("#hddSocialGoogleClientId").length>0&&($("#hddUserId").val()==""||$("#hddUserId").val()==undefined)&&initEventLoginSocial.renderLoginGoogleButton()});CompareCar={addId:function(n,t){var i,r;if(typeof Storage!="undefined"){if(i=CompareCar.getListId(),i!=null&&i!=undefined){if(i.split(",").length>1)return MsgBox.MessageError("Maximum limit exceeded! You can only compare a maximum of 2 cars at a time"),!1;if(r=","+i+",",r.search(","+n+",")==-1)i+=","+n;else return MsgBox.MessageError("This listing has been added to comparison."),!1}else i=n;localStorage.setItem("lstComparisonId",i);this.changeHtml(t,!0,n);this.changeLink(i,!1)}},getListId:function(){if(typeof Storage!="undefined")return localStorage.getItem("lstComparisonId")},cancelItem:function(n,t){this.removeId(n);this.changeHtml(t,!1,n)},removeId:function(n){var u,i,r,t;if(typeof Storage!="undefined"&&(u=CompareCar.getListId(),u!=null&&u!=undefined)){for(i="",r=u.split(","),t=0;t<r.length;t++)r[t]!=""&&r[t]!=n&&(i+=i==""?r[t]:","+r[t]);i!=""?localStorage.setItem("lstComparisonId",i):this.removeAll();this.changeLink(i,!1)}},removeAll:function(){typeof Storage!="undefined"&&localStorage.removeItem("lstComparisonId")},changeHtml:function(n,t,i){t?($(n).addClass("added_compare"),$(n).attr("onclick","CompareCar.cancelItem('"+i+"', this);"),$(n).find("span").text("Comparing")):($(n).removeClass("added_compare"),$(n).attr("onclick","CompareCar.addId('"+i+"', this);"),$(n).find("span").text("Compare"))},checkStatusAuto:function(){var n=CompareCar.getListId();n!=null&&n!=undefined&&(this.changeLink(n,!1),n=","+n+",",$(".btn_compare").each(function(){var t=$(this).attr("id").replace("compare_","");n.search(","+t+",")>-1&&CompareCar.changeHtml(this,!0,t)}))},changeLink:function(n,t){var r="/compared-listings",i=0,u='<span id="header-count-compare"><\/span>';n!=null&&n!=undefined&&n!=""&&(i=n.split(",").length,r="/compared-listings/"+n.replaceAll(",","-"));$(".car_compare").attr("href",r);i>0&&($(".car_compare").append(u),$(".car_compare #header-count-compare").text(i),$(".header-ver2 .header-top").append(u),$(".header-ver2 .header-top #header-count-compare").text(i));t&&window.history.pushState("","Compared listings",r)},deleteAuto:function(n,t){var i,r,u,f;$(".upload-car-comp li.item_"+n).remove();i='<li class="item_1">';i+=' <div class="comp-item">';i+='     <a class="btn-upload display-bl" href="/cars-for-sale">';i+='         <img src="/Content/Mobile/images/bg-item.png" />';i+='         <i class="icon-plus-2"><\/i>';i+='         <span class="txt display-bl">Add to compare<\/span>';i+="     <\/a>";i+=" <\/div>";i+="<\/li>";n==0&&(r=$(".upload-car-comp li.item_1 .comp-item .delete-image"),r.length?(u=r.attr("onclick").replace("CompareCar.deleteAuto(1,","CompareCar.deleteAuto(0,"),r.attr("onclick",u)):$(".upload-car-comp li.item_2").remove(),$(".upload-car-comp li.item_1").addClass("item_0").removeClass("item_1"));$(".upload-car-comp li.item_0").after(i);f=!1;$("#price"+(n+1)+" span").hasClass("green-clr")&&(f=!0);$(".li-comp-top span:nth-child("+(n+1)+")").remove();$("#price"+(n+1)).remove();$("#payment"+(n+1)).remove();$(".col-compare-info").append('<li class="price"> <span class="null">-<\/span> <\/li>');$(".list-compare-info li .col_"+n).remove();$(".list-compare-info li").append('<span class="col">-<\/span>');this.removeId(t);this.changeLink(this.getListId(),!0)}};$(document).ready(function(){CompareCar.checkStatusAuto()});var WapEvent={Init:function(){var t,i,n;this.fixMenuScroll();$(window).scroll(function(){$(this).scrollTop()!=0?$(".toTop").fadeIn():$(".toTop").fadeOut()});$(".toTop").click(function(){$("body,html").animate({scrollTop:0},200)});$(".btn-menu, .bg-menu").click(function(){$(".box-search-head").hasClass("show")&&$(".box-search-head").removeClass("show");$(".box-menu-top, .bg-menu, body").hasClass("show")?$(".box-menu-top, .bg-menu, body").removeClass("show"):$(".box-menu-top, .bg-menu, body").addClass("show")});$(".btn-s").click(function(){$(".box-menu-top, .bg-menu, body").hasClass("show")&&$(".box-menu-top, .bg-menu, body").removeClass("show");$(".box-search-head, .icon-search").hasClass("show")?$(".box-search-head, .icon-search").removeClass("show"):$(".box-search-head, .icon-search").addClass("show")});$(".btn-view-all").click(function(){$(".box-view-all, .btn-view-all").hasClass("open")?$(".box-view-all, .btn-view-all").removeClass("open"):$(".box-view-all, .btn-view-all").addClass("open")});this.showHideKeyWord();this.showHideSubMenu(".menu-product");$("#popup").on("click",".close-popup, .close_login, .close, .btn-cancel",function(n){CommonsEvent.ClosePopup();n.stopPropagation()});$(".menu-product .menu-top-ver2 .sub-menu .icon-2").on("click",function(){$(this).parent().hasClass("open-lv2")?$(this).parent().removeClass("open-lv2"):$(this).parent().addClass("open-lv2")});$(".menu-top-ver2 .sub-menu li a").hasClass("active")&&(t=$(".menu-top-ver2 .sub-menu li a.active").parent().parent().prev(),t.is('[class^="icon"]')?(t=$(".menu-top-ver2 .sub-menu li a.active").parent().parent().prev().prev(),t.addClass("active")):t.addClass("active"));$(".menu-top-ver2 .sub-menu .sub-menu-new-level-2 ul.list li a").hasClass("news-active")&&$(".menu-top-ver2 .sub-menu .sub-menu-2 li a.news-active").parent().parent().parent().prev().addClass("news-active");this.AddHtmlInBody();$("#popup").on("change",".btn-select  .select-box",function(){$(this).addClass("color333")});$(".digit").length>0&&$(".digit").keypress(function(n){return n.which==46&&$(this).val().includes(".")?!1:n.which!=46&&n.which!=8&&n.which!=0&&(n.which<48||n.which>57)?!1:!0});typeof Storage!="undefined"&&(i=$(".car_compare").attr("href"),window.location.pathname!=i&&(n=CompareCar.getListId(),n!=null&&n!=""?(n=n.replace(/-/g,","),CompareCar.changeLink(n,!1)):CompareCar.removeAll()))},showHideSubMenu:function(n){$(".menu-top-ver2 li .icon, .menu-top-ver2 li .more-menu",n).on("click",function(){$(this).parent().toggleClass("open")})},fixMenuScroll:function(){var n=0;$(window).scroll(function(){var t=$(this).scrollTop();t<n&&t>$("#header").height()+100?$("#header").addClass("top-menu fixed-header"):$("#header").removeClass("top-menu fixed-header");n=t})},showHideKeyWord:function(){$("#showHideBoxKeyword").on("click",function(){$(this).text()=="View more"?($(this).text("View less"),$(".box-quiklink .col-hide").removeClass("hidden")):($(this).text("View more"),$(".box-quiklink .col-hide").addClass("hidden"))})},AddHtmlInBody:function(){var n="";n+='<div id="ctsDropdownPopup"><\/div>';n+='<div id="ctsDropdown"><\/div>';$("body").append(n)},scrollToBottom:function(n){if(!($("#"+n).length<1)){var t=document.getElementById(n);$("#"+n).animate({scrollTop:t.scrollHeight-t.clientHeight},500)}},scrollToTop:function(n,t){$("#"+n).animate({scrollTop:t!=undefined?t:0},300)},showMsgError:function(n,t){$(n).next().children().empty().text(t)},initClosePopupVerify:function(){$("#verifyotpbox").on("click",".close, .btn-cancel",function(){$("#verifyotpbox").empty();$("#popup div").length?$("#popup").show():CommonsEvent.RemoveNoScroll()})},eventGtm:function(){try{$("#call-seller, .btn-call-seller, .btn-call, .btn-revealPhone").on("click",function(){let t=$(this).data("id");(typeof t=="undefined"||t=="")&&(t=0);let u={event:"call-seller",productId:t};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(u);typeof fbq=="function"&&fbq("track","Contact");let i=$("#hddUserId").val();(typeof i=="undefined"||i=="")&&(i=0);let n=$("#hddDealerId").val();(typeof n=="undefined"||n=="")&&(n=$(this).attr("data-seller-id"));(typeof n=="undefined"||n=="")&&(n=0);let r="Other";location.pathname.indexOf("-aid")>-1?r="Detail":location.pathname.indexOf("-for-sale")>-1&&(r="List");let f={event:"actionUsedcar",action:"call",pageType:r,productID:t,sellerID:n,userID:i};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(f)});$(".btn-chat-seller").on("click",function(){let n=$(this).data("id");(typeof n=="undefined"||n=="")&&(n=0);let u={event:"chat-with-seller",productId:n};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(u);let t=$("#hddUserId").val();(typeof t=="undefined"||t=="")&&(t=0);let i=$("#hddDealerId").val();(typeof i=="undefined"||i=="")&&(i=0);let r="Other";location.pathname.indexOf("-aid")>-1?r="Detail":location.pathname.indexOf("-for-sale")>-1&&(r="List");let f={event:"actionUsedcar",action:"chat",pageType:r,productID:n,sellerID:i,userID:t};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(f)});$(".btn-sms").on("click",function(){let n=$(this).data("id");(typeof n=="undefined"||n=="")&&(n=0);let t=$("#hddUserId").val();(typeof t=="undefined"||t=="")&&(t=0);let i=$("#hddDealerId").val();(typeof i=="undefined"||i=="")&&(i=0);let r="Other";location.pathname.indexOf("-aid")>-1?r="Detail":location.pathname.indexOf("-for-sale")>-1&&(r="List");let u={event:"actionUsedcar",action:"sms",pageType:r,productID:n,sellerID:i,userID:t};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(u)});$(".md-check-price").on("click",function(){var n={event:"check-product-price",productId:$(this).data("id")};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(n)})}catch(n){console.error("Exception => WapEvent.eventGtm() => "+n)}}},_isLoadLogin=!0,AccountEvent={GetUserLoginInfo:function(){$.ajax({type:"GET",cache:!1,data:{},url:"/Auto/AccountInfo",success:function(n){$("#box-user").append(n)},complete:function(){AccountEvent.GetUserInfoCallBack()},error:function(){}})},GetUserInfoCallBack:function(){typeof AutoSavingWeb!="undefined"&&AutoSavingWeb.CheckAutoSave();typeof OneSignalApp!="undefined"&&OneSignalApp.Init();$(".showMenuLogin").on("click",function(){$(".menu-product").hide();$("#menuUserLogin").removeClass("hidden").show(300)});$("#backMenu").on("click",function(){$("#menuUserLogin").addClass("hidden").hide();$(".menu-product").show(300)});if(WapEvent.showHideSubMenu("#menuUserLogin"),$("#product-detail").length){var n=$("#hddUserId").val();n!=null&&n!=undefined&&n>0?n==$("#hddCreatedUser").val().trim()?($("#product-detail .box-management").show(),$("#product-detail .box-seller-action").hide()):($("#product-detail .box-management").hide(),$("#product-detail .box-seller-action").show()):$("#product-detail .box-seller-action").show()}loginSuggest.Init();typeof CommentEvent!="undefined"&&CommentEvent.loadFormDefault();loginSuggest.loginGoogle()},LoginSocial:function(){},ShowPopupLogin:function(){const n=this;if(_isLoadLogin){_isLoadLogin=!1;var t=window.location.pathname,i={returnUrl:t};PostForm.LoadPopupFromUrl("/Account/LoginPopup",i,n.PopupLoginCallBack())}},InitEventRemember:function(){$("#popup").on("click","#cbRememberPage",function(){$("#Remember").val()=="false"?($("#Remember").val("true"),$(".custom-checkbox .icon-ok").show()):($("#Remember").val("false"),$(".custom-checkbox .icon-ok").hide())})},PopupLoginCallBack:function(){const n=this;n.InitEventRemember();_isLoadLogin=!0},CheckIsLogin:function(n){return $.ajax({type:"GET",cache:!1,url:"/Account/CheckIfLogin",success:function(t){return typeof t!="undefined"&&t!=null&&t!=""?n(!0):n(!1)}}),!1}},AutoHotRecomment={Init:function(){if($("#auto_foryou").length>0)PostForm.LoadFromUrl("/Auto/RecommendHome",{top:6},function(n){n.Error||!n||n.indexOf("<head>")!=-1?$("#auto_foryou").remove():($("#auto_foryou").append(n),setTimeout(function(){$("#homeNewCarsSaleSlide").length>0&&new Swiper("#homeNewCarsSaleSlide",{slidesPerView:1.3,spaceBetween:10,breakpoints:{"@0.00":{slidesPerView:1.3,spaceBetween:10},"@0.70":{slidesPerView:2,spaceBetween:10},"@1.00":{slidesPerView:3,spaceBetween:10},"@1.50":{slidesPerView:4,spaceBetween:10}}})},200),setTimeout(function(){var n=$("#homeNewCarsSaleSlide .swiper-slide").first().outerHeight(),t=$("#homeNewCarsSaleSlide .swiper-slide").attr("style"),i=t+" height: "+n+"px;";$("#homeNewCarsSaleSlide .swiper-slide .view-more-s").attr("style",i)},500),AutoSavingWeb.Init());var t=$("#hddUserId").val();t!==undefined&&$("#TotalSave").length==0&&typeof Storage!==undefined&&$("#auto_foryou .like-s").length>0&&$("#auto_foryou .like-s").each(function(){var i=$(this).attr("data-auto-id").replace("auto_",""),n=localStorage.getItem("lstAutoId_"+t);n!==null&&n.search(i)>-1&&$(this).addClass("active")})})}},MsgBox={MessageSuccessRedirect:function(n,t){(typeof t=="undefined"||t=="")&&(t="/");(typeof n=="undefined"||n=="")&&(n="Sucessfully!");$("#popup .close").unbind();var i="";i+='<div class="modal in" id="" style="display: block;top:10%;">';i+='<div class="modal-dialog">';i+='<div class="content-popup">';i+='<button type="button" class="close" onclick="location.href=\''+t+'\'"><i class="icon-cancel-5"><\/i><\/button>';i+='<div class="text-center">';i+='<span class="icon-check-done"><i class="icon-check"><\/i><\/span>';i+='<h2 class="heading-p mt-15 mb-5">'+n+"<\/h2>";i+="<\/div>";i+="<\/div>";i+="<\/div>";i+="<\/div>";i+='<div class="modal-backdrop in"><\/div>';$("#popup").empty().html(i).show();typeof CommonsEvent!="undefined"&&CommonsEvent.AddNoScroll()},MessageSuccessReloadPage:function(n){(typeof n=="undefined"||n=="")&&(n="Sucessfully!");$("#popup .close").unbind();var t="";t+='<div class="modal in" id="" style="display: block;top:10%;">';t+='<div class="modal-dialog">';t+='<div class="content-popup">';t+='<button type="button" class="close" onclick="location.reload();"><i class="icon-cancel-5"><\/i><\/button>';t+='<div class="text-center">';t+='<span class="icon-check-done"><i class="icon-check"><\/i><\/span>';t+='<h2 class="heading-p mt-15 mb-5">'+n+"<\/h2>";t+="<\/div>";t+="<\/div>";t+="<\/div>";t+="<\/div>";t+='<div class="modal-backdrop in"><\/div>';$("#popup").empty().html(t).show();typeof CommonsEvent!="undefined"&&CommonsEvent.AddNoScroll()},MessageSuccessText:function(n,t){typeof t!="undefined"&&($("#lblMessage",t).empty(),$(".msg-success",t).show().find("#textSuccess").empty().text(n))},MessageSuccess:function(n){(n==""||n==undefined)&&(n="Sucessfully!");var t="";t+='<div class="modal in" id="" style="display: block;top:28%;">';t+='<div class="modal-dialog">';t+='<div class="content-popup">';t+='<button type="button" class="close"><i class="icon-cancel-5"><\/i><\/button>';t+='<div class="text-center">';t+='<span class="icon-check-done"><i class="icon-check"><\/i><\/span>';t+='<h2 class="heading-p mt-15 mb-5">'+n+"<\/h2>";t+="<\/div>";t+="<\/div>";t+="<\/div>";t+="<\/div>";t+='<div class="modal-backdrop in"><\/div>';$("#popup").empty().html(t).show();typeof CommonsEvent!="undefined"&&CommonsEvent.AddNoScroll()},MessageError:function(n){var t="";t+='<div class="modal in" style="display: block;top:28%;">';t+='<div class="modal-dialog">';t+='<div class="content-popup">';t+=' <button type="button" class="close" onclick="CommonsEvent.ClosePopup();"><i class="icon-cancel-5"><\/i><\/button>';t+='<div class="text-center">';t+=' <span class="icon-warning"><\/span>';t+='<h2 class="heading-p mt-15 mb-10">Warning<\/h2>';t+='<p class="sub-text">'+n+"<\/p>";t+="<\/div>";t+="<\/div>";t+="<\/div>";t+="<\/div>";t+='<div class="modal-backdrop in"><\/div>';$("#popup").empty().html(t).show();typeof CommonsEvent!="undefined"&&CommonsEvent.AddNoScroll()},MessageConfirmLogin:function(){var n="";n+='<div class="bg-popup"><\/div>';n+='    <div class="modal-popup set-fixed w-400 popup-v204" style="top:28%;">';n+='        <span class="close-popup inner-close-popup">';n+='            <i class="icon-cancel-5"><\/i>';n+="        <\/span>";n+='        <div class="inner-popup radius">';n+='            <div class="popup-content">';n+='                <div class="popup-msg">Sign Up or Sign In for better experience with Philkotse!<\/div>';n+='                <a href="/login?ReturnUrl='+window.location.pathname+'" class="btn-sign-in">Sign in<\/a>';n+='                <a href="/register" class="btn-sign-up">Sign up<\/a>';n+="            <\/div>";n+="        <\/div>";n+="    <\/div>";$("#popup").empty().html(n).show();typeof CommonsEvent!="undefined"&&CommonsEvent.AddNoScroll()},MessageConfirmLogOut:function(){confirm("Are you sure you want to log out?")&&(Utility.SetCookie("_isFirstRequest","",-1),location.href="/account/logout")},MessageNavigate:function(n,t,i){var r="";r+='<div class="bg-popup-not-close"><\/div>';r+='    <div class="modal-popup set-fixed w-400 popup-v204" style="top: 28%;">';r+='        <div class="inner-popup radius">';r+='            <div class="popup-content">';r+='                <div class="popup-msg">'+n+"<\/div>";r+='                <a href="'+i+'" class="btn-sign-in">'+t+"<\/a>";r+="            <\/div>";r+="        <\/div>";r+="    <\/div>";$("#popup").empty().html(r).show()},MessageSuccessWithDescription:function(n,t,i){var r="";r+=' <div class="modal in" style="display: block;"> ';r+='         <div class="modal-dialog"> ';r+='             <div class="content-popup '+i+'"> ';r+='                 <button type="button" class="close"><i class="icon-cancel-5 close-popup-success"><\/i><\/button> ';r+='                 <div class="text-center"> ';r+='                     <span class="icon-check-done"><i class="icon-check"><\/i><\/span> ';r+='                     <p class="dialog-msg mb-0">'+n+"<\/p>";r+='                     <p class="dialog-description">'+t+"<\/p> ";r+="                 <\/div> ";r+="             <\/div> ";r+="         <\/div> ";r+="     <\/div> ";r+='  <div class="modal-backdrop in"><\/div> ';$("#popup").empty().html(r).show();CommonsEvent.AddNoScroll()},MessageNavigate:function(n,t,i){var r="";r+='<div class="bg-popup-not-close"><\/div>';r+='    <div class="modal-popup set-fixed w-400 popup-v204" style="top: 28%;">';r+='        <div class="inner-popup radius">';r+='            <div class="popup-content">';r+='                <div class="popup-msg">'+n+"<\/div>";r+='                <a href="'+i+'" class="btn-sign-in">'+t+"<\/a>";r+="            <\/div>";r+="        <\/div>";r+="    <\/div>";$("#popup").empty().html(r).show()},Notification:function(n,t){var i="";i+='<div class="modal in" id="popupsuccess" style="display: block;">';i+='<div class="modal-dialog">';i+='<div class="content-popup"> ';i+='<span class="close pointer" onclick="CommonsEvent.ClosePopup();"><i class="icon-cancel-5"><\/i><\/span>';i+='<div class="c-small content-s text-center h-230 w-660">';i+='  <h2 class="fsize-28 blue-clr  mg-bottom-0 lheight-1dot6">'+n+"<\/h2>";i+='  <p class="fsize-15">'+t+"<\/p>";i+="<\/div>";i+="<\/div>";i+="<\/div>";i+="<\/div>";i+='<div class="modal-backdrop in"><\/div>';$("#popup").empty().html(i).show();CommonsEvent.AddNoScroll()},ConfirmMessage:function(n){n||(n="Are you sure?");var t="";t+='<div class="bg-popup"><\/div>';t+='    <div class="modal-popup set-fixed w-400 popup-v204" style="top: 28%;">';t+='        <span class="close-popup inner-close-popup">';t+='            <i class="icon-cancel-5"><\/i>';t+="        <\/span>";t+='        <div class="inner-popup">';t+='            <div class="popup-content">';t+='                <div class="popup-msg">'+n+"<\/div>";t+='                  <span class="btn bg-green text-non-uppercase fsize-16 fweight-normal post_delete" onclick="CommonsEvent.ClosePopup();"> OK <\/span>';t+='                  <span class="btn bg-gray-300 text-non-uppercase fsize-16 fweight-normal" onclick="CommonsEvent.ClosePopup();"> Cancel <\/span>';t+="            <\/div>";t+="        <\/div>";t+="    <\/div>";$("#popup").empty().html(t).show()},ConfirmMessageDelete:function(n){n||(n="Are you sure?");var t="";t+='<div class="bg-popup"><\/div>';t+='    <div class="modal-popup set-fixed w-400 popup-v204" style="top: 28%;">';t+='        <span class="close-popup inner-close-popup">';t+='            <i class="icon-cancel-5"><\/i>';t+="        <\/span>";t+='        <div class="inner-popup">';t+='            <div class="popup-content">';t+='                <div class="popup-msg">'+n+"<\/div>";t+='                  <span class="btn bg-green text-non-uppercase fsize-16 fweight-normal post_delete"> OK <\/span>';t+='                  <span class="btn bg-gray-300 text-non-uppercase fsize-16 fweight-normal" onclick="CommonsEvent.ClosePopup();"> Cancel <\/span>';t+="            <\/div>";t+="        <\/div>";t+="    <\/div>";$("#popup").empty().html(t).show()},LoadingList:function(n,t){var i="";i+='<div class="fb-loading-wrapper pull-left full-width">';i+='\t<div class="fblw-timeline-item  pull-left full-width">';i+='\t\t<div class="fblwti-animated">';i+='\t\t\t<div class="fblwtia-mask fblwtia-title-line fblwtia-title-mask-0"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-sepline-sapo fblwtia-sapo-line-0"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-sepline-sapo fblwtia-sepline-sapo-0"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-title-line fblwtia-title-mask-1"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-sepline-sapo fblwtia-sapo-line-1"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-sepline-sapo fblwtia-sepline-sapo-1"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-front-mask fblwtia-front-mask-2"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-sapo-line fblwtia-sapo-line-2"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-sepline-sapo fblwtia-sepline-sapo-2"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-front-mask fblwtia-front-mask-3"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-sapo-line fblwtia-sapo-line-3"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-sepline-sapo fblwtia-sepline-sapo-3"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-front-mask fblwtia-front-mask-4"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-sapo-line fblwtia-sapo-line-4"><\/div>';i+='\t\t\t<div class="fblwtia-mask fblwtia-sepline-sapo fblwtia-sepline-sapo-4"><\/div>';i+="\t\t<\/div>";i+="\t<\/div>";i+="<\/div>";t?$(n).append(i):$(n).html(i)},MessageInfoWithTitle:function(n,t){let i="";i+='<div class="modal in" style="display: block;top:10%;">';i+='<div class="modal-dialog">';i+='<div class="content-popup">';i+='<button type="button" class="close"><i class="icon-cancel-5"><\/i><\/button>';i+='<h2 class="heading-popup">'+t+"<\/h2>";i+='<div class="text-center">';i+='<span class="icon-check-done"><i class="icon-lightbulb"><\/i><\/span>';i+='<div class="mt-15 mb-5" style="line-height:21px;">'+n+"<\/div>";i+='<p class="mt-20 mb-0"><button class="btn-blue" onclick="CommonsEvent.ClosePopup();">OK<\/button><\/p>';i+="<\/div>";i+="<\/div>";i+="<\/div>";i+="<\/div>";i+='<div class="modal-backdrop in"><\/div>';$("#popup").empty().html(i).show();typeof CommonsEvent!="undefined"&&CommonsEvent.AddNoScroll()},ConfirmMessageWithFunction:function(n,t,i){n||(n="Are you sure?");t||(t="OK");let r="";r+='<div class="bg-popup"><\/div>';r+='<div class="modal-popup set-fixed w-400 popup-v204" style="top: 28%;">';r+='    <span class="close-popup inner-close-popup">';r+='        <i class="icon-cancel-5"><\/i>';r+="    <\/span>";r+='    <div class="inner-popup">';r+='        <div class="popup-content">';r+='            <div class="popup-msg lh-20">'+n+"<\/div>";r+='              <span class="btn text-non-uppercase fsize-16 fweight-normal" style="background: #2070d2;" id="btnConfirmOk">'+t+"<\/span>";r+="        <\/div>";r+="    <\/div>";r+="<\/div>";$("#popup").html(r).append(function(){$("#btnConfirmOk").on("click",function(){typeof i=="function"&&i()});CommonsEvent.AddNoScroll()})}},Location={InitLocationEvent:function(){$("#frm-register").length>0&&Location.EventRegion("#frm-register ","#cboRegion");$("#feedbackDealer").length>0&&Location.EventRegion("#feedbackDealer ","#cboRegion");$("#priceDrop").length>0&&Location.EventRegion("#priceDrop ","#cboRegion");$("#makeAnOffer").length>0&&Location.EventRegion("#makeAnOffer ","#cboRegion");$("#loanForm").length>0&&Location.EventRegion("#loanForm ","#cboRegion");$("#page_change_profile").length>0&&Location.EventRegion("#page_change_profile ","#cboRegion")},EventRegion:function(n,t){var r=n+t,u=$(r).val(),i=$(n+" #hddCityId").val();i>0&&(Location.GenerateCity(u,i,n+"#cboCity"),Location.EventCity(n,"#cboCity"));$(r).on("change",function(){Location.ValidateRegion(n,t);Location.GenerateCity(this.value,i,n+"#cboCity");Location.EventCity(n,"#cboCity")})},EventCity:function(n,t){var i=n+t;$(i).on("change",function(){Location.ValidateCity(n,t)})},GenerateCity:function(n,t,i){var r=null;$("body").data("GetListCity_"+n)!=null&&(r=$("body").data("GetListCity_"+n));r==null?$.ajax({type:"POST",cache:!1,url:"/City/GetByRegionId",data:{regionId:n},success:function(t){r=t;$("body").data("GetListCity_"+n,r)},timeout:5e3,complete:function(){Location.BindCity(t,r,i)}}):Location.BindCity(t,r,i)},BindCity:function(n,t,i){$(i).find("option:gt(0)").remove();var r=$(i).html();t!=undefined&&$.each(t,function(t,i){r+=n==i.CityID?'<option value="'+i.CityID+'" selected="selected">'+i.CityName+"<\/option>":'<option value="'+i.CityID+'">'+i.CityName+"<\/option>"});$(i).html(r).trigger("chosen:updated")},ValidateRegion:function(n,t){var i=!0,r=n+t,f=n+' .error .field-validation-valid[data-valmsg-for="RegionId"]',u=$(r).val();return u=="0"||u==undefined||u==null?(Location.setErrorText(r,f,!1),i=!1):($(r).parent().removeClass("erro"),$(f).text(""),i=!0),i},ValidateCity:function(n,t){var i=!0,r=n+t,f=n+' .error .field-validation-valid[data-valmsg-for="CityId"]',u=$(r).val();return u=="0"||u==undefined||u==null?(Location.setErrorText(r,f,!0),i=!1):($(r).parent().removeClass("erro"),$(f).text(""),i=!0),i},setErrorText:function(n,t,i){$(n).parent().addClass("erro");var r="#frm-register",u="#priceDrop",f="#makeAnOffer",e="#feedbackDealer";if(i){t.includes(r)?$(t).text("This field is required"):t.includes(u)?$(t).text(""):t.includes(f)||t.includes(e)?$(t).text(""):$(t).text("Please input your Region.");return}t.includes(r)?$(t).text("This field is required"):t.includes(u)?$(t).text(""):t.includes(f)||t.includes(e)?$(t).text(""):$(t).text("Please input your City.");return}},bannerApp={checkBrowserAndOS:function(){var n=Utility.GetCookie("displayBanner"),t;(n==undefined||n=="")&&(n="true");t=/(android)/i.test(navigator.userAgent);n=="true"&&t&&bannerApp.displayBannerApp()},displayBannerApp:function(){$(".banner-app").show();$(".banner-app").on("click","#close_app",function(){Utility.SetCookie("displayBanner",!1,30);$(".banner-app").hide()})}},popupSurveyWap={surveyId:"",surveyLink:"",timeBeforeDisplay:4e4,init:function(n,t,i){const r=this;if(typeof t!="undefined"&&t!=""&&typeof i!="undefined"&&i!="")popupSurveyWap.surveyId=t,popupSurveyWap.surveyLink=i;else return;popupSurveyWap.surveyId!=""&&popupSurveyWap.surveyLink!=""&&(r.getCookieSurvey()||(window.location.href.indexOf("#philkotsecampaign")!=-1&&typeof Utility!="undefined"&&Utility.RemoveHashTag(),typeof n!="undefined"&&parseInt(n)>0&&(popupSurveyWap.timeBeforeDisplay=n),r.checkTimeToDisplay()))},initEvent:function(){const n=this;$("#popup").on("click",".close-survey",function(){n.setCookieSurvey()})},setCookieSurvey:function(){let n="closePopupSurvey"+popupSurveyWap.surveyId;typeof Utility!="undefined"&&Utility.SetCookie(n,!0,999)},getCookieSurvey:function(){let n="closePopupSurvey"+popupSurveyWap.surveyId;if(typeof Utility!="undefined")return Utility.CheckCookie(n)},checkTimeToDisplay:function(){const n=this;setTimeout(function(){n.displayPopupSurvey();n.initEvent()},n.timeBeforeDisplay)},displayPopupSurvey:function(){const t=this;let n="";n+='<div class="modal in" id="popupSurvey" style="display: block; margin-top:1%">';n+='  <div class="modal-dialog" style="height:514px;margin:10px;width:auto;margin-top:40px;">';n+='      <div class="content-popup" style="height:100%;padding:0;">';n+='          <span class="close pointer close-survey" data-survey-id="'+t.surveyId+'" style="top:-21px;right:-7px;height:25px;width:25px;text-align:center;background:url(/ContentV2/Wap/img/icon-close-value.svg) no-repeat center center #EBEBEB;border:1px solid #fff;border-radius:50%;-moz-border-radius:50%;-webkit-border-radius:50%;text-indent:-99999px"><\/span>';n+='          <iframe width="100%" height="100%" src="'+t.surveyLink+'" frameborder="0" allowfullscreen><\/iframe>';n+="      <\/div>";n+="  <\/div>";n+="<\/div>";n+='<div class="modal-backdrop in"><\/div>';$("#popup").empty().html(n);typeof CommonsEvent!="undefined"&&CommonsEvent.AddNoScroll()}},iconEventWap={init:function(){const n=this},initIconBermonth:function(){if($("#cgHome").length!=0||$("#pgDealerPromoIndex").length!=0||$("#ReviewSearch").length!=0||$("#boxNewsSearch").length!=0){let n="";n+='<div class="icon-float-banner" id="icon-bermonth">';n+='    <span class="close-float-banner"><\/span>';n+='    <a href="/year-end-promos/home" rel="nofollow" target="_blank">';n+='        <img src="/ContentV2/Wap/img/wap-icon-philkotse-bermonth.png" alt="Icon Bermonth" data-bannername="icon_float_bermonth_wap" />';n+="    <\/a>";n+="<\/div>";$("body").append(n);$(".icon-float-banner .close-float-banner").on("click",function(n){$(".icon-float-banner").hide();n.stopPropagation()})}},initIconBermonthRacingGame:function(){let t=window.location.pathname;if(t.startsWith("/bermonth-rewards")){let n="";n+='<div class="icon-float-banner" id="icon-bermonth-racing-game">';n+='    <span class="close-float-banner"><\/span>';n+='    <a href="/racing-game" rel="nofollow" target="_blank">';n+='        <img src="/ContentV2/Wap/img/wap-icon-racing-game.png" alt="Icon Bermonth Racing Game" data-bannername="icon_float_bermonth_racing_game_wap" />';n+="    <\/a>";n+="<\/div>";$("body").append(n);$(".icon-float-banner .close-float-banner").on("click",function(n){$(".icon-float-banner").hide();n.stopPropagation()})}},initIconDOW:function(){let n=0;$.ajax({type:"POST",cache:!1,url:"/DOWEvent/GetTurnCount",success:function(t){typeof t!="undefined"&&t!=null&&(n=t);n!="0"&&(n="+"+n);let i="";i+=$("#box-icon-lowest-mp").length>0?'<div class="pp-qc" style="bottom:403px;">':'<div class="pp-qc">';i+='<span class="close-float-banner-360"><\/span>';i+='   <span class="text" id="txtIconDOWTurnCount">'+n+"<\/span>";i+="<\/div>";$("body").append(i);$(".pp-qc").on("click",function(){location.href="/"});$(".close-float-banner-360").on("click",function(n){$(".pp-qc").hide();n.stopPropagation()})},error:function(){}})},updateTextForIconDOW:function(n){typeof n=="undefined"&&(n=0);let i=$("#txtIconDOWTurnCount").text(),t=parseInt(n)+parseInt(i);typeof t=="undefined"||isNaN(t)||(t!="0"?$("#txtIconDOWTurnCount").text("+"+t):$("#txtIconDOWTurnCount").text(t))},checkIsEnableEventDOW:function(){const n=this;$.ajax({type:"POST",cache:!1,url:"/DOWEvent/CheckIsEnableEvent",success:function(t){if(typeof t!="undefined"&&t!=null)if(t==!0)n.initIconDOW();else return!1;else return!1},error:function(){return!1}})},checkIsEnableEvent_Bermonth_202207:function(){const n=this;n.initIconBermonth_202207();return},initIconBermonth_202207:function(){let n=0;var e=[{id:1,src:"icon-sedan-under-p500k.png",url:"/used-cars-sedan-for-sale/mlt500000",width:84,height:93},{id:2,src:"icon-suv-crossover-under-p750k.png",url:"/used-cars-suv-for-sale/mlt750000",width:89,height:125},{id:3,src:"icon-like-new-99.png",url:"/used-cars-for-sale/km1000-10000",width:114,height:118},{id:4,src:"icon-hot-promos.png",url:"/all-promotions-in-the-philippines",width:99,height:86},{id:5,src:"icon-suv-crossover-under-p750k.png",url:"/used-cars-suv-for-sale/mlt750000",width:89,height:125}];let f=7200;const i="bermonth202207_icon_id_current",t="bermonth202207_icon_id_next";let r=Utility.CheckCookie(i),u=Utility.CheckCookie(t);if(r||u){if(!r&&u){let r=Utility.GetCookie(t),n=parseInt(r);n>0&&(Utility.SetCookie(i,n,null,f),n==5?Utility.SetCookie(t,1,null,null):Utility.SetCookie(t,n+1,null,null))}else if(r&&!u){let r=Utility.GetCookie(i);n=parseInt(r);n>0&&(n==5?Utility.SetCookie(t,1,null,null):Utility.SetCookie(t,n+1,null,null))}}else Utility.SetCookie(i,1,null,f),Utility.SetCookie(t,2,null,null);if(n=parseInt(Utility.GetCookie(i)),n>0){let i=e[n-1],t="";t+='<div class="icon-float-banner" id="icon-bermonth-202207" data-banner-id="'+i.id+'">';t+='    <span class="close-float-banner-bermonth-202207"><\/span>';t+='    <a href="'+i.url+'">';t+='       <img src="/ContentV2/landing-page/bermonth_202207/images/icon-float/'+i.src+'" width="'+i.width+'" height="'+i.height+'" alt="Icon Bermonth 202207" data-bannername="icon_float_bermonth_202207_wap" />';t+="    <\/a>";t+="<\/div>";$("body").append(t);$("#cgModelGuide").length>0&&$(".icon-float-banner").css("bottom",315);$(".icon-float-banner .close-float-banner-bermonth-202207").on("click",function(n){$(".icon-float-banner").hide();n.stopPropagation()})}}},callBackFunctionsWap={getPromoCallback:function(n){try{let o="submit_success_get_promo";!n||(o=n);let u="",t=$("#cboBrandModelTextFormRequest").text(),i=$("#hddCallBackCityName").val(),s=$("#hddGetPromoPopupPromoId").val(),h=$("#hddGetPromoPopupHighlight").val(),c=$("#hddGetPromoPopupDealerName").val();u||(u="");t||(t=$("#cboBrandModelTextSearchPopup").text());t||(t="");i||(i=$("#cboCityTextPopup").text());i||(i="");let r;r=$("#popup").is(":empty")?$("#Phone").val():$("#popup #Phone").val();(typeof r=="undefined"||r=="")&&(r=0);let l={event:o,url:location.href,brand:u,model:t,promoid:s,highlight:h,dealername:c,phonenumber:r};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(l);typeof fbq=="function"&&fbq("track","SubmitApplication");let f="Other";location.pathname.indexOf("-dpid")>-1?f="Detail":(location.pathname.indexOf("-promotions-in-the-philippines")>-1||location.pathname.indexOf("search-car-promos")>-1)&&(f="List");let e=$("#hddUserId").val();e||(e=0);let a={event:"actionNewCarPromo",action:"getPromo",model:u+" "+t,city:i,pageType:f,userID:e};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(a)}catch(t){console.error("Exception : Wap => callBackFunctionsWap.getPromoCallback() => "+t)}typeof missionJS!="undefined"&&missionJS.markCompletedExploringMission(missionJS.MissionType.ExploringGetPromo)},getQuoteCallback:function(n){try{let e="submit_success_get_quote";!n||(e=n);let r="",t=$("#cboBrandModelTextFormRequest").text(),i=$("#hddCallBackCityName").val(),o=$("#hddCallBackYear").val(),s=$("#popup #Phone").val();r||(r="");t||(t=$("#cboBrandModelTextSearchPopup").text());t||(t="");i||(i=$("#cboCityTextPopup").text());i||(i="");let h={event:e,url:location.href,brand:r,model:t,year:o,phone:s};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(h);typeof fbq=="function"&&fbq("track","CompleteRegistration");let u="Other";location.pathname.indexOf("-price-philippines")>-1||location.pathname.indexOf("-price-philippines-vsid")>-1?u="Detail":location.pathname.indexOf("-philippines-price-list")>-1&&(u="List");let f=$("#hddUserId").val();f||(f=0);let c={event:"actionNewCarQuote",action:"getQuote",model:r+" "+t,city:i,pageType:u,userID:f};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(c)}catch(t){console.error("Exception : Wap => callBackFunctionsWap.getQuoteCallback() => "+t)}},loanApplicationCallback:function(n){try{let t="loan_form_submission";!n||(t=n);let i={event:t};typeof GtmUtils!="undefined"&&GtmUtils.pushDataEvent(i);typeof fbq=="function"&&fbq("track","Loan success")}catch(t){console.error("Exception : Wap => callBackFunctionsWap.loanApplicationCallback() => "+t)}typeof missionJS!="undefined"&&missionJS.markCompletedExploringMission(missionJS.MissionType.ExploringApplyAutoLoan)}};$(document).ready(function(){WapEvent.Init();AccountEvent.GetUserLoginInfo();AutoHotRecomment.Init();WapEvent.initClosePopupVerify();iconEventWap.init();WapEvent.eventGtm()});AutoSavingWeb={Init:function(){$(".auto_save").on("click",function(){var n=$("#hddUserId").val();if(n==undefined){MsgBox.MessageConfirmLogin();return}var i=$(this).attr("id"),t=i.replace("auto_","");$(this).hasClass("active")?($(this).removeClass("active"),$.ajax({type:"POST",cache:!1,url:"/MyAccount/ProductSave_Delete/",data:{productId:t},success:function(t){if(!t.Error){var i=parseInt($("#box-user .nav_saved:first").text());!isNaN(i)&&i>0?i--:i=0;AutoSavingWeb.ShowNumberSave(i);typeof Storage!="undefined"&&(localStorage.removeItem("lstAutoId_"+n),localStorage.removeItem("numberSave_"+n))}}})):($(this).addClass("active"),$.ajax({type:"POST",cache:!1,url:"/Auto/ProductSave_Insert/",data:{productId:t},beforeSend:function(){},success:function(t){if(!t.Error){var i=parseInt($("#box-user .nav_saved:first").text());!isNaN(i)&&i>0?i++:i=1;AutoSavingWeb.ShowNumberSave(i);typeof Storage!="undefined"&&(localStorage.removeItem("lstAutoId_"+n),localStorage.removeItem("numberSave_"+n))}}}))})},CheckAutoSave:function(){var i=$("#hddUserId").val(),n,t,r;i!==undefined&&(n=null,t=null,typeof Storage!="undefined"&&(n=localStorage.getItem("lstAutoId_"+i),t=localStorage.getItem("numberSave_"+i)),n==null||t==null?(r=$(this).attr("id"),$.ajax({type:"POST",dataType:"json",cache:!1,url:"/Auto/ProductSave_GetList/",success:function(r){n=r.join();n!=null&&n!=""&&(t=r.length,typeof Storage!="undefined"&&(localStorage.setItem("lstAutoId_"+i,n),localStorage.setItem("numberSave_"+i,t)),AutoSavingWeb.ActiveProductSave(n),AutoSavingWeb.ShowNumberSave(t))}})):(AutoSavingWeb.ActiveProductSave(n),AutoSavingWeb.ShowNumberSave(t)))},ActiveProductSave:function(n){$(".auto_save").length>0&&$(".auto_save").each(function(){var t=$(this).attr("id").replace("auto_","");n.search(t)>-1&&$(this).addClass("active")})},SaveAuto:function(n,t,i){i instanceof Function&&n>0&&t>0&&AutoSavingWeb.CallSaveAuto(n,t,function(t){if(!t.Error){var r=parseInt($("#box-user .nav_saved:first").text());!isNaN(r)&&r>0?r++:r=1;AutoSavingWeb.ShowNumberSave(r);typeof Storage!="undefined"&&(localStorage.removeItem("lstAutoId_"+n),localStorage.removeItem("numberSave_"+n))}i(t)})},DeleteSavedAuto:function(n,t,i){i instanceof Function&&n>0&&t>0&&AutoSavingWeb.CallDeleteSavedAuto(n,t,function(t){if(!t.Error){var r=parseInt($("#box-user .nav_saved:first").text());!isNaN(r)&&r>0?r--:r=0;AutoSavingWeb.ShowNumberSave(r);typeof Storage!="undefined"&&(localStorage.removeItem("lstAutoId_"+n),localStorage.removeItem("numberSave_"+n))}i(t)})},ShowNumberSave:function(n){n!=null&&n>0?($("#box-user .nav_saved:first").text(n),$(".left-menu-management").length>0&&$(".left-menu-management .nav_saved:first").text(n)):($("#box-user .nav_saved:first").text("0"),$(".left-menu-management").length>0&&$(".left-menu-management .nav_saved:first").text("0"))},CallSaveAuto:function(n,t,i){i instanceof Function&&n>0&&t>0&&$.ajax({type:"POST",cache:!1,url:"/Auto/ProductSave_Insert/",data:{productId:t},success:i})},CallDeleteSavedAuto:function(n,t,i){i instanceof Function&&n>0&&t>0&&$.ajax({type:"POST",cache:!1,url:"/MyAccount/ProductSave_Delete/",data:{productId:t},success:i})}};$(document).ready(function(){})