function AddFailure(){}function AddSuccess(n){$("#ManageAddAuthUser").html("");var t=n.indexOf("validation-summary-errors");t==-1?($("#selectedview").html(n),$(".ui-dialog-content").dialog("close"),$(".ui-dialog-content").dialog("destroy")):$("#manageprofile").html(n)}function ClosePopup(){$(".ui-dialog-content").dialog("close");$("#divConfirmation").hide()}function InitPaymentViews(){var i,n,t,r,u;typeof ServerDate=="undefined"&&(ServerDate=0);i=0;$("#onetime-paydate-btn").click(function(){$(document).ready(function(){$("#OneTimePaymentMode_PaymentDate").datepicker().focus()})});$("#recurring-paydate-btn").click(function(){$(document).ready(function(){$("#RecurringPaymentMode_PaymentDate").datepicker().focus()})});$("#OneTimePaymentMode_PaymentDate").datepicker({beforeShowDay:function(n){if($("#OneTimePaymentMode_PaymentDueDate").val()!=null){var i=n.getFullYear()+"/"+(n.getMonth()+1)+"/"+n.getDate(),t=new Date($("#OneTimePaymentMode_PaymentDueDate").val()),r=t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate();if(r==i)return[!0,"dp-highlight","Payment Due Date"]}return[!0,"",""]},minDate:ServerDate,dateFormat:"dd M yy"});$("#RecurringPaymentMode_PaymentDate").datepicker({beforeShowDay:function(n){if($("#RecurringPaymentMode_PaymentDueDate").val()!=null){var i=n.getFullYear()+"/"+(n.getMonth()+1)+"/"+n.getDate(),t=new Date($("#RecurringPaymentMode_PaymentDueDate").val()),r=t.getFullYear()+"/"+(t.getMonth()+1)+"/"+t.getDate();if(r==i)return[!0,"dp-highlight","Payment Due Date"]}return[!0,"",""]},minDate:ServerDate,dateFormat:"dd M yy"});n=$("#isonetimeedit").val();t=$("#isrecurringtimeedit").val();$("#OneTimePaymentMode_CurrentBalanceAmount").val()<=0?$("#btnOnetimePayment").addClass("disabled"):$("#btnOnetimePayment").removeClass("disabled");$("#RecurringPaymentMode_CurrentBalanceAmount").val()<=0?$("#btnRecurringPayment").addClass("disabled"):$("#btnRecurringPayment").removeClass("disabled");n=="disabled"?($("#OneTimePaymentMode_PaymentDate").datepicker("disable"),$("#divOneTimeRoot *").filter(":input").prop("disabled",!0),$("#divOneTimeRoot *").filter(":input").addClass("ecp-display-mode"),$("#divOneTimeRoot").addClass("ecp-display-mode"),$("#btnOnetimePayment").addClass("disabled")):($("#OneTimePaymentMode_PaymentDate").datepicker("enable"),$("#OneTimePaymentMode_PaymentDate").prop("readonly",!0),$("#divOneTimeRoot *").filter(":input").prop("disabled",!1),$("#btnOnetimePayment").removeClass("disabled"));t=="disabled"?($("#RecurringPaymentMode_PaymentDate").datepicker("disable"),$("#divRecurringRoot *").filter(":input").prop("disabled",!0),$("#divRecurringRoot *").filter(":input").addClass("ecp-display-mode"),$("#divRecurringRoot").addClass("ecp-display-mode"),$("#btnRecurringPayment").addClass("disabled")):($("#RecurringPaymentMode_PaymentDate").datepicker("enable"),$("#RecurringPaymentMode_PaymentDate").prop("readonly",!0),$("#divRecurringRoot *").filter(":input").prop("disabled",!1),$("#btnOnetimePayment").removeClass("disabled"));r=$("#divOneTimeRadio input:radio:checked").val();$("#divOneTimeRadio input:radio:checked").val()=="O"&&n!="disabled"?$("#OneTimePaymentMode_OtherAmountValue").prop("disabled",!1):$("#OneTimePaymentMode_OtherAmountValue").prop("disabled",!0);u=$("#divRecurringRadio input:radio:checked").val();$("#divRecurringRadio input:radio:checked").val()=="O"&&t!="disabled"?$("#RecurringPaymentMode_OtherAmountValue").prop("disabled",!1):$("#RecurringPaymentMode_OtherAmountValue").prop("disabled",!0);$("#RecurringPaymentMode_OtherAmountValue").val()==0&&$("#RecurringPaymentMode_OtherAmountValue").val("");$("#RecurringPaymentMode_OtherAmountValue").removeAttr("data-val");$("#divOneTimeRadio input:radio").click(function(){$(this).val()==="O"?$("#OneTimePaymentMode_OtherAmountValue").prop("disabled",!1):$("#OneTimePaymentMode_OtherAmountValue").prop("disabled",!0)});$("#divRecurringRadio input:radio").click(function(){$(this).val()==="O"?$("#RecurringPaymentMode_OtherAmountValue").prop("disabled",!1):$("#RecurringPaymentMode_OtherAmountValue").prop("disabled",!0)});CheckForPopup()}function CheckForPopup(){if(!popupchecked){popupchecked=!0;var n=$("#ModalToShow").val(),t=$("#PaymentMobileMode").val();n=="BLOCK"&&t!="Profile"?$("#PaymentBlockedModal").modal("show"):n=="NOPROFILE"&&t!="Profile"?$("#MustHaveProfileModal").modal("show"):n=="NOBAL"&&t!="Profile"&&$("#NoBalanceModal").modal("show")}}function openDeletePopup(){$("#divDeletePayment").dialog({closeText:"Close",autoOpen:!0,width:800,resizable:!1,title:"Delete Payment",modal:!0,open:function(){}})}function CloseWindow(){$(".ui-dialog-content").dialog("close");$("#divConfirmation").hide()}function openMsg(){}function openPopup(n){ResetSessionClock();$("#manageprofile").dialog({closeText:"Close",autoOpen:!0,width:888,resizable:!1,title:n,modal:!0,open:function(){}})}function CloseWindow(){$(".ui-dialog-content").dialog("close");$("#divConfirmation").hide()}function CloseDeleteWindow(){$("#manageprofile").dialog("close");$("#divConfirmation").hide()}function ValidateOtherAmount(n){var i=n?n:window.event,t=i.keyCode?i.keyCode:i.which;return t==16?!1:t>=48&&t<=57||t>=96&&t<=105||t==8||t==9||t==46||t==37||t==39||t==110||t==190?!0:!1}function AddAmtCommas(n){$(n).val($(n).val().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,"))}function RemoveAmtCommas(n){$(n).val($(n).val().replace(",",""))}function SubmitOneTimePaymentForm(){return RemoveAmtCommas("#OneTimePaymentMode_OtherAmountValue"),!0}function SubmitRecurringPaymentForm(){return RemoveAmtCommas("#RecurringPaymentMode_OtherAmountValue"),!0}function AddMobileOneTimeEvents(){$("#OneTimePaymentMode_PaymentDate").change(function(){$("#mobileOneTimePaymentDate").val($("#OneTimePaymentMode_PaymentDate").val())});$("#mobileOneTimePaymentDate").change(function(){$("#OneTimePaymentMode_PaymentDate").val($("#mobileOneTimePaymentDate").val())})}function AddMobileRecurringEvents(){$("#RecurringPaymentMode_PaymentDate").change(function(){$("#mobileRecurringPaymentDate").val($("#RecurringPaymentMode_PaymentDate").val())});$("#mobileRecurringPaymentDate").change(function(){$("#RecurringPaymentMode_PaymentDate").val($("#mobileRecurringPaymentDate").val())})}var popupchecked=!1;$("#btnCancel").click(function(){CloseWindow()});$("#btnCancel").click(function(){CloseWindow()});$(document).unbind("keydown").bind("keydown",function(n){var i=!1,t;n.keyCode===8&&(t=n.srcElement||n.target,i=t.tagName.toUpperCase()==="INPUT"&&(t.type.toUpperCase()==="TEXT"||t.type.toUpperCase()==="PASSWORD"||t.type.toUpperCase()==="FILE"||t.type.toUpperCase()==="EMAIL"||t.type.toUpperCase()==="NUMBER"||t.type.toUpperCase()==="TEL"||t.type.toUpperCase()==="URL")||t.tagName.toUpperCase()==="TEXTAREA"?t.readOnly||t.disabled:!0);i&&n.preventDefault()})