<!--
function processGiftCertificateTotal() { 
	var docForm = document.giftcert;
	var isOK = false;
	
	if (isNumeric(docForm.ct15) && isNumeric(docForm.ct30) && isNumeric(docForm.gc20) && isNumeric(docForm.gc50) && isNumeric(docForm.gc100) && isNumeric(docForm.ps1) && isNumeric(docForm.ps2) && isNumeric(docForm.ps3) && isNumeric(docForm.ops1) && isNumeric(docForm.ops2) && isNumeric(docForm.ops3)) {

		var sum1 = (docForm.gc20.value-0) * 20;
		var sum2 = (docForm.gc50.value-0) * 50;
		var sum3 = (docForm.gc100.value-0) * 100;
		var sum4 = (docForm.ps1.value-0) * 131.99;
		var sum5 = (docForm.ps2.value-0) * 158.99;
		var sum6 = (docForm.ps3.value-0) * 170.99;
		var sum7 = (docForm.ops1.value-0) * 98.69;
		var sum8 = (docForm.ops2.value-0) * 125.69;
		var sum9 = (docForm.ops3.value-0) * 137.69;
		var sum10 = (docForm.ct15.value-0) * 15;
		var sum11 = (docForm.ct30.value-0) * 30;
		
		var total1 = (docForm.ct15.value-0) + (docForm.ct30.value-0) + (docForm.gc20.value-0) + (docForm.gc50.value-0) + (docForm.gc100.value-0) + (docForm.ps1.value-0) + (docForm.ps2.value-0) + (docForm.ps3.value-0) + (docForm.ops1.value-0) + (docForm.ops2.value-0) + (docForm.ops3.value-0);
		var total2 = sum1 + sum2 + sum3 + sum4 + sum5 + sum6 + sum7 + sum8 + sum9 + sum10 + sum11;
		
		docForm.gc20amount.value = Math.round(sum1*100)/100;
		docForm.gc50amount.value = Math.round(sum2*100)/100;
		docForm.gc100amount.value = Math.round(sum3*100)/100;
		docForm.ps1amount.value = Math.round(sum4*100)/100;
		docForm.ps2amount.value = Math.round(sum5*100)/100;
		docForm.ps3amount.value = Math.round(sum6*100)/100;
		docForm.ops1amount.value = Math.round(sum7*100)/100;
		docForm.ops2amount.value = Math.round(sum8*100)/100;
		docForm.ops3amount.value = Math.round(sum9*100)/100;
		docForm.ct15amount.value = Math.round(sum10*100)/100;
		docForm.ct30amount.value = Math.round(sum11*100)/100;
			
		docForm.gctotal.value = total1;
		docForm.gctotalamount.value = Math.round(total2*100)/100; // round the number to 2 decimals
		isOK = true;
	}
	return isOK;
}

function isNumeric(whichObj) {
	var tmpNumber = parseInt(whichObj.value);
	
	if(isNaN(tmpNumber)) {
		alert("You entered an invalid number. Please enter a valid integer.");
		whichObj.value = "0";
		return false;
	} else {
		return true;
	}
}

function doCheckFields(formObj) { 
	var message = "";
	var isOK = false;
	
	if (formObj.name.value.length < 1) { message = message + "Name is required\n"; } 
	if (formObj.address.value.length < 1) { message = message + "Address is required\n"; } 
	if (formObj.city.value.length < 1) { message = message + "City is required\n"; } 
	if (formObj.state.value.length < 1) { message = message + "State or Province is required\n"; } 
	if (formObj.zip.value.length < 1) { message = message + "Zip or Postal Code is required\n"; }
	if (formObj.phone.value.length < 1) { message = message + "Phone number is required\n"; } 
	if (formObj.email.value.length < 3) { message = message + "Email is required\n"; } 

	if(message!="") {
		alert("Whoops! The following form field(s) were incomplete or incorrect:\n\n" + message + "\n\n Please complete or correct the form and submit again.");
	} else {
		if (processGiftCertificateTotal()) {
			isOK = true;
		}
	} 
  
	return isOK;
}
//-->