function Calculate(PriceIn)
{

	var PLTTdiv = document.getElementById("PLTT");
	var totalDiv = document.getElementById("TOTTAX");
	var PLTT =0;
	var Price = parseFloat(PriceIn);
	
	if (Price < 55000.01)
	{
		PLTT = Price * 0.005;
	}
	else if (Price > 55000)
	{
		if (Price < 250000.01) {
			PLTT = (55000 * .005) + ((Price - 55000) * 0.01);
		} else if (Price < 400000.01) {
			PLTT = (55000 * .005) + ((250000 - 55000) * 0.01) + ((Price - 250000)*.015);
		} else {
			PLTT = (55000 * .005) + ((250000 - 55000) * 0.01) + ((400000 - 250000) * .015) + ((Price - 400000) * .02);
		}
	}
	totalDiv.innerHTML = "$"+PLTT.toFixed(2).toString();	
}

function CalculateMortgage(form)
{

	var P = parseFloat(form.principal.value);
	var i = parseFloat(form.interestPercent.value);
	var n = parseFloat(form.years.value);

	var monthlyPayment = 0;
	
	if((P>0)&&(i>0)&&(n>0)){
		monthlyPayment = (P*((Math.pow((1+i/200),(1/6))-1))/(1-Math.pow((Math.pow((1+i/200),(1/6))),-(n*12)))); //(P*(((1+i/200)^(1/6)-1))/(1-(((1+i/200)^(1/6)))^-(n*12)))
	}
	document.getElementById("MonthlyPayment").innerHTML = "$"+monthlyPayment.toFixed(2);
}
