function screen(input) {
  if (input == "") input = "0";
  var a = input.split("");
  var b = "";
  for (var i in a)
    if ((a[i].match(/\d/)) || (a[i] == "."))
    b += a[i];
  while (b.length>1 && b.charAt(0) == "0") b=b.substr(1,b.length);
  return b;
}

function checkInputs()
{
	
	   document.forms["inputform"].loan_amount.value = screen(document.forms["inputform"].loan_amount_unchecked.value);
	   document.forms["inputform"].loan_rate.value = screen(document.forms["inputform"].loan_rate_unchecked.value);
	   document.forms["inputform"].number_payments.value = screen(document.forms["inputform"].number_payments_unchecked.value);
    if (screen(document.forms["inputform"].loan_amount.value)<=0)
      { 
	   alert("Problem with Loan Amount: All Inputs must be larger than zero.");
	   return false;
      }
   else if (screen(document.forms["inputform"].loan_rate.value)<=0)
   {
	   alert("Problem with Loan Rate:  All Inputs must be larger than zero.");
	   return false;
   }
   else if (screen(document.forms["inputform"].number_payments.value)<=0)
   {
	   
	   alert("Problem with Number of Payments:  All Inputs must be larger than zero.");
	   return false;
   }
 
   else {
	   return true;
      }
}



