function calculate()
{
	var TotVal=0;
	var currVal; 
	
	for (i = 0 ; i <= 11 ; i++) {
		currVal = document.monthly.elements[i].value;
		if(currVal == "") {
			currVal = 0;
		}
		if(isNaN(currVal)) {
			alert("Please be certain to only enter numeric values.");
			document.monthly.elements[i].focus();
			break;
		}
		else {
			TotVal = TotVal + parseInt(currVal);
			document.monthly.TotalDebt.value = TotVal
		}
	}
}
function checkvalue(j)
{
	if (document.monthly.elements[j].value > 1000000)
	{
		document.monthly.elements[j].value > 1000000;
	}
	
	calculate();
}


function dtir()
{
	var TotRatio=0
	
	for (i = 0 ; i <= 9 ; i++)
	{	
		SubTot1 = document.ratio.income.value / document.ratio.debt.value;
	}
	{
		SubTot2 = 1 / SubTot1
	}
	{
		TotRatio = SubTot2 * 100
	}
	
	
	document.ratio.dti.value = TotRatio
}
function checkvalue(j)
{
	if (document.ratio.elements[j].value > 2)
	{
		document.ratio.elements[j].value = 0;
	}
	
	dtir();
}
