// validate form

function ValidateForm()
{
	
/*	CalculateTotal(this.FORM)
	
	CalculateTotal(document.FORM)
	// check quantity
	// if (document.FORM.quantity.value >= "3") {
	if ((document.FORM.quantity.value <= "5"))
		{
			alert ("A minimum of six items is required to fulfil an order. ")
			// alert (document.FORM.quantity.value)
			return (false)
		}
*/
	// quantity
	if (document.FORM.quantity.value <= 5)
	{
		alert ("You need to order at least six items. Please add more items.")
		return (false)
	}

	// age checkbox
	if (!document.FORM.agecheck.checked)
	{
		alert ("You need to be eighteen to purchase wine. Please check the age checkbox if you are over eighteen.")
		document.FORM.agecheck.focus()
		return (false)
	}

	// name
	if (document.FORM.realname.value == "")
	{
		alert ("Please supply your name")
		document.FORM.realname.focus()
		return (false)
	}
	
	// address
	if (document.FORM.address.value == "")
	{
		alert ("Please supply your address")
		document.FORM.address.focus()
		return (false)
	}
	
	// city
	if (document.FORM.city.value == "")
	{
		alert ("Please supply your city")
		document.FORM.city.focus()
		return (false)
	}
		
	// phone
	if ((document.FORM.phone.value == "") && (document.FORM.email.value == ""))
	{
		alert ("Please supply your either a phone number or email address")
		document.FORM.phone.focus()
		return (false)
	}

	
	
	// payment
	if ((!document.FORM.cheque.checked) && (!document.FORM.creditcard.checked))
	{
		alert ("Please indicate your method of payment.")
		document.FORM.cheque.focus()
		return (false)
	}
	
	// if they have chosen to pay by cheque we print the page for them
	if (document.FORM.cheque.checked)
	{
		alert('Please print this page and post it to us with your cheque. Our postal address is listed on our Contact Page.')
		window.print()
		return (false)
	}
		
		
	//	alert('form validates')
		return (true)
}
