var message;
var fieldtofocus;

function contact_validator(form)  
  { var passed=true;
  fieldtofocus="";
  
  message="Please check that you have completed the following fields correctly: \n"
/*  
  if(form.fname.value=="")
    {message +="--First Name\n";
	 passed=false;
	 fieldtofocus=form.fname;
	 if (fieldtofocus==""){fieldtofocus=form.fname}
	}
	
  if(form.lname.value=="")
    {message +="--Last Name\n";
	 passed=false;
	 fieldtofocus=form.lname;
	 if (fieldtofocus==""){fieldtofocus=form.lname}
	}
*/
	x = form.Email.value;
	filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if (!filter.test(x)) 
	{message +="--Valid Email\n";
	 passed=false;
	 fieldtofocus=form.Email;
     if (fieldtofocus==""){fieldtofocus=form.Email}
	}
	
/*	
 if(form.Comments.value=="")
    {message +="--Comments/Questions\n";
	 passed=false;
	 fieldtofocus=form.Comments;
     if (fieldtofocus==""){fieldtofocus=form.Comments}
	}

*/  if (passed==false) {fixfieldinfo(message, fieldtofocus);}

  return passed;

}  	 

function fixfieldinfo(message, fieldtofocus)
  {alert(message);
   fieldtofocus.focus();
  }