<!--
function calc_rp_pmt_w_fv(theForm){
var msg = "Please enter valid numbers";

var obj = theForm.currentage_calc05;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
	}

obj = theForm.mip_calc05;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
	}

obj = theForm.r_calc05;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
	}

obj = theForm.tw_calc05;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
	}

obj = theForm.mwsaa_calc05;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
	}
obj = theForm.mwp_calc05;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
	}
	
obj = theForm.req_fv_calc05;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
	}
	
	
obj = theForm.pv_calc05;
var obj2 = theForm.pmt_calc05;


if ((theForm.task2.value == "a") && ((obj.value == "") || isNaN(obj.value))){
		alert(msg);
		obj.focus();
		return false
}


if ((theForm.task2.value == "b") && ((obj2.value == "") || isNaN(obj2.value))){
		alert(msg);
		obj2.focus();
		return false
}



if (parseFloat(theForm.mwsaa_calc05.value) < (parseFloat(theForm.currentage_calc05.value) + parseFloat(theForm.mip_calc05.value))) {
alert("The retirement plan is not feasible due to input error. Please check the value of your first, second and fifth input.");
theForm.currentage_calc05.focus();
return false
}


//<input type=hidden name=maxPV05 value="22,358.79">
//<input type=hidden name=maxPMT05 value="215.77">

var tempstr = "";
var str;
if (theForm.task2.value == "a") {
	str = theForm.maxPV05.value;

	for (j=0;j<str.length;j++){
		if (str.charAt(j) != ",") tempstr += str.charAt(j)
	}
	if (parseFloat(obj.value) > parseFloat(tempstr)){
		alert("The retirement plan is not feasible due to input error. Hint: Your input value should not be greater than the maximum value shown above.");
		obj.focus();
		return false
	}
}

tempstr = "";
if (theForm.task2.value == "b") {
	str = theForm.maxPMT05.value;

	for (j=0;j<str.length;j++){
		if (str.charAt(j) != ",") tempstr += str.charAt(j)
	}
	
	if (parseFloat(obj2.value) > parseFloat(tempstr)){
		alert("The retirement plan is not feasible due to input error. Hint: Your input value should not be greater than the maximum value shown above.");
		obj2.focus();
		return false
	}
}


return true;


} // end function

//-->

