function validate (required, requiredNames, form) {
	var ret = true;
	var requiredList = required.split(",");
	var names = requiredNames.split(",");
	var notfound = new Array();
	for (var i = 0; i < requiredList.length; i++) {
		var value = eval("form." + requiredList[i] + ".value");
		if (value == null || value == "") {
			notfound.push(names[i]);
		}
	}
	if (notfound.length) {
		var message = "Please fill in these required fields:\n";
		for (var j = 0; j < notfound.length; j++) {
			message += notfound[j] + "\n";
		}
		alert(message);
		ret = false;
	}
	
	if (form.checkMatch != null) {
		var checkMatch = form.checkMatch.value;
		var checkMatchList = checkMatch.split(",");
		for (var i = 0; i < checkMatchList.length; i++) {
			var name1 = checkMatchList[i];
			var val1 = eval("form." + checkMatchList[i] + ".value");
			i++;
			var name2 = checkMatchList[i];
			var val2 = eval("form." + checkMatchList[i] + ".value");
			if (val1 != val2) {
				message += name1 + " does not match " + name2;
				ret = false;
			}
		}
	}
	return ret;
}