<!--
function calc_pmt_w_pv(theForm){
var msg = "Please enter valid numbers";



//alert("a = obj.value.match(/\S/)" + ;

var obj = theForm.fv_calc02;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
	}

obj = theForm.mip_calc02;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
	}
obj = theForm.ihp_calc02;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
	}
obj = theForm.r_calc02;
	if (isNaN(obj.value) == true || obj.value == ""){ //is not a number
	alert(msg);
	obj.focus();
	return false
}


obj = theForm.ihp_calc02;
var obj2 = theForm.mip_calc02;

if (parseFloat(obj.value) < parseFloat(obj2.value)) {
	alert("The investment plan is not feasible due to input error. Please check the value of your second and third input.");
	theForm.ihp_calc02.focus();
	return false
}

obj = theForm.iv_calc02;
obj2 = theForm.pmt_calc02;


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
}


var tempstr = "";
var str;
if (theForm.task2.value == "a") {
	str = theForm.maxPV.value;

	for (j=0;j<str.length;j++){
		if (str.charAt(j) != ",") tempstr += str.charAt(j)
	}
	if (parseFloat(obj.value) > parseFloat(tempstr)){
		alert("The investment 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.maxPMT.value;

	for (j=0;j<str.length;j++){
		if (str.charAt(j) != ",") tempstr += str.charAt(j)
	}
	

	if (parseFloat(obj2.value) > parseFloat(tempstr)){
		alert("The investment 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

//-->
