addLoadEvent(testimonialDOM);

function validateTestimonial(theForm) {

	if ((theForm.last_name.value=="")||(theForm.first_name.value=="")||(theForm.email.value=="")||(theForm.message.value=="")) {
		alert("Please, enter your comment, name and e-mail address.");
		return false;
	}
	if (!validateEmail(theForm.email.value)) {
		alert("Please, enter a valid e-mail address.");
		return false;
	}
	
	theForm.sc.value=1;
	return true;
}

function testimonialDOM() {
	var frmTestimonial = document.getElementById("testimonialform");
	
	if(frmTestimonial) {
		frmTestimonial.onsubmit = function () { 
			return validateTestimonial(frmTestimonial); 
		}
		
		var btnSubmitTestimonial = document.getElementById("buttonSubmitTestimonial");
		if(btnSubmitTestimonial) {
			btnSubmitTestimonial.onclick = function () {
				if(validateTestimonial(frmTestimonial)) {
					frmTestimonial.submit();
				}
				return false;
			}	
		}
	}	
}


