//<![CDATA[
var rxEmailAddress	= /^(\w+|[.]|[-]+)+[@](\w+|[-]+)+[.](\w+|[.]|[-]+)+$/;

function submitContact()
{
	var txtEmail			= document.getElementById('txtEmail');
	var frmContact			= document.getElementById('frmContact');


	// WARNING: do not change the error checking below other than the messages without matching the changes in the
	//			asp.net thank_you class, otherwise exceptions will be generated by the class
	
	var errors			= '';
	
	if (txtEmail.value.length < 6 || txtEmail.value.length > 255 || !rxEmailAddress.test(txtEmail.value))
	{
		errors = errors + '- enter a valid email address between 6 and 255 characters in length\r\n';
	}

	if (errors.length > 0)
	{
		window.alert('Sorry, please correct the following before submitting the mailing list form:\r\n\r\n' + errors);
	}
	else
	{
		frmContact.submit();
	}
}
//]]>
