<!--

function updatePrice()
{
  var quantity = Math.abs(document.quantity.prodCount.value);

  if (document.quantity.prodDelv.value == 0) /* USA Delivery */
  {
    if (quantity == 1) 
    { 
      prodPrice = toDollars(prod1_price + prod1_usa_delv);
      prodDesc = prod1_desc + ", USA Delivery";
      prodCode = prod1_code;
  
      /* Update text boxes showing costs */
      document.quantity.prodCost.value = " $ " + toDollars(prod1_price);
      document.quantity.postageCost.value = " $ " + toDollars(prod1_usa_delv);
    }
    else if (quantity == 2) 
    { 
      prodPrice = toDollars(prod2_price + prod2_usa_delv);
      prodDesc = prod2_desc + ", USA Delivery";
      prodCode = prod2_code;
  
      /* Update text boxes showing costs */
      document.quantity.prodCost.value = " $ " + toDollars(prod2_price);
      document.quantity.postageCost.value = " $ " + toDollars(prod2_usa_delv);
    }
    else // 3 + 1 Free 
    { 
      prodPrice = toDollars(prod3_price + prod3_usa_delv);
      prodDesc = prod3_desc + ", USA Delivery";
      prodCode = prod3_code;
  
      /* Update text boxes showing costs */
      document.quantity.prodCost.value = " $ " + toDollars(prod3_price);
      document.quantity.postageCost.value = " $ " + toDollars(prod3_usa_delv);
    }
  }
  else /* non-USA Delivery */
  {
    if (quantity == 1) 
    {
      prodPrice = toDollars(prod1_price + prod1_world_delv);
      prodDesc = prod1_desc;
      prodCode = prod1_code;
  
      /* Update text boxes showing costs */
      document.quantity.prodCost.value = " $ " + toDollars(prod1_price);
      document.quantity.postageCost.value = " $ " + toDollars(prod1_world_delv);
    }
    else if (quantity == 2) 
    { 
      prodPrice = toDollars(prod2_price + prod2_world_delv);
      prodDesc = prod2_desc; 
      prodCode = prod2_code;
  
      /* Update text boxes showing costs */
      document.quantity.prodCost.value = " $ " + toDollars(prod2_price);
      document.quantity.postageCost.value = " $ " + toDollars(prod2_world_delv);
    }
    else 
    { 
      prodPrice = toDollars(prod3_price + prod3_world_delv);
      prodDesc = prod3_desc; 
      prodCode = prod3_code;
  
      /* Update text boxes showing costs */
      document.quantity.prodCost.value = " $ " + toDollars(prod3_price);
      document.quantity.postageCost.value = " $ " + toDollars(prod3_world_delv);
    }
  }
  
  return true;
}

function toDollars(costInCents)
{
  var dollars = Math.floor(costInCents / 100);
  var cents = costInCents % 100;
  var dollarString = "";

  dollarString = dollars + ".";

  if (cents < 10)
  {
    dollarString = dollarString + "0" + cents;
  }
  else
  {
    dollarString = dollarString + cents;
  }

  return dollarString;
}

//-->
