// JavaScript Document

function startPieCalc(){
  interval = setInterval("pieCalc()",1);
}
function pieCalc(){
  one = document.order.apple.value;
  two = document.order.pecan.value; 
  three = document.order.pumpkin.value;
  four = document.order.sweetpotato.value;
  five = document.order.clientdonation.value;
  
  document.order.quantity.value = (one * 1) + (two * 1) + (three * 1) + (four * 1) + (five * 1);
  document.order.subtotal.value = ((one * 1) + (two * 1) + (three * 1) + (four * 1) + (five * 1)) * 25;
  
  six = document.order.handling.value;
  
  document.order.total.value = (((one * 1) + (two * 1) + (three * 1) + (four * 1) + (five * 1)) * 25) + (six * 1);
  
  var seven = "LLAA Project Pie (";
  
  if (one > 0){
  seven = seven + one +" Apple, ";
  }
  
  if (two > 0){
  seven = seven + two +" Pecan, ";
  }
  
  if (three > 0){
  seven = seven + three +" Pumpkin, ";
  }
  
  if (four > 0){
  seven = seven + four +" Sweet Potato, ";
  }
  
  if (five > 0){
  seven = seven + five +" Donation, ";
  }
  
  document.order.item_name.value = seven.slice(0, -2) + ")";
   
}
function stopPieCalc(){
  clearInterval(interval);
}