// determine whether a text field on a form is empty
function isEmpty(inputStr){
	if (inputStr == null || inputStr == ""){
		return true;}
	return false;}
//validate eMail addresses
function validateEmail(EmailValue){
	var bFormValidate = new Boolean(true);
	var at="@"
	var dot="."
	var lat=EmailValue.indexOf(at)
	var lstr=EmailValue.length
	var ldot=EmailValue.indexOf(dot)
	if (EmailValue.indexOf(at)==-1){
		bFormValidate = false;}
	if (EmailValue.indexOf(at)==-1 || EmailValue.indexOf(at)==0 || EmailValue.indexOf(at)==lstr){
		bFormValidate = false;}
	if (EmailValue.indexOf(dot)==-1 || EmailValue.indexOf(dot)==0 || EmailValue.indexOf(dot)==lstr){
		bFormValidate = false;}
	 if (EmailValue.indexOf(at,(lat+1))!=-1){
		bFormValidate = false;}
	 if (EmailValue.substring(lat-1,lat)==dot || EmailValue.substring(lat+1,lat+2)==dot){
		bFormValidate = false;}
	 if (EmailValue.indexOf(dot,(lat+2))==-1){
		bFormValidate = false;}
	 if (EmailValue.indexOf(" ")!=-1){
		bFormValidate = false;}
	return bFormValidate;}
//validate email verification form
function valContact(){
	var Form 			= document.forms[0];
	var EmailValue 		= new String(Form.email.value);
	var AlertMessage	= new String("We cannot process your information request\nbecause the following items are missing from\nyour form submittal:\n\n");
	bFormValidate		= new Boolean(true);
	if(isEmpty(EmailValue)){
		AlertMessage += "Your eMail Address\n";
		bFormValidate = false;}
	else if(!validateEmail(EmailValue)){
		AlertMessage += "A properly formatted eMail Address\n";
		bFormValidate = false;}
	// if any alert strings were generated, then construct the message and send it in an alert box
	if (bFormValidate == false){
		alert(AlertMessage+ "\nPlease check the form, and then click the\n\"Submit\" button again. Thanks.");}
	//otherwise, process the form
	if (bFormValidate == true){
			Form.submit();}}