addLoadEvent(addGuestBookValidation);


function addGuestBookValidation() {
	var frmGuestbook = document.getElementById("guestbook");
	if(frmGuestbook) {
		frmGuestbook.onsubmit = function () {
			return validateGuestbook(this);
		}
	}	
}

function validateGuestbook(theForm) {
	var error = 0;
	var msg = "";
	
	if(theForm.tekst.value.length==0) {
		msg += "\n- " + lbl_guestbook_bericht;
		error++;
	}
	if(theForm.naam.value.length==0) {
		msg += "\n- " + lbl_guestbook_naam;
		error++;
	}
	
	if(error) {
		alert(lbl_guestbook_verplichte_velden + msg);
		return false;
	}
	theForm.x.value = "abc123";
	return true;
}
