function compute(obj) {
 	x=obj.Amount.value
	y=obj.Rate.value
	z = (obj.Term.value/12)

totalann = eval((x*(Math.pow(1 + ((y*.01)/1),z)))-x)
totalsemi = eval((x*(Math.pow(1 + ((y*.01)/2),(z*2))))-x)
totalqtr = eval((x*(Math.pow(1 + ((y*.01)/4),(z*4))))-x)
totalmth = eval((x*(Math.pow(1 + ((y*.01)/12),(z*12))))-x)

yieldann = eval((((x*(Math.pow(1 + ((y*.01)/1),1)))-x)/x)*100)
yieldsemi = eval((((x*(Math.pow(1 + ((y*.01)/2),(2))))-x)/x)*100)
yieldqtr = eval((((x*(Math.pow(1 + ((y*.01)/4),(4))))-x)/x)*100)
yieldmth = eval((((x*(Math.pow(1 + ((y*.01)/12),(12))))-x)/x)*100)

obj.TotalAnn.value = rounding(totalann)
obj.TotalSemi.value = rounding(totalsemi)
obj.TotalQtr.value = rounding(totalqtr)
obj.TotalMth.value = rounding(totalmth)

obj.YieldAnn.value = rounding(yieldann)
obj.YieldSemi.value = rounding(yieldsemi)
obj.YieldQtr.value = rounding(yieldqtr)
obj.YieldMth.value = rounding(yieldmth)

}


function rounding(n)
{
	pennies = n * 100 ;
	pennies = Math.round(pennies) ;
	strPennies = " " + pennies ;
	len = strPennies.length ;
	return strPennies.substring(0, len - 2) + "." + strPennies.substring((len - 2), len);
}
