HELOC Payment Calculator
"}function fval(t,e,r,a){var d=0,o=0;if(0==r)o=1*t/e*1;else{d=1*r/100/a*1;for(var n=1,i=0;1*e>i;i++)n*=1+1*d;o=t*n*d/(1*n-1)}return o}function calculate(){resultBlock.removeClass(hiddenClass);var t=parseFloat(document.getElementById("MortgLoanAmount").value).toFixed(2);if(isNaN(t)||0>t)return alert("Error"),!1;var e=parseFloat(document.getElementById("MortgInterestRate").value).toFixed(2);if(isNaN(e)||0>e)return alert("Error"),!1;var r=parseInt(document.getElementById("MortgMonths").value).toFixed(2);if(isNaN(r)||0>=r)return alert("Error"),!1;var a=parseInt(document.getElementById("IntOnly").value).toFixed(2);if(isNaN(a)||0>=a)return alert("Error"),!1;var d=12*r,o=12*a,n=fval(t,d,e,12),i=document.getElementById("inf");i.innerHTML="Monthly Principal & Interest Payment: "+c3(n.toFixed(2))+"";var s=Math.round(100*parseFloat(t*e/1200))/100,l=document.getElementById("infi");l.innerHTML="Monthly Interest Only Payment: "+c3(s.toFixed(2))+"";var h=Number(document.getElementById("month").value),c=Number(document.getElementById("year").value),u=t,p=0,m=0,F=0,y=0,x=e/1200,v=0,b=Math.round(100*parseFloat(n))/100,g=0,f=0,w=0,M="class='odd'",I="
",document.getElementById("ReShed").innerHTML=I;var A={},T={},P={},S=0,H=[],k=[],z=[],C=e/100,O=12*a,j=12*r,L=[],D=t*C/12,Q=0;S=Math.pow(1+C/12,j),Q=C>0?t*(C/12*S/(S-1)):t/j;var R=t,J=0,W=C,Y=0,q=0,G=0,K=0,U=0;R=-t,H.push(parseFloat(0)),k.push(parseFloat(0)),z.push(parseFloat(R.toFixed(2)));for(var E=1;O+1>E;E++)G=-R*W/12,K=0,Y+=G,D=G,q+=K,J=R,U+=1,12==U&&(H.push(parseFloat(Y.toFixed(2))),k.push(parseFloat(q.toFixed(2))),z.push(parseFloat(J.toFixed(2))),Y=0,q=0,U=0);for(var B=1;j+1>B;B++)G=-R*W/12,K=Q-G,q+=K,Y+=G,J=R-G+Q,U+=1,12==U?(H.push(parseFloat(Y.toFixed(2))),k.push(parseFloat(q.toFixed(2))),z.push(parseFloat(J.toFixed(2))),Y=0,q=0,U=0):B==j&&(H.push(parseFloat(Y.toFixed(2))),k.push(parseFloat(q.toFixed(2))),z.push(parseFloat(J.toFixed(2)))),R=J;A.name="Interest",T.name="Principal",P.name="Balance",A.data=H,T.data=k,P.data=z,L.push(A),L.push(T),L.push(P),Highcharts.visualize=function(t){t.xAxis.categories=[],Highcharts.setOptions({colors:["#b11116","#008000","#1991d0"]}),t.series=[],t.series=L;new Highcharts.Chart(t)},$(document).ready(function(){options={chart:{renderTo:"ct-chart",defaultSeriesType:"column"},credits:{enabled:!1},title:{text:"HELOC Payoff Schedule",style:{fontSize:"14px"}},xAxis:{min:1,title:{text:"Year"}},yAxis:{title:{text:"Amount, $"}},legend:{align:"center",borderWidth:0},tooltip:{formatter:function(){return"Year "+this.x+"
"+this.series.name+"
$"+this.y.formatCurr(2,",",".")}},responsive:{rules:[{condition:{maxWidth:250},chartOptions:{legend:{align:"center",verticalAlign:"bottom",layout:"horizontal"},yAxis:{labels:{align:"left",x:0,y:-5},title:{text:null}},subtitle:{text:null},credits:{enabled:!1}}}]},plotOptions:{column:{stacking:"normal",pointPadding:0}}},Highcharts.visualize(options)})}Number.prototype.formatCurr=function(t,e,r){var a=this,t=isNaN(t=Math.abs(t))?2:t,r=void 0==r?".":r,e=void 0==e?",":e,d=0>a?"-":"",o=parseInt(a=Math.abs(+a||0).toFixed(t))+"",n=(n=o.length)>3?n%3:0;return d+(n?o.substr(0,n)+e:"")+o.substr(n).replace(/(\d{3})(?=\d)/g,"$1"+e)+(t?r+Math.abs(a-o).toFixed(t).slice(2):"")};var hiddenClass="hidden",resultBlock=$(".resultBlock"),mthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");jQuery(document).ready(function(){jQuery(window).resize(function(){var t=jQuery("#ct-chart").highcharts(),e=jQuery("#ct-chart").closest(".wraper").width();t.setSize(e,.75*e,!1)}),calculate()});
ncG1vNJzZmifn6SxpK3LnKylmaSkv7R6wqikaKCVobykec%2BasKadnql6pK3LnKylmaSkv3A%3D