// JavaScript Document




function startCalc(){
  interval = setInterval("calc()",1);
}



function calc(){
    UnitPrice = 11.95;
	// Bulk Discount Price - Price Break #2
    // BulkPrice = 8.95;
    Price = UnitPrice;
    Total = 0;
    Quantity = (document.CalculateForm.Qty1.value * 1) + (document.CalculateForm.Qty2.value * 1);
	Postage = document.CalculateForm.Postage.value;
	// Calculation to see if Bulk Discount Applies
    //if (Quantity >= 10){
    //    Price = BulkPrice;
    //}
    Total = (Quantity * Price) + (Postage * 1);
    Total = Total.toFixed(2);
    document.CalculateForm.Total.value = Total;
}
 



function stopCalc(){
  clearInterval(interval);
}



function SetPayPalFields() {

	PriceOne = 11.95;
	// Bulk Discount Price -  Price Break 2
	// PriceTwo = 8.50;
	Price = PriceOne;	

    Quantity = (document.CalculateForm.Qty1.value * 1) + (document.CalculateForm.Qty2.value * 1);
	Postage = document.CalculateForm.Postage.value 
	// Calculation to see if Bulk Discount Applies
	//if (Quantity >= 10) {
	//	Price = PriceTwo;
	//}
	
	// Add the individual quantity fields into the item_name variable to pass through to PayPal
	// eliminating the need to use a shopping cart for items that are basically the same
	document.PayPalForm.item_name.value = "Moon Gardening Calendar - " + "[ " +  document.CalculateForm.Qty1.value + " x Design #1 " + " ----- " + document.CalculateForm.Qty2.value + " x Design #2 " + "]";
	document.PayPalForm.amount.value = Price;
	document.PayPalForm.quantity.value = Quantity; //document.CalculateForm.Qty.value;
	document.PayPalForm.shipping.value = document.CalculateForm.Postage.value;
}