function cr(num){var di,dj,dk,dh,numLength=num.length;if(numLength>0){num=num.toString();di=num.indexOf("%");if(di>=0){num=num.substring(0,di)+""+num.substring(di+1,numLength);numLength=num.length;};dj=num.indexOf("$");if(dj>=0){num=num.substring(0,dj)+""+num.substring(dj+1,numLength);numLength=num.length;};dk=num.indexOf(" ");if(dk>=0){num=num.substring(0,dk)+""+num.substring(dk+1,numLength);numLength=num.length;};dh=num.indexOf(",");if(dh>=0){while(dh>=1){num=num.substring(0,dh)+""+num.substring(dh+1,numLength);numLength=num.length;dh=num.indexOf(",");};};num=eval(num);}else{num=0;};return num;};function db(num){var isNeg=0;if(num<0){num=num*-1;isNeg=1;};onum=Math.round(num*100)/100;integer=Math.floor(onum);if(Math.ceil(onum)==integer){decimal="00";}else{decimal=Math.round((onum-integer)*100)};decimal=decimal.toString();if(decimal.length<2)decimal="0"+decimal;integer=integer.toString();var tmpnum="",tmpinteger="",y=0;for(x=integer.length;x>0;x--){tmpnum=tmpnum+integer.charAt(x-1);y=y+1;if(y==3&x>1){tmpnum=tmpnum+",";y=0;};};for(x=tmpnum.length;x>0;x--){tmpinteger=tmpinteger+tmpnum.charAt(x-1);};finNum=tmpinteger+"."+decimal;if(isNeg==1){finNum="-"+finNum;};return finNum;};function calculateTotals(form){var a=0,e=0,c=0,d=0,f=0,b="",cq=form.descA.value,aw=cr(form.princA.value),z=cr(form.intA.value),bk=cr(form.payA.value),av=0,ch=0;if(aw>0&&z>0&&bk>0){av=dc(cq,aw,z,bk);form.costA.value=db(av);ch=dd(cq,aw,z,bk);d=ch;form.rempayA.value=db(d);e=av;a=aw;c=bk;f++;ce=de(cq,aw,z,bk,form.costA.value,form.rempayA.value);b=""+b+""+ce+"";};var cp=form.descB.value,au=cr(form.princB.value),x=cr(form.intB.value),bj=cr(form.payB.value),at=0,bs=0;if(au>0&&x>0&&bj>0){at=dc(cp,au,x,bj);form.costB.value=db(at);bs=dd(cp,au,x,bj);form.rempayB.value=db(bs);if(bs>d){d=bs;};e=eval(e)+eval(at);a=eval(a)+eval(au);c=eval(c)+eval(bj);f++;cd=de(cp,au,x,bj,form.costB.value,form.rempayB.value);b=""+b+""+cd+"";};var co=form.descC.value,as=cr(form.princC.value),w=cr(form.intC.value),bi=cr(form.payC.value),ar=0,br=0;if(as>0&&w>0&&bi>0){ar=dc(co,as,w,bi);form.costC.value=db(ar);br=dd(co,as,w,bi);form.rempayC.value=db(br);if(br>d){d=br;};e=eval(e)+eval(ar);a=eval(a)+eval(as);c=eval(c)+eval(bi);f++;cc=de(co,as,w,bi,form.costC.value,form.rempayC.value);b=""+b+""+cc+"";};var cn=form.descD.value,aq=cr(form.princD.value),v=cr(form.intD.value),bh=cr(form.payD.value),ap=0,bq=0;if(aq>0&&v>0&&bh>0){ap=dc(cn,aq,v,bh);form.costD.value=db(ap);bq=dd(cn,aq,v,bh);form.rempayD.value=db(bq);if(bq>d){d=bq;};e=eval(e)+eval(ap);a=eval(a)+eval(aq);c=eval(c)+eval(bh);f++;cb=de(cn,aq,v,bh,form.costD.value,form.rempayD.value);b=""+b+""+cb+"";};var cm=form.descE.value,ao=cr(form.princE.value),u=cr(form.intE.value),bg=cr(form.payE.value),an=0,bp=0;if(ao>0&&u>0&&bg>0){an=dc(cm,ao,u,bg);form.costE.value=db(an);bp=dd(cm,ao,u,bg);form.rempayE.value=db(bp);if(bp>d){d=bp;};e=eval(e)+eval(an);a=eval(a)+eval(ao);c=eval(c)+eval(bg);f++;ca=de(cm,ao,u,bg,form.costE.value,form.rempayE.value);b=""+b+""+ca+"";};var cl=form.descF.value,am=cr(form.princF.value),t=cr(form.intF.value),bf=cr(form.payF.value),al=0,bo=0;if(am>0&&t>0&&bf>0){al=dc(cl,am,t,bf);form.costF.value=db(al);bo=dd(cl,am,t,bf);form.rempayF.value=db(bo);if(bo>d){d=bo;};e=eval(e)+eval(al);a=eval(a)+eval(am);c=eval(c)+eval(bf);f++;bz=de(cl,am,t,bf,form.costF.value,form.rempayF.value);b=""+b+""+bz+"";};var ck=form.descG.value,ak=cr(form.princG.value),s=cr(form.intG.value),be=cr(form.payG.value),aj=0,bn=0;if(ak>0&&s>0&&be>0){aj=dc(ck,ak,s,be);form.costG.value=db(aj);bn=dd(ck,ak,s,be);form.rempayG.value=db(bn);if(bn>d){d=bn;};e=eval(e)+eval(aj);a=eval(a)+eval(ak);c=eval(c)+eval(be);f++;by=de(ck,ak,s,be,form.costG.value,form.rempayG.value);b=""+b+""+by+"";};var cj=form.descH.value,ai=cr(form.princH.value),r=cr(form.intH.value),bd=cr(form.payH.value),ah=0,bm=0;if(ai>0&&r>0&&bd>0){ah=dc(cj,ai,r,bd);form.costH.value=db(ah);bm=dd(cj,ai,r,bd);form.rempayH.value=db(bm);if(bm>d){d=bm;};e=eval(e)+eval(ah);a=eval(a)+eval(ai);c=eval(c)+eval(bd);f++;bx=de(cj,ai,r,bd,form.costH.value,form.rempayH.value);b=""+b+""+bx+"";};var ci=form.descI.value,ag=cr(form.princI.value),q=cr(form.intI.value),bc=cr(form.payI.value),af=0,bl=0;if(ag>0&&q>0&&bc>0){af=dc(ci,ag,q,bc);form.costI.value=db(af);bl=dd(ci,ag,q,bc);form.rempayI.value=db(bl);if(bl>d){d=bl;};e=eval(e)+eval(af);a=eval(a)+eval(ag);c=eval(c)+eval(bc);f++;bw=de(ci,ag,q,bc,form.costI.value,form.rempayI.value);b=""+b+""+bw+"";};var cg=form.descJ.value,ab=cr(form.princJ.value),p=cr(form.intJ.value),ae=cr(form.payJ.value),ad=0,bb=0;if(ab>0&&p>0&&ae>0){ad=dc(cg,ab,p,ae);form.costJ.value=db(ad);bb=dd(cg,ab,p,ae);form.rempayJ.value=db(bb);if(bb>d){d=bb;};e=eval(e)+eval(ad);a=eval(a)+eval(ab);c=eval(c)+eval(ae);f++;bv=de(cg,ab,p,ae,form.costJ.value,form.rempayJ.value);b=""+b+""+bv+"";};if(f==0){}else{form.totalCost.value=db(e);form.totalPrincipal.value=db(a);form.totalTerm.value=db(d);form.totalPmtAmt.value=db(c);form.formCost.value=e;form.formPrinc.value=a;form.formLength.value=d;form.formPay.value=c;form.formDebts.value=f;b=""+b+"</table><br><br><strong><font size='4'>Before and After Consolidation</font></strong><TABLE BORDER=0 CELLPADDING=4 BGCOLOR=black width='95%'><TR><TD BGCOLOR=white ALIGN=CENTER width='50'><B>&nbsp;</B></TD><TD BGCOLOR=white ALIGN=CENTER><B>Owed</B></small></font></TD><TD BGCOLOR=white ALIGN=CENTER><B>Interest Rate</B></TD><TD BGCOLOR=white ALIGN=CENTER><B>Payment</B></TD><TD BGCOLOR=white ALIGN=CENTER><B>Total Interest</b></TD><TD BGCOLOR=white ALIGN=CENTER><B>Months to Payoff </B></TD></TR><TR><TD BGCOLOR=white><B>Before</font></TD><TD ALIGN=RIGHT BGCOLOR=white>$"+db(cr(form.totalPrincipal.value))+"</TD><TD ALIGN=RIGHT BGCOLOR=white>N/A</TD><TD ALIGN=RIGHT BGCOLOR=white>$"+db(cr(form.totalPmtAmt.value))+"</TD><TD ALIGN=RIGHT BGCOLOR=white>$"+db(cr(form.totalCost.value))+"</TD><TD ALIGN=RIGHT BGCOLOR=white>"+db(d)+"</TD></TR>";form.formAna.value=b;};};function calculateTotal(form){calculateTotals(form);if(form.consolRate.value==0||form.consolRate.value==""){alert("Please enter an annual interest rate for your consolidation loan.");form.consolRate.focus();}else;if(form.consolLength.value==0||form.consolLength.value==""){alert("Please enter the length of the term (number of years) for your consolidation loan.");form.consolLength.focus();}else{var bu="Consolidation Loan",h=form.formPrinc.value,ba=cr(form.consolRate.value),bt=cr(form.consolLength.value),i=ba;if(i>1.0){i=i/100.0;};i/=12;var noMonths=bt*12,pow=1;for(var j=0;j<noMonths;j++)pow=pow*(1+i);var ac=(h*pow*i)/(pow-1),o=dc(bu,h,ba,ac),pmtSign="-",pmtColor="green",pmtReport="",az=form.formPay.value;form.presPay.value=db(az);form.consolPay.value=db(ac);var k=eval(az)-eval(ac);if(k<0){k*=-1;pmtSign="+";pmtColor="red";};pmtReport=pmtSign+"$"+db(k);form.payChange.value=pmtSign+""+db(k);var termSign="-",termColor="green",termReport="",ax=form.formLength.value;form.presTime.value=db(ax);form.consolTime.value=db(noMonths);var g=eval(ax)-eval(noMonths);if(g<0){g*=-1;termSign="+";termColor="red";};termReport=termSign+""+db(g);form.timeChange.value=termSign+""+db(g);var aa=cr(form.consolCharge.value);if(aa==""){aa=0;};var intSign="-",dm="green",dl="",ay=form.formCost.value;form.presInt.value=db(ay);o=eval(o)+eval(aa);form.consolInt.value=db(o);var l=eval(ay)-eval(o);if(l<0){l*=-1;intSign="+";dm="red";};dl=intSign+"$"+db(l);form.intChange.value=intSign+""+db(l);var m=form.formDebts.value;if(pmtSign=="-"&&termSign=="+"&&intSign=="+"){form.summary.value="If you consolidate your "+m+" debts into a single $"+db(h)+" loan, for "+noMonths+" months, at "+cr(form.consolRate.value)+"% APR, your monthly debt payments will be reduced by $"+db(k)+", but it will take you an additional "+db(g)+" months to pay off your debts and you will end up paying an additional $"+db(l)+" in interest charges and/or loan fees.";}else;if(pmtSign=="-"&&termSign=="-"&&intSign=="-"){form.summary.value="If you consolidate your "+m+" debts into a single $"+db(h)+" loan, for "+noMonths+" months, at "+cr(form.consolRate.value)+"% APR, your monthly debt payments will be reduced by $"+db(k)+", you will pay off your debts "+db(g)+" months earlier and you will end up saving $"+db(l)+" in interest charges and/or loan fees. Just make sure you don't create any new debt paying off your consolidation loan";}else;if(pmtSign=="-"&&termSign=="+"&&intSign=="-"){form.summary.value="If you consolidate your "+m+" debts into a single $"+db(h)+" loan, for "+noMonths+" months, at "+cr(form.consolRate.value)+"% APR, your monthly debt payments will be reduced by $"+db(k)+", it will take you an additional "+db(g)+" months to pay off your debts and you will end up saving $"+db(l)+" in interest charges and/or loan fees. Just make sure you don't do what most people who consolidate do -- they create new debt while they're paying off their consolidation loan.";}else;if(pmtSign=="-"&&termSign=="-"&&intSign=="+"){form.summary.value="If you consolidate your "+m+" debts into a single $"+db(h)+" loan, for "+noMonths+" months, at "+cr(form.consolRate.value)+"% APR, your monthly debt payments will be reduced by $"+db(k)+", you will pay off your debts "+db(g)+" months earlier but you will end up paying an additional $"+db(l)+" in interest charges and/or loan fees.";}else;if(pmtSign=="+"&&termSign=="-"&&intSign=="+"){form.summary.value="If you consolidate your "+m+" debts into a single $"+db(h)+" loan, for "+noMonths+" months, at "+cr(form.consolRate.value)+"% APR, your monthly debt payments will increase by $"+db(k)+", you will pay off your debts "+db(g)+" months earlier but you will end up paying an additional $"+db(l)+" in interest charges and/or loan fees.";}else{form.summary.value="No Summary Available.";};var b=form.formAna.value;b=""+b+"<TR><TD BGCOLOR=white><B>After</B></TD><TD ALIGN=RIGHT BGCOLOR=white>$"+form.totalPrincipal.value+"</TD><TD ALIGN=RIGHT BGCOLOR=white>"+db(cr(form.consolRate.value))+"%</TD><TD ALIGN=RIGHT BGCOLOR=white>$"+form.consolPay.value+"</TD><TD ALIGN=RIGHT BGCOLOR=white>$"+form.consolInt.value+"</TD><TD ALIGN=RIGHT BGCOLOR=white>"+form.consolTime.value+"</TD></TR><TR><TD BGCOLOR=white><B>Change</B></TD><TD ALIGN=RIGHT BGCOLOR=white></TD><TD ALIGN=RIGHT BGCOLOR=white></TD><TD ALIGN=RIGHT BGCOLOR=white><FONT COLOR="+pmtColor+"><b>"+pmtReport+"</b></TD><TD ALIGN=RIGHT BGCOLOR=white><B><FONT COLOR="+dm+">"+dl+"</FONT></b></TD><TD ALIGN=RIGHT BGCOLOR=white><b><FONT COLOR="+termColor+">"+termReport+"</FONT></b></TD></TR>";form.formAna.value=b;};};function dc(name,principal,interest,payment){var i=interest;if(i>1.0){i=i/100.0;};i/=12;var prin=principal,count=0,prinPort=0,dg=0,pmt=payment,n=0;while(eval(prin)>eval(pmt)){dg=prin*i;n=n+dg;prinPort=pmt-dg;prin=prin-prinPort;count=count+1;if(count>600){df(name);break;};};dg=prin*i;n=n+dg;prinPort=pmt-dg;prin=prin-prinPort;var totalInt=n;return totalInt;};function dd(name,principal,interest,payment){var i=interest;if(i>1.0){i=i/100.0;};i/=12;var prin=principal,count=0,prinPort=0,dg=0,pmt=payment,n=0,lastPmt=0;while(eval(prin)>eval(pmt)){dg=prin*i;prinPort=pmt-dg;prin=prin-prinPort;count=count+1;if(count>600){break;};};totalPmts=prin/payment+count;return totalPmts;};function df(name){alert("Based on the terms you entered for "+name+", your monthly interest charge is greater than your monthly payment -- which means you will never pay off "+name+". Please increase the payment amount until this alert message disappears.");};function cy(form){form.descB.focus();};function cx(form){form.descC.focus();};function cw(form){form.descD.focus();};function cv(form){form.descE.focus();};function cu(form){form.descF.focus();};function ct(form){form.descG.focus();};function cs(form){form.descH.focus();};function da(form){form.descI.focus();};function cz(form){form.descJ.focus();};function de(name,principal,interest,payment,cost,term){cf="<TR><TD BGCOLOR=white>"+name+"</TD><TD ALIGN=RIGHT BGCOLOR=white>$"+db(principal)+"</TD><TD ALIGN=RIGHT BGCOLOR=white>"+db(interest)+"%</TD><TD ALIGN=RIGHT BGCOLOR=white>$"+db(payment)+"</TD><TD ALIGN=RIGHT BGCOLOR=white>$"+cost+"</TD><TD ALIGN=RIGHT BGCOLOR=white>"+term+"</small></font></TD></TR>";return cf;};function writeAna(form){calculateTotals(form);calculateTotal(form);var report="<HEAD><TITLE>Your Debt Consolidation Analysis</TITLE></HEAD>"+"<BODY BGCOLOR = '#FFFFFF'><CENTER><font face='arial'><big><strong>Your Debt Consolidation Analysis</strong></big></FONT><BR><br><strong>Provided by Consolidate 1st<br>http://www.consolidate-1st.com</strong></CENTER><P><strong><font size='4'><center>Your Listed Debts</center></font></strong><CENTER><br><TABLE BORDER=0 CELLPADDING=4 BGCOLOR=black width='95%'><TR><TD BGCOLOR=white ALIGN=CENTER width='50'><B>&nbsp;</B></TD><TD BGCOLOR=white ALIGN=CENTER><B>Owed</B></small></font></TD><TD BGCOLOR=white ALIGN=CENTER><B>Interest Rate</B></TD><TD BGCOLOR=white ALIGN=CENTER><B>Payment</B></TD><TD BGCOLOR=white ALIGN=CENTER><B>Total Interest</b></TD><TD BGCOLOR=white ALIGN=CENTER><B>Months to Payoff</B></TD></TR> "+form.formAna.value+" </TABLE><p><form method='post'><input type='button' value='Close Window' onClick='window.close()'></form></CENTER></BODY></HTML>";reportWin=window.open("","","width=650,height=400,toolbar=yes,menubar=yes,scrollbars=yes");reportWin.document.write(report);reportWin.document.close();};function TheDate(){today=new Date();TimeHrs=today.getHours();TimeMin=today.getMinutes();DateMth=today.getMonth()+1;DateDate=today.getDate();DateYear=today.getYear();DateDy=today.getDay();if(TimeHrs>12){TimeHrs=TimeHrs-12;if(TimeHrs==12){AmPm="am"}else{AmPm="pm"};}else{if(TimeHrs==12){AmPm="pm"}else{AmPm="am"};};if(TimeMin<10){TimeMin="0"+TimeMin};if(DateMth==1){DateMonth="January "}else if(DateMth==2){DateMonth="February "}else if(DateMth==3){DateMonth="March "}else if(DateMth==4){DateMonth="April "}else if(DateMth==5){DateMonth="May "}else if(DateMth==6){DateMonth="June "}else if(DateMth==7){DateMonth="July "}else if(DateMth==8){DateMonth="August "}else if(DateMth==9){DateMonth="September "}else if(DateMth==10){DateMonth="October "}else if(DateMth==11){DateMonth="November "}else{DateMonth="December "};if(DateDy==0){DateDay="Sunday, "}else if(DateDy==1){DateDay="Monday, "}else if(DateDy==2){DateDay="Tuesday, "}else if(DateDy==3){DateDay="Wednesday, "}else if(DateDy==4){DateDay="Thursday, "}else if(DateDy==5){DateDay="Friday, "}else{DateDay="Saturday, "};brsr=navigator.appName;if(brsr=="Netscape"){if(DateYear<99){DateYear=DateYear+2000}else{DateYear=DateYear+1900};};document.write("<span class=\"smtext\">"+DateDay+DateMonth+DateDate+", "+DateYear+"</span>")};
