// JavaScript Document

addOnload(getAllForms);

var allForms;

function getAllForms() {
	allForms = document.getElementsByTagName("form");
	for (i=0; i<allForms.length; i++) allForms[i].onsubmit = checkRequired;
}

function checkRequired() {
	var theForm = this;
	for (i=0; i<theForm.elements.length; i++) 
		if ((theForm.elements[i].className.indexOf("req")>-1) && (theForm.elements[i].value == "")) { alert("Please fill required fields.");  theForm.elements[i].focus(); return false;}
}