// JavaScript Document
// check for blank fields
function isblank(s)
{
for (var i = 0; i < s.length; i++)	{
	var c = s.charAt(i);
	if ((c != ' ') && (c != '\n') && (c != '\t'))
		return false;
	}
	return true;
}

function verifymethod(f)
{
	var radio_choice = false;
	var pattern = /.+@.+\..+/;
	if (document.contactinfo.MethodOfNotice[0].checked)
	{
		if (pattern.test(document.contactinfo.email.value))
			return true;
		else
			alert("You have requested notification by e-mail!\n\nPlease enter your email address!");
	return false;
	}
	if (document.contactinfo.MethodOfNotice[1].checked)
	{
					if (((!document.contactinfo.name.value == null) ||  (!document.contactinfo.name.value == "") || !isblank(document.contactinfo.name)) 
					&& ((!document.contactinfo.StreetAddress.value == null) ||  (!document.contactinfo.StreetAddress.value == "") || !isblank(document.contactinfo.StreetAddress)) 
					&& ((!document.contactinfo.town.value == null) ||  (!document.contactinfo.town.value == "") || !isblank(document.contactinfo.town)) 
					&& ((!document.contactinfo.zip.value == null) ||  (!document.contactinfo.zip.value == "") || !isblank(document.contactinfo.zip))
					&& (document.contactinfo.State.selectedIndex >= 1))

						return true;
					else
						alert("You have requested notification by US mail!\n\nPlease enter your name and complete address!");
					return false;
	}
	if (!radio_choice)
	{
	// If there were no selections made display an alert box 
		alert("No button has been selected!\n\nPlease select a method of contact!");
	return false;
	}
	return true;
}

