

<!--

learningon = new Image(132, 30);
learningon.src = "/navbuttons/learning-on.gif";
learningoff = new Image(132, 30);
learningoff.src = "/navbuttons/learning-off.gif";

referenceon = new Image(133, 30);
referenceon.src = "/navbuttons/reference-on.gif";
referenceoff = new Image(133, 30);
referenceoff.src = "/navbuttons/reference-off.gif";

planningon = new Image(133, 30);
planningon.src = "/navbuttons/planning-on.gif";
planningoff = new Image(133, 39);
planningoff.src = "/navbuttons/planning-off.gif";

resourceon = new Image(133, 30);
resourceon.src = "/navbuttons/resource-on.gif";
resourceoff = new Image(133, 30);
resourceoff.src = "/navbuttons/resource-off.gif";

function img_act(imgName) {
      if (document.images) {
         imgOn = eval(imgName + "on.src");
         document [imgName].src = imgOn;
      }
   }

   function img_inact(imgName) {
      if (document.images) {
         imgOff = eval(imgName + "off.src");
         document [imgName].src = imgOff;
      }
   }

// -------------------------------------------- Start Calculator Functions 


// --------------------- Return Required

function CalcInflate(form) {

	var GOAL=form.goal.value-0;
	var INFL=form.infl.value-0;
	var NYRS=form.nyrs.value-0;
	var NEWGL=0;
	var AMT=GOAL;
		if (INFL >= 1) {
		INFL=INFL/100
		}

	for (y=1; y<=NYRS; y=y+1)
		{
//		alert ("here I am y = "+ y)
		AMT=AMT*(1+INFL)
		};
	AMT=Math.round(AMT);
	form.newgl.value=AMT;
	}


function CalcInterest(form) {
	var FV=form.fv.value-0;
	var PV=form.pv.value-0;
	var PD=form.pd.value-0;
// make monthly deposit yearly total;
	PD=PD*12;
	var TX=form.tx.value-0;
	var N=form.n.value-0;
	var INTR=0;
	var TOT=0;
	var AMT=0;
	var DONE=0;
	if (TX >= 1) {
		TX=TX/100
		}
	for (i=10;i<=1000;i=i+1)
		{
		AMT=PV
		for (x=1;x<=N;x=x+1)
		{
//		AMT=AMT*(1+i/1000)+PD;
		AMT=AMT*(1+i/1000*(1-TX))+PD;
		if (AMT<FV) {
			continue
			}
		else {
//  	here is where we go if AMT>=FV
			INTR=i;
			TOT=AMT;
			DONE=1;
			break
			}
			}
		if (DONE==1) {
			break
			}
//		let's try the next interest rate
		continue
		}
//	divide interest by the initial i value in the for loop
	INTR=INTR/10
//	alert ("done = " + DONE + "  INTR = " + INTR)
	if (DONE==0){
	form.intr.value="over 100"
	}
	else {
	form.intr.value=INTR
	}

// this is the total accumulated amount
	form.tot.value=Math.round(TOT);
	}


//-->
