function CalculateTotal_onclick(theForm)
{
//	alert("In CalculateTotal_onclick\nOTP_qty.value: " + theForm.OTP_qty.value);
  //alert("theForm.OTP_qty.value * 10 is: " + theForm.OTP_qty.value * 10);
  
  var pCost = 0.00;
  var pSH = 0.00;
  var pUnitPrice = 0.00;

  
//  if (theForm.OTP_qty.value == 1)
//  {
//	 pCost = 12.95 * theForm.OTP_qty.value;
//	 pSH = 2.75 + (theForm.OTP_qty.value * 0.90);
//	 pUnitPrice = 12.95;
//  }
//  else if (theForm.OTP_qty.value == 2)
//  {
//	 pCost = 12.95 * theForm.OTP_qty.value;
//	 pSH = 2.75 + (theForm.OTP_qty.value * 0.90);
//	 pUnitPrice = 12.95;
//  }
//  else if(theForm.OTP_qty.value >= 3)
//  {
	 pCost = 10.95 * theForm.OTP_qty.value;
	 pUnitPrice = 10.95;
//	 if (theForm.OTP_qty.value < 12)
//	 {
		pSH = 2.90 + (theForm.OTP_qty.value * 1.00);
//	 }
//  }

//	alert("theForm.OTP_shipTo_state.value is: " + theForm.OTP_shipTo_state.value);

	//document.getElementById('lblUnitPrice').innerText = pUnitPrice;
	//document.getElementById('lblsh').innerText = DecimalFormat(pSH,2);
	//document.getElementById('lblBookTotal').innerText = DecimalFormat(pCost,2);
	//document.getElementById('lblTotal').innerText = DecimalFormat(pCost + pSH,2);
	
	theForm.OTP_UnitPrice.value = pUnitPrice;
	theForm.OTP_sh.value = DecimalFormat(pSH,2);
	theForm.OTP_BookTotal.value = DecimalFormat(pCost,2);
	theForm.OTP_Total.value = DecimalFormat(pCost + pSH,2);

	return true;
}

function BuyNow_onclick(theForm)
{
//	alert("In BuyNow_onclick");

	CalculateTotal_onclick(theForm);
	
	theForm.quantity.value = theForm.OTP_qty.value;
	theForm.shipping.value = theForm.OTP_sh.value;
	theForm.amount.value = theForm.OTP_UnitPrice.value;
	//theForm.amount.value = document.getElementById('lblUnitPrice').innerText;

	theForm.submit();
	
//	alert("theForm.shipTo_firstName.value is: " + theForm.shipTo_firstName.value + "\ntheForm.shipTo_lastName.value is: " + theForm.shipTo_lastName.value);
}
