function FractionalInterest(Interest, NumOfPeriods)
{
	return Math.pow(1+Interest,1/NumOfPeriods) - 1;
}

//StartOfPeriod = 1 means payment starts at beginning of period
//			otherwise at the end of the period
//PV = 1 means present value; otherwise future value
function FixedAnnuity(StartOfPeriod, Interest, NumOfPeriods, PV) 
{
	var v = 1 / (1+Interest);
	var Result = 0;

	if (v == 1) 
		Result = NumOfPeriods;
	else
	 	Result = (1 - Math.pow(v,NumOfPeriods)) / (1-v);

	if (StartOfPeriod == 0)
		Result = Result * v;

	if (PV ==0)
		Result = Result * Math.pow(1+Interest,NumOfPeriods)

	return Result;	
}

