function getValidator(oForm)
{
	return function()
		{
			var sFormAction = oForm.getAttribute("CustomValidateAction");
			if (!sFormAction)
				return true;
		
			for (var iCnt = 0; iCnt < oForm.length; iCnt++)
			{
				var sValidateTitle = oForm[iCnt].getAttribute("CustomValidateTitle");
				if (sValidateTitle)
				{
					if (oForm[iCnt].value == "")
					{
						window.alert('You must specify ' + sValidateTitle + ' in order to ' + sFormAction + '.');
						oForm[iCnt].select();
						return false;
					}
				}
			}
		
			return true;
		};
}

window.onload = function()
{
	var aForms = document.getElementsByTagName("FORM");
	for (var iCnt = 0; iCnt < aForms.length; iCnt++)
		aForms[iCnt].onsubmit = getValidator(aForms[iCnt]);
};