var userAccountRecovery=function(){function n(){$("#UserAccountRecoveryWindow").data("kendoWindow").close();modal.onClose()}function i(){window.DefaultSpinner.stop();$("body").fadeTo("fast",1);$("body").css("pointer-events","")}function u(){userAccountRecovery.container.fadeTo("fast",.5);userAccountRecovery.container.css("pointer-events","none");window.DefaultSpinner.spin(userAccountRecovery.container[0])}function f(){$.validator.defaults.resetForm()}function e(n){var i,t;userAccountRecovery.container.fadeTo("fast",1);userAccountRecovery.container.css("pointer-events","");window.DefaultSpinner.stop();i=n.responseJSON;i?i.Success?($("#UserAccountRecovery").hide(),$("#UserAccountRecoveryClose").show()):i.Message?notification.showError(i.Message):(t={},n.responseJSON&&n.responseJSON.Errors&&($.each(n.responseJSON.Errors,function(n){n!==null&&(t[n]="",$.each(this,function(){t[n]+=this+"\n\r"}),t[n]=t[n].substring(0,t[n].length-2))}),$("#UserAccountRecoveryForm").validate().showErrors(t))):(userAccountRecovery.errorText&&notification.showError(userAccountRecovery.errorText),$.validator.defaults.resetForm(),$("#UserAccountRecoveryWindow").data("kendoWindow").close())}function t(n){n&&n.responseJSON&&n.responseJSON.Message&&notification.showError(n.responseJSON.Message)}function o(n){userAccountRecovery.container=n.jquery?n:$(n)}function s(){$.ajax({url:"/Account/Login/UserAccountRecoveryContact"}).done(function(t){var r,i;t.Type===1?(win=window.open(t.Content,"_blank"),n()):(n(),r=t.Content,$("#ContactWindow").html(r),$.validator.unobtrusive.parse($("#ContactForm")),i=$("#ContactWindow").data("kendoWindow"),i.center(),i.open())}).fail(function(n){t(n)})}function h(n){n=n||0;$.ajax({url:"/Account/Login/UserAccountRecovery?R="+n,beforeSend:r()}).done(function(n){$("#UserAccountRecoveryWindow").html(n);$.validator.unobtrusive.parse($("#UserAccountRecoveryForm"));var t=$("#UserAccountRecoveryWindow").data("kendoWindow");t.center();t.open()}).fail(function(n){t(n)}).always(function(){i()})}function r(){window.DefaultSpinner.spin($("body").get(0));$("body").fadeTo("fast",.5);$("body").css("pointer-events","none")}return container=null,{closePopup:n,hideSpinner:i,onBeginRequest:u,onCloseRequest:f,onCompleteRequest:e,onFailureRequest:t,setContainer:o,showContactUsPopup:s,showPopup:h,showSpinner:r}}()