function ValidateRegistration() 
{
  var theform = document.register;
  var cookies = document.cookie;
  var country = cookies.substring(cookies.indexOf("country=") + 8, cookies.indexOf("country=") + 10);
      country = country.toUpperCase();
  if (theform.vchFirstName.value == "")
  	{
		alert("Please enter a value for the \"First Name\" field");
		theform.vchFirstName.focus();
		return(false);
	}
  if (theform.vchLastName.value == "")
    {
    	alert("Please enter a value for the \"Last Name\" field.");
    	theform.vchLastName.focus();
    	return(false);
    }
  if (theform.vchPosition.value == "")
    {
		alert("Please enter a value for the \"Position\" field.");
		theform.vchPosition.focus();
		return(false);
	}
  if (theform.vchEmailAddress.value == "" || !IsValidEmail(theform.vchEmailAddress.value))
  	{
		alert("Please enter a valid email address");
		theform.vchEmailAddress.focus();
		return(false);
	}

  if (theform.vchEmailAddress.value != theform.vchEmailAddress2.value)
  	{
		alert("Email address inputs must match.");
		theform.vchEmailAddress.focus();
		return(false);
	}

  if (theform.vchCompanyName.value == "")
  	{
		alert("Please enter a value for the \"School/Organization\" field.");
		theform.vchCompanyName.focus();
		return(false);
	}
  if (theform.vchAddress1.value == "")
  	{
		alert("Please enter a value for the \"School Address\" field.");
		theform.vchAddress1.focus();
		return(false);
	}
  if (theform.vchCity.value == "")
  	{
		alert("Please enter a value for the \"City\" field.");
		theform.vchCity.focus();
		return(false);
	}
  if (theform.vchRegion.value == "SELECT" || theform.vchRegion.value == "")
    {
		if (country != "NZ")
		{
			alert("Please enter a value for the \"State\" field.");
			theform.vchRegion.focus();
			return(false);
		}
	}
  if (theform.vchPostalCode.value == "")
  	{
		if (country == "US" || country == "CA")
		{
			alert("Please enter a value for the \"Postal Code\" field.");
			theform.vchPostalCode.focus();
			return(false);
		}
		else
		{
			if (country == "AU")
			{
				alert("Please enter a value for the \"Postcode\" field.");
				theform.vchPostalCode.focus();
				return(false);
			}
		}
	}
  if (theform.user.value == "")
  	{
		alert("Please enter a value for the \"Renaissance User ID\" field.");
		theform.user.focus();
		return(false);
	}
  if (theform.pass1.value == "")
  	{
		alert("Please enter a value for the \"Password\" field.");
		theform.pass1.focus();
		return(false);
	}
  if (theform.pass2.value == "")
  	{
		alert("Please enter a value for the \"Re-type Password\" field.");
		theform.pass2.focus();
		return(false);
	}
  if (theform.pass1.value != theform.pass2.value)
  	{
		alert("Passwords don't match.");
		theform.pass1.focus();
		return(false);
	}

  return(true);
}