
function getNum(theField) {

  val = theField.value;

  return (!val || isNaN(val)) ?0:parseInt(val,10); 

}

function addFields(theForm) {

  total = 0;

  total += getNum(theForm.cardDebt); // we could loop here too

  total += getNum(theForm.paydayDebt);

  total += getNum(theForm.medicalDebt);

  total += getNum(theForm.legalDebt);

  if (total ==0) {

    alert('Debt amount too small')

    return false

  }

  url = (total < 10000) ? "http://www.financialaffiliatemarketing.com/click2.php?id=98&bid=3152":"http://www.financialaffiliatemarketing.com/click2.php?id=98&bid=2290"

  window.location=url

  return false

}
