function calctotdue(form)
{
 var totdue = 0;
 var shipping = 0;
 var subtot = 0;
 var peach = 0;
 var valea = 0;
 var shipea = 0;
 var qty = parseInt(form.qty.value, 10);

 if (isNaN(qty) || qty < 1)
    { alert("You must enter a number in the Books box.");
    return;
    }
 if (qty < 5)
    {
        valea = form.ea1val.value;
        shipea = form.shp1val.value;
        peach = parseFloat(valea.substring(1), 10); shipping = parseFloat(shipea.substring(1), 10); }
 else
    {
    if (qty < 16)
        {
            valea = form.ea2val.value;
            shipea = form.shp2val.value;
            peach = parseFloat(valea.substring(1), 10); shipping = parseFloat(shipea.substring(1), 10); }
    else
        {
            valea = form.ea3val.value;
            shipea = form.shp3val.value;
            peach = parseFloat(valea.substring(1), 10); shipping = parseFloat(shipea.substring(1), 10); }
    }
 
 form.each.value = peach.toFixed(2);
 subtot = qty * peach;
 form.subtot.value = subtot.toFixed(2);
 totdue = (subtot + shipping);
 form.ship.value = shipping.toFixed(2);
 form.totsale.value = totdue.toFixed(2);

}
function setRonly()
{
document.mailform.ea1val.readOnly = true;
document.mailform.ea2val.readOnly = true;
document.mailform.ea3val.readOnly = true;
document.mailform.shp1val.readOnly = true;
document.mailform.shp2val.readOnly = true;
document.mailform.shp3val.readOnly = true;
document.mailform.subtot.readOnly = true;
document.mailform.ship.readOnly = true;
document.mailform.totsale.readOnly = true;
}

