KJE.parameters.set("MSG_DROPPER2_TITLE","Certificate interest rates:");KJE.parameters.set("MSG_DROPPER_TITLE","Certificate ladder inputs:");KJE.parameters.set("MSG_DROPPER_CLOSETITLE","Total to invest KJE1, Amount per certificate KJE2, mature every KJE3 months");KJE.parameters.set("MSG_GRAPH1","Certificate Ladder");KJE.parameters.set("MSG_GRAPH2","Single Certificate");KJE.parameters.set("MSG_PERIODIC_AMOUNT_AVAILABLE","Amount in each");KJE.parameters.set("MSG_CD_RATE_OF_RETURN","Certificate interest rate");KJE.parameters.set("MSG_FUND_ACCESS","Frequency of maturing");KJE.parameters.set("MSG_REPORT_COL2","Balance at Maturity of Single Certificate");KJE.parameters.set("MSG_REPORT_COL3","Balance at Maturity of Ladder");KJE.parameters.set("MSG_LADDER_RESULT","You will have earned MSG_AMOUNT using Certificate Laddering.");KJE.parameters.set("MSG_FUND_INDEX","Frequency of maturing Share Certificate");KJE.CDLadderCalc=function(){this.TOTAL_TO_INVEST=0;this.FUND_INDEX=KJE.Default.CD_MATURE_ANNUAL;this.FUND_ACCESS=0;this.OLD_FUND_ACCESS=0;this.PERIODIC_AMOUNT_AVAILABLE=0;this.CD_STARTING_AMOUNT=0;this.MSG_LADDER_ROW=KJE.parameters.get("MSG_LADDER_ROW","
qq | CD_TIME_LABELqq | CD_RATE_OF_RETURNqq | CD_APYqq | CD_STARTING_AMOUNT | CD_FIRST_MATURITYqq |
");this.MSG_LADDER_RESULT=KJE.parameters.get("MSG_LADDER_RESULT","You will have earned MSG_AMOUNT using CD Laddering.*");this.MSG_MORE=KJE.parameters.get("MSG_MORE","more");this.MSG_LESS=KJE.parameters.get("MSG_LESS","less");this.MSG_CALC_AMOUNT=KJE.parameters.get("MSG_CALC_AMOUNT","CALC_AMOUNT MSG_CHANGE");this.CALC_AMOUNT="";this.LADDER_RESULT="";this.MSG_ERROR1=KJE.parameters.get("MSG_ERROR1","Longest maturity can't exceed 360 months (30 years)");this.dRatesOfReturn=KJE.FloatArray(360);for(var a=1;a<=this.dRatesOfReturn.length;a++){this.setPeriodRate(a,KJE.parameters.get("MONTHLY_RATE"+a,0))}this.NUMBER_OF_CDS=-1;this.OLD_NUMBER_OF_CDS=-1;this.MIN_NUMBER_CDS=KJE.parameters.get("MIN_NUMBER_CDS",1);this.CD_LADDER_TOTAL=0;this.SINGLE_CD_TOTAL=0;this.LADDER_DIFFERENCE=0;this.COMPOUND_INDEX=KJE.Default.COMPOUND_ANNUALLY;this.COMPOUND_DESC="";this.CD_MAX_COUNT=10;this.CD_RATE_OF_RETURN=KJE.FloatArray(this.CD_MAX_COUNT);this.CD_MONTHS=new Array(this.CD_MAX_COUNT);this.CD_FINAL_BALANCE=KJE.FloatArray(this.CD_MAX_COUNT);this.CD_FIRST_MATURITY=KJE.FloatArray(this.CD_MAX_COUNT);this.CD_INTEREST_EARNED=KJE.FloatArray(this.CD_MAX_COUNT);this.CD_APY=KJE.FloatArray(this.CD_MAX_COUNT);this.CD_TIME_LABEL=new Array(this.CD_MAX_COUNT);this.cats=null;this.sSchedule=new KJE.Repeating()};KJE.CDLadderCalc.prototype.clear=function(){};KJE.CDLadderCalc.prototype.calculate=function(l){var b=KJE;var h=KJE.Default.COMPOUND_DESC[this.COMPOUND_INDEX];var k=KJE.Default.COMPOUND_VALUE[this.COMPOUND_INDEX];this.COMPOUND_DESC=KJE.Default.COMPOUND_SELECTIONS[this.COMPOUND_INDEX];this.FUND_ACCESS=KJE.Default.CD_MATURE_VALUE[this.FUND_INDEX];var f=this.TOTAL_TO_INVEST;var o=Math.floor(f/this.PERIODIC_AMOUNT_AVAILABLE);if(othis.CD_RATE_OF_RETURN.length){o=this.CD_RATE_OF_RETURN.length}this.DR_BALANCE=KJE.FloatArray(o);this.DR_SINGLE_BALANCE=KJE.FloatArray(o);this.DR_CD_BALANCE=KJE.FloatArray(o);this.CD_STARTING_AMOUNT=b.round(f/o,2);for(var a=0;a360&&a0&&this.CD_RATE_OF_RETURN[a]!=c&&this.OLD_NUMBER_OF_CDS==o&&this.OLD_FUND_ACCESS==this.FUND_ACCESS)){this.setPeriodRate(this.CD_MONTHS[a],this.CD_RATE_OF_RETURN[a])}else{this.CD_RATE_OF_RETURN[a]=c}}var m=(this.CD_RATE_OF_RETURN[o-1]/100)/k;this.CD_LADDER_TOTAL=0;for(var a=0;a0?b.dollars(this.LADDER_DIFFERENCE,2):b.dollars(this.LADDER_DIFFERENCE*-1,2)),KJE.replace("MSG_CHANGE",(this.LADDER_DIFFERENCE>0?this.MSG_MORE:this.MSG_LESS),this.MSG_CALC_AMOUNT));this.LADDER_RESULT=KJE.replace("MSG_TERM",this.CD_TIME_LABEL[o-1],KJE.replace("MSG_AMOUNT",this.CALC_AMOUNT,this.MSG_LADDER_RESULT));this.sFreq=h;this.NUMBER_OF_CDS=o};KJE.CDLadderCalc.prototype.formatReport=function(b){var c=KJE;var a=this.iDecimal;var d=b;d=KJE.replace("TOTAL_TO_INVEST",c.dollars(this.TOTAL_TO_INVEST,2),d);d=KJE.replace("COMPOUND_DESC",this.COMPOUND_DESC,d);d=KJE.replace("NUMBER_OF_CDS",c.number(this.NUMBER_OF_CDS,0),d);d=KJE.replace("CD_LADDER_TOTAL",c.dollars(this.CD_LADDER_TOTAL,2),d);d=KJE.replace("SINGLE_CD_TOTAL",c.dollars(this.SINGLE_CD_TOTAL,2),d);d=KJE.replace("CD_TIME_LONGEST",this.CD_TIME_LABEL[this.NUMBER_OF_CDS-1],d);d=KJE.replace("FUND_ACCESS",c.number(this.FUND_ACCESS),d);d=KJE.replace("PERIODIC_AMOUNT_AVAILABLE",c.dollars(this.PERIODIC_AMOUNT_AVAILABLE,2),d);d=KJE.replace("CALC_AMOUNT",this.CALC_AMOUNT,d);d=KJE.replace("LADDER_RESULT",this.LADDER_RESULT,d);var f="";for(var e=0;e",f,d);for(var e=this.NUMBER_OF_CDS-1;e>=0;e--){d=KJE.replace("CD_RATE_OF_RETURN"+(e+1),c.percent(this.CD_RATE_OF_RETURN[e]/100,2),d);d=KJE.replace("CD_MONTHS"+(e+1),c.number(this.CD_MONTHS[e],0),d);d=KJE.replace("CD_FINAL_BALANCE"+(e+1),c.dollars(this.CD_FINAL_BALANCE[e],2),d);d=KJE.replace("CD_FIRST_MATURITY"+(e+1),c.dollars(this.CD_FIRST_MATURITY[e],2),d);d=KJE.replace("CD_INTEREST_EARNED"+(e+1),c.dollars(this.CD_INTEREST_EARNED[e],2),d);d=KJE.replace("CD_APY"+(e+1),c.percent(this.CD_APY[e],3),d);d=KJE.replace("CD_TIME_LABEL"+(e+1),this.CD_TIME_LABEL[e],d)}d=KJE.replace("CD_STARTING_AMOUNT",c.dollars(this.CD_STARTING_AMOUNT,2),d);d=d.replace("**REPEATING GROUP**",this.sSchedule.getRepeat());this.sSchedule.clearRepeat();return d};KJE.CDLadderCalc.prototype.setPeriodRate=function(a,b){if(a>360){return}if(a<1){return}if(b>20){return}if(b<=0){return}this.dRatesOfReturn[a-1]=b};KJE.CDLadderCalc.prototype.getPeriodRate=function(a){if(a>360){a=360}if(a<=0){a=1}a--;for(var b=a;b>=0;b--){if(this.dRatesOfReturn[b]!=0){return this.dRatesOfReturn[b]}}return this.dRatesOfReturn[0]};KJE.Default.COMPOUND_DAILY=0;KJE.Default.COMPOUND_MONTHLY=1;KJE.Default.COMPOUND_QRTLY=2;KJE.Default.COMPOUND_SEMI=3;KJE.Default.COMPOUND_ANNUALLY=4;KJE.Default.COMPOUND_SELECTIONS=["compound daily","compound monthly","compound quarterly","compound semi-annually","compound annually"];KJE.Default.COMPOUND_DESC=["Day","Month","Quarter","Semi-annual","Year"];KJE.Default.COMPOUND_VALUE=[360,12,4,2,1];KJE.Default.COMPOUND_INDEX=[0,1,2,3,4];KJE.Default.CD_MATURE_ANNUAL=3;KJE.Default.CD_MATURE_SELECTIONS=["3 months","6 months","9 months","12 months","18 months","24 months"];KJE.Default.CD_MATURE_VALUE=[3,6,9,12,18,24];KJE.Default.CD_MATURE_INDEX=[0,1,2,3,4,5];KJE.CalcName="Credit Union Certificate Ladder Calculator";KJE.CalcType="CertificateLadder";KJE.CalculatorTitle="CD Ladder Calculator";KJE.parseInputs=function(b){var a=KJE.getDropBox("FUND_INDEX",KJE.parameters.get("FUND_INDEX",KJE.Default.CD_MATURE_ANNUAL),KJE.Default.CD_MATURE_INDEX,KJE.Default.CD_MATURE_SELECTIONS);b=KJE.replace("**FUND_INDEX**",a,b);a=KJE.getDropBox("COMPOUND_INDEX",KJE.parameters.get("COMPOUND_INDEX",KJE.Default.COMPOUND_ANNUALLY),KJE.Default.COMPOUND_INDEX,KJE.Default.COMPOUND_SELECTIONS);b=KJE.replace("**COMPOUND_INDEX**",a,b);b=KJE.replace("**MSG_LADDER_FOOTER**",KJE.parameters.get("MSG_LADDER_FOOTER","*Note that at the end of the time period shown, only a portion of your CD Ladder balance is liquid, while the entire Single CD balance is liquid."),b);return b};KJE.initialize=function(){KJE.CalcControl=new KJE.CDLadderCalc();KJE.GuiControl=new KJE.CDLadder(KJE.CalcControl)};KJE.CDLadder=function(j){var f=KJE;var b=KJE.gLegend;var g=KJE.inputs.items;this.MSG_GRAPH1=KJE.parameters.get("MSG_GRAPH1","CD Ladder");this.MSG_GRAPH2=KJE.parameters.get("MSG_GRAPH2","Single CD");KJE.DollarSlider("TOTAL_TO_INVEST","Total to invest",KJE.parameters.get("CD_MINIMUM",500),100000000,0,0,4);KJE.DollarSlider("PERIODIC_AMOUNT_AVAILABLE","Amount in each CD",KJE.parameters.get("CD_MINIMUM",500),KJE.parameters.get("CD_MAXIMUM",1000000));KJE.DropBox("COMPOUND_INDEX","Interest is compounded");KJE.DropBox("FUND_INDEX","Frequency of maturing CD");var i=KJE.parameters.get("MSG_CD_RATE_OF_RETURN","CD interest rate");for(var d=0;dInput information:
**GRAPH1** ";KJE.DefinitionText=" Total to investThis is the total amount to invest in your Certificate Ladder. Frequency of Maturing certificatesHow often you would like to have a certificate maturing. For example, if you choose six months, one of your certificates in your Certificate Ladder will mature every six months. Amount in each certificateHow much you wish to invest in each certificate in your ladder. We use this amount to calculate the number of certificates in the ladder. If the amount that you enter isn't evenly divisible by the total you wish to put into your Certificate Ladder, we will automatically adjust it up to an evenly divisible amount. certificates in your LadderThe number of certificates that will be in your Certificate Ladder. Each certificate will have a different maturity, so that one of your certificates will mature at the frequency you specify. This calculator assumes that you redeposit all matured certificates into new certificates that have a term of the longest maturity in your original Certificate Ladder. Interest is compoundedInterest earned on your certificates accumulated interest. This calculator allows you to choose the frequency that your certificates interest income is added to your account. The more frequently this occurs, the sooner your accumulated interest income will generate additional interest. You may wish to check with your local office to find out how often interest is being compounded on your particular certificate. ";KJE.ReportText='
At the end of CD_TIME_LONGEST, your balance using Certificate Laddering will be CD_LADDER_TOTAL. Using a single rollover certificate, your balance will be SINGLE_CD_TOTAL. LADDER_RESULT **GRAPH** Total to invest | TOTAL_TO_INVEST |
Frequency of certificates maturing | FUND_ACCESS months |
Amount in each certificate | PERIODIC_AMOUNT_AVAILABLE |
Certificates in your ladder | NUMBER_OF_CDS |
Interest is compounded | COMPOUND_DESC |
**REPEATING GROUP** ';