// JavaScript Document
<!-- Begin
function checkChoice(whichbox) {
with (whichbox.form) 
{
{<!-- calculate the product count, cost and subtotal -->
var prod = requiredQuantity.value;
if (prod > 0) {var prodval = eval(one.value);}
if (prod > 9) {var prodval = eval(ten.value);}
if (prod > 19) {var prodval = eval(twenty.value);}
if (prod > 29) {var prodval = eval(thirty.value);}

var prodtot = eval(prod) * eval(prodval);

hiddenprice.value = eval(prodval);
hiddensubtotal.value = eval(prodtot);

document.myform.price.value = (formatCurrency(hiddenprice.value));
document.myform.subtotal.value = (formatCurrency(hiddensubtotal.value));}

<!--CALCULATE TAX -->
{
if(SalesTax.checked) {
taxtotal.value = eval(hiddensubtotal.value) * eval(taxRate.value);
document.myform.Tax.value = formatCurrency(taxtotal.value);
	}
else {
taxtotal.value = 0;
document.myform.Tax.value = "";}
}

<!--CALCULATE SHIPPING -->
{
if(Express.checked) {
shiptotal.value = (eval(prod) * eval(PerBook.value)) + eval(ExpressPrice.value);
document.myform.Ship.value = formatCurrency(shiptotal.value);}
else if(prod > 50) {
shiptotal.value = 0;
document.myform.Ship.value = "";}
else {
shiptotal.value = (eval(prod) * eval(PerBook.value)) + eval(RegularPrice.value);
document.myform.Ship.value = formatCurrency(shiptotal.value);}}


<!--CALCULATE TOTAL -->
hiddentotal.value = eval(hiddensubtotal.value) + eval(taxtotal.value) + eval(shiptotal.value);
return (formatCurrency(hiddentotal.value));}}

//  END PRICING

function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (tempobj.name.substring(0,8)=="required") {
if (((tempobj.type=="text"||tempobj.type=="textarea")&&
tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
tempobj.selectedIndex==0)) {
pass=false;
break;
         }
      }
   }
}
if (!pass) {
shortFieldName=tempobj.name.substring(8,30).toUpperCase();
alert("Please make sure the "+shortFieldName+" field was properly completed.");
return false;
}
else

javascript:window.print()

return true;
}

function printscreen(which) {
javascript:window.print();}


function formatCurrency(num) {
<!-- Function courtesy of:  Cyanide_7 (leo7278@hotmail.com) -->
<!-- Web Site:  http://www7.ewebcity.com/cyanide7 -->
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num)) num = "0";
cents = Math.floor((num*100+0.5)%100);
num = Math.floor((num*100+0.5)/100).toString();
if(cents < 10) cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));
return ("$" + num + "." + cents);
}
//  End -->