/* Arrays to hold shoppping cart entries */

var QuantA = new Array();
var DescA = new Array();
var PriceCodeA = new Array();

var BookCount  = 0;
var Taxes      = 0.0;
var Discount   = 0.0;
var S_and_H    = 0.0;

function ClearCart()
{
    BookCount  = 0;
    Taxes      = 0.0;
    S_and_H    = 0.0;
    while (QuantA.length > 0)
        QuantA.pop();
    while (PriceCodeA.length > 0)
        PriceCodeA.pop();
    while (DescA.length > 0)
        DescA.pop();
}

function TrimCents(cost)
{
// all dollar amounts passed to Paypal must have only 2 decimal positions.
var trimedval = new String();
var pos;

trimedval = cost.toString(10);
pos = trimedval.indexOf('.');
switch (pos)
{
    case -1:
        trimedval += '.00';
        break;
    default :
        if (trimedval.length >= pos+3 )
            trimedval = trimedval.slice(0, pos+3);
        else
            trimedval += '0';
        break;
}
return trimedval;
}
