function checkIfInt(qtyField)	{
	if(/^\d+$/.test(qtyField.value) == false)	{
		alert("Invalid quantity specified, defaulting to 1!");

		qtyField.value = 1;
	}
}

function checkPostalCode(anonPostalCodeField)	{
	var isGood = false;

	// Check for US style postal code
	if(/(^\d{5}$)/.test(anonPostalCodeField.value) == true	)	{
		isGood = true;
	} else {
		// Check for Canada style postal code
		if(/^\s*[a-ceghj-npr-tvxy]\d[a-z](\s)?\d[a-z]\d\s*$/i.test(anonPostalCodeField.value) == true)	{
			isGood = true;
		}
	}

	if(isGood == true)	{
		document.cart.submit();
	} else	{
		alert("Invalid Postal Code");
	}
}

function checkForPostalCode()	{
	var bResult = true;

	if(document.forms.cart.postalCode.value == "")	{
		bResult = confirm("You have not entered a postal code yet.  We cannot calculate sales tax or shipping information without this data.  If you are outside of the U.S., click 'OK' to skip this step.  Otherwise, click Cancel and enter a postal code, then click 'Get Shipping Quote'.");
		document.forms.cart.postalCode.focus();
	}

	if(bResult == true)	{
		self.location='order.php';
	} else	{
		document.forms.cart.postalCode.focus();
	}
}

function clearCart()	{
	var bResult = false;
	bResult = confirm("Are you sure you wish to remove all items from your cart?");

	if(bResult == true)	{
		self.location='cart.php?op=cart_clear';
	} else	{
		document.forms.cart.button_placeOrder.focus();
	}
}


