function onblur_calc()
{
  var item_totals;

  var os1 = parseInt(document.order_sheet.os1.value);
  if(isNaN(os1) === true)
  {
    os1 = 0;
  }
  var os3 = parseInt(document.order_sheet.os3.value);
  if(isNaN(os3) === true)
  {
    os3 = 0;
  }
  var os5 = parseInt(document.order_sheet.os5.value);
  if(isNaN(os5) === true)
  {
    os5 = 0;
  }
  var os7 = parseInt(document.order_sheet.os7.value);
  if(isNaN(os7) === true)
  {
    os7 = 0;
  }
  var os9 = parseInt(document.order_sheet.os9.value);
  if(isNaN(os9) === true)
  {
    os9 = 0;
  }



  var os0 = parseInt(document.order_sheet.os0.value);
  if(isNaN(os0) === true)
  {
    os0 = 0;
  }
  var os2 = parseInt(document.order_sheet.os2.value);
  if(isNaN(os2) === true)
  {
    os2 = 0;
  }
  var os4 = parseInt(document.order_sheet.os4.value);
  if(isNaN(os4) === true)
  {
    os4 = 0;
  }
  var os6 = parseInt(document.order_sheet.os6.value);
  if(isNaN(os6) === true)
  {
    os6 = 0;
  }
  var os8 = parseInt(document.order_sheet.os8.value);
  if(isNaN(os8) === true)
  {
    os8 = 0;
  }
  
 
  var qty_total = os1 + os3 + os5 + os7 + os9 ;
 

//Full Set 
  //If you change any of the prices or quantities, this starts the section you need to make changes to
  if((os1 == 0) || (os1 == "") || (isNaN(os1) === true))
  {
    price_per_widget_os1 = 0;
    }
 
 if((os1 >= 1) && (os1 <= 50))
  {
    price_per_widget_os1 = 897.15;
  }
  if((os1 >= 51) && (os1 <= 100))
  {
    price_per_widget_os1 = 961.23;
  }
  if((os1 >= 101) && (os1 <= 150))
  {
    price_per_widget_os1 = 1025.31;
  }
  if((os1 >= 151) && (os1 <= 200))
  {
    price_per_widget_os1 = 1089.39;
  }
  if((os1 >= 201) && (os1 <= 250))
  {
    price_per_widget_os1 = 1153.48;
  }
  if((os1 >= 251) && (os1 <= 300))
  {
    price_per_widget_os1 = 1217.56;
  }
  if((os1 >= 301) && (os1 <= 350))
  {
    price_per_widget_os1 = 1281.64;
  }
  if((os1 >= 351) && (os1 <= 400))
  {
    price_per_widget_os1 = 1345.72;
  }
  if((os1 >= 401) && (os1 <= 450))
  {
    price_per_widget_os1 = 1409.8;
  }


//Invitation card
//If you change any of the prices or quantities, this starts the section you need to make changes to
  if((os3 == 0) || (os3 == "") || (isNaN(os3) === true))
  {
    price_per_widget_os3 = 0;
    }
   if((os3 >= 1) && (os3 <= 50))
  {
    price_per_widget_os3 = 672.7;
  }
  if((os3 >= 51) && (os3 <= 100))
  {
    price_per_widget_os3 = 736.76;
  }
  if((os3 >= 101) && (os3 <= 150))
  {
    price_per_widget_os3 = 800.83;
  }
  if((os3 >= 151) && (os3 <= 200))
  {
    price_per_widget_os3 = 864.9;
  }
  if((os3 >= 201) && (os3 <= 250))
  {
    price_per_widget_os3 = 928.96;
  }
  if((os3 >= 251) && (os3 <= 300))
  {
    price_per_widget_os3 = 993.03;
  }
  if((os3 >= 301) && (os3 <= 350))
  {
    price_per_widget_os3 = 1057.1;
  }
  if((os3 >= 351) && (os3 <= 400))
  {
    price_per_widget_os3 = 1121.16;
  }
  if((os3 >= 401) && (os3 <= 450))
  {
    price_per_widget_os3 = 1185.23;
  }

//Response Card
//If you change any of the prices or quantities, this starts the section you need to make changes to
  if((os5 == 0) || (os5 == "") || (isNaN(os5) === true))
  {
    price_per_widget_os5 = 0;
    }
   if((os5 >= 1) && (os5 <= 50))
  {
    price_per_widget_os5 = 384.49;
  }
  if((os5 >= 51) && (os5 <= 100))
  {
    price_per_widget_os5 = 394.1;
  }
  if((os5 >= 101) && (os5 <= 150))
  {
    price_per_widget_os5 = 403.72;
  }
  if((os5 >= 151) && (os5 <= 200))
  {
    price_per_widget_os5 = 413.33;
  }
  if((os5 >= 201) && (os5 <= 250))
  {
    price_per_widget_os5 = 422.94;
  }
  if((os5 >= 251) && (os5 <= 300))
  {
    price_per_widget_os5 = 432.55;
  }
  if((os5 >= 301) && (os5 <= 350))
  {
    price_per_widget_os5 = 442.17;
  }
  if((os5 >= 351) && (os5 <= 400))
  {
    price_per_widget_os5 = 451.78;
  }
  if((os5 >= 401) && (os5 <= 450))
  {
    price_per_widget_os5 = 461.39;
  }


//Thank You Note
//If you change any of the prices or quantities, this starts the section you need to make changes to
  if((os7 == 0) || (os7 == "") || (isNaN(os7) === true))
  {
    price_per_widget_os7 = 0;
    }
   if((os7 >= 1) && (os7 <= 50))
  {
    price_per_widget_os7 = 384.49;
  }
  if((os7 >= 51) && (os7 <= 100))
  {
    price_per_widget_os7 = 394.1;
  }
  if((os7 >= 101) && (os7 <= 150))
  {
    price_per_widget_os7 = 403.72;
  }
  if((os7 >= 151) && (os7 <= 200))
  {
    price_per_widget_os7 = 413.33;
  }
  if((os7 >= 201) && (os7 <= 250))
  {
    price_per_widget_os7 = 422.94;
  }
  if((os7 >= 251) && (os7 <= 300))
  {
    price_per_widget_os7 = 432.55;
  }
  if((os7 >= 301) && (os7 <= 350))
  {
    price_per_widget_os7 = 442.17;
  }
  if((os7 >= 351) && (os7 <= 400))
  {
    price_per_widget_os7 = 451.78;
  }
  if((os7 >= 401) && (os7 <= 450))
  {
    price_per_widget_os7 = 461.39;
  }


//Seating Card
//If you change any of the prices or quantities, this starts the section you need to make changes to
  if((os9 == 0) || (os9 == "") || (isNaN(os9) === true))
  {
    price_per_widget_os9 = 0;
    }
   if((os9 >= 1) && (os9 <= 50))
  {
    price_per_widget_os9 = 257.61;
  }
  if((os9 >= 51) && (os9 <= 100))
  {
    price_per_widget_os9 = 261.45;
  }
  if((os9 >= 101) && (os9 <= 150))
  {
    price_per_widget_os9 = 256.3;
  }
  if((os9 >= 151) && (os9 <= 200))
  {
    price_per_widget_os9 = 269.14;
  }
  if((os9 >= 201) && (os9 <= 250))
  {
    price_per_widget_os9 = 272.99;
  }
  if((os9 >= 251) && (os9 <= 300))
  {
    price_per_widget_os9 = 276.83;
  }
  if((os9 >= 301) && (os9 <= 350))
  {
    price_per_widget_os9 = 280.68;
  }
  if((os9 >= 351) && (os9 <= 400))
  {
    price_per_widget_os9 = 284.52;
  }
  if((os9 >= 401) && (os9 <= 450))
  {
    price_per_widget_os9 = 288.37;
  }



//If you change any of the prices or quantities, this starts the section you need to make changes to
  if((qty_total == 0) || (qty_total == "") || (isNaN(qty_total) === true))
  {
    price_per_widget = 0;
    }
  if((qty_total == 1) && (qty_total == 1))
  {
    price_per_widget = 6.00;
  }
  if((qty_total >= 2) && (qty_total <= 3))
  {
    price_per_widget = 3.00;
  }
 if((qty_total >= 4) && (qty_total <= 7))
  {
    price_per_widget = 2.75;
  }
  if((qty_total >= 8) && (qty_total <= 16))
  {
    price_per_widget = 2.50;
  }
  if((qty_total >= 17) && (qty_total <= 30))
  {
    price_per_widget = 1.90;
  }
  if((qty_total >= 31) && (qty_total <= 47))
  {
    price_per_widget = 1.50;
  }
  if(qty_total >= 48)
  {
    price_per_widget = 1.25;
  }


  //do not edit below this line!
  
document.order_sheet.price_per_widget_os1.value = price_per_widget_os1.toFixed(2);
 document.order_sheet.price_per_widget_os3.value = price_per_widget_os3.toFixed(2);
 document.order_sheet.price_per_widget_os5.value = price_per_widget_os5.toFixed(2);
 document.order_sheet.price_per_widget_os7.value = price_per_widget_os7.toFixed(2);
 document.order_sheet.price_per_widget_os9.value = price_per_widget_os9.toFixed(2);

  var blk_price = price_per_widget_os1;
  var blu_price = price_per_widget_os3;
  var grn_price = price_per_widget_os5;
  var gld_price = price_per_widget_os7;
  var htpnk_price = price_per_widget_os9;
  
  var total_price = blk_price + blu_price +  grn_price + gld_price + htpnk_price;

  document.order_sheet.total_qty.value = qty_total;
  document.order_sheet.price_per_widget.value = price_per_widget.toFixed(2);
  document.order_sheet.total_price.value = total_price.toFixed(2);


  document.order_sheet.blk_price.value = blk_price.toFixed(2);
  document.order_sheet.blu_price.value = blu_price.toFixed(2);
  document.order_sheet.grn_price.value = grn_price.toFixed(2);
  document.order_sheet.gld_price.value = gld_price.toFixed(2);
  document.order_sheet.htpnk_price.value = htpnk_price.toFixed(2);
  
  
//  document.paypal.amount.value = price_per_widget.toFixed(2);!
//  document.paypal.quantity.value = qty_total;!

document.paypal.amount.value = total_price;

}

