//this is used in the play for nmu forms (among others)
function checkEmailAddress(emailAddress)
{
	var checkEmail = "@.";
	var checkStr = emailAddress;
	var EmailValid = false;
	var EmailAt = false;
	var EmailPeriod = false;
	var EmailGap = false;
	for (i = 0; i < checkStr.length; i++) 
	{
		ch = checkStr.charAt(i);
		for (j = 0; j < checkStr.length; j++)
		{
			if(ch == checkEmail.charAt(j) && ch == "@")
				EmailAt = true; // @ is present
				
			if(ch == checkEmail.charAt(j) && ch == ".")
				EmailPeriod = true; // . is present

			var whitespace = " \s\t\n\r";
			if(ch == whitespace.charAt(checkEmail.charAt(j)))
				EmailGap = true; // whitespace is present
			
			// if @ is there and . is there and no whitespace then it's ok
			if((EmailAt == true) && (EmailPeriod == true) && (EmailGap == false))
			{
				EmailValid = true;
				break;
			}
		}
	} 
		return(EmailValid);		
}
