var commentForm = false;

function checkForm() {
	var comment = document.getElementsByName("comment")[0];
	var mail = document.getElementsByName("mail")[0];
	if (!comment || !mail) {
		return true;
	}
	var fail = false;
	mailReg = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;
	if ((mail.value.search(mailReg) == -1 || mail.value == '@')) {
		document.getElementById("formMail").style.color = "red";
		fail = true;
	} if (!comment.value) {
		if (!commentForm) {
			commentForm = document.createElement("b");
			commentForm.innerHTML = "Comment:";
			commentForm.style.color = "red";
			commentForm.style.marginTop = "10px";
			comment.parentNode.insertBefore(commentForm, comment.previousSibling.previousSibling);
		}
		fail = true;
	}
	return !fail;
}