

function validateForm(theForm)
{
	//alert("first name: " + theForm.FirstName.value);

	//alert("first name: " + theForm.FirstName.value);


	if (theForm.FirstName.value == "")
	{
		alert("Please enter a value for the \"First Registrant First Name\" field.");
		theForm.FirstName.focus();
		return false;
	}
	
	if (theForm.LastName.value == "")
	{
		alert("Please enter a value for the \"Last Name\" field.");
		theForm.LastName.focus();
		return false;
	}

	if (theForm.EmailAddress.value == "")
	{
		alert("Please enter a value for the \"Email Address\" field.");
		theForm.EmailAddress.focus();
		return false;
	}	

	if (theForm.HomeAreaCode.value == "" || theForm.HomePhoneNumber.value == "")
	{
		alert("Please enter a value for the \"Home Phone\" field.");
		theForm.HomeCellphoneAreaCode.focus();
		return false;
	}

	if (theForm.TotalAmount1.value == "Total Amount pounds" && theForm.TotalAmount2.value == "Total Amount Euro")
	{
		alert("Please enter a value for the \"Total Amount\" field.");
		theForm.TotalAmount1.focus();
		return false;
	}

	if (theForm.AccountNumber.value == "" || theForm.ExpirationDate.value == "" || theForm.Security.value == "")
	{
		if (theForm.AccountNumber.value == "")
		{
			alert("Please enter a value for the \"Account Number\" field.");
			theForm.AccountNumber.focus();
			return false;
		}

		if (theForm.ExpirationDate.value == "")
		{
			alert("Please enter a value for the \"Expiration Date\" field.");
			theForm.ExpirationDate.focus();
			return false;
		}

		if (theForm.Security.value == "")
		{
			alert("Please enter a value for the \"Security Code\" field.");
			theForm.Security.focus();
			return false;
		}
	}

	calculateTotal(theForm);	
	
	return true;

}
