
// Function to validate email address by characters
function checkEmail(emailInput) {
	var emailFilter = /^.+@.+\..{2,4}$/;
	var illegalChars = /[\(\)\<\>\,\;\:\\\"\[\]]/;
	
	if ((emailInput.value.length < 6) ||
		(!(emailFilter.test(emailInput.value))) ||
		(emailInput.value.match(illegalChars)))	{
			alert("Please enter a valid email address.");
			document.contactForm.Email.value = "";
			document.contactForm.Email.focus();
			return false;
	}
	return true;
}

// Function to check for html links in comments field
function checkComments(commentInput) {
	var linkFilter = "<a";
	
	if (commentInput.value.match(linkFilter)) {
		alert("HTML is not allowed in this comments field. Please remove all HTML code.");
		document.contactForm.Comments.focus();
		return false;
	}
	return true;
}
