price1=25.00;
price2=19.95;
price3=17.45;
price4=13.95;
ship=2.97; //per book
handle=1.40;

var calc = document.getElementById('buy');

function calculate(){
   if(document.order.quantity.value > 3 && document.order.quantity.value < 21){
      document.order.amount.value = 19.95;
   }
   if(document.order.quantity.value > 20 && document.order.quantity.value < 101){
      document.order.amount.value = 17.45;
   }
   if(document.order.quantity.value > 100){
      document.order.amount.value = 13.95;
   }
   var shipping = document.order.quantity.value * ship;
   var sandh = shipping + handle;
   var sandh = roundNumber(sandh,2)
   document.order.shipping.value = sandh;
}


function roundNumber(num, dec) {
	var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
	return result;
}
