var financingPaymentModel = function(data) {
    var self = this;
    self.ModelData = ko.mapping.fromJS(data, {}, self);
    self.PaymentData = ko.mapping.fromJS(InitialPaymentData, {}, self);

    self.MakePayment = function() {

    };

};

function InitialPaymentData() {
    this.SubscriberId= 0;
    this.ProcessPaymentAmount = 0;
}


$(function () {
    ko.bindingHandlers.currency = {
        symbol: ko.observable('$'),
        update: function (element, valueAccessor, allBindingsAccessor) {
            return ko.bindingHandlers.text.update(element, function () {
                var value = +(ko.utils.unwrapObservable(valueAccessor()) || 0),
                    symbol = ko.utils.unwrapObservable(allBindingsAccessor().symbol === undefined
                        ? allBindingsAccessor().symbol
                        : ko.bindingHandlers.currency.symbol);
                return symbol + value.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,");
            });
        }
    };

    ko.bindingHandlers.trueFalseRadioButton =
    {
        init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
            // event handler for the element change event
            var changeHandler = function () {
                var elementValue = $(element).val();
                var observable = valueAccessor();      // set the observable value to the boolean value of the element value
                observable($.parseJSON(elementValue));
            };    // register change handler for element
            ko.utils.registerEventHandler(element,
                                          "change",
                                          changeHandler);
        },
        update: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {
            var elementValue = $.parseJSON($(element).val());
            var observableValue = ko.utils.unwrapObservable(valueAccessor()); if (elementValue === observableValue) {
                element.checked = true;
            }
            else {
                element.checked = false;
            }
        }
    };
});
