function reCalculateKt(changedObj) {
	ktArray = new Array();
	
	refreshVariables();
	
	ktArray["results"] = new Array();

	ktArray["results"]["max_allowable_debt"] = ktArray["vars"]["value_of_home"]*(ktArray["vars"]["loan_to_value_ratio"]/100);
	ktArray["results"]["total_balance_owed"] = ktArray["vars"]["balance_mortgage_1"]+ktArray["vars"]["balance_mortgage_2"]+ktArray["vars"]["balance_mortgage_3"];
	ktArray["results"]["potential_loan_amount"] = ktArray["results"]["max_allowable_debt"]-ktArray["results"]["total_balance_owed"];
	
	displayValues();
}

function displayValues() {
	for (var fieldId in ktArray["results"]) {
		var fieldObj = document.getElementById(fieldId);
		if (fieldObj && ktArray["results"][fieldId]) {
			fieldObj.innerHTML = numberFormat(ktArray["results"][fieldId], fieldObj.getAttribute("valuetype"), fieldObj.getAttribute("valueformat"));
		}
	}
}

var helpTexts = new Array();
helpTexts["value_of_home"] = "<b>Appraised Value of Home</b><br>The amount you can borrow largely depends upon the appraised value of your home. If it has been a while since you purchased your house, it is likely worth quite a bit more, so you may need to have your property re-appraised.";
helpTexts["loan_to_value_ratio"] = "<b>Loan to Value Ratio:</b><br>This is a <b>percentage</b> of your home's appraised value used to calculate the <b>maximum total debt</b> that a lender will allow to be secured by your home.<br><b>80%</b> is common, but may be as high as 125%. Depends on your state laws, credit history, income, and other factors.";
helpTexts["balance_mortgage_2"] = "<b>If Applicable</b>";
helpTexts["balance_mortgage_3"] = "<b>Other Liens:</b><br>The amount you still owe on any loans that are secured by your home.";
helpTexts["total_balance_owed"] = "<b>Balance Owed:</b><br>This is total amount that you still owe on any outstanding mortgages and loans that are secured by your home.";
