regex1 = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
regex2 = /^(\w+[ ]*[\.\-\?\(\)\&\,\!\'\:\;\þ\s]*[ ]*)+$/
regex3 = /^([A-z]+[ ]?[A-z]*)$/

function checkMsg(maxchar) {
	if (document.ordForm.comment.value.length > maxchar) {
	alert("Please keep your message to under " + maxchar + " characters");
	document.ordForm.comment.select();
	document.ordForm.comment.focus();
	return false;
	}
	sendForm();
}

function sendForm() {
	var okSofar=true;

	if (document.ordForm.comment.value.length > 0){
		if (!regex2.test(document.ordForm.comment.value)){
		alert("What you typed is not going to work. The acceptable characters are . - ? ( ) & , ! ';:.");
		document.ordForm.comment.select();
		document.ordForm.comment.focus();
		okSofar=false;
		}
	}

	if (!regex1.test(document.ordForm.email.value)){
	alert("Please enter a correct email address.");
	document.ordForm.email.select();
	document.ordForm.email.focus();
	okSofar=false;
	}

	if (document.ordForm.phone.value.length < 7){
		alert("Please provide your phone number.");
		document.ordForm.phone.select();
		document.ordForm.phone.focus();
		okSofar=false;
	}
	
	if (!regex3.test(document.ordForm.lname.value)){
	alert("Please enter a last name.");
	document.ordForm.lname.select();
	document.ordForm.lname.focus();
	okSofar=false;
	}

	if (!regex3.test(document.ordForm.fname.value)){
	alert("Please enter a first name.");
	document.ordForm.fname.select();
	document.ordForm.fname.focus();
	okSofar=false;
	}

	if (okSofar == true) {
	document.ordForm.submit();
	}
}