function calcSec179()
{
  // Maximum Section 179 Deduction
  var max179 = 250000;
  var taxBracket = 0.35;

  var cost = parseInt(document.getElementById('cost').value);
  if(cost == NaN) cost = 0;
  var sec179 = (cost > max179) ? max179 : cost;
  var bonus = (cost - sec179) * 0.5;
  var regularFirstYear = bonus * 0.2;
  var totalFirstYear = sec179 + bonus + regularFirstYear;
  var cashSavings = totalFirstYear * taxBracket;
  var loweredCost = cost - cashSavings;

  document.getElementById('sec179').value = sec179.toFixed(2);
  document.getElementById('bonus').value = bonus.toFixed(2);
  document.getElementById('regularFirstYear').value = regularFirstYear.toFixed(2);
  document.getElementById('totalFirstYear').value = totalFirstYear.toFixed(2);
  document.getElementById('cashSavings').value = cashSavings.toFixed(2);
  document.getElementById('loweredCost').value = loweredCost.toFixed(2);

}
