').val()}$(document).ready(function(){$("#ps_loginModalUsername, #ps_loginModalEmail, #ps_loginModalPwd").keypress(function(n){var t=n.which;t==13&&$(".ps_loginModal-button").click()})});$("#ps_loginModalEmail").on("change",function(){$("#ps_loginModalEmail").val()==""?$("#ps_LoginModalEmail-Error").html("Please enter your email or phone number").fadeIn():$("#ps_LoginModalEmail-Error").html("").fadeOut("slow")});$("#ps_loginModalPwd").on("change",function(){$("#ps_loginModalPwd").val()==""?$("#ps_LoginModalPwd-Error").html("Password is required.").fadeIn():$("#ps_LoginModalPwd-Error").html("").fadeOut("slow")});$(".ps_loginModal-button").click(function(){if($("#ps_loginModalEmail").val()=="")return $("#ps_LoginModalEmail-Error").html("Please enter your email or phone number").fadeIn(),!1;if($("#ps_loginModalPwd").val()=="")return $("#ps_LoginModalPwd-Error").html("Password is required.").fadeIn(),!1;var n={__RequestVerificationToken:getAntiForgeryToken(),Email:$("#ps_loginModalEmail").val(),Password:$("#ps_loginModalPwd").val()};$(this).prop("disabled","true");$.ajax({url:"/Customer/LoginFromModal",type:"POST",cache:!1,data:n,dataType:"json",success:function(n){if(n.success)$("#ps_LoginModal_validation_Summary_Errors").hide().fadeOut(500),location.href="/storeclosed";else{$(".ps_loginModal-button").removeAttr("disabled");var t="Login was unsuccessful. Please correct the errors and try again.
"+n.message;$("#ps_LoginModal_validation_Summary_Errors").html(t).fadeIn()}},error:function(n,t,i){alert(i)}});$("#ps_PopupLoginForm").valid()||window.dataLayer.push({event:"loginFailed"})});$("#ps_closeModalBtn").click(function(){$.post("/Customer/CloseLoginPopupModal");$("#loginDialog").dialog("close")})