<!--

function updatePrice()
{
  var postage = 0;
  var totalPence = 0;
  var units = Math.abs(document.quantity.prodCount.value);
  var delivery = "";

  if (document.quantity.prodDelv.value == 0) /* UK Delivery */
  {
    delivery = "<br>(Delivery, UK)";
    postage = uk_delv_price[units];
  }
  else /* non-UK Delivery */
  {
    delivery = "<br>(Delivery, EU)";
    postage = other_delv_price[units];
  }
  
  totalPence = (units * prod_unit_price) + postage;

  /* Set variables passed to shopping basket */  
  if (units == 1)
  {
    prodDesc = units + " " + prod_container;
  }
  else
  {
    prodDesc = units + " " + prod_containers;
  }
  prodDesc += prod_desc;
  prodDesc += delivery;
  prodCode = prod_code + units;
  prodPrice = "" + toPounds(totalPence);

  /* Update text boxes showing costs */
  document.quantity.prodCost.value = " £ " + toPounds(units * prod_unit_price);
  document.quantity.postageCost.value = " £ " + toPounds(postage);
  
  return true;
}

function toPounds(costInPence)
{
  var pounds = Math.floor(costInPence / 100);
  var pence = costInPence % 100;
  var poundString = "";

  poundString = pounds + ".";

  if (pence < 10)
  {
    poundString = poundString + "0" + pence;
  }
  else
  {
    poundString = poundString + pence;
  }

  return poundString;
}

//-->
