
//this function use to display cat product using on chnage 
function check_numeric_value(getValue) {

	getValue = document.getElementById(getValue);
	if(numValue(getValue)== false) return false;

}

function check_present_value() {

	future_value = document.getElementById("future_value");
	if(blankValidation(future_value,"Future value cannot be blank.")== false) return false;

	years = document.getElementById("years");
	if(blankValidation(years,"Year value cannot be blank.")== false) return false;

	discount_rate = document.getElementById("discount_rate");
	if(blankValidation(discount_rate, "Discount Rate value cannot be blank.")== false) return false;

}

function doCalc()
{
	zeroBlanks(document.mainform);
	var p = numval(document.mainform.p.value);
	var c = numval(document.mainform.c.value);
	var r = numval(document.mainform.r.value)/100;
	var y = numval(document.mainform.y.value);
	var n = numval(document.mainform.n.value);

	if (document.mainform.addTiming[0].checked)
		document.mainform.fv.value = formatNumber(basicInvestment(p,r/n,y*n,c/n),2);
	else
		document.mainform.fv.value = formatNumber(bI2(p,r/n,y*n,c/n),2);
}


function bI2(p,r,y,c)
{
	if (c == null) c = 0;
	if (y == 0) return p;
	return futureValue(p,r,y) + c*geomSeries(1+r,0,y-1);
}

