
/*
	purpose:
		used in the contact page
	page:
		/contact_us/index.cfm
	Parameters:
		theform - object reference to the form being passed
*/

function CheckContactForm(theform)
{
	
	if (!IsWordNumberSpecial(theform.firstname.value))
	{
		alert("Please enter your first name.");
		theform.firstname.focus();
		return false;
	}
	
	if (!IsWordNumberSpecial(theform.lastname.value))
	{
		alert("Please enter your last name.");
		theform.lastname.focus();
		return false;
	}
	
	if (!IsWordNumberSpecial(theform.companyname.value))
	{
		alert("Please enter your company name.");
		theform.companyname.focus();
		return false;
	}

	if (!IsWordNumberSpecial(theform.address.value))
	{
		alert("Please enter your address.");
		theform.address.focus();
		return false;
	}
	
	if (!IsWordNumberSpecial(theform.city.value))
	{
		alert("Please enter your city.");
		theform.city.focus();
		return false;
	}
	
	if (theform.state[theform.state.selectedIndex].value == "")
	{
		alert("Please select a valid state/province.");
		theform.state.focus();
		return false;
	}
	
	if (theform.country[theform.country.selectedIndex].value == "")
	{
		alert("Please select a valid country.");
		theform.country.focus();
		return false;
	}
	
	if (!IsWordNumberSpecial(theform.postalcode.value))
	{
		alert("Please enter your postal/zip code.");
		theform.postalcode.focus();
		return false;
	}

	if (!IsPhone(theform.phone.value))
	{
		alert("Please enter a valid phone number.");
		theform.contactphone.focus();
		return false;
	}
	
	if (!IsEmail(theform.email.value))
	{
		alert("Please enter a valid email address.");
		theform.email.focus();
		return false;
	}
	
	if (!IsEmail(theform.emailconfirm.value))
	{
		alert("Please enter a valid confirmation email address.");
		theform.emailconfirm.focus();
		return false;
	}
	
	if (theform.email.value != theform.emailconfirm.value)
	{
		alert("Your email address and confirmation email address do not match.");
		theform.emailconfirm.focus();
		return false;
	}
	
	return true;
}

/*
	purpose:
		used in the contact page
	page:
		/signup/index.cfm
	Parameters:
		theform - object reference to the form being passed
*/

function CheckSignupForm(theform)
{
	
	if (!IsWordNumberSpecial(theform.firstname.value))
	{
		alert("Please enter your first name.");
		theform.firstname.focus();
		return false;
	}
	
	if (!IsWordNumberSpecial(theform.lastname.value))
	{
		alert("Please enter your last name.");
		theform.lastname.focus();
		return false;
	}
	
	if (!IsWordNumberSpecial(theform.companyname.value))
	{
		alert("Please enter your company name.");
		theform.companyname.focus();
		return false;
	}

	if (!IsWordNumberSpecial(theform.address.value))
	{
		alert("Please enter your address.");
		theform.address.focus();
		return false;
	}
	
	if (!IsWordNumberSpecial(theform.city.value))
	{
		alert("Please enter your city.");
		theform.city.focus();
		return false;
	}
	
	if (theform.state[theform.state.selectedIndex].value == "")
	{
		alert("Please select a valid state/province.");
		theform.state.focus();
		return false;
	}
	
	if (theform.country[theform.country.selectedIndex].value == "")
	{
		alert("Please select a valid country.");
		theform.country.focus();
		return false;
	}
	
	if (!IsWordNumberSpecial(theform.postalcode.value))
	{
		alert("Please enter your postal/zip code.");
		theform.postalcode.focus();
		return false;
	}

	if (!IsPhone(theform.phone.value))
	{
		alert("Please enter a valid phone number.");
		theform.contactphone.focus();
		return false;
	}
	
	if (!IsEmail(theform.email.value))
	{
		alert("Please enter a valid email address.");
		theform.email.focus();
		return false;
	}
	
	if (!IsEmail(theform.emailconfirm.value))
	{
		alert("Please enter a valid confirmation email address.");
		theform.emailconfirm.focus();
		return false;
	}
	
	if (theform.email.value != theform.emailconfirm.value)
	{
		alert("Your email address and confirmation email address do not match.");
		theform.emailconfirm.focus();
		return false;
	}
	
	return true;
}

