Login


Register | Recover Password

Loan Calculator

');b.document.close()}else b.focus();s=f(b.document).find("body").empty();w=a.table(c).css("table-layout","auto").width("auto").append(''); v=[];f.each(d,function(i,l){if(l.enabled){var r=l.label.split("|")[0];l=h.input[i];var p=j%y;p=v[p]||(v[p]=a.row(w));a.head(p,r).css("text-align","left");a.cell(p,i=="term"?l+" years":i=="interest"?l.toFixed(2)+"%":a.$(l)+(i=="taxes"||i=="insurance"?" /yr":i=="pmi"||i=="extra"?" /mo":""));j++}});for(j=d.count;j0&&g.unshift("extra");m.taxes>0&&g.push("taxes");if(m.pmi>0||m.insurance>0)g.push("insurance");e={cht:"bvs",chm:"D,"+e.value.balance.substr(1)+","+g.length+",0,2,0",chbh:"a,4",chs:b+"x"+n,chxt:"x,y",chxl:"0:|"+function(i, l){for(;l++<=h.input.term;)i.push(l);return i.join("|")}([],0)+"|1:|$0|$"+k.month.total.toFixed(0),chf:"bg,s,"+e.pane.back.substr(1),chco:a.C(g),chd:"e"+g.length+":"+(m.extra>0?a.E(A.extra,o)+",":"")+a.E(A.principal,o)+","+a.E(A.interest,o)+(m.taxes>0?","+a.E(A.taxes,o):"")+(m.pmi>0||m.insurance>0?","+a.E(A.insurance,o):"")+","+a.E(A.balance)};c.graph.width(b).height(n).attr("src",a.google+a.P(e)).show();s.processed=true}},validate:function(){V=function(d,n,j,m,k){if(b.fields[d].enabled){d=e[d];var g= d.val(),s=d.data("label"),o;if(g.length>0){g=parseFloat(g);if(isNaN(g))o="The '"+s+"' field must be a number.";else if(gm)o="The '"+s+"' field must be "+(gu)q=x-u;else{u=x;q=0}d.balance=x-u-q}return{interest:t,principal:u,extra:q}};balance=function(t){if(d.extra==0)return d.payment*(1-accum(t))/d.interest;return d.balance};var b=this,a=b.objects,e=b.values,c=b.fields,h=e.input={},d=e.value={},n=e.payment={month:{},year:{}},j=n.total={principal:0,extra:0,interest:0},m=e.amort= {},k=m.month={principal:[],extra:[],interest:[],taxes:[],insurance:[],balance:[]};m=m.year={principal:[],extra:[],interest:[],taxes:[],insurance:[],balance:[]};if(!b.validate())return b.pane("error");f.each(c,function(t){h[t]=b.Z(a[t],0)});d.principal=h.principal;d.interest=h.interest/1200;d.term=h.term*12;d.down=h.down/h.principal;d.taxes=b.N(h.taxes/12,2);d.insurance=b.N(h.insurance/12,2);d.pmi=d.down>=0.2?0:h.pmi;d.pmiTerm=d.term;d.extra=h.extra;d.balance=h.principal-h.down;d.payment=b.N(d.balance* d.interest/(1-accum(0)),2);d.paymentTerm=0;for(c=1;c<=d.term;c++){var g=paid(c),s=balance(c),o=Math.floor((c-1)/12),A=d.taxes,C=d.insurance+(c>d.pmiTerm?0:d.pmi);if(s==0&&g.principal>0)g.principal+=b.N(d.principal-j.principal-g.principal-j.extra-g.extra,2);k.principal.push(g.principal);k.extra.push(g.extra);k.interest.push(g.interest);k.taxes.push(A);k.insurance.push(C);k.balance.push(s);add(m.principal,o,g.principal);add(m.extra,o,g.extra);add(m.interest,o,g.interest);add(m.taxes,o,A);add(m.insurance, o,C);m.balance[o]=d.paymentTerm?null:s;j.principal+=g.principal;j.extra+=g.extra;j.interest+=g.interest;if(c").attr("title",z).text(p[k?p.length-1:0]).click(function(){a[r].focus()}).appendTo(i);a[r]=f("<"+l+"/>").css(d.css.field).data("id", r).data("label",p[0]).focus(function(){f(this).select()}).blur(function(B){B=B.target;if(B.type=="text"){B=f(B);var E=parseFloat(B.val());if(isNaN(B.val())){E=B.val();E=E.replace(",","");E=parseFloat(E);B.val(E.toFixed(r=="term"?0:2))}else isNaN(E)||B.val(E.toFixed(r=="term"?0:2))}}).keypress(function(B){if(B.which=="13"){B=f(B.target);B.trigger(B.data("id")=="principal"?"change":"blur");b.calculate()}}).appendTo(i);if(l=="select"){p=m.min[r];l=a[r].append(f("