function CheckEmail(anEmailField)
{
	if (anEmailField.value == '')
		return;
		
	atSignLocation = anEmailField.value.indexOf('@');
	if (atSignLocation < 1)
		{
		//the @ must be present and it can't be the first character
		alert('Invalid email address');
		anEmailField.focus();
		}
	else
		{
		periodLocation = anEmailField.value.indexOf('.', atSignLocation+2);
		if (periodLocation < 0)
			{
			//the period must be present and be at least the second character after the @
			alert('Invalid email address');
			anEmailField.focus();
			}
		else
			{
			emailLength = anEmailField.value.length;
			if (emailLength-1 == periodLocation)
				{
				//the period can't be the last character
				alert('Invalid email address');
				anEmailField.focus();
				}
			}
		}
}
