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;aro=document.getElementById("mpayment");aro.innerHTML=month;return false}function convert(){var A=new String();A=document.calcform.startm.value;document.calcform.startm.value=A.toLowerCase()}function changenum(){document.calcform.startyear.value=parseInt(document.calcform.startyear.value)}var d=new Date;function getFieldValue(B){var C;var A=new RegExp(B+"=([^&]+)","gi");if(A.test(location.search)){C=unescape(RegExp.$1)}else{C=""}return C}function Currency(C){var B=new String(C);var A=B.indexOf(".",[0]);var B=B.substring(0,A+3);var C=parseFloat(B);return B}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 A=document.calcform.dpayment.value;var B=document.calcform.price.value;if(B.indexOf(",")>=0){alert("Please do not put commas in the Price number")}}function check1(){var A=document.calcform.dpayment.value;if(A.indexOf(",")>=0){alert("Please do not put commas in the Down Payment number")}};
