
function BT_calcBookTot()  {
   /* Validate and Calculate Totals */
   if (document.form1.EcologicalModelQty.value != "" && 
        isNaN(document.form1.EcologicalModelQty.value) == true) {
	    	alert("Please enter a valid quantity");
		    document.form1.EcologicalModelQty.focus();
			document.form1.EcologicalModelQty.select();
			return;
		}
/*		
	if (document.form1.IdentChildGiftsQty.value != "" && 
        isNaN(document.form1.IdentChildGiftsQty.value) == true) {
	    	alert("Please enter a valid quantity");
		    document.form1.IdentChildGiftsQty.focus();
			document.form1.IdentChildGiftsQty.select();
			return;
		}
	if (document.form1.EnergyProjectsQty.value != "" && 
        isNaN(document.form1.EnergyProjectsQty.value) == true) {
	    	alert("Please enter a valid quantity");
		    document.form1.EnergyProjectsQty.focus();
			document.form1.EnergyProjectsQty.select();
			return;
		}
	if (document.form1.KiKQty.value != "" && 
        isNaN(document.form1.KiKQty.value) == true) {
	    	alert("Please enter a valid quantity");
		    document.form1.KiKQty.focus();
			document.form1.KiKQty.select();
			return;
		}
*/
		
   var amt1 = document.form1.EcologicalModelQty.value * 16.00;
       amt1 = Math.round(amt1 * 100) / 100;
/*	   
   var amt2 = document.form1.IdentChildGiftsQty.value * 10.95;
       amt2 = Math.round(amt2 * 100) / 100;  
   var amt3 = document.form1.EnergyProjectsQty.value * 15.00;
       amt3 = Math.round(amt3 * 100) / 100;
   var amt4 = document.form1.KiKQty.value * 7.95;
       amt4 = Math.round(amt4 * 100) / 100;
*/
	      
  /* Calculate SubTotal */
  document.form1.BookTot1.value = amt1;
/*
  document.form1.BookTot2.value = amt2; 
  document.form1.BookTot3.value = amt3;
  document.form1.BookTot4.value = amt4;
*/  
  var subtot = amt1 /*+ amt2 + amt3 + amt4 */ ;
      subtot = Math.round(subtot * 100) / 100;
  document.form1.Subtotal.value = subtot;
								  								  
  /* Calculate Sales Tax */  
  var CTtax = 0;
  if (document.form1.State.value == "Connecticut") {
     CTtax = Math.round(subtot * .06 * 100) / 100; }
  document.form1.CTtax.value = CTtax;
	 
  /* Calculate Shipping Cost */
  var shipcost = 0;
  if ((subtot >= .01) && (subtot <= 16.00)) {shipcost = 2.25;}
  if ((subtot >= 16.01) && (subtot <= 80.00)) {shipcost = 4.75;}
  if ((subtot >= 80.01) && (subtot <= 160.00)) {shipcost = 7.50;}
  if ((subtot >= 160.01) && (subtot <= 320.00)) {shipcost = 11.00;}
  if ((subtot >= 320.01) ) {shipcost = 15.00;}
  document.form1.Shipping.value = shipcost;
	 
   /* Calculate Grand Total */
   var grandtotal = Math.round((subtot + CTtax + shipcost) * 100) / 100;
   document.form1.GrandTotal.value = grandtotal ; 

   /* Extend decimal places to 2 */
   var P
   var Q
   var N
   Q = document.form1.BookTot1.value
   N = 2
   Q = String(Q) ; 
    while ((P=Q.indexOf('.'))<0) Q+='.'
    while (Q.length <= P+N) Q+='0'
   document.form1.BookTot1.value = Q

/*   
   Q = document.form1.BookTot2.value
   N = 2
   Q = String(Q) ; 
    while ((P=Q.indexOf('.'))<0) Q+='.'
    while (Q.length <= P+N) Q+='0'
   document.form1.BookTot2.value = Q
   
   Q = document.form1.BookTot3.value
   N = 2
   Q = String(Q) ; 
    while ((P=Q.indexOf('.'))<0) Q+='.'
    while (Q.length <= P+N) Q+='0'
   document.form1.BookTot3.value = Q
   
   Q = document.form1.BookTot4.value
   N = 2
   Q = String(Q) ; 
    while ((P=Q.indexOf('.'))<0) Q+='.'
    while (Q.length <= P+N) Q+='0'
   document.form1.BookTot4.value = Q
*/
  							  
   Q = document.form1.Subtotal.value
   N = 2
   Q = String(Q) ; 
    while ((P=Q.indexOf('.'))<0) Q+='.'
    while (Q.length <= P+N) Q+='0'
   document.form1.Subtotal.value = Q
  							  
	Q = document.form1.CTtax.value
   N = 2
   Q = String(Q) ; 
    while ((P=Q.indexOf('.'))<0) Q+='.'
    while (Q.length <= P+N) Q+='0'
   document.form1.CTtax.value = Q
  
   Q = document.form1.Shipping.value
   N = 2
   Q = String(Q) ; 
    while ((P=Q.indexOf('.'))<0) Q+='.'
    while (Q.length <= P+N) Q+='0'
   document.form1.Shipping.value = Q
  							  
   Q = document.form1.GrandTotal.value
   N = 2
   Q = String(Q) ; 
    while ((P=Q.indexOf('.'))<0) Q+='.'
    while (Q.length <= P+N) Q+='0'
   document.form1.GrandTotal.value = Q
  							  					}		  						
