function checkvisitorsForm() {

var comment;
var guestName;
var permittedChars = /^[A-Za-z0-9\-\,\ ]{1,}$/;

comment = document.getElementById("comment").value;
guestName = document.getElementById("guestName").value;


if (comment == "") {
	hideAllErrors();
	document.getElementById("commentError").style.display = "inline";
	document.getElementById("comment").select();
	document.getElementById("comment").focus();
return false;

} else if (permittedChars.test(comment) == false) {
	hideAllErrors();
	document.getElementById("commentCharsError").style.display = "inline";
	document.getElementById("comment").select();
	document.getElementById("comment").focus();
return false;

} else if (guestName == "") {
	hideAllErrors();
	document.getElementById("guestNameError").style.display = "inline";
	document.getElementById("guestName").select();
	document.getElementById("guestName").focus();
return false;

} else if (permittedChars.test(guestName) == false) {
	hideAllErrors();
	document.getElementById("guestNameCharsError").style.display = "inline";
	document.getElementById("guestName").select();
	document.getElementById("guestName").focus();
return false;

}
return true;
}
 
function hideAllErrors() {
	document.getElementById("commentError").style.display = "none"
	document.getElementById("commentCharsError").style.display = "none"
	document.getElementById("guestNameError").style.display = "none"
	document.getElementById("guestNameCharsError").style.display = "none"
}
