﻿var Sawbuck = window.Sawbuck || {}; Sawbuck.SavingsCalculator = function() {
	var _price = 500000; var _state = "CA"; function getValues() { data = { State: _state, PropertyPrice: _price }; $j.ajax({ type: "POST", url: "/service/WebService.asmx/GetSawbuckSavings", data: Sawbuck.Utilities.toJson(data), contentType: "application/json; charset=utf-8", dataType: "json", processData: false, success: function(response) { if (response.d) { $j("#upFrontAmount").text(response.d.UpFront.toPrice()); $j("#annualAmount").text(response.d.Annual.toPrice() + "/yr"); $j("#lifetimeAmount").text(response.d.Lifetime.toPrice()); } }, error: function() { } }); }
	return { init: function() { getValues(); }, setPrice: function(price) { _price = price; getValues(); }, setState: function(state) { _state = state; getValues(); } }
} ();