
function compute_amount(form)
{
	//Format inputs;
	if(document.calcform.term.value==""){document.calcform.term.value="0";}
	if(document.calcform.amount.value==""){document.calcform.amount.value="0";}
	if(document.calcform.rate.value==""){document.calcform.rate.value="0";}
	//Rate
	var in_rate=(eval(document.calcform.rate.value));
	var proceed=1;
	if(in_rate==0){proceed=0;alert("Please enter an interest rate.");}
	if(proceed==1){
		var in_amount=eval(document.calcform.amount.value);
		var in_term=eval(document.calcform.term.value);
		in_term = in_term*12;//convert to months
		///////////////////
		var out_repayment = getLoanRepayment(in_rate,in_term,in_amount);
		document.calcform.repayment.value = "€"+addCommas(format(out_repayment,2));
	}//end proceed
}