﻿$(function() {

    $("#btnCalculateDeduction").click(function() {

        var dataForPost = {
            salePrice: $("#txtSalePrice").val(),
            downpaymentPercent: $("#txtDownpaymentPercent").val()            
        };

        $.ajax({
            type: "POST",
            url: "/properties2/calculatetaxdeduction",
            data: dataForPost,
            dataType: "json",
            success: function(result) {
                // alert(result.toString());
                $("#txtTaxDeductionResult").html("$" + addCommas(result.toFixed(0).toString()) + "<br /> tax deduction<br /> the first year");

            },
            error: function(msg) {
                alert(msg.status + " : " + msg.statusText);
            }

        });

    });


});

