function randomCFProblem(form) { 	var theCF1 = ((Math.round(Math.random()*5)) + 1)*100; 	var theCF2 = ((Math.round(Math.random()*5)) + 1)*100;  	var theCF3 = ((Math.round(Math.random()*5)) + 1)*100;  	var theCF4 = ((Math.round(Math.random()*5)) + 1)*100;   	var theNR = (Math.round((Math.random()*2000)+1)/100);  	form.Year1.value="" + theCF1; 	form.Year2.value="" + theCF2; 	form.Year3.value="" + theCF3; 	form.Year4.value="" + theCF4;  	form.NRInput.value="" + theNR;  	form.PVOutput.value=""; }  function findPVCF(form) { 	var theCF1 = form.Year1.value; 	if (!isPositiveNumber(theCF1)) { 		return false; 	} 	var theCF2 = form.Year2.value; 	if (!isPositiveNumber(theCF2)) { 		return false; 	} 	var theCF3 = form.Year3.value; 	if (!isPositiveNumber(theCF3)) { 		return false; 	} 	var theCF4 = form.Year4.value; 	if (!isPositiveNumber(theCF4)) { 		return false; 	} 	var theNR = form.NRInput.value; 	if (!isPositiveNumber(theNR)) { 		return false; 	} 	var thePV = theCF1/Math.pow((1 + theNR/100),1); 	thePV += theCF2/Math.pow((1 + theNR/100),2); 	thePV += theCF3/Math.pow((1 + theNR/100),3); 	thePV += theCF4/Math.pow((1 + theNR/100),4); 	form.PVOutput.value = "" + Math.round(thePV*100)/100; 	return true; }  function findFVCF(form) { 	var theCF1 = form.Year1.value; 	if (!isPositiveNumber(theCF1)) { 		return false; 	} 	var theCF2 = form.Year2.value; 	if (!isPositiveNumber(theCF2)) { 		return false; 	} 	var theCF3 = form.Year3.value; 	if (!isPositiveNumber(theCF3)) { 		return false; 	} 	var theCF4 = form.Year4.value; 	if (!isPositiveNumber(theCF4)) { 		return false; 	} 	var theNR = form.NRInput.value; 	if (!isPositiveNumber(theNR)) { 		return false; 	} 	var thePV = theCF1*(Math.pow((1 + theNR/100),3)); 	thePV += theCF2*(Math.pow((1 + theNR/100),2)); 	thePV += theCF3*(1 + theNR/100); 	thePV += theCF4*1.0; 	form.PVOutput.value = "" + Math.round(thePV*100)/100; 	return true; }  function isPositiveNumber(inputStr) { 	for (var i = 0; i < inputStr.length; i++) { 		var oneChar = inputStr.substring(i,i+1); 		if (((oneChar >= "0") && (oneChar <= "9")) || (oneChar == ".")) { 		 		} else { 			alert("Please make sure that only numbers are input."); 			return false; 		}  	}	return true; }
