<!-- Begin
function Loan() {
var housePrice;
var IR;
var dpayment;
var years;
var monthPay;
var month;
switch(document.calcform.startm.value) {
case "january":
document.calcform.startm.value="0";
parseInt(document.calcform.startm.value)
break;
case "february":
document.calcform.startm.value="1";
parseInt(document.calcform.startm.value)
break;
case "march":
document.calcform.startm.value="2";
parseInt(document.calcform.startm.value);
break;
case "april":
document.calcform.startm.value="3";
parseInt(document.calcform.startm.value);
break;
case "may":
document.calcform.startm.value="4";
parseInt(document.calcform.startm.value);
break;
case "june":
document.calcform.startm.value="5";
parseInt(document.calcform.startm.value);
break;
case "july":
document.calcform.startm.value="6";
parseInt(document.calcform.startm.value);
break;
case "august":
document.calcform.startm.value="7";
parseInt(document.calcform.startm.value);
break;
case "september":
document.calcform.startm.value="8";
parseInt(document.calcform.startm.value);
break;
case "october":
document.calcform.startm.value="9";
parseInt(document.calcform.startm.value);
break;
case "november":
document.calcform.startm.value="10";
parseInt(document.calcform.startm.value);
break;
case "december":
document.calcform.startm.value="11";
parseInt(document.calcform.startm.value);
break;
default:
document.calcform.startm.value="0";
parseInt(document.calcform.startm.value);
break;
}
housePrice = parseFloat(document.calcform.price.value);
dpayment = parseFloat(document.calcform.dpayment.value);
IR = parseFloat(document.calcform.interest.value);
years = parseFloat(document.calcform.time.value);
housePrice = housePrice - dpayment;
month = years * 12;
interestRate = IR / 12;
negmonth =- 1 * month;
var bottom = 1 - (Math.pow(interestRate+1,negmonth));
var top = interestRate;
var mid = top / bottom;
var dec;
document.calcform.monthPay.value = (housePrice * mid);
monthPay = document.calcform.monthPay.value;
document.calcform.monthPay.value = eval(monthPay);
housePrice = housePrice - document.calcform.monthPay.value;
document.calcform.month.value = month;
}
function convert() {
var startmonth = new String();
startmonth = document.calcform.startm.value;
document.calcform.startm.value = startmonth.toLowerCase();
}
function changenum() {
document.calcform.startyear.value=parseInt(document.calcform.startyear.value);
}
var d = new Date;
function getFieldValue (strFieldName) {
var strFieldValue;
var objRegExp = new RegExp(strFieldName + "=([^&amp;amp;amp;amp;amp;amp;]+)","gi");
if (objRegExp.test(location.search))
strFieldValue = unescape(RegExp.$1);
else strFieldValue="";
return strFieldValue;
}
function Currency(money1) {
var money = new String(money1);
var decimal = money.indexOf(".",[0]);
var money = money.substring(0,decimal+3);
var money1 = parseFloat(money);
return money;
}
var startmonth;
startmonth = getFieldValue("startm");
var monthofpayment = new String;
month = getFieldValue("month");
monthPay = getFieldValue("monthPay");
Houseprice = getFieldValue("price");
Ir = getFieldValue("interest");
Ir = Ir/12;
year = getFieldValue("startyear")
function check() {
var dPayment = document.calcform.dpayment.value;
var price = document.calcform.price.value;
if(price.indexOf(",") >= 0) {
alert("Please do not put commas in the Price number")
   }
}
function check1() {
var dPayment = document.calcform.dpayment.value;
if(dPayment.indexOf(",") >= 0) {
alert("Please do not put commas in the Down Payment number");
   }
}
//  End -->


