var t = 0; // term
var i = 0; // Interest
var i2 = 0; // Interest
var ir = 0; // Interestrate
var a = 0; // Value
var r1 = 0; // Result1
var r2 = 0; // Result2
var r3 = 0; // Result3
var r4 = 0; // Result4
var r6 = 0; // Result5
var d = 0; //decimal place
var s = "0"; //string
var d1 = 0; //decimal place
var s1 = "0"; //string
var d2 = 0; //decimal place
var s2 = "0"; //string

function calculateValue() 
{
	if(document.TheForm.interest.value=="" || document.TheForm.term.value=="" ||
 document.TheForm.amount.value=="")
	{
		alert("Please fill in all of the required fields.")
	}

	else 
	{
		t = document.TheForm.term.value;
		i = Math.pow((1 +(document.TheForm.interest.value/100)),document.TheForm.
term.value);
		i2 = Math.pow((1 +(document.TheForm.interest.value/12/100)),document.
TheForm.term.value*12);
		ir = document.TheForm.interest.value/100;
		a = document.TheForm.amount.value;
		r1 = i-1;
		r3 = i2-1;
		r2 = i/r1 * ir * a/12;
		r4 = i2/r3 * ir * a/12;
		r5 = a * ir/12;
		d = String(r2).indexOf(".");
		s = String(r2).substring(0,(d+5));
		d1 = String(r4).indexOf(".");
		s1 = String(r4).substring(0,(d+5));
		d2 = String(r5).indexOf(".");
		s2 = String(r5).substring(0,(d+5));
		document.TheForm.monthly.value = Math.round(s1*100)/100;
		document.TheForm.ionly.value = Math.round(s2*100)/100
	}
}

function MM_callJS(jsStr) 
{
	//v2.0
	return eval(jsStr)
}


function describe (text){
window.status = text;
return true;
}
function clearstatus (){
window.status = "";
}