function buildlist()
{
  if(document.order_sheet.os1.value > 0)
  {
    if(document.paypal.item_name.value !== "Widgets: ")
    {
      document.paypal.item_name.value += ", ";
    }
    document.paypal.item_name.value += " Full Set:" + document.order_sheet.os1.value + " Color:" + document.order_sheet.os0.value;
  }
  if(document.order_sheet.os3.value > 0)
  {
    if(document.paypal.item_name.value !== "Widgets: ")
    {
      document.paypal.item_name.value += ", ";
    }
    document.paypal.item_name.value += " Invitation Card:" + document.order_sheet.os3.value + " Color:" + document.order_sheet.os2.value;
  }
  if(document.order_sheet.os5.value > 0)
  {
    if(document.paypal.item_name.value !== "Widgets: ")
    {
      document.paypal.item_name.value += ", ";
    }
    document.paypal.item_name.value += " Response Card:" + document.order_sheet.os5.value + " Color:" + document.order_sheet.os4.value;
  }
  if(document.order_sheet.os7.value > 0)
  {
    if(document.paypal.item_name.value !== "Widgets: ")
    {
      document.paypal.item_name.value += ", ";
    }
    document.paypal.item_name.value += " Thanks You Note:" + document.order_sheet.os7.value + " Color:" + document.order_sheet.os6.value;
  }
  if(document.order_sheet.os9.value > 0)
  {
    if(document.paypal.item_name.value !== "Widgets: ")
    {
      document.paypal.item_name.value += ", ";
    }
    document.paypal.item_name.value += " Seating Card:" + document.order_sheet.os9.value + " Color:"  + document.order_sheet.os8.value;
  }
 }