//function getradioValue(contactus, contact)
//{
//   obj = document.forms[contactus][contact]
//   for(i=0;i<obj.length;i++)
//      if(obj[i].checked) return obj[i].value;
//}

function validation(myForm) {
	var errs = '';
	var first = '';
	if (myForm.firstname.value.length < 1) {
		errs += '   first name \n';
	}
	if (myForm.lastname.value.length < 1) {
		errs += '   last name \n';
	}
    var emailPat = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    var matchArray = myForm.email.value.match(emailPat);
    if (myForm.email.value.length > 1) {
	    if (matchArray == null) {
	        errs += '   email (must be a valid email address) \n';
        }
    }	
	  var j = false;
	  for (i = 0; i < myForm.contact.length; i++) {
		if (myForm.contact[i].checked) {
		   j = true;
		}
	  }
	  if (j == false) { 
		errs += '   contact preference \n';
	  }
//	if (myForm.phone.value.length < 1 && getradioValue("forum2007", "rsvp")) {
//		errs += '   phone number \n';
//	}
	if (myForm.email.value.length < 1) {
		errs += '   email address \n';
	}
	if (errs.length > 3) {
		errs = 'You are missing some required fields.\n\nPlease provide: \n' + errs; 
		alert(errs); 
		return false;
	} else {
		return true;
	}
}

