function contactValidate()
{
	if (document.getElementById("email").value=="")
	{
		alert("You must include your return email address.");
		document.getElementById("email").focus();
		return false;
	}
	if (verifyEmail()==false) return false;
	if (verifyOrderNum()==false) return false;
	if (document.getElementById("message").value=="")
	{
		alert("You have not entered a message.");
		document.getElementById("message").focus();
		return false;
	}
	return true;
}
function verifyOrderNum()
{
	var foundWhole=document.getElementById('order').value;
	if (foundWhole=="") return true;

	var foundSum=0;
	var foundNum="";
	var foundCheck=foundWhole.charAt(foundWhole.length-1);

	for (i=0; i<foundWhole.length-1; i++)
	{
		foundSum+=parseInt(foundWhole.charAt(i));
		foundNum+=foundWhole.charAt(i);
	}

	var rawNum=parseInt(foundNum);
	var calcCheck=(foundSum % 9);

	if (((rawNum-19)/31)==parseInt((rawNum-19)/31) && calcCheck==foundCheck) return true;

	alert ("The order number is not valid.");
	return false;
}
function verifyEmail()
{
	var email=document.getElementById('email').value;
	var at=email.indexOf("@",0);
	var dot=email.indexOf(".",at);

	if (at>0 && dot>at+1 && email.charAt(dot+1)!="") return true;
	alert("The email address is not valid.");
	return false;
}
