function ClosePopup(){$("#popup").empty();AutoScroll()}function ClosePopupRefresh(){$("#popup").empty();AutoScroll();location.reload(!0)}function ClosePopupRedirect(){$("#popup").empty();AutoScroll();window.location.href="/"}function ReloadPageRegister(){location.reload(!0)}function CloseVerifyPhonePopup(){$("#popup").show();$("#VerifyPhonePopup").empty();AutoScroll()}function Loading(){var n=$("#hdStaticSite").val();$("#loadding").html('<div class="bg-popup-loading"> <img alt="Loading" src="'+n+'/web/images/loading300.gif" class="loading"/><\/div>')}function Loaded(){$("#loadding").empty()}function NoScroll(){var t=$("body").width(),n;$("body").css("overflow","hidden");n=$("body").width()-t;$("body").css("margin-right",n+"px");$(".nav.nav-home .container").css("padding-right",n+"px")}function AutoScroll(){$("body,.nav.nav-home .container").removeAttr("style")}function FirebasePhoneVerifier(n){function i(){return{success:!1,data:null,message:null,code:null}}function f(t,r){Loading();var u=i();$("#"+n).load("/Common/GetOTP?phoneToVerify="+t,function(n,t){return t==="success"?(Loaded(),u.success=!0,$("#frmGetOtp").removeData("validator").removeData("unobtrusiveValidation"),$.validator.unobtrusive.parse($("#frmGetOtp")),NoScroll()):u.message="There is an error with OTP function. Please try again later!",r(u)})}function e(n,t,r){var u=i();return u.success=!0,r(u)}function o(r,u,f){function o(n){console.log(n);window.recaptchaToken=n;$("#frmGetOtp #recaptchaToken").val(n);$("#otpMessage").addClass("hidden");s(r,u,function(n){if(!n.success){e.reset();$("#otpMessage").html(n.message).removeClass("hidden");return}return f(n)})}function h(){e=new firebase.auth.RecaptchaVerifier("btnSendOtp",{size:"invisible",callback:o});e.render()}var e=null;h();$("#getOtp .close").click(function(){if($("#"+n).empty(),t){var r=i();return r.message="Your phone number has not been verified. Please try again!",f(r)}})}function s(n,t,u){firebase_app.OpenVerifyPopup(n,t);r=$("#frmGetOtp #phoneNumber").val();var f=i();$("#frmGetOtp").valid()&&$.ajax({type:"POST",url:"/Common/GetOTP",data:$("#frmGetOtp").serialize(),beforeSend:function(){},success:function(n){n?n.Success?f.success=!0:f.message=n.Title:f.message="There is an error with OTP function. Please try again later!"},error:function(){f.message="There is an error with OTP function. Please try again later!"},complete:function(){return u(f)}})}function h(n){u=$("#frmVerifyOtp #Code").val();var t=i();$("#frmVerifyOtp").valid()&&$.ajax({type:"POST",url:"/Common/VerifyOTPv2",data:$("#frmVerifyOtp").serialize(),beforeSend:function(){Loading()},success:function(n){n?n.Success?t.success=!0:t.message=n.Title:t.message="There is an error with OTP function. Please try again later!"},error:function(){t.message="There is an error with OTP function. Please try again later!"},complete:function(){return Loaded(),n(t)}})}function c(r){$("#btnVerifyOtp").click(function(){$("#otpMessage").addClass("hidden");h(function(n){return n.success?r(n):($("#otpMessage").html(n.message).removeClass("hidden"),r(n))})});$("#verifyOtp .close").click(function(){if($("#"+n).empty(),t){var u=i();return u.message="Your phone number has not been verified. Please try again!",r(u)}})}var r=undefined,u=undefined,t=!0;FirebaseAppInitializer.Init();this.Verify=function(i,s,h){f(s,function(f){if(!f.success)return t=!1,h(f,r,u);o(i,s,function(f){if(!f.success)return t=!1,h(f,r,u);e(i,s,function(i){if(!i.success)return t=!1,h(i,r,u);c(function(i){return i.success&&(t=!1,$("#"+n).empty(),AutoScroll()),h(i,r,u)})})})})}}function LoadAccountInfo(){$.ajax({type:"GET",cache:!1,url:"/Account/AccountInfo",data:{returnUrl:window.location.pathname},success:function(n){$("#acccountInfo").html(n)},complete:function(){}})}var utils={replace_bold_text:function(n,t){if(t===null||t==="")return n;if(n){var i=$.trim(t).replace(/ /gi,"|");return n.replace(new RegExp(i,"gi"),n=>"<b>"+n+"<\/b>")}return""}},popup=popup||{},save_auto,cookie_manager,notifys,url;popup.event={loadAjax:function(n,t,i){$(n).load(t,i)},loadAjaxPopup:function(n,t){$("#popup").load(n,t)}};var main={init:function(){var f,s,n,r,e,t,o,i,u;window.location.href.indexOf("indianauto.com")!=-1&&(f="https://log.indianauto.com/js/indianauto/dvl_indianauto.js?v=-"+(new Date).toISOString().substring(0,13),$("body").append('<script type="text/javascript" src="'+f+'"><\/script>'));menu.close();main.InitForm();$("#cbCitySuggest").select2();$("#hdShowSuggeestCity").length>0&&$("#hdAllowShowSuggestCity").length>0&&(s=parseInt($("#hdShowSuggeestCity").val()));n=cookie_manager.get_cookie("SessionSuggestCity");(n==undefined&&n!=null||n!="")&&($("#header .head-location > a").removeClass("active"),$(".location-box").hide(),$("body").find(".overlay-popup").remove(),$("span.select2-dropdown").remove(),$("body").removeClass("no-scroll-extend"),r=unescape(n),e=r.substring(0,r.indexOf("|")),$("#cbCitySuggest").val(e));$("#cbCitySuggest").length>0&&$("#cbCitySuggest").change(function(){var t=$(this).val(),n=!1;window.location.pathname=="/"&&(n=!0);main.update_suggest_city(t,!1,n)});$("#wrapper").css("min-height",$(window).height()-230+"px");$("#header .head-menu a").click(function(n){menu.open();n.preventDefault()});$("#header .head-location a").click(function(n){menu.open_location();n.preventDefault()});$("#header .head-search").click(function(n){menu.open_search_common();n.preventDefault()});$(".search-common-box .icon-cancel-1").click(function(){$("#txtTextSearchCommon").val("");$(this).hide()});$("#txtTextSearchCommon").keyup(function(n){var i,t;$(this).val()!==""?$(".search-common-box .icon-cancel-1").show():$(".search-common-box .icon-cancel-1").hide();i=n?n.which?n.which:n.keyCode:event.keyCode;i==13&&$("#ui-id-1 li").length>0&&(t=$("#ui-id-1 li:first-child a").attr("href"),t!=""&&(window.location.href=t))});t=null;$("#txtTextSearchCommon").autocomplete({minLength:0,delay:500,source:function(n,i){var u=$.trim(n.term),f=null,r;f=$("#hddNewTypeId").val()==""?null:parseInt($("#hddNewTypeId").val());u.length>-1&&(r="",r="/Home/GetSuggestionSearch",t!==null&&t.readyState!==4&&t.abort(),t=$.ajax({url:r,data:{keyword:u,newsType:f},success:function(n){i(eval(n))}}))}}).bind("focus",function(){$(this).autocomplete("search")}).autocomplete("instance")._renderItem=function(n,t){if(n.addClass("common-search-drop"),t.suggestion!==null&&t.suggestion!==""){var i=utils.replace_bold_text(t.suggestion,this.term);return $("<li class='item-search event'>").append("<a href='"+t.link+"' class=''><span>"+i+"<\/span> <span class='text-common'>"+t.category_name+"<\/span><\/a>").appendTo(n)}};o=$(window).height();o>0&&$(".popup-menu-header .menu").attr("style","height: 100%");$(window).resize(function(){var n=$(window).height();n>0&&$(".popup-menu-header .menu").attr("style","height: 100%")});i=$(window);u=i.scrollTop();i.on("scroll",function(){var n=i.scrollTop(),t;n>45&&n>u?($("#header").animate({top:"-50px"},0),$(".location-box").css("display")=="block"&&($("#header .head-location > a").removeClass("active"),$(".location-box").hide(),$("body").find(".overlay-popup").remove(),$("span.select2-dropdown").remove(),$("body").removeClass("no-scroll-extend"))):$("#header").animate({top:0},0);u=n;t=document.documentElement.scrollTop||document.body.scrollTop;t>400?$("#toTop").show():$("#toTop").hide()});$("#toTop").click(function(){$("body, html").animate({scrollTop:0},500)});$("#popup").on("click","button[type=submit]",function(n){main.InitFormPopup($(this).attr("id"));n.preventDefault()});$(document).on("click",function(n){var t=$(n.target),u=t.closest(".menu"),i,r;$closestnoticeNotSelectCityContainer=t.closest(".notice-not-select-city");u.length<=0&&$closestnoticeNotSelectCityContainer.length<=0&&$(".popup-menu-header").css("left")=="0px"&&menu.close();var f=t.closest(".location-box"),e=t.closest(".head-location"),o=t.closest(".select2-container");f.length<=0&&e.length<=0&&o.length<=0&&$closestnoticeNotSelectCityContainer.length<=0&&$("#header .head-location > a").hasClass("active")&&($("#header .head-location > a").removeClass("active"),$(".location-box").hide(),$("body").find(".overlay-popup").remove(),$("body").removeClass("no-scroll-extend"));i=t.closest(".search-common-box");r=t.closest(".head-search");r.length<=0&&i.length<=0&&$("#header .head-search").hasClass("active")&&($("#header .head-search").removeClass("active"),$(".search-common-box").hide(),$("body").find(".overlay-popup").remove(),$("body").removeClass("no-scroll-extend"),console.log("no close menu"))});$(window).load(function(){});AppLink.getAppLink();main.load_account_info()},update_suggest_city:function(n,t,i){var r={cityId:n,isHomePage:i};ajax_feed.post_json_extention("/Home/UpdateCitySuggest",r,null,function(n){$("#header .head-location > a").removeClass("active");$(".location-box").hide();$("body").find(".overlay-popup").remove();$("span.select2-dropdown").remove();$("body").removeClass("no-scroll-extend");t||(window.location.href=n.Content!=""?n.Content:window.location.href)})},InitForm:function(){$("button[type=reset]").click(function(){$(".field-validation-error").empty()});$("button[type=submit]").click(function(){var t,i,n;if($(this).attr("id")=="btnPost")if(post.ValidatePost()){if($("#CityId").val()==0)return!1;for(t="",i=0;i<15;i++)t+=$("#Technical"+(i+1)).val()+";";t+=$("#Technical20").val()+";";t!=""&&($("#TechProductString").val(t),$("#Spec").val()!=t&&$("#isUpdateSpec").val("True"))}else return!1;if($(this).attr("id")=="btnGetPass"&&$(this).addClass("disabled"),n=$(this).parents("form:first"),$(n).off("submit"),n.valid())n.submit(function(){var t=n.serialize();return this.beenSubmitted==t&&($(n).attr("IsCompareSubmitted")=="1"||$(n).attr("IsCompareSubmitted")==undefined||$(n).attr("IsCompareSubmitted")==null)?!1:(Loading(),this.beenSubmitted=t,$.post(n.attr("action"),t,function(t){if($("#imgCaptchaCar").attr("src","/Common/Captcha/?type=3&time="+(new Date).getTime()),$("#imgCaptcha").attr("src","/Common/Captcha/?type=0&time="+(new Date).getTime()),$("#imgCaptchaSupport").attr("src","/Common/Captcha/?type=4&time="+(new Date).getTime()),t.Error)t.NextAction==11?($(".frmPost").length>0&&sellCarOTP.ShowVerifyPhone(t.Obj),$("#frmProfile").length>0&&profileOTP.ShowVerifyPhone(t.Obj)):(notifys.CreateMessageError(t.Title,n),grecaptcha&&grecaptcha.reset());else switch(t.NextAction){case 1:notifys.ReloadPage(t.Title);break;case 2:t.Title=="/notify-success/1"?notifys.MessageSuccessPosted(1):t.Title=="/notify-success/2"?notifys.MessageSuccessPosted(2):location.href=t.Title;break;case 4:notifys.MessageRedirect(t.Title);break;case 5:notifys.MessagePopup(t.Title);break;case 6:$("#lblMessage").empty();notifys.MessageRefresh(t.Title,"Notification");break;case 7:MessageMessageSendLinkActive(t.Title);break;default:notifys.CreateMessageErrorSign(t.Title)}Loaded()}),!1)});else return $("#lblMessage").empty(),!1})},InitFormPopup:function(n){var t=$("#popup form:first"),i;return n!=undefined&&(t=$("#popup #"+n).parents("form")),t.valid()?(i=t.serialize(),Loading(),$.post(t.attr("action"),i,function(n){if(Loaded(),n.Error)if(n.NextAction==11)$("#popupRegister .form-reg").length>0?registrationOTP.ShowVerifyPhone(n.Obj):$("#checkoffer").length>0?sellerGetOfferNewCarOTP.ShowVerifyPhone(n.Obj):sellerOTP.ShowVerifyPhone(n.Obj);else return notifys.CreateMessageError(n.Title,t),!1;else switch(n.NextAction){case 1:notifys.ReloadPage(n.Title,n.Obj);break;case 2:location.href=n.Title;break;case 4:notifys.MessagePopup(n.Title,n.Obj);break;case 5:notifys.CreateMessageError(n.Title,t);break;case 10:if($("#popup .frmShowSeller").length>0){var i=$("#popup .frmShowSeller #Name").val(),r=$("#popup .frmShowSeller #Phone").val();cookie_manager.set_cookie("GetSellerDetailLong",JSON.stringify({Fullname:i,Phone:r}),365)}notifys.CreateMessageDetail(n.Obj);break;case 12:eval(n.CallBackFunction);break;default:notifys.CreateMessageError(n.Title,t)}}),!1):void 0},load_account_info:function(){$.ajax({type:"GET",cache:!1,url:"/Account/AccountInfo",data:{returnUrl:window.location.pathname},success:function(n){$("#acccountInfo").html(n)},complete:function(){}})}},menu={open:function(){$(".popup-menu-header").animate({left:0},400);$("body").addClass("no-scroll")},close:function(){$(".popup-menu-header").animate({left:"-100%"},400);$("body").removeClass("no-scroll")},active_menu:function(n){$(".popup-menu-header ul li").removeClass("active");switch(n){case 1:$(".popup-menu-header ul li#meu-home").addClass("active");break;case 2:$(".popup-menu-header ul li#menu-used-cars").addClass("active");break;case 3:$(".popup-menu-header ul li#menu-new-car").addClass("active");break;case 4:$(".popup-menu-header ul li#menu-new-review").addClass("active");break;case 5:$(".popup-menu-header ul li#menu-gallery").addClass("active");break;case 6:$(".popup-menu-header ul li#menu-new-tips").addClass("active");break;case 7:$(".popup-menu-header ul li#menu-new-stories").addClass("active");break;case 8:$(".popup-menu-header ul li#menu-new-compare").addClass("active");break;case 9:$(".popup-menu-header ul li#menu-new-cars-suv").addClass("active")}},open_location:function(){$("#header .head-location > a").hasClass("active")?($("#header .head-location > a").removeClass("active"),$(".location-box").hide(),$("body").find(".overlay-popup").remove(),$("body").removeClass("no-scroll-extend")):($("#header .head-location > a").addClass("active"),$(".location-box").show(),$("body").find(".overlay-popup").remove(),$("body").append('<div class="overlay-popup"><\/div>'),$("body").addClass("no-scroll-extend"),$("#header .head-search").removeClass("active"),$(".search-common-box").hide(),$("#cbCitySuggest option").length<=1&&setTimeout(function(){ajax_feed.post_json_extention("/Home/GetDataLocation",null,null,function(n){var i,t,r;if(n!==null){if(i="",n.ListProvince!==null)for(t=0;t<n.ListProvince.length;t++)r=n.ListProvince[t].Id===n.CityId?"selected":"",i+="<option "+r+' value="'+n.ListProvince[t].Id+'" >'+n.ListProvince[t].Name+"<\/option>";$("#cbCitySuggest").html(i)}})},0))},open_search_common:function(){$("#header .head-search").hasClass("active")?($("#header .head-search").removeClass("active"),$("body").find(".overlay-popup").remove(),$("body").removeClass("no-scroll-extend"),$(".search-common-box").hide()):($("#header .head-search").addClass("active"),$("body").find(".overlay-popup").remove(),$("body").append('<div class="overlay-popup"><\/div>'),$("body").addClass("no-scroll-extend"),$(".search-common-box").show(),$("#txtTextSearchCommon").focus(),$("#header .head-location > a").removeClass("active"),$(".location-box").hide())}},account={InitPopup:function(){$("#popup").on("click",".close, .bg-popup",function(n){ClosePopup();n.stopPropagation()});$("#popup").on("change","#chkTerms",function(){$("#popup #chkTerms:checked").length>0?$("#popup #btnRegister").removeClass("disabled"):$("#popup #btnRegister").addClass("disabled")})},LoginPopup:function(){var n=document.URL,t,i;n=n.replace(new RegExp("/p([0-9]+)"),"");n=n.replace(new RegExp("#"),"");t=location.host;i=t+"/login";window.location.href=i},RegisterPopup:function(){$("#popup").load("/register");NoScroll()},ForgotPasswordPopup:function(){$("#popup").load("/forgotpassword");NoScroll()}},ajax_feed=ajax_feed||{};ajax_feed={post_json_extention:function(n,t,i,r,u){$.ajax({url:n,type:"POST",dataType:"json",data:t,async:!0,beforeSend:function(){i!=null&&i!=undefined&&i()},success:function(n){var u=window.location.pathname,i=t!=null&&t.url!=undefined?t.url:"/dang-nhap";t===null||t.login===undefined||t.login?t===null||t.access===undefined||t.access||(window.location.href=i):window.location.href=i+"?returnUrl="+u;r!=null&&r!=undefined&&r(n)},error:function(n){console.log(n.statusText+n.responseText);u!=null&&u!=undefined&&u()}})},post_html_extention:function(n,t,i,r,u){$.ajax({url:n,type:"POST",dataType:"html",cache:!1,data:t,async:!0,beforeSend:function(){i!=null&&i!=undefined&&i()},success:function(n){var u=window.location.pathname,i=t!=null&&t.url!=undefined?t.url:"/dang-nhap";t===null||t.login===undefined||t.login?t===null||t.access===undefined||t.access||(window.location.href=i):window.location.href=i+"?returnUrl="+u;r!=null&&r!=undefined&&r(n)},error:function(n){console.log(n.statusText+n.responseText);u!=null&&u!=undefined&&u()}})},get_html_extention:function(n,t,i,r,u){$.ajax({url:n,type:"GET",dataType:"html",cache:!1,data:t,async:!0,beforeSend:function(){i!=null&&i!=undefined&&i()},success:function(n){var u=window.location.pathname,i=t!=null&&t.url!=undefined?t.url:"/dang-nhap";t===null||t.login===undefined||t.login?t===null||t.access===undefined||t.access||(window.location.href=i):window.location.href=i+"?returnUrl="+u;r!=null&&r!=undefined&&r(n)},error:function(n){console.log(n.statusText+n.responseText);u!=null&&u!=undefined&&u()}})}};save_auto=save_auto||{};save_auto={save_auto_member:function(n,t){var o=$("#hddUserId").val(),u,i,r,f,e;o==undefined?(u=location.protocol+"//"+location.host+"/login?returnurl="+location.pathname,window.location=u):(i=!0,r=$(n).attr("data-id"),t!=null&&i!=undefined?$(n).find("i").hasClass("active")&&(i=!1):$(n).find("i").hasClass("active")&&(i=!1),f={productId:r.replace("auto_",""),isAdd:i},e="/Product/SaveToFavourit",ajax_feed.post_json_extention(e,f,null,function(n){n.Success?i?t!=null&&i!=undefined?$("."+r).find("i").addClass("active"):$("."+r).find("i").addClass("active"):t!=null&&i!=undefined?$("."+r).find("i").removeClass("active"):$("."+r).find("i").removeClass("active"):notifys.MessagePopup(n.Message)}))},show_number_save:function(n){n!=null&&n>0?$(".nav_saved").text(n):$(".nav_saved").text("0")}};cookie_manager=cookie_manager||{};cookie_manager={set_cookie:function(n,t,i){var u=new Date,f,r;u.setTime(u.getTime()+i*864e5);f="expires="+u.toUTCString();r=location.hostname.split(".").reverse()[1]+"."+location.hostname.split(".").reverse()[0];r!=undefined&&r.indexOf("localhost")>-1&&(r="localhost");document.cookie=n+"="+t+";"+f+";path=/;domain=."+r},get_cookie:function(n){for(var t,r=n+"=",u=document.cookie.split(";"),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""}};notifys={CreateMessageError:function(n,t){var i=$(t).find("#lblMessage");i.html('<div class="field-validation-error">'+n+"<\/div>")},CreateMessageErrorSign:function(n){var t=$("#lblMessage");t.html('<div class="field-validation-error">'+n+"<\/div>")},ReloadPage:function(n,t){(t==undefined||t=="")&&(t="Notification");var i="";i+='<div class="bg-popup" onclick="ClosePopupRefresh()"><\/div>';i+="<div class='pop-noti'>";i+="   <h2 class='title-22-u no-mg-top'>"+t+"<\/h2>";i+="   <a class='close' href='javascript:ClosePopupRefresh();'><i class='ic-cancel'><\/i><\/a>";i+="   <div class='content'>";i+='       <p class="have-mail">';i+=n;i+="       <\/p>";i+="   <\/div>";i+="<\/div>";$("#popup").html(i);NoScroll();$("#popup").click(function(){$("#popup").empty()})},MessagePopup:function(n,t){(t==undefined||t=="")&&(t="Notification");var i="";i+="<div onclick='ClosePopup()' class='bg-popup'><\/div>";i+="<div class='pop-noti'>";i+="   <h2 class='title-22-u no-mg-top'>"+t+"<\/h2>";i+="   <a class='close' href='javascript:ClosePopup();'><i class='ic-cancel'><\/i><\/a>";i+="   <div class='content'>";i+='       <p class="have-mail">';i+=n;i+="       <\/p>";i+="   <\/div>";i+="<\/div>";$("#popup").html(i);NoScroll()},MessagePopupFocus:function(n,t){(t==undefined||t=="")&&(t="Notification");var i="";i+="<div onclick='ClosePopup()' class='bg-popup'><\/div>";i+="<div class='pop-noti'>";i+="   <h2 class='title-22-u no-mg-top'>"+t+"<\/h2>";i+="   <a class='close' href='javascript:ClosePopup();'><i class='ic-cancel'><\/i><\/a>";i+="   <div class='content text-center mg-bottom-30'>";i+='       <p class="have-mail mg-bottom-20">';i+=n;i+="       <\/p>";i+='       <button type="button" onclick="ClosePopup()" class="btn-popup-green">Ok<\/button>';i+="   <\/div>";i+="<\/div>";$("#popup").html(i);NoScroll()},MessageRedirect:function(n,t){(t==undefined||t=="")&&(t="Notification");var i="";i+="<div class='bg-popup' onclick='ClosePopupRedirect()'><\/div>";i+="<div class='pop-noti'>";i+="   <h2 class='title-22-u no-mg-top'>"+t+"<\/h2>";i+="   <a class='close'  href='javascript:ClosePopupRedirect();'><i class='ic-cancel'><\/i><\/a>";i+="   <div class='content'>";i+='       <p class="have-mail">';i+=n;i+="       <\/p>";i+="   <\/div>";i+="<\/div>";$("#popup").html(i);NoScroll()},MessageRefresh:function(n,t){(t==undefined||t=="")&&(t="Notification");var i="";i+="<div class='bg-popup' onclick='ClosePopupRefresh()'><\/div>";i+="<div class='pop-noti'>";i+="   <h2 class='title-22-u no-mg-top'>"+t+"<\/h2>";i+="   <a class='close'  href='javascript:ClosePopupRefresh();'><i class='ic-cancel'><\/i><\/a>";i+="   <div class='content'>";i+='       <p class="have-mail">';i+=n;i+="       <\/p>";i+="   <\/div>";i+="<\/div>";$("#popup").html(i);NoScroll()},MessageSuccessPosted:function(n){var t="",i;n==1?(i="CONGRATULATION",strMessage="Your car listing is successfully submitted for review.<\/br> Press OK to return to Home page"):n==2&&(i="CONGRATULATION!",strMessage="Your car listing is successfully submitted for review.<\/br> Press OK to return to Home page");t+="<div class='bg-popup' onclick='ClosePopupRedirect()'><\/div>";t+="<div class='pop-noti'>";t+="   <h2 class='title-22-u no-mg-top'>"+i+"<\/h2>";t+="   <a class='close'  href='javascript:ClosePopupRedirect();'><i class='ic-cancel'><\/i><\/a>";t+="   <div class='content content3'>";t+='       <span class="p-348">';t+=strMessage;t+="       <\/span>";t+='<div class="control text-center mg-bottom-30">';t+='\t\t<button onclick="location.href=\'/\'" class="btn-popup-green">OK<\/button>';t+="   <\/div><\/div>";t+="<\/div>";$("#popup").html(t);NoScroll()},ConfirmMessageLogout:function(){confirm("Do you want to sign out of your account?")&&(location.href="/account/logout")},CreateMessageDetail:function(n){if(n!=null){var t="";t+='<div onclick="ClosePopup()" class="bg-popup"><\/div>';t+='<div class="pop-noti">';t+='<h2 class="title-22-u mg-top-0">'+(n.DisplayName!=undefined?n.DisplayName:"")+"<\/h2>";t+='<a class="close" href="javascript:ClosePopup();"><i class="icon-cancel"><\/i><\/a>';t+='<div class="content mg-top-12 mg-bottom-20">';t+='<ul class="i-info">';n.Phone!=null&&n.Phone!=""&&(t+='\t\t<li><a href="javascript:;"><i class="icon-phone"><\/i>'+n.Phone+'<\/a> <a class="call-now" href="tel:'+n.Phone+'"> Call now<\/a><\/li>');n.Address!=null&&n.Address!=""&&(t+='\t\t<li><a href="javascript:;" class="seller-address"><i class="icon-location-1 pd-left-5"><\/i><span>'+n.Address+"<\/span><\/a><\/li>");n.Email!=null&&n.Email!=""&&(t+='\t\t<li><a href="javascript:;" class="pull-left"><i class="icon-mail"><\/i>'+n.Email+"<\/a><\/li>");t+="\t<\/ul>";t+='<div class="clearboth"><\/div>';t+="<\/div>";t+="<\/div>";$("#popup").html(t);NoScroll()}},MessagePostLeadForm:function(n,t,i){var u,r;(t==undefined||t=="")&&(t="Notification");u="";$.each(i,function(n,t){u+="<img width='100' alt='Auto title' height='100' src='"+t.Image+"'>"});r="";r+="<div class='bg-popup'><\/div>";r+="<div class='popup modal-popup'>";r+="   <h2 class='title-22-u no-mg-top'>"+t+"<\/h2>";r+="   <a class='close' href='javascript:;'><i class='icon-cancel-2'><\/i><\/a>";r+="   <div class='content text-center mg-bottom-30'>";r+='       <p class="have-mail mg-bottom-20">';r+=n;r+="       <\/p>";r+=u;r+='       <button type="button" onclick="ClosePopup()" class="btn-138-green">Ok<\/button>';r+="   <\/div>";r+="<\/div>";$("#popup").html(r);NoScroll()}};$.fn.kmmask=function(){$(this).keyup(function(n){if(n.key!="ArrowLeft"&&n.key!="ArrowRight"){var t=$(this).val().replace(/\./g,"").replace(/,/g,"");$(this).val(t).formatCurrency({roundToDecimalPlace:-1,symbol:""});t=$(this).val();$(this).val(t)}})};$.fn.pricemask=function(){$(this).keyup(function(n){var t,i,r,u;n.key!="ArrowLeft"&&n.key!="ArrowRight"&&(t=$(this).val().replace(/\./g,"").replace(/,/g,""),t=t.toString(),i=t.substring(t.length-3),r=t.substring(0,t.length-3),r!=""&&(i=","+i),u=r.replace(/\B(?=(\d{2})+(?!\d))/g,",")+i,$(this).val(u))})};$.fn.focusTextToEnd=function(){this.focus();var n=this.val();return this.val("").val(n),this};$.fn.trimSpace=function(){$(this).on("blur",function(){$(this).val($.trim($(this).val()))})};$.fn.numbersOnly=function(){this.keyup(function(n){n.key!="ArrowLeft"&&n.key!="ArrowRight"&&(this.value=this.value.replace(/[^0-9]/g,""))})};var sellerOTP={ShowVerifyPhone:function(n){n.match(/\d{10,13}/g)==n?($("#popup").hide(),firebase_app.VerifyOTPPopup("frmShowSeller",n,function(n){if(n.Success){$("#popup #CodeVerify").val(n.Message);var t=$("#popup #Phone").val();n.PhoneNumber!=""&&n.PhoneNumber!=t&&$("#popup #Phone").val(n.PhoneNumber);$("#popup").show();$(".frmShowSeller button[type=submit]").click()}else notifys.CreateMessageError(n.Message)})):alert("Wrong format phone")}},registrationOTP={ShowVerifyPhone:function(n){n.match(/\d{10,13}/g)==n?$.ajax({url:"/Account/CheckExitsMobile",type:"POST",data:{phone:n},beforeSend:function(){Loading()},success:function(t){t.Error?notifys.CreateMessageError(t.Title,$("#popup #btnRegister").parents("form")):firebase_app.VerifyOTPPopup("popupRegister",n,function(n){if(n.Success){$("#popup #Code").val(n.Message);$("#popup #lblMessage").empty();var t=$("#popup #Provider").val();n.PhoneNumber!=""&&n.PhoneNumber!=t&&$("#popup #Provider").val(n.PhoneNumber);$("#popupRegister button[type=submit]").click()}else notifys.CreateMessageError(n.Message),$("#popup #Provider").focus()})},complete:function(){Loaded()}}):notifys.CreateMessageError("Wrong format phone",$("#popup #btnVerify").parents("form"))}},sellCarOTP={ShowVerifyPhone:function(n){n.match(/\d{10,13}/g)==n?n!=$("#Contact_Mobile").text()?firebase_app.VerifyOTPPopup("frmCreateAuto",n,function(n){if(n.Success){$("#Contact_Mobile").attr("readonly","readonly");$(".frmPost #PhoneValid").val(n.Message);var t=$(".frmPost #Contact_Mobile").val();n.PhoneNumber!=""&&n.PhoneNumber!=t&&$(".frmPost #Contact_Mobile").val(n.PhoneNumber);$(".frmPost").submit()}else alert(n.Message),$("#Contact_Mobile").focus()}):(alert("Enter another phone number"),$("#Contact_Mobile").focusTextToEnd()):alert("Wrong format phone")}},profileOTP={ShowVerifyPhone:function(n){n.match(/\d{10,13}/g)==n?n!=$("#txtMobileAlias").text()?$.ajax({url:"/Account/CheckExitsMobile",type:"POST",data:{phone:n},beforeSend:function(){Loading()},success:function(t){t.Error?alert(t.Title):firebase_app.VerifyOTPPopup("frmProfile",n,function(n){if(n.Success){var t=$("#frmProfile #MobileAlias").val();n.PhoneNumber!=""&&n.PhoneNumber!=t&&$("#frmProfile #MobileAlias").val(n.PhoneNumber);$("#frmProfile button[type=submit]").click()}})},complete:function(){Loaded()}}):(alert("Enter another phone number"),$("#MobileAlias").focusTextToEnd()):alert("Wrong format phone")}},sellerGetOfferNewCarOTP={ShowVerifyPhone:function(n){n.match(/\d{10,13}/g)==n?($("#popup").hide(),firebase_app.VerifyOTPPopup("checkoffer",n,function(n){if(n.Success){var t=$("#checkoffer #PhoneNumber").val();n.PhoneNumber!=""&&n.PhoneNumber!=t&&$("#checkoffer #PhoneNumber").val(n.PhoneNumber);$("#popup #CodeVerify").val("success");$("#popup").show();$("#checkoffer button[type=submit]").click()}})):alert("Wrong format phone")}},isIncludeEngageswipeBannerCssFile=!1,isIncludeEngageswipeBannerJsfile=!1,isIncludeGrowProxyBannerJsfile=!1,isShownMobileCard=!1,isIncludeSwiperCssWapCssFile=!1,isIncludeGoogleAdsLibraryFile=!1;const enumBuilder=function(){return Object.freeze([].reduce.call(arguments,function(n,t,i){if(typeof t!="string")throw TypeError("Supplied key was not a string: "+t);if({}.hasOwnProperty.call(n,t))throw SyntaxError("key already used: "+t);return n[t]=i,n},Object.create(null)))},bannerTypeEnum=enumBuilder("empty","Banner","EmbededCode","IndianautoApp","MobileEngageSwipe","MobileGrow","MobileCube","MobileSlide","MobileCard","GoogleAds"),pageIdEnum=enumBuilder("empty","Home","UsedCarList","UsedCarDetail","News","NewsDetail","CarPrice","CarPriceDetail","CarReview","CarReviewDetail");var randomBanner={show:function(n){if(typeof bannerData!="undefined"&&bannerData.Id==n){var t=bannerData.ListPosition;$.each(t,function(t,i){var p=i.ListBanner,c=[],o=[],l=[],w=[],b=[],k=[],s=[],e=[],h=[],a=[],f=[],g=[],v,r,u,y,d;if($.each(p,function(n,t){if(t.Type!=bannerTypeEnum.MobileSlide&&t.Type!=bannerTypeEnum.MobileCard){
//!= type mobileslider && != MobileCard
c.push(t.Id);o.push(t.ImageUrl);l.push(t.Image2);w.push(t.Image3);b.push(t.Image4);s.push(t.TargetLink);e.push(t.Title);h.push(t.Alternate);f.push(t.Type);k.push(t.EmbededCode);a.push(t.ClassName);g.push(t.Description)}}),$.each(p,function(n,t){if(t.Type==bannerTypeEnum.MobileSlide||t.Type==bannerTypeEnum.MobileCard)if(t.Type==bannerTypeEnum.MobileCard){var r=cookie_manager.get_cookie("AdsBannerMobileCards-"+i.Name);if(!(r==undefined&&r!=null||r!=""))return c.push(t.Id),f.push(t.Type),o.push(t.ImageUrl),console.log(t.Id),!1}else return c.push(t.Id),f.push(t.Type),o.push(t.ImageUrl),!1}),v=o.length,v>0){if(r=Math.floor(v*Math.random()),u="",f[r]==bannerTypeEnum.Banner)u+="<a href='"+s[r]+"' title='"+e[r]+"' rel='nofollow' target='_blank'>",u+="<img src='"+o[r]+"' title='"+e[r]+"' alt='"+h[r]+"' class='"+a+"' />",u+="<\/a>";else if(f[r]==bannerTypeEnum.EmbededCode||f[r]==bannerTypeEnum.GoogleAds)u+=k[r].replace(/<\\\/script>/g,"<\/script>");else if(f[r]==bannerTypeEnum.IndianautoApp)u+='<span class="Indianauto-App-Link"> <a href=\''+s[r]+"' title='"+e[r]+"' rel='nofollow'>",u+="<img src='"+o[r]+"' title='"+e[r]+"' alt='"+h[r]+"' class='"+a+"' />",u+="<\/a><\/span>";else if(f[r]==bannerTypeEnum.MobileCube){if(y=!0,$("link[href='"+$("#hdswipercsswapcssfile").val()+"']").length||(y=!1),(n==pageIdEnum.NewsDetail||!y)&&!isIncludeSwiperCssWapCssFile){isIncludeSwiperCssWapCssFile=!0;let n=document.createElement("link");n.type="text/css";n.rel="stylesheet";n.href=""+$("#hdswipercsswapcssfile").val();n.media="all";$("head").append(n)}u+="<div class='swiper-container swiper-cube'>";u+="<div class='swiper-wrapper'>";u+="<div class='swiper-slide' ><a href='"+s[r]+"' title='"+e[r]+"' rel='nofollow' target='_blank'><img src='"+o[r]+"' alt='"+h[r]+"' /><\/a><\/div>";u+="<div class='swiper-slide'><a href='"+s[r]+"' title='"+e[r]+"' rel='nofollow' target='_blank'><img src='"+l[r]+"' alt='"+h[r]+"' /><\/a><\/div>";u+="<div class='swiper-slide' ><a href='"+s[r]+"' title='"+e[r]+"' rel='nofollow' target='_blank'><img src='"+w[r]+"' alt='"+h[r]+"' /><\/a><\/div>";u+="<div class='swiper-slide' ><a href='"+s[r]+"' title='"+e[r]+"' rel='nofollow' target='_blank'><img src='"+b[r]+"' alt='"+h[r]+"' /><\/a><\/div>";u+="<\/div > ";u+="<div class='swiper-pagination'><\/div>";u+="<\/div > "}else if(f[r]==bannerTypeEnum.MobileSlide||f[r]==bannerTypeEnum.MobileCard)u+="<div>",f[r]==bannerTypeEnum.MobileCard?(u+="\t<iframe id='slider-iframe'  src='/AdsBanner/GetBanner?platformId=2&pageId="+n+"&posId="+i.Id+"&type="+f[r]+"' frameborder='0'><\/iframe>",$("#"+i.Name+"").height(0)):u+="\t<iframe id='slider-iframe' class= 'ads-banner-iframe'  src='/AdsBanner/GetBanner?platformId=2&pageId="+n+"&posId="+i.Id+"&type="+f[r]+"' frameborder='0'><\/iframe>",u+="<\/div>";else if(f[r]==bannerTypeEnum.MobileEngageSwipe){if(!isIncludeEngageswipeBannerCssFile){isIncludeEngageswipeBannerCssFile=!0;let n=document.createElement("link");n.type="text/css";n.rel="stylesheet";n.href=""+$("#hdmobileengageswipebanneradswapcssfile").val();n.media="all";$("head").append(n)}u+="<div style='height: 100%;'>";u+="    <div id='apps-ad-engageswipe'>";u+="        <div id='banner-ad' style='right: 1500px;'>";u+="            <div id='banner-close' style='display: none;'><\/div>";u+="            <div id='mobile-engage-swipe-banner-wrapper' style='width: 320px; height: 416px; left: 20px; top: 112px;'>";u+="                <div id='banner-content'>";u+="                 <div><a href='"+s[r]+"' title='"+e[r]+"' rel='nofollow' target='_blank'><img alt='"+e[r]+"' src='"+o[r]+"' width=320 height = 416'/><\/a><\/div>";u+="                <\/div > ";u+="            <\/div>";u+="            <div id='banner-better-experience' style='display: none;'>";u+="                <div id='banner-better-text' style='padding-top: 50px;'>";u+="                    <div id='repeat-rotateicon'><\/div>Please rotate to potrait mode for optimum viewing experience.";u+="                <\/div>";u+="            <\/div>";u+="        <\/div>";u+="        <div id='invitation-ad' style='right: 0px;'>";u+="            <div id='invitation-close'><\/div>";u+="            <div id='invitation-content'>";u+="                <div id='invitation-engage-more'><img alt='Banner' src='"+l[r]+"' width=320 height=50 />";u+="                    <div id='invitation-engage' class='invitation-engage-start' style='left: 640px;'>";u+="                        <div id='invitation-engage-direction'><\/div>";u+="                        <div id='repeat-notice'><\/div>";u+="                    <\/div>";u+="                <\/div>";u+="            <\/div>";u+="            <div id='edu-notification-content' style='width: 77px; left: 141.5px; display: none;' class=''><\/div>";u+="        <\/div>";u+="    <\/div>";u+="<\/div>"}else f[r]==bannerTypeEnum.MobileGrow&&(u+=n!=pageIdEnum.News?"<div id='mobileCubeMarginTop' class='mg-top-5'>&nbsp;<\/div><span id='mobile-grow-ads-banner'><input id='mobilegrowurl' type='hidden' value='/AdsBanner/GetBanner?platformId=2&pageId="+n+"&posId="+i.Id+"&type="+f[r]+"'><\/span>":"<span id='mobile-grow-ads-banner'><input id='mobilegrowurl' type='hidden' value='/AdsBanner/GetBanner?platformId=2&pageId="+n+"&posId="+i.Id+"&type="+f[r]+"'><\/span>");if(f[r]!=bannerTypeEnum.MobileEngageSwipe?$("#"+i.Name).html(u):$("body").append(u),f[r]==bannerTypeEnum.MobileCube&&$(".swiper-cube").length>0&&typeof d=="undefined"&&(d=new Swiper(".swiper-container.swiper-cube",{effect:"cube",loop:!0,autoplay:!0,grabCursor:!0,cubeEffect:{shadow:!0,slideShadows:!0,shadowOffset:20,shadowScale:.94}})),f[r]==bannerTypeEnum.MobileEngageSwipe&&!isIncludeEngageswipeBannerJsfile){isIncludeEngageswipeBannerJsfile=!0;let n=document.createElement("script");n.type="text/javascript";n.src=""+$("#hdmobileengageswipebanneradswapjsfile").val();$("head").append(n)}if(f[r]==bannerTypeEnum.MobileGrow&&!isIncludeGrowProxyBannerJsfile){isIncludeGrowProxyBannerJsfile=!0;let n=document.createElement("script");n.type="text/javascript";n.src=""+$("#hdmobilegrowinitbanneradswapjsfile").val();$("head").append(n);$("#"+i.Name+"").css({"margin-bottom":"10px","margin-top":"10px"})}if(f[r]==bannerTypeEnum.MobileCard&&(window.addEventListener("scroll",function(){randomBanner.showMobileCard(i.Name)},!1),$(".mobile-sticky-banner .close-button.icon-cancel").remove()),f[r]==bannerTypeEnum.GoogleAds&&!isIncludeGoogleAdsLibraryFile){isIncludeGoogleAdsLibraryFile=!0;let n=document.createElement("script");n.type="text/javascript";n.setAttribute("data-ad-client","ca-pub-1348571685641357");n.async=!0;n.src=""+$("#hdGoogleAdsLibrary").val();$("head").append(n)}}else $("#"+i.Name).remove(),$("."+i.Name).remove()});AppLink.getAppLink()}},close:function(n,t=0){var r=$("#"+n),i,u;t==bannerTypeEnum.MobileCard&&(i=new Date,i.setTime(i.getTime()+2592e5),u="expires="+i.toGMTString(),document.cookie="AdsBannerMobileCards-"+n+"="+n+";"+u+";path=/");r.addClass("hide");r.parent().hide()},run:function(){if(typeof bannerData!="undefined"){var n=bannerData.Id;randomBanner.show(n)}},getStaticUrl:function(){return $("#hdStaticSite").val()},showMobileCard:function(n){var t=window;t.scrollY>=t.innerHeight/2&&isShownMobileCard===!1&&(isShownMobileCard=!0,$("#"+n+"").css({height:"auto"}))}},AppLink={getAppLink:function(){var n=navigator.userAgent||navigator.vendor||window.opera;/windows phone/i.test(n)&&$(".Indianauto-App-Link>a").attr("href","https://www.microsoft.com/en-us/store/apps/windows");/android/i.test(n)&&$(".Indianauto-App-Link>a").attr("href","https://play.google.com/store/apps/details?id=com.indianauto");/iPad|iPhone|iPod/.test(n)&&!window.MSStream&&$(".Indianauto-App-Link>a").attr("href","https://apps.apple.com/us/app/indianauto/id1492977860?ls=1")}},FirebaseAppInitializer={Initialized:!1,Init:function(){FirebaseAppInitializer.Initialized||(this.Initialized=!0)}},firebase_app={VerifyOTPPopup:function(n,t,i){var r=new FirebasePhoneVerifier("VerifyPhonePopup");r.Verify(n,t,function(n,t,r){if(console.log(n.success,t,r),n.success){var u={Success:n.success,PhoneNumber:t,Code:r,Message:"success"};return i(u)}$("#otpMessage").html("Invalid code, please try again!")})},ReSendOtp:function(n){$("#"+n+" button[type=submit]").click()},OpenVerifyPopup:function(n,t){$("#VerifyPhonePopup").load("/Common/VerifyOTP?phoneToVerify="+t+"&formToverify="+n)}};url={build_url:function(n){var i=document.URL,t,r,u,f,e;i=i.replace(new RegExp("/p([0-9]+)"),"");i=i.replace(new RegExp("#"),"");t=location.pathname;r=window.location.search;"URLSearchParams"in window&&(u=new URLSearchParams(window.location.search),u.set("sortid",n),r=u.toString());f=/\/p/g;f.test(t)&&(t=t.substring(0,t.lastIndexOf("/")));e=t+"?"+r;location.href=e}};$(document).ready(function(){});