if(!iQ.Ajax){alert('iQAjax.js Not Loaded');}; if(!iQ.Utils){alert('iQUtils.js Not Loaded');}; YAHOO.util.Event.addListener(window,"load",function(){doCreateMortCalcForm()}); function doCreateMortCalcForm(){ objMortgage_Panel = new YAHOO.widget.Dialog("Mortgage_Panel", { postmethod:"none", width:"400px", disply:"table", visible:false, draggable:true, close:true, constraintoviewport:false, fixedcenter:true, modal:true, zindex:300 } ); objMortgage_Panel.setBody('
Years: 
Loan Amount: 
Annual Insurance: 
Interest Rate: 
Annual Tax: 
Monthly HOA: 
Results
Monthly Principal + Interest: 
Monthly Tax: 
Monthly Ins: 
Monthly HOA: 
Total Payment: 

The information provided here is intended to be used as a guideline and may not reflect the actual payments.

'); objMortgage_Panel.setHeader('Mortgage Calculator') objMortgage_Panel.render(document.body); } function doMortCalc(ListPrice){ document.loan.LA.value = ListPrice; document.loan.YR.value = 30; document.loan.IR.value="6.0"; document.loan.AT.value = 1000; document.loan.AI.value = 300; document.loan.HOA.value = 36; objMortgage_Panel.show(); dosum(); } function floor(number){ return Math.floor(number*Math.pow(10,2))/Math.pow(10,2); } function dotax(){ document.loan.AT.value = floor(document.loan.LA.value * .01); } function dosum(){ var mi = document.loan.IR.value / 1200; var base = 1; var mbase = 1 + mi; for (i=0;i< document.loan.YR.value * 12;i++){ base = base * mbase } document.loan.PI.value = floor(document.loan.LA.value * mi / ( 1 - (1/base))) document.loan.MT.value = floor(document.loan.AT.value / 12) document.loan.MI.value = floor(document.loan.AI.value / 12) document.loan.MHOA.value = floor(document.loan.HOA.value / 1) var dasum = document.loan.LA.value * mi / ( 1 - (1/base)) + document.loan.AT.value / 12 + document.loan.AI.value / 12 + document.loan.HOA.value / 1; document.loan.MP.value = floor(dasum); } function onCancel(){ objMortgage_Panel.hide(); }