function GoalCalc(form){;
var PVLump, PVMonth, PV, IR, N, M, Inflation, Age, RAge, RIncome, RetireReturn, PreRetireReturn, Death, RetireLump, MSave, RR, RR1, PRR, PRR1, PRRM, PRRM1, YRetire, NMonth, PRRMonth, PRRMonth1, RetireLump, MSaveRLump, MSave;
var PV=form.PV.value;
var M=form.M.value;
var Inflation=form.Inflation.value;
var Age=form.Age.value;
var RAge=form.RAge.value;
var RIncome=form.RIncome.value;
var RetireReturn=form.RetireReturn.value;
var PreRetireReturn=form.PreRetireReturn.value;Death=form.Death.value;
RR=(RetireReturn/100);
Inflation=Inflation/100;
RR=((1+RR)/(1+Inflation))-1;RR1=1+RR;
PRR=(PreRetireReturn/100);
PRR=((1+PRR)/(1+Inflation))-1;
PRR1=1+PRR;PRRM=(1+(PRR/12));
PRRM=(Math.pow(PRRM, 12)-1);PRRM1=1 + PRRM;
N=RAge-Age;YRetire=Death-RAge;
NMonth=N*12;
PRRMonth=PRR/12;
PRRMonth1=1+PRRMonth;
RetireLump=(1-(1/(Math.pow(RR1, (YRetire-1)))));
RetireLump=RIncome*(1+(RetireLump/RR));
RetireLump=Math.round(RetireLump);
PVLump=(RetireLump/(Math.pow(PRR1, N)))-PV;
PVLump=Math.round(PVLump);
MSaveRLump=(RetireLump/(Math.pow(PRRM1, N)))-PV;
MSave=(1-(1/(Math.pow(PRRMonth1,NMonth))));
MSave=(1+(MSave/PRRMonth));
MSave=(MSaveRLump/MSave)-M;
MSave=Math.round(MSave);
form.RetireLump.value=RetireLump;
form.PVLump.value=PVLump;
form.MSave.value=MSave;
}
