function checkform()
{
if (document.forms[1].fname.value.length == 0){
   alert('Please enter your first name.');
   document.forms[1].fname.focus();
   return false;
}
if (document.forms[1].lname.value.length == 0){
   alert('Please enter your last name.');
   document.forms[1].lname.focus();
   return false;
}

var emailStr=document.forms[1].emailaddress.value

var emailPat=/^(.+)@(.+)$/
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
	var validChars="\[^\\s" + specialChars + "\]"
	var firstChars=validChars
	var quotedUser="(\"[^\"]*\")"
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
	var atom="(" + firstChars + validChars + "*" + ")"
	var word="(" + atom + "|" + quotedUser + ")"
	// The following pattern describes the structure of the user
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
	var matchArray=emailStr.match(emailPat)
	if (matchArray==null) {
	        alert("The email address you entered is not valid, please verify.")
		document.forms[1].emailaddress.focus();
	        return false;
	}
	var user=matchArray[1]
	var domain=matchArray[2]
	
	// See if "user" is valid 
	if (user.match(userPat)==null) {
	    // user is not valid
	    alert("The email address you entered is not valid, please verify.")
		document.forms[1].emailaddress.focus();
	    return false;
	}
	var IPArray=domain.match(ipDomainPat)
	if (IPArray!=null) {
	    // this is an IP address
	          for (var i=1;i<=4;i++) {
	            if (IPArray[i]>255) {
	                alert("The email address you entered is not valid, please verify.")
		document.forms[1].emailaddress.focus();
	                return false;
	            }
	    }
	    return true
	}
	
	// Domain is symbolic name
	var domainArray=domain.match(domainPat)
	if (domainArray==null) {
	        alert("The email address you entered is not valid, please verify.")
		document.forms[1].emailaddress.focus();
	    return false;
	}
	
	var atomPat=new RegExp(atom,"g")
	var domArr=domain.match(atomPat)
	var len=domArr.length
	if (domArr[domArr.length-1].length<2 || 
	    domArr[domArr.length-1].length>4) {
	   // the address must end in a two letter or three letter word.
	   alert("Your email address must end in a valid domain extension.")
		document.forms[1].emailaddress.focus();
	   return false;
	}
	
	if (domArr[domArr.length-1].length<=3 && len<2) {
	   var errStr="The email address you entered is not valid, please verify."
	   alert(errStr)
		document.forms[1].emailaddress.focus();
          return false;
	}

	if (document.forms[1].disclaimer.checked != 1) {
	alert("Please read the disclaimer and click the 'I Agree' checkbox.");
	return false;
	}
	// return checksend();

 }

 
 
function checksend() {
	var agree=confirm("BLANK ROME GOVERNMENT RELATIONS LLC EMAIL DISCLAIMER:\n\nThis e-mail link will enable you to contact an attorney with Blank Rome Government Relations LLC. If you are not currently a client of Blank Rome Government Relations LLC, your e-mail is not protected by attorney-client privilege, will not be treated as confidential, and may be disclosed to others outside our law firm.\n\nJust because you send us such an unsolicited e-mail or information does not mean that we agree to enter into an attorney-client relationship with you (i.e., act as your attorney). If you still wish to send this e-mail without confidentiality, please press the \"OK\" button below. Alternatively, please press the \"Cancel\" button, and the e-mail will be terminated.\n\nBy providing this email link to one of our attorneys, this attorney does not seek to practice in any jurisdiction in which she or he is not authorized to do so.");
	if (agree){
	return true;
	}
	else {
		return false;
	}
}
