function Loading(n){LoadingProcess(n,loadingPath)}function LoadingProcess(n,t){$(n).empty().html('<div class="loader"><img src='+t+" /><\/div>")}function LoadHtml(n,t){$(n).load(t)}function GetAjaxPageHtml(n,t,i,r){$(n).val()!=undefined&&$(function(){$.ajax({type:"GET",cache:!1,async:r,url:t,context:document.body,success:function(r){$(n).html(r);$.fn.registerDesingEvents&&$(n).registerDesingEvents();i!=null&&(window.history.pushState({page:t},null,i),loadPage=!0)},error:function(){$(n).html(localizationDictionary.ERROROCCURED)}})})}function PostAjaxPage(n,t,i,r){$(n).val()!=undefined&&(Loading(n),$(function(){$.ajax({type:"POST",data:t,cache:!1,async:r,url:i,context:document.body,success:function(t){$(n).html(t)},error:function(){$(n).html(localizationDictionary.ERROROCCURED)}})}))}function PostAjaxPageForJson(n,t,i,r){$(n).val()!=undefined&&(Loading(n),$(function(){$.ajax({type:"POST",contentType:"application/json; charset=utf-8",data:t,cache:!1,async:r,url:i,context:document.body,success:function(t){$(n).html(t)},error:function(){$(n).html(localizationDictionary.ERROROCCURED)}})}))}function generateAjaxUrl(n,t){var i=$("#pageSetting");return"/"+i.data("culture")+"/"+i.data("country")+"/ajax/"+n+"/"+t}function RegisterEvents(){$("#modal-user-login").on("shown.bs.modal",function(){$("#modal-user-login").find(".modal-body").html("<iframe src='/logindialog' style='width: 100%; height: 100%' scrolling='no' marginwidth='0' marginheight='0' frameborder='0' vspace='0' hspace='0'><\/iframe>")});$("#modal-user-login").on("hidden.bs.modal",function(){$("#modal-user-login").find(".modal-body").html("")});$("#modal-forgot-password").on("shown.bs.modal",function(){$("#modal-forgot-password").find(".modal-body").html("<iframe src='/forgotpassworddialog/?m="+forgotPasswordEmailAddress+"' style='width: 100%; height: 100%' scrolling='no' marginwidth='0' marginheight='0' frameborder='0' vspace='0' hspace='0'><\/iframe>")});$("#modal-forgot-password").on("hidden.bs.modal",function(){$("#modal-forgot-password").find(".modal-body").html("")});$("#modal-user-register").on("shown.bs.modal",function(){$("#modal-user-register").find(".modal-body").html("<iframe src='/registerdialog' style='width: 100%; height: 100%' scrolling='no' marginwidth='0' marginheight='0' frameborder='0' vspace='0' hspace='0'><\/iframe>")});$("#modal-user-register").on("hidden.bs.modal",function(){$("#modal-user-register").find(".modal-body").html("")})}function RefreshHeaderAndHideLoginDialog(){if($("#ShoppingCartContent").length>0){window.location=window.location;return}HideLoginDialog();var n=getQuerystring("returnUrl");n!=""?window.location=n:RefreshHeader()}function RefreshHeader(){var n=function(){UpdateCartInfo()};setTimeout(function(){UpdateLoginInfo(n)},500)}function ShowForgotPasswordDialog(){var n=$("#modal-user-register .modal-body > iframe").contents().find("html").find("#EmailAddress").val();HideLoginDialog();HideRegisterDialog();forgotPasswordEmailAddress=n!=undefined?n:"";$("#modal-forgot-password").modal("show")}function HideForgotPasswordDialog(){$("#modal-forgot-password").modal("hide")}function HideRegisterDialog(){$("#modal-user-register").modal("hide")}function ShowLoginDialog(){$("#modal-user-login").modal("show")}function HideLoginDialog(){$("#modal-user-login").modal("hide")}function UpdateLoginInfo(n){var t=function(t){var i=$(".header-user-section");i.html(t.content);$.fn.registerDesingEvents&&i.registerDesingEvents();n!=null&&n()},i=function(){};$.ajax({url:generateAjaxUrl("visitor","getheaderusercontent"),type:"POST",dataType:"json",success:t,error:i})}function UpdateCartInfo(n){var t=function(t){var i=$(".header-cart-section");i.html(t.content);$.fn.registerDesingEvents&&i.registerDesingEvents();n!=null&&n()},i=function(){};$.ajax({url:document.location.protocol=="https:"?generateAjaxUrl("shop","getshoppingcartsummarysec"):generateAjaxUrl("shop","getshoppingcartsummary"),type:"POST",dataType:"json",success:t,error:i})}function UpdateCartInformation(){var n=function(n){var i,t;trackingModule.cartRefreshed(n.ItemList);ShoppingCartTotalDiscountedPrice=n.TotalDiscountedPrice;i=$(".header-cart-section");$("#spanCart").html('(<span id="cartQuantity_Header" class="header-cart-quantity">'+n.TotalQuantity+'<\/span><span id="cartTotal_Header" class="header-cart-total"> '+localizationDictionary.Product+" "+n.TotalDiscountedPrice+"<\/span>)");$("#divCartSlider").html(n.CartContent);$("#favorite-count").html(n.FavoriteCount);$("#header-user-section").html(n.TopBarMenuContent);t=$("#last-order-bar");n.InfoBarContentLine1&&t.size()>0&&($("#splastOrderWelcome").html(n.InfoBarContentLine1),t.addClass("showLastOrderBar"));n.InfoBarContentLine2&&t.size()>0&&($("#splastOrderBar").html(n.InfoBarContentLine2),t.addClass("showLastOrderBar"));n.InfoBarContentLine2Bold&&t.size()>0&&($("#splastOrderBarStatus").html(n.InfoBarContentLine2Bold),t.addClass("showLastOrderBar"));n.InfoBarContentLine2Link&&t.size()>0&&($("#splastOrderBarLink").html(n.InfoBarContentLine2Link),barbar.addClass("showLastOrderBar"));$("#back-to-cartQuantity").length&&$("#back-to-cartQuantity").html(n.TotalQuantity);$.fn.registerDesingEvents&&i.registerDesingEvents()},t=function(){};$.ajax({url:document.location.protocol=="https:"?generateAjaxUrl("shop","getsessioninstantdataSecure"):generateAjaxUrl("shop","getsessioninstantdata"),type:"GET",dataType:"json",cache:!1,async:!0,success:n,error:t})}function Logout(){var i=window.location.host,n=function(){window.location="/"},t=function(){window.location="/"};$.ajax({url:generateAjaxUrl("authentication","logout"),type:"POST",dataType:"json",success:n,error:t})}function SendActivation(){var n="EmailAddress="+$("#LoginEmail").val();PostAjaxPage("#divMessage",n,generateAjaxUrl("authentication","sendactivationemail"),!0)}function ActivationUI(){this.control=$("#modalSaveChanges");this.lastHref="";this.targetObject=null;this.formIsChanged=!1;this.$CountryId=$("#CountryId");this.$CityId=$("#CityId");this.$LanguageId=$("#LanguageId");this.$CityName=$("#CityName");this.$CountyId=$("#CountyId");this.$CountyName=$("#CountyName");this.$PhoneNumber=$("#PhoneNumber");this.$PhoneNumberWithCountryCode=$("#PhoneNumberWithCountryCode");this.$PhoneNumberWithCountryCodeInfoMessage=$("#divwebUI_ShippingAddressViewModel_PhoneNumberCountryCodeIncluded");this.$PhoneNumberInfoMessage=$("#divwebUI_ShippingAddressViewModel_OrderInfoWillSentSMS");this.$countOfChildren=$("select[name$=CountOfChildren]");this.$pregnantCategory=$("input[name=InterestedCategories][value=16]");this.init()}function ChangePasswordUI(){var t=this,n;this.$form=$("form[id=ChangePasswordForm]");this.$submit=this.$form.find(".submit-button");t.$form.resetValidation();this.$submit.click(function(n){n.preventDefault();t.$form.submit()});n=$("#IsSuccess").val();n!="undefined"&&n!=undefined&&setTimeout(function(){location.href=localizationDictionary.MYINFORMATIONURL},4e3)}function PersonalInformationUI(){this.control=$("#modalSaveChanges");this.$CountryId=$("#CountryId");this.$PhoneNumber=$("#PhoneNumber");this.$PhoneNumberWithCountryCode=$("#PhoneNumberWithCountryCode");this.lastHref="";this.targetObject=null;this.formIsChanged=!1;this.$CityId=null;this.$CountyId=null;this.$countOfChildren=null;this.$pregnantCategory=null;this.$campaignChoiceSMS=null;this.$campaignChoiceEmail=null;this.validatePhoneNumberConfirmationCodeFirst=!1;this.init()}function MasterpassUserProfileProcess(){this.otpClock="";this.isOpenUpdateMPOtpForm=!1;this.otpUpdateOk=!1;this.otpResendFault=!1;this.tyrCountOtpCodeUpdate=0;this.HasMpAccount=!1;this.IsMpAccountBlock=!1;this.IsMpAccountRelatedClient=!1}function SmsValidation(){personalInformationUI.$CountryId.change(function(){var n=$(this).val();n!=null&&n!=""&&personalInformationUI.OnCountryIdChanged(n)});$("#divPersonalInformation").hide();$("#divOtherInformation").hide();$("#divPersonalInformationEdit").show();$(".alert-block").hide();$("#divPersonalInformationEdit").registerDesingEvents();$("#divOtherInformationEdit").registerDesingEvents();var n=$("#PhoneNumber").val();n!=null&&n!=""?(personalInformationUI.formIsChanged=!1,personalInformationUI.SaveForm(),NewActionCode=!0):(NewActionCode=!0,$("#DivPhoneNumberAndSmsControlError").show(),$("#PhoneNumberAndSmsControlError").show(),$("#FreeSmsMessage").removeClass("DisplayBlock"),$("#FreeSmsMessage").hide(),$("#DivPhoneNumber").addClass("invalid"))}function EmailValidation(){var n,t,i;SendValidationEmail();n='Kampanyalardan SMS ile haberdar olmak için cep telefonunuzu  <a href="#" class="" style="text-decoration:underline;font-weight: bold;" id="btnPersonalInformationEditForValidation" onclick="SmsValidation()" off-save-changes-operation="true">doğrulayınız.<\/a>';t=$("#DivInfoMessage").html();$("#DivInfoMessage").html("");t.includes("SMS")&&($("#DivInfoMessage").append(n),$("#DivInfoMessage").append("<br>"));i='<label class="emailvalidationlinkNotification" >Doğrulama linki mail adresinize gönderildi.Lütfen kontrol ediniz.<\/label>';$("#DivInfoMessage").append(i)}function mfsToUpdateResponseHandler(n,t){return masterpassUserProfileProcess.MFSUpdateResponseHandler(n,t),!1}function mfsToOtpUpdateUserConfirmResponseHandler(n,t){return masterpassUserProfileProcess.MFSOtpUpdateUserConfirmResponseHandler(n,t),!1}function chkMPResponseHandler(n,t){return masterpassUserProfileProcess.MFSChkMPResponseHandler(n,t),!1}function OtpResendAction(){return masterpassUserProfileProcess.MFSOtpResendAction(),!1}function mfsToOtpResendResponseHandler(n,t){masterpassUserProfileProcess.MfsOtpResendResponseHandler(n,t)}function AddressInformationUI(){this.control=$("#modalSaveChanges");this.addresses=$("#divAddresses");this.addressForm=$("#addressForm");this.lastHref="";this.targetObject=null;this.formIsChanged=!1;this.init()}function CustomerBankAccountUI(){this.control=$("#modalSaveChanges");this.customerBankAccounts=$("#divCustomerBankAccountsPanel");this.customerBankAccountForm=$("#customerBankAccountForm");this.lastHref="";this.targetObject=null;this.formIsChanged=!1;this.init()}function BankChanged(){var n=$("#BankId option:selected").val();GetSwiftCodeList(n)}function GetSwiftCodeList(n){var t="",i=this;$.getJSON("/user/GetSwiftCodeList",{selectedBankId:n},function(n){$("#BankCode").html(t);t+="<input class='valid' type='text' value="+n[0].Text+" readonly>";$("#BankCode").html(t)})}function GetAddressesPage(n){GetNewUrlFromAjax(n,function(t){window.history.pushState!=null?GetAjaxPageHtml("#divAddresses",n,decodeURIComponent(t),!1):location.href=decodeURIComponent(t)})}function GetOrdersPage(n,t){GetNewUrlFromAjax(n,function(i){window.history.pushState!=null?(GetAjaxPageHtml("#divOrders",n,decodeURIComponent(i),!1),t&&$("#divMessage").html("")):location.href=decodeURIComponent(i)})}function GetWalletPage(n,t){GetNewUrlFromAjax(n,function(i){window.history.pushState!=null?(GetAjaxPageHtml("#divWallet",n,decodeURIComponent(i),!1),t&&$("#divMessage").html("")):location.href=decodeURIComponent(i)})}function GetCouponsPage(n){GetNewUrlFromAjax(n,function(t){window.history.pushState!=null?(GetAjaxPageHtml("#divWallet",n,decodeURIComponent(t),!1),messageRemove&&$("#divCoupons").html("")):location.href=decodeURIComponent(t)})}function GetInvitationsPage(n){GetNewUrlFromAjax(n,function(t){window.history.pushState!=null?(GetAjaxPageHtml("#divInvitations",n,decodeURIComponent(t),!1),messageRemove&&$("#divCoupons").html("")):location.href=decodeURIComponent(t)})}function GetReturnsPage(n){GetNewUrlFromAjax(n,function(t){window.history.pushState!=null?GetAjaxPageHtml("#divReturns",n,decodeURIComponent(t),!1):location.href=decodeURIComponent(t)})}function CountryChanged(){var n=$("#CountryId option:selected").val();GetLanguageList(n)}function GetLanguageList(n){var t="",i=this;$.getJSON("/user/getLanguageList",{selectedCountryId:n},function(n){$("#LanguageId").html(t);$.each(n,function(n,i){t+="<option value="+i.Value+">"+i.Text+"<\/option>"});$("#LanguageId").html(t);$("#LanguageId").chosen("destroy");$("#LanguageId").chosen();$("#DivLanguageList .chosen-icon").first().html("&#61556;")})}function CountryChangedForRegister(){var n=$("#RegisterFormView_CountryId option:selected").val();GetLanguageListForRegister(n)}function GetLanguageListForRegister(n){var t="";$.getJSON("/user/getLanguageList",{selectedCountryId:n},function(n){$("#RegisterFormView_LanguageId").html(t);$.each(n,function(n,i){t+="<option value="+i.Value+">"+i.Text+"<\/option>"});$("#RegisterFormView_LanguageId").html(t);$("#RegisterFormView_LanguageId").chosen("destroy");$("#RegisterFormView_LanguageId").chosen();$("#DivLanguage .chosen-icon").first().html("&#61556;")})}function redirectRegisterPage(n){var t=$("#LoginEmail").val();t!=""?$.ajax({url:generateAjaxUrl("Authentication","SetEmailTempData"),type:"GET",cache:!1,data:{Email:t},success:function(){window.location.href=n},error:function(){window.location.href=n}}):window.location.href=n}function redirectLoginPage(n){var t=$("#RegisterFormView_RegisterEmail").val();({}).LoginEmail=t;t!=""?$.ajax({url:generateAjaxUrl("Authentication","SetEmailTempData"),type:"GET",cache:!1,data:{Email:t},success:function(){window.location.href=n},error:function(){window.location.href=n}}):window.location.href=n}function PhoneNumberOnChange(){var n=document.getElementById("PhoneNumber").value;document.getElementById("DivPhoneNumberAndSmsControlError").style.marginTop=n.length==15&&n!="0(___) ___ ____"?"-5px":"0px"}function OrderAddressEntiyRule(){this.CountryAddressRules=[];this.$AddressEntityType_Region=1;this.$AddressEntityType_District=2;this.$AddressEntityType_City=3;this.$AddressEntityType_County=4;this.$AddressEntityType_PostalCode=5;this.$AddressEntityType_Street=6;this.$AddressEntityType_Floot=7;this.$AddressEntityType_Flat=8;this.$AddressEntityType_House=9;this.$AddressEntryType_Text=1;this.$AddressEntryType_Select=2;this.$AddressEntryType_Hidden=3;this.$AddressEntryType_Hybrid=4}var loadingPath="/Resource/images/loader.gif",loadPage=!1,forgotPasswordEmailAddress,masterpassUserProfileProcess,NewActionCode;try{loadPage=window.history.state}catch(err){}$(document).ready(function(){RegisterEvents();switch(location.hash){case"#login":$("#modal-user-login").modal("show");break;case"#register":$("#modal-user-register").modal("show");break;case"#forgotpassword":$("#modal-forgot-password").modal("show")}$("#btnlastOrderBarClose").on("click",function(){$("#last-order-bar").removeClass("showLastOrderBar")})});forgotPasswordEmailAddress="";NewActionCode=!1;ActivationUI.prototype={init:function(){var n=this;$("#modalSaveChangesNoBtn").click(function(){n.CompleteEvent();n.control.modal("hide")});$("#modalSaveChangesYesBtn").click(function(){n.SaveForm();n.CompleteEvent();n.control.modal("hide")});$("#btnActivationSave").click(function(){n.formIsChanged=!1;n.SaveForm()});$("#FirstName").resetValidation();$("#FirstName").valid();$("#LastName").valid();n.$CountryId.valid();n.$CountryId.change(function(){var t=$(this).val();t!=null&&t!=""&&n.OnCountryIdChanged(t)});n.$CityId.change(function(t){var i=$(this).val(),r;i!=null&&i!=""&&(r=t.OpenChildChoosenDrop,n.SetAddressEntityToControl("",n.orderAddressEntiyRule.$AddressEntityType_City,i,r))});$("#pregnancy").fadeOut();n.$pregnantCategory.on("ifChecked",function(){$("#pregnancy").fadeIn()});n.$pregnantCategory.on("ifUnchecked",function(){$("#pregnancy").fadeOut()});$("#child1st, #child2nd, #child3rd, #child4th, #child5th").fadeOut();n.$countOfChildren.change(function(){var n=$(this).val();switch(n){case"1":$("#child1st").fadeIn();$("#child2nd, #child3rd, #child4th, #child5th").fadeOut();break;case"2":$("#child1st, #child2nd").fadeIn();$("#child3rd, #child4th, #child5th").fadeOut();break;case"3":$("#child1st, #child2nd, #child3rd").fadeIn();$("#child4th, #child5th").fadeOut();break;case"4":$("#child1st, #child2nd, #child3rd, #child4th").fadeIn();$("#child5th").fadeOut();break;case"5":$("#child1st, #child2nd, #child3rd, #child4th, #child5th").fadeIn();break;default:$("#child1st, #child2nd, #child3rd, #child4th, #child5th").fadeOut()}})},Show:function(){this.control.modal("show")},CheckClickEvent:function(n){var t=n.currentTarget.attributes.getNamedItem("off-save-changes-operation");return t!=undefined&&t?!0:this.formIsChanged?($(window).unbind(),n.preventDefault(),this.lastHref=n.currentTarget.href,$("#modalSaveChanges").modal("show"),!1):!0},RefreshPageCloseEvents:function(){var n=this;$("a[href]").click(function(t){n.CheckClickEvent(t)})},ClearEvents:function(){this.lastHref=""},CompleteEvent:function(){this.targetObject!=null&&this.targetObject.click!=undefined&&this.targetObject.click!=null&&this.targetObject.click();window.location.href!=null&&(window.location.href=this.lastHref);this.ClearEvents()},SaveForm:function(){var n=$("#activationForm"),t=n.valid();t?n.submit():(n.validateForm(),$("html, body").animate({scrollTop:$("div .invalid").offset().top},1e3))},FormSuccess:function(n,t){var i=this;t=="success"&&(isNaN(n.Message)?($("#divWarning").show(),$("#divMessage").show(),$("#divCouponMessage").hide()):($("#divWarning").hide(),$("#divCouponMessage").show(),$("#activationForm").hide(),$("#divMessage").html(n.ExternalScripts)))},OnCountryIdChanged:function(n){var t=this;$.inArray(n,countryIdListWhereCustomerFillsSalaryRange)?$("#divSalaryRange").hide():($("#divSalaryRange").show(),$("#SalaryRange").chosen("destroy"),$("#SalaryRange").chosen())},GetChildAddressEntities:function(n,t,i,r,u,f,e,o){$.ajax({url:generateAjaxUrl("Master","GetChildAddressEntities"),dataType:"json",async:!1,data:{parentAddressEntityId:n,parentAddressEntityTypeId:t,childAddressEntityTypeId:i,isValidName:e},success:function(t){var i=r.children().first();r.empty();r.append(i);t!=null&&$.each(t,function(n,t){r.append($("<option/>",{value:t.Value,text:t.Text}))});u==null&&(u=-1);r.val(u);f!=undefined&&f||r.checkValidate();r.chosen("destroy");r.chosen();ResetFormTabIndex();n!="-1"&&o&&setTimeout(function(){r.parent().find("a").mousedown()},100)}})},DestroyChildSelectionControl:function(n){var t=n.children().first();n.empty();n.append(t);n.chosen("destroy");n.chosen();ResetFormTabIndex()},SetAddressEntityToControl:function(n,t,i,r){var u=personalInformationUI.orderAddressEntiyRule.GetChildAddressEntityType(t),f,e,o,s,h;if(u!=""){if(f=$.grep(personalInformationUI.orderAddressEntiyRule.CountryAddressRules,function(n){return n.AddressEntityTypeId===u}),e=f[0].AddressEntryTypeId,e==personalInformationUI.orderAddressEntiyRule.$AddressEntryType_Select||e==personalInformationUI.orderAddressEntiyRule.$AddressEntryType_Hybrid){var c=personalInformationUI.orderAddressEntiyRule.GetAddressEntityTypeName(u),l=n+c+"Id",a=f.length>0?f[0].AddressEntryTypeId==personalInformationUI.orderAddressEntiyRule.$AddressEntryType_Select:!1;r=typeof r!="undefined"?r==="false"?!1:!0:!0;personalInformationUI.GetChildAddressEntities(i,t,u,$("#"+l),-1,!1,a,r)}o=personalInformationUI.orderAddressEntiyRule.GetChildAddressEntityType(u);o!=""&&(s=personalInformationUI.orderAddressEntiyRule.GetAddressEntityTypeName(o),h=n+s+"Id",personalInformationUI.DestroyChildSelectionControl($("#"+h)))}}};PersonalInformationUI.prototype={init:function(){var n=this;n.LoadFormDetails()},LoadFormDetails:function(){var n=this,t;n.orderAddressEntiyRule=new OrderAddressEntiyRule;n.orderAddressEntiyRule.GetAddressEntityRules($("#CountryId").val());n.$CityId=$("#CityId");n.$CountyId=$("#CountyId");n.$countOfChildren=$("select[name=CountOfChildren]");n.$pregnantCategory=$("input[name=InterestedCategories][value=16]");n.$campaignChoiceSMS=$("input[name=CampaignChoices][value=2]");n.$campaignChoiceEmail=$("input[name=CampaignChoices][value=1]");$("#modalSaveChangesNoBtn").click(function(){n.CompleteEvent();n.control.modal("hide");n.formIsChanged&&(location.href=localizationDictionary.MYINFORMATIONURL)});$("#modalSaveChangesYesBtn").click(function(){n.SaveForm();n.CompleteEvent();n.control.modal("hide")});$("#btnPersonalInformationSave").off().click(function(){n.formIsChanged=!1;n.SaveForm()});$("#btnOtherInformationSave").off().click(function(){n.formIsChanged=!1;n.SaveForm()});$("#btnPersonalInformationCancel").click(function(){n.formIsChanged||($("#divPersonalInformation").show(),$("#divOtherInformation").show(),$("#divPersonalInformationEdit").hide(),$("#divOtherInformationEdit").hide());location.reload()});$("#btnOtherInformationCancel").click(function(){n.formIsChanged||($("#divOtherInformation").show(),$("#divPersonalInformation").show(),$("#divOtherInformationEdit").hide(),$("#divPersonalInformationEdit").hide(),location.reload())});$("#btnPersonalInformationEdit").click(function(){$("#divPersonalInformation").hide();$("#divOtherInformation").hide();$("#divPersonalInformationEdit").show();$("#CountryId").chosen("destroy");$("#CountryId").chosen();$(".alert-block").hide();$("#LanguageId").chosen("destroy");$("#LanguageId").chosen();$("#DivLanguageList .chosen-icon").first().html("&#61556;");$("#DivPhoneNumberAndSmsControlError").hide();$("#PhoneNumberAndSmsControlError").hide();$("#divPersonalInformationEdit").registerDesingEvents();$("#divOtherInformationEdit").registerDesingEvents()});$("#divPersonalInformationEdit").hide();$("#btnOtherInformationEdit").click(function(){$("#divOtherInformation").hide();$("#divPersonalInformation").hide();$("#divOtherInformationEdit").show();$("#CityId").chosen("destroy");$("#CityId").chosen();$("#CountyId").chosen("destroy");$("#CountyId").chosen();$("#EducationalLevel").chosen("destroy");$("#EducationalLevel").chosen();$("#SalaryRange").chosen("destroy");$("#SalaryRange").chosen();$("#CountOfChildren").chosen("destroy");$("#CountOfChildren").chosen();$(".alert-block").hide()});$("#divOtherInformationEdit").hide();n.$CityId.change(function(t){var i=$(this).val(),r;i!=null&&i!=""&&(r=t.OpenChildChoosenDrop,n.SetAddressEntityToControl("",n.orderAddressEntiyRule.$AddressEntityType_City,i,r))});$("#pregnancy").fadeOut();n.$pregnantCategory.attr("checked")=="checked"&&$("#pregnancy").fadeIn();n.$pregnantCategory.on("ifChecked",function(){$("#pregnancy").fadeIn()});n.$pregnantCategory.on("ifUnchecked",function(){$("#pregnancy").fadeOut()});$("input[name=InterestedCategories]").on("ifChecked",function(){n.formIsChanged=!0});$("input[name=InterestedCategories]").on("ifUnchecked",function(){n.formIsChanged=!0});$("input[name=CampaignChoices]").on("ifChecked",function(t){n.formIsChanged=!0;t.currentTarget.value=="1"&&$("#IsEmailChecked").iCheck("check");t.currentTarget.value=="2"&&$("#IsSmsChecked").iCheck("check")});$("input[name=CampaignChoices]").on("ifUnchecked",function(t){n.formIsChanged=!0;t.currentTarget.value=="1"&&$("#IsEmailChecked").iCheck("uncheck");t.currentTarget.value=="2"&&$("#IsSmsChecked").iCheck("uncheck")});$("#IsEmailChecked").on("ifChanged",function(t){n.formIsChanged=!0;t.currentTarget.checked?$("input[name=CampaignChoices][value=1]").iCheck("check"):$("input[name=CampaignChoices][value=1]").iCheck("uncheck")});$("#IsSmsChecked").on("ifChanged",function(t){n.formIsChanged=!0;t.currentTarget.checked?$("input[name=CampaignChoices][value=2]").iCheck("check"):$("input[name=CampaignChoices][value=2]").iCheck("uncheck")});$("#child1st, #child2nd, #child3rd, #child4th, #child5th").fadeOut();t=n.$countOfChildren.val();switch(t){case"1":$("#child1st").fadeIn();$("#child2nd, #child3rd, #child4th, #child5th").fadeOut();break;case"2":$("#child1st, #child2nd").fadeIn();$("#child3rd, #child4th, #child5th").fadeOut();break;case"3":$("#child1st, #child2nd, #child3rd").fadeIn();$("#child4th, #child5th").fadeOut();break;case"4":$("#child1st, #child2nd, #child3rd, #child4th").fadeIn();$("#child5th").fadeOut();break;case"5":$("#child1st, #child2nd, #child3rd, #child4th, #child5th").fadeIn();break;default:$("#child1st, #child2nd, #child3rd, #child4th, #child5th").fadeOut()}n.$countOfChildren.change(function(){var t=$(this).val();switch(t){case"1":$("#child1st").fadeIn();$("#child2nd, #child3rd, #child4th, #child5th").fadeOut();break;case"2":$("#child1st, #child2nd").fadeIn();$("#child3rd, #child4th, #child5th").fadeOut();break;case"3":$("#child1st, #child2nd, #child3rd").fadeIn();$("#child4th, #child5th").fadeOut();break;case"4":$("#child1st, #child2nd, #child3rd, #child4th").fadeIn();$("#child5th").fadeOut();break;case"5":$("#child1st, #child2nd, #child3rd, #child4th, #child5th").fadeIn();break;default:$("#child1st, #child2nd, #child3rd, #child4th, #child5th").fadeOut()}n.IsDeleteChildren(t)})},Show:function(){this.control.modal("show")},PhoneNumberChange:function(n){n=="PhoneNumber1"?($("#PhoneNumber2").val($("#PhoneNumber").val()),$("#PhoneNumber").val("")):n=="PhoneNumber2"&&$("#PhoneNumber").val($("#PhoneNumber2").val())},CheckClickEvent:function(n){var t=n.currentTarget.attributes.getNamedItem("off-save-changes-operation");return t!=undefined&&t?!0:this.formIsChanged?($(window).unbind(),n.preventDefault(),this.lastHref=n.currentTarget.href,$("#modalSaveChanges").modal("show"),!1):!0},RefreshPageCloseEvents:function(){var n=this;$("a[href]").click(function(t){n.CheckClickEvent(t)})},ClearEvents:function(){this.lastHref=""},CompleteEvent:function(){this.targetObject!=null&&this.targetObject.click!=undefined&&this.targetObject.click!=null&&this.targetObject.click();window.location.href!=null&&(window.location.href=this.lastHref);this.ClearEvents()},SaveForm:function(){var f=$("#personalForm"),e=f.valid(),i,r,u,t,n;if(e)if(this.validatePhoneNumberConfirmationCodeFirst||$("#"+registerMasterpassFormId).length)(masterpassUserProfileProcess==undefined||masterpassUserProfileProcess==null)&&(masterpassUserProfileProcess=new MasterpassUserProfileProcess,masterpassUserProfileProcess.Init(),masterpassUserProfileProcess.CheckMasterPass());else if($("#DivPhoneNumberAndSmsControlError").hide(),$("#PhoneNumberAndSmsControlError").hide(),i=$("#hdnIsDomesticRule").val(),i=!0&&i.toLowerCase()=="true"){for(r=$("#PhoneNumber").val(),t=document.getElementsByTagName("input"),n=0;n<t.length;n++)t[n].type.toLowerCase()=="checkbox"&&t[n].id=="IsSmsChecked"&&(u=t[n].checked);(r==""||r==null)&&(u=="true"||u==!0)?($("#DivPhoneNumberAndSmsControlError").show(),$("#PhoneNumberAndSmsControlError").show(),$("#FreeSmsMessage").removeClass("DisplayBlock"),$("#FreeSmsMessage").hide(),$("#DivPhoneNumber").addClass("invalid"),NewActionCode=!0):$("#personalForm").submit()}else $("#personalForm").submit()},FormSuccess:function(n,t){var i=this;t=="success"?($("#divMessage").html(n.Message),$("#divPersonalInformation").html(n.PersonalInfo),$("#divOtherInformation").html(n.PersonalOtherInfo),$("#divPersonalInformationEdit").html(n.PersonalInfoEdit),$("#divOtherInformationEdit").html(n.PersonalOtherInfoEdit),$("#divPersonalInformation").hide(),$("#divOtherInformation").hide(),$("#divPersonalInformationEdit").hide(),$("#divSMSConfirmationPanel").hide(),$("#divOtherInformationEdit").hide(),n.theAction=="displaySMSConfirmation"?($("#divPersonalInformationEdit").show(),$("#divSMSConfirmationPanel").show(),$("#divPersonalInformationEdit").registerDesingEvents(),$("#divOtherInformationEdit").registerDesingEvents(),$("#PhoneNumber").attr("ReadOnly",!0),$("#EmailAddress").attr("ReadOnly",!0),$("#ActivationCode").val(""),$("#IsPhoneNumberValidationForm").val("True"),this.validatePhoneNumberConfirmationCodeFirst=!0,NewActionCode&&(document.getElementById("ActivationCodeMessage").innerHTML="Kampanyalardan SMS ile haberdar olmak için cep telefonunuza gönderilen onay kodunu aşağıdaki alana giriniz.")):n.theAction=="viewSummary"||n.theAction==""?($("#divPersonalInformation").show(),$("#divOtherInformation").show(),i.LoadFormDetails(),i.formIsChanged=!1):n.theAction=="editPersonelInfo"&&($("#divPersonalInformationEdit").show(),$("#divPersonalInformationEdit").registerDesingEvents(),$("#divOtherInformationEdit").registerDesingEvents()),$("#btnPersonalInformationEditForValidation").click(function(){i.$CountryId.change(function(){var n=$(this).val();n!=null&&n!=""&&i.OnCountryIdChanged(n)})}),$("#btnPersonalInformationEdit").click(function(){$("#divPersonalInformation").hide();$("#divOtherInformation").hide();$("#divPersonalInformationEdit").show();$(".alert-block").hide();$("#divPersonalInformationEdit").registerDesingEvents();$("#divOtherInformationEdit").registerDesingEvents()}),$("#btnOtherInformationEdit").click(function(){$("#divOtherInformation").hide();$("#divPersonalInformation").hide();$("#divOtherInformationEdit").show();$(".alert-block").hide();$("#divPersonalInformationEdit").registerDesingEvents();$("#divOtherInformationEdit").registerDesingEvents()}),i.formIsChanged=!1):($("#divMessage").html(n),i.formIsChanged=!1);this.ClearEvents()},IsDeleteChildren:function(n){switch(n){case"-1":$("#Child1st_IsDelete").val(!0);$("#Child2nd_IsDelete").val(!0);$("#Child3rd_IsDelete").val(!0);$("#Child4th_IsDelete").val(!0);$("#Child5th_IsDelete").val(!0);break;case"1":$("#Child1st_IsDelete").val(!1);$("#Child2nd_IsDelete").val(!0);$("#Child3rd_IsDelete").val(!0);$("#Child4th_IsDelete").val(!0);$("#Child5th_IsDelete").val(!0);break;case"2":$("#Child1st_IsDelete").val(!1);$("#Child2nd_IsDelete").val(!1);$("#Child3rd_IsDelete").val(!0);$("#Child4th_IsDelete").val(!0);$("#Child5th_IsDelete").val(!0);break;case"3":$("#Child1st_IsDelete").val(!1);$("#Child2nd_IsDelete").val(!1);$("#Child3rd_IsDelete").val(!1);$("#Child4th_IsDelete").val(!0);$("#Child5th_IsDelete").val(!0);break;case"4":$("#Child1st_IsDelete").val(!1);$("#Child2nd_IsDelete").val(!1);$("#Child3rd_IsDelete").val(!1);$("#Child4th_IsDelete").val(!1);$("#Child5th_IsDelete").val(!0);break;case"5":$("#Child1st_IsDelete").val(!1);$("#Child2nd_IsDelete").val(!1);$("#Child3rd_IsDelete").val(!1);$("#Child4th_IsDelete").val(!1);$("#Child5th_IsDelete").val(!1);break;default:$("#Child1st_IsDelete").val(!1);$("#Child2nd_IsDelete").val(!1);$("#Child3rd_IsDelete").val(!1);$("#Child4th_IsDelete").val(!1);$("#Child5th_IsDelete").val(!1)}},GetChildAddressEntities:function(n,t,i,r,u,f,e,o){$.ajax({url:generateAjaxUrl("Master","GetChildAddressEntities"),dataType:"json",async:!1,data:{parentAddressEntityId:n,parentAddressEntityTypeId:t,childAddressEntityTypeId:i,isValidName:e},success:function(t){var i=r.children().first();r.empty();r.append(i);t!=null&&$.each(t,function(n,t){r.append($("<option/>",{value:t.Value,text:t.Text}))});u==null&&(u=-1);r.val(u);f!=undefined&&f||r.checkValidate();r.chosen("destroy");r.chosen();ResetFormTabIndex();n!="-1"&&o&&setTimeout(function(){r.parent().find("a").mousedown()},100)}})},DestroyChildSelectionControl:function(n){var t=n.children().first();n.empty();n.append(t);n.chosen("destroy");n.chosen();ResetFormTabIndex()},SetAddressEntityToControl:function(n,t,i,r){var u=personalInformationUI.orderAddressEntiyRule.GetChildAddressEntityType(t),e,f,o,s,h;if(u!=""){if(e=$.grep(personalInformationUI.orderAddressEntiyRule.CountryAddressRules,function(n){return n.AddressEntityTypeId===u}),f=e[0].AddressEntryTypeId,f==personalInformationUI.orderAddressEntiyRule.$AddressEntryType_Select||f==personalInformationUI.orderAddressEntiyRule.$AddressEntryType_Hybrid){var c=personalInformationUI.orderAddressEntiyRule.GetAddressEntityTypeName(u),l=n+c+"Id",a=e.length>0?f==personalInformationUI.orderAddressEntiyRule.$AddressEntryType_Select:!1;r=typeof r!="undefined"?r==="false"?!1:!0:!0;personalInformationUI.GetChildAddressEntities(i,t,u,$("#"+l),-1,!1,a,r)}o=personalInformationUI.orderAddressEntiyRule.GetChildAddressEntityType(u);o!=""&&(s=personalInformationUI.orderAddressEntiyRule.GetAddressEntityTypeName(o),h=n+s+"Id",personalInformationUI.DestroyChildSelectionControl($("#"+h)))}}};MasterpassUserProfileProcess.prototype={Init:function(){var n=this;$(document).on("hide.bs.modal","#"+otpConfirmModalFormId,function(){n.otpClock.setTime(180);n.isOpenUpdateMPOtpForm=!1;n.otpUpdateOk==!1&&personalInformationUI.FormSuccess("<div class='row alert alert-error'>Masterpass doğrulaması yapılmadığından güncelleme işlemi başarısız.<\/div>",!1,null);$("#divSMSConfirmationPanel").hide()});$(document).on("hidden.bs.modal","#"+otpConfirmModalFormId,function(){n.otpUpdateOk==!0&&(n.otpUpdateOk=!1,$("#personalForm").submit())})},Load:function(){},CheckMasterPass:function(){$("#"+checkMasterpassFormId).submit()},ResetMasterpassOtpForm:function(){var n=this;$("#divOtpUserSmsMessageError").html("");$("#divOtpUserSmsSendAgain").css("display","none");$("#btnOtpUserInfoVerify").prop("disabled",!1);$("#divOtpUserSmsMessageError").css("display","none");$("#divOtpUserValidationCode").removeClass("invalid");$("#divOtpUserValidationCode").addClass("valid");n.tyrCountOtpCodeUpdate=0},MFSChkMPResponseHandler:function(n,t){var i=$("#"+checkMasterpassFormId).find('input[name="msisdn"]').val(),r=$("#"+checkMasterpassFormId).find('input[name="token"]').val(),u={MasterpassMethodName:"CheckMasterpass-WEB-UserProfile",Status:n,ReferenceNo:t.referenceNo,ResponseCode:t.responseCode,ResponseDescription:t.responseDescription,Token:r,Msisdn:i,ResponseDateTime:new Date,TransactionId:t.transactionId};t.responseCode=="0000"||t.responseCode==""?(this.MpAccountStatus(t.accountStatus),this.HasMpAccount?this.IsMpAccountRelatedClient?this.SubmitPersonalForm():this.IsMpAccountBlock?alert("Maspterpass Hesabınız bloklanmıştır. Lütfen Masterpass ile iletişime geçiniz."):this.MpUpdatePhoneNumber():this.SubmitPersonalForm()):($.ajax({url:generateAjaxUrl("order","writeresponsemasterpasslog"),data:JSON.stringify(u),dataType:"json",contentType:"application/json; charset=utf-8",type:"POST",async:!0,traditional:!0,success:function(){},error:function(){}}),alert(localizationDictionary.ERROROCCURED))},MFSUpdateResponseHandler:function(n,t){var i=this;$("#divLoading").show();var r=$("#"+registerMasterpassFormId).find('[name="msisdn"]').val(),u=$("#"+registerMasterpassFormId).find('[name="theNewValue"]').val(),f=$("#"+registerMasterpassFormId).find('[name="token"]').val();if(MasterpassUpdateUserInfoLog={Status:"Error",Token:f,OldPhoneNumber:r,NewPhoneNumber:u,ReferenceNo:t.referenceNo,ResponseCode:t.responseCode,ResponseDescription:t.responseDescription},MasterpassUpdateUserInfoLog=JSON.stringify(MasterpassUpdateUserInfoLog),t.responseCode=="0000"||t.responseCode=="")MasterpassUpdateUserInfoLog={Status:"Success",Token:f,OldPhoneNumber:r,NewPhoneNumber:u,ReferenceNo:t.referenceNo,ResponseCode:t.responseCode,ResponseDescription:t.responseDescription},MasterpassUpdateUserInfoLog=JSON.stringify(MasterpassUpdateUserInfoLog);else if(t.responseCode=="5001"){MasterpassUpdateUserInfoLog={Status:"OTP",Token:f,OldPhoneNumber:r,NewPhoneNumber:u,ReferenceNo:t.referenceNo,ResponseCode:t.responseCode,ResponseDescription:t.responseDescription};MasterpassUpdateUserInfoLog=JSON.stringify(MasterpassUpdateUserInfoLog);this.otpClock=$(".otpUpdateUserClock").FlipClock({clockFace:"MinuteCounter",autoStart:!1,callbacks:{stop:function(){i.isOpenUpdateMPOtpForm&&($("#btnOtpUserInfoVerify").prop("disabled",!0),$("#divOtpUserSmsSendAgain").css("display","block"))}}});i.otpClock.setCountdown(!0);i.otpClock.setTime(180);$("#"+otpConfirmModalFormId).on("shown.bs.modal",function(){i.otpClock.start();i.ResetMasterpassOtpForm();i.isOpenUpdateMPOtpForm=!0});$("#btnOtpUserInfoVerify").on("click",function(){$("#divLoading").show();var n=$("#otpUserValidationCode").val();n&&n.trim().length==6&&(i.tyrCountOtpCodeUpdate<3?(i.tyrCountOtpCodeUpdate++,$("#"+otpConfirmFormId).find('input[name="validationCode"]').attr("value",n),$("#"+otpConfirmFormId).submit()):($("#"+otpConfirmModalFormId).modal("hide"),personalInformationUI.FormSuccess("<div class='row alert alert-error'>Gereğinden fazla yanlış kod girişi yapıldı! Kart kaydetme işlemi sonlandırılmıştır.<\/div>",!1,null),$("#divSMSConfirmationPanel").hide()));$("#divLoading").hide()});$("#btnCalcelDeleteUserInfo").on("click",function(){$("#divMessage").html("<div class='row alert alert-error'> Doğrulama yapılmadığından güncelleme işlemi gerçekleştirilemedi.<\/div>");$("#divSMSConfirmationPanel").hide();personalInformationUI.formIsChanged=!1});$("#btnCalcelDeleteUserInfo").on("click",function(){$("#divMessage").html("<div class='row alert alert-error'> Doğrulama yapılmadığından güncelleme işlemi gerçekleştirilemedi.<\/div>");$("#divSMSConfirmationPanel").hide();personalInformationUI.formIsChanged=!1});$("#"+otpConfirmModalFormId).modal("show")}else personalInformationUI.FormSuccess("<div class='row alert alert-error'>"+t.responseDescription+"<\/div>",!1,null),$("#divSMSConfirmationPanel").hide(),MasterpassUpdateUserInfoLog=JSON.stringify(MasterpassUpdateUserInfoLog);$.ajax({url:generateAjaxUrl("user","writemasterpassupdateuserinfolog"),data:MasterpassUpdateUserInfoLog,dataType:"json",contentType:"application/json; charset=utf-8",type:"POST",traditional:!0,success:function(){},error:function(){}});$("#divLoading").hide()},MFSOtpUpdateUserConfirmResponseHandler:function(n,t){var i=$("#"+registerMasterpassFormId).find('[name="msisdn"]').val(),r=$("#"+registerMasterpassFormId).find('[name="theNewValue"]').val(),u=$("#"+registerMasterpassFormId).find('[name="token"]').val(),f;MasterpassUpdateUserInfoLog={Status:"OTP-ERROR",Token:u,OldPhoneNumber:i,NewPhoneNumber:r,ReferenceNo:t.referenceNo,ResponseCode:t.responseCode,ResponseDescription:t.responseDescription};MasterpassUpdateUserInfoLog=JSON.stringify(MasterpassUpdateUserInfoLog);f=this;t.responseCode=="0000"||t.responseCode==""?(MasterpassUpdateUserInfoLog={Status:"OTP-SUCCESS",Token:u,OldPhoneNumber:i,NewPhoneNumber:r,ReferenceNo:t.referenceNo,ResponseCode:t.responseCode,ResponseDescription:t.responseDescription},MasterpassUpdateUserInfoLog=JSON.stringify(MasterpassUpdateUserInfoLog),f.otpUpdateOk=!0,$("#"+otpConfirmModalFormId).modal("hide")):t.responseCode=="1409"?(personalInformationUI.FormSuccess("<div class='row alert alert-error'>"+localizationDictionary.PHONECONFIRMATIONCODEWRONG+"<\/div>",!1,null),$("#divSMSConfirmationPanel").hide(),$("#divOtpUserSmsMessageError").html(localizationDictionary.PHONECONFIRMATIONCODEWRONG),$("#divOtpUserSmsMessageError").css("display","block"),$("#divOtpUserSmsSendAgain").css("display","block"),$("#divOtpUserValidationCode").removeClass("valid"),$("#divOtpUserValidationCode").addClass("invalid")):(personalInformationUI.FormSuccess("<div class='row alert alert-error'>"+t.responseDescription+"<\/div>",!1,null),$("#divSMSConfirmationPanel").hide(),$("#divOtpUserSmsMessageError").html(t.responseDescription),$("#divOtpUserSmsMessageError").css("display","block"),$("#divOtpUserSmsSendAgain").css("display","block"),$("#divOtpUserValidationCode").removeClass("valid"),$("#divOtpUserValidationCode").addClass("invalid"));$.ajax({url:generateAjaxUrl("user","writemasterpassupdateuserinfolog"),data:MasterpassUpdateUserInfoLog,dataType:"json",contentType:"application/json; charset=utf-8",type:"POST",traditional:!0,success:function(){},error:function(){}})},MFSOtpResendAction:function(){var n=this,t=MFS.getLastToken();return $("#divOtpUserSmsSendAgain").css("display","none"),$("#otpUserValidationCode").hasClass("selected")&&$("#otpUserValidationCode").removeClass("input-validation-error"),$("#divOtpUserSmsMessageError").html(""),$("#divOtpUserSmsMessageError").css("display","none"),$("#divOtpUserValidationCode").removeClass("invalid"),$("#divOtpUserValidationCode").addClass("valid"),MFS.resendOtp(t,"tur",mfsToOtpResendResponseHandler),n.otpClock.setTime(180),n.otpClock.start(),n.otpResendFault==!1&&n.ResetMasterpassOtpForm(),!1},MfsOtpResendResponseHandler:function(n,t){var i=this;t.responseCode=="0000"||t.responseCode==""?i.otpResendFault=!1:t.responseCode=="5001"?(i.otpResendFault=!1,$("#modal-checkMPOtpForm").modal("show")):(i.otpResendFault=!0,$("#divOtpUserSmsSendAgain").css("display","block"),$("#divOtpUserSmsMessageError").html(t.responseDescription),$("#divOtpUserSmsMessageError").css("display","block"),$("#divOtpUserValidationCode").addClass("invalid"),$("#divOtpUserValidationCode").removeClass("valid"))},MpAccountStatus:function(n){this.HasMpAccount=n.substring(1,1)=="1";this.IsMpAccountRelatedClient=n.substring(3,1)=="1";this.IsMpAccountBlock=n.substring(4,1)=="1"},SubmitPersonalForm:function(){$("#personalForm").submit()},MpUpdatePhoneNumber:function(){var t=$("#"+registerMasterpassFormId).find('[name="msisdn"]').val(),i=$("#"+registerMasterpassFormId).find('[name="theNewValue"]').val(),n;if(t==i){$("#personalForm").submit();return}$("#divLoading").show();n=$("#personalForm").serializeJSON();$.ajax({type:"POST",contentType:"application/json; charset=utf-8",data:JSON.stringify(n),cache:!1,async:"false",url:generateAjaxUrl("user","validatePhoneNumberConfirmationCode"),context:document.body,success:function(n){n.action=="continue"?($("#divLoading").hide(),$("#"+registerMasterpassFormId).submit()):$("#personalForm").submit()},error:function(){$("#msgInvalidConfirmationCode").show();$("#divSmsCodeTextbox").addClass("invalid")}})}};AddressInformationUI.prototype={init:function(){var n=this;$("#modalSaveChangesNoBtn").click(function(){n.CompleteEvent();n.control.modal("hide");n.addresses.show();$("#divAddressForm").hide()});$("#modalSaveChangesYesBtn").click(function(){n.addressForm.validateForm();var t=n.addressForm.find(inputDivSelector).filter(":visible").hasClass("invalid");t?n.control.modal("hide"):(n.SaveForm(),n.control.modal("hide"))});$("input#commercial").on("ifChecked",function(){$("#commercial-invoice").fadeIn("fast")});$("input#personal").on("ifChecked",function(){$("#commercial-invoice").fadeOut("fast")});$("#btn-address-save2").click(function(){var t;n.addressForm.validateForm();t=n.addressForm.find(inputDivSelector).filter(":visible").hasClass("invalid");t||(n.addressForm.validateForm(),t=n.addressForm.find(inputDivSelector).filter(":visible").hasClass("invalid"),t||(n.SaveForm(),n.CompleteEvent()),n.control.modal("hide"))});$("#btn-address-cancel").click(function(){n.formIsChanged?n.Show():(n.addresses.show(),$("#divAddressForm").hide())})},Show:function(){this.control.modal("show")},CheckClickEvent:function(n){var t=n.currentTarget.attributes.getNamedItem("off-save-changes-operation");return t!=undefined&&t?!0:this.formIsChanged?($(window).unbind(),n.preventDefault(),this.lastHref=n.currentTarget.href,$("#modalSaveChanges").modal("show"),!1):!0},RefreshPageCloseEvents:function(){var n=this;n.formIsChanged&&$("a[href]").click(function(t){n.CheckClickEvent(t)})},ClearEvents:function(){this.lastHref=""},CompleteEvent:function(){this.targetObject!=null&&this.targetObject.click!=undefined&&this.targetObject.click!=null&&this.targetObject.click();this.ClearEvents()},SaveForm:function(){var n,t;addressInformationUI.addressForm.validateForm();n=addressInformationUI.addressForm.find(inputDivSelector).filter(":visible").hasClass("invalid");n||(t={CustomerAddressId:$("#CustomerAddressId").val(),AddressDefinition:$("#CustomerAddress_AddressDefinition").val(),FullName:$("#CustomerAddress_FullName").val(),PhoneNumber:$("#CustomerAddress_PhoneNumber").val(),PhoneNumberInfoMessage:$("#divwebUI_ShippingAddressViewModel_OrderInfoWillSentSMS").val(),PhoneNumberWithCountryCode:$("#CustomerAddress_PhoneNumberWithCountryCode").val(),PhoneNumberWithCountryCodeInfoMessage:$("#divwebUI_ShippingAddressViewModel_PhoneNumberCountryCodeIncluded").val(),CountryId:$("#CustomerAddress_CountryId").val(),CountryZoneId:$("#CustomerAddress_CountryZoneId").val(),CountryZoneName:$("#CustomerAddress_CountryZoneName").val(),DistrictId:$("#CustomerAddress_DistrictId").val(),DistrictName:$("#CustomerAddress_DistrictName").val(),CityId:$("#CustomerAddress_CityId").val(),CityName:$("#CustomerAddress_CityName").val(),CountyId:$("#CustomerAddress_CountyId").val(),CountyName:$("#CustomerAddress_CountyName").val(),PostalCode:$("#CustomerAddress_PostalCode").val(),Address:$("#CustomerAddress_Address").val(),StreetId:$("#CustomerAddress_StreetId").val(),StreetName:$("#CustomerAddress_StreetName").val(),House:$("#CustomerAddress_House").val(),Floor:$("#CustomerAddress_Floor").val(),Flat:$("#CustomerAddress_Flat").val(),IsCountryZoneEnabled:$("#CustomerAddress_IsCountryZoneEnabled").val(),IsDistrictEnabled:$("#CustomerAddress_IsDistrictEnabled").val(),IsCountyEnabled:$("#CustomerAddress_IsCountyEnabled").val(),IsStreetEnabled:$("#CustomerAddress_IsStreetEnabled").val(),IsFloorEnabled:$("#CustomerAddress_IsFloorEnabled").val(),IsFlatEnabled:$("#CustomerAddress_IsFlatEnabled").val(),IsHouseEnabled:$("#CustomerAddress_IsHouseEnabled").val(),IsAddressDefinationInActive:$("#CustomerAddress_IsAddressDefinationInActive").val(),IsCountryZoneIdRequired:$("#CustomerAddress_IsCountryZoneIdRequired").val(),IsDistrictIdRequired:$("#CustomerAddress_IsDistrictIdRequired").val(),IsCountyIdRequired:$("#CustomerAddress_IsCountyIdRequired").val(),IsStreetIdRequired:$("#CustomerAddress_IsStreetIdRequired").val(),IsFloorRequired:$("#CustomerAddress_IsFloorRequired").val(),IsFlatRequired:$("#CustomerAddress_IsFlatRequired").val(),IsHouseRequired:$("#CustomerAddress_IsHouseRequired").val(),IsZipCodeRequired:$("#CustomerAddress_IsZipCodeRequired").val()},this.ClearEvents())},SaveForm:function(){var n,t;addressInformationUI.addressForm.validateForm();n=addressInformationUI.addressForm.find(inputDivSelector).filter(":visible").hasClass("invalid");n||(t={CustomerAddressId:$("#CustomerAddressId").val(),AddressDefinition:$("#CustomerAddress_AddressDefinition").val(),FullName:$("#CustomerAddress_FullName").val(),PhoneNumber:$("#CustomerAddress_PhoneNumber").val(),PhoneNumberInfoMessage:$("#divwebUI_ShippingAddressViewModel_OrderInfoWillSentSMS").val(),PhoneNumberWithCountryCode:$("#CustomerAddress_PhoneNumberWithCountryCode").val(),PhoneNumberWithCountryCodeInfoMessage:$("#divwebUI_ShippingAddressViewModel_PhoneNumberCountryCodeIncluded").val(),CountryId:$("#CustomerAddress_CountryId").val(),CountryZoneId:$("#CustomerAddress_CountryZoneId").val(),CountryZoneName:$("#CustomerAddress_CountryZoneName").val(),DistrictId:$("#CustomerAddress_DistrictId").val(),DistrictName:$("#CustomerAddress_DistrictName").val(),CityId:$("#CustomerAddress_CityId").val(),CityName:$("#CustomerAddress_CityName").val(),CountyId:$("#CustomerAddress_CountyId").val(),CountyName:$("#CustomerAddress_CountyName").val(),PostalCode:$("#CustomerAddress_PostalCode").val(),Address:$("#CustomerAddress_Address").val(),StreetId:$("#CustomerAddress_StreetId").val(),StreetName:$("#CustomerAddress_StreetName").val(),House:$("#CustomerAddress_House").val(),Floor:$("#CustomerAddress_Floor").val(),Flat:$("#CustomerAddress_Flat").val(),IsCountryZoneEnabled:$("#CustomerAddress_IsCountryZoneEnabled").val(),IsDistrictEnabled:$("#CustomerAddress_IsDistrictEnabled").val(),IsCountyEnabled:$("#CustomerAddress_IsCountyEnabled").val(),IsStreetEnabled:$("#CustomerAddress_IsStreetEnabled").val(),IsFloorEnabled:$("#CustomerAddress_IsFloorEnabled").val(),IsFlatEnabled:$("#CustomerAddress_IsFlatEnabled").val(),IsHouseEnabled:$("#CustomerAddress_IsHouseEnabled").val(),IsAddressDefinationInActive:$("#CustomerAddress_IsAddressDefinationInActive").val(),IsCountryZoneIdRequired:$("#CustomerAddress_IsCountryZoneIdRequired").val(),IsDistrictIdRequired:$("#CustomerAddress_IsDistrictIdRequired").val(),IsCountyIdRequired:$("#CustomerAddress_IsCountyIdRequired").val(),IsStreetIdRequired:$("#CustomerAddress_IsStreetIdRequired").val(),IsFloorRequired:$("#CustomerAddress_IsFloorRequired").val(),IsFlatRequired:$("#CustomerAddress_IsFlatRequired").val(),IsHouseRequired:$("#CustomerAddress_IsHouseRequired").val(),IsZipCodeRequired:$("#CustomerAddress_IsZipCodeRequired").val()},$.ajax({type:"POST",contentType:"application/json; charset=utf-8",data:JSON.stringify(t),cache:!1,async:"false",url:generateAjaxUrl("user","customeraddress"),context:document.body,success:function(n){$("#divAddressFormMessage").show();$("#divAddressFormMessage").html(n.Message);n.Result?setTimeout(function(){GetAddressesPage(localizationDictionary.MYADDRESSESAJAXURL.replace(encodeURIComponent("{PageIndex}"),"1"));$("#divAddressForm").hide();$("#divAddresses").show()},2e3):$("#divAddressFormMessage").show()},error:function(){$("#divAddressFormMessage").html(localizationDictionary.ERROROCCURED)}}))}};CustomerBankAccountUI.prototype={init:function(){var n=this;n.customerBankAccountForm.validateFormWhenFirstLoad();n.customerBankAccountForm.resetValidation();$("#customerBankAccountFormNoBtn").click(function(){n.CompleteEvent();n.control.modal("hide");customerBankAccountsCount>0?n.customerBankAccounts.show():($("#divWallet").show(),$("#divLcwMoneyPanel").show(),$("#btnShowRefundLandingPage").hide(),$("#btnBackToReturnInputPanel").show(),$("#refund-landing-selection label[for=wire] .iradio").iCheck("uncheck"));$.event.trigger({type:"ToggleUcReturnRefundChoicePageReturnButtons",ShowOrHide:"show"});$("#divCustomerBankAccountForm").hide();$("input[name='account-info']").iCheck("uncheck");$(".bank-account-info-container").removeClass("baic-selected")});$("#customerBankAccountFormYesBtn").click(function(){n.customerBankAccountForm.validateForm();n.customerBankAccountForm.valid()?(n.SaveForm(),n.control.modal("hide")):n.control.modal("hide")})},Show:function(){this.control.modal("show")},CheckClickEvent:function(n){var t=n.currentTarget.attributes.getNamedItem("off-save-changes-operation");return t!=undefined&&t?!0:this.formIsChanged?($(window).unbind(),n.preventDefault(),this.lastHref=n.currentTarget.href,$("#modalSaveChanges").modal("show"),!1):!0},RefreshPageCloseEvents:function(){var n=this;n.formIsChanged&&$("a[href]").click(function(t){n.CheckClickEvent(t)})},ClearEvents:function(){this.lastHref=""},CompleteEvent:function(){this.targetObject!=null&&this.targetObject.click!=undefined&&this.targetObject.click!=null&&this.targetObject.click();this.ClearEvents()},SaveForm:function(){if(this.customerBankAccountForm.valid()){var n={BankId:$("#BankId").val(),BankAccountId:$("#BankAccountId").val(),AccountOwner:$("#AccountOwner").val(),IBANNumber:$("#IBANNumber").val(),TaxNumber:$("#TaxNumber").val(),AccountFatherName:$("#AccountFatherName").val(),BankCode:$("#BankCode").val()};$.ajax({type:"POST",contentType:"application/json; charset=utf-8",data:JSON.stringify(n),cache:!1,async:"false",url:generateAjaxUrl("user","savecustomerbankaccountform"),context:document.body,success:function(n){$("#divCustomerBankAccountForm").hide();$("#divCustomerBankAccountFormMessage").show();$("#divCustomerBankAccountFormMessage").html(n.Message);n.Result?(GetAjaxPageHtml("#divCustomerBankAccounts",localizationDictionary.CustomerBankAccountsAjax,null,!1),$("#divCustomerBankAccountsPanel").show(),$.event.trigger({type:"ToggleUcReturnRefundChoicePageReturnButtons",ShowOrHide:"show"}),$("input[name='account-info']").iCheck("uncheck"),customerBankAccountsCount==1&&$("#bankAccountListContainer input[name='account-info']").iCheck("check"),setTimeout(function(){$("#divCustomerBankAccountFormMessage").hide()},4e3)):$("#divCustomerBankAccountFormMessage").show();$("#BankCode").chosen("destroy");$("#BankCode").chosen()},error:function(){$("#divCustomerBankAccountFormMessage").html(localizationDictionary.ERROROCCURED)}})}}};$(document).ready(function(){$("#DivLanguage .chosen-icon").first().html("&#61556;");$("#CustomerAddress_FullName").keypress(function(n){var t=new RegExp("^[a-zA-ZçÇıİğĞöÖşŞüÜ ]+$"),i=String.fromCharCode(n.charCode?n.charCode:n.which);return t.test(i)?!0:(n.preventDefault(),!1)});$("#BillingAddressView_FullName").keypress(function(n){var t=new RegExp("^[a-zA-ZçÇıİğĞöÖşŞüÜ ]+$"),i=String.fromCharCode(n.charCode?n.charCode:n.which);return t.test(i)?!0:(n.preventDefault(),!1)});$("#ShippingAddressView_FullName").keypress(function(n){var t=new RegExp("^[a-zA-ZçÇıİğĞöÖşŞüÜ ]+$"),i=String.fromCharCode(n.charCode?n.charCode:n.which);return t.test(i)?!0:(n.preventDefault(),!1)})});OrderAddressEntiyRule.prototype={GetAddressEntityRules:function(n){oui=this;$.ajax({url:generateAjaxUrl("master","getcountryaddressrules"),type:"GET",cache:!1,data:{countryId:n},success:function(n){$.each(n,function(n,t){var i={};i[n]=t;$.extend(oui.CountryAddressRules,i)})},error:function(){alert(localizationDictionary.ERROROCCURED)}})},GetChildAddressEntityType:function(n){var t=$.grep(this.CountryAddressRules,function(t){return t.ParentAddressEntityTypeId===n})[0];return t!=undefined?t.AddressEntryTypeId===this.$AddressEntryType_Hidden?this.GetChildAddressEntityType(t.AddressEntityTypeId):t.AddressEntityTypeId:""},GetAddressEntityTypeName:function(n){switch(n){case this.$AddressEntityType_Region:return"CountryZone";case this.$AddressEntityType_District:return"District";case this.$AddressEntityType_City:return"City";case this.$AddressEntityType_County:return"County";case this.$AddressEntityType_PostalCode:return"PostalCode";case this.$AddressEntityType_Street:return"Street";default:""}}}