<!--
function Form_Validator(theForm)
{
	bReturn = true;
	
	var emailAddress = theForm.emailaddress.value;
	var pos = emailAddress.indexOf('.');
	
	if (theForm.emailaddress.value.indexOf('@')<0 )
	{
		alert("Please enter a valid email address.");
		theForm.emailaddress.focus();
		bReturn = false;
	}
	else if (theForm.emailaddress.value.length < 7 )
	{
		alert("Please enter a valid email address.");
		theForm.emailaddress.focus();
		bReturn = false;
	}
	else if (theForm.emailaddress.value.indexOf('\'')>0)
	{
		alert("Please enter a valid email address.");
		theForm.emailaddress.focus();
		bReturn = false;
	}		
	else if (pos < 0)
	{
		alert("Please enter a valid email address.");
		theForm.emailaddress.focus();
		bReturn = false;
	}
	else
	{
		pos = emailAddress.lastIndexOf(".");
		var emailType = emailAddress.substr(pos + 1);
		if (emailType.length < 2)
		{
			alert("Please enter a valid email address.");
			theForm.emailaddress.focus();
			bReturn = false;
		}
		if (emailType.length > 3)
		{
			alert("Please enter a valid email address.");
			theForm.emailaddress.focus();
			bReturn = false;
		}
	}
	if (theForm.firstname.value == "")
	{
		alert("Please tell us your first name.");
		theForm.firstname.focus();
		bReturn = false;
	}
	if (theForm.firstname.value.indexOf('\'')>0)
	{
		alert("Please do not enter invalid characters in the first name field.");
		theForm.firstname.focus();
		bReturn = false;
	}	
	if (theForm.surname.value == "")
	{
		alert("Please tell us your surname.");
		theForm.surname.focus();
		bReturn = false;
	}
	if (theForm.surname.value.indexOf('\'')>0)
	{
		alert("Please do not enter invalid characters in the surname field.");
		theForm.surname.focus();
		bReturn = false;
	}	
	if (theForm.agree.checked==false)
	{
		alert("Please agree to the terms and conditions before entering the competition!");
		theForm.agree.focus();
		bReturn = false;
	}
	return (bReturn);
}

//-->
