function CheckRequiredFieldsWithNames(FormName,FieldArray,FieldArrayNames)
{
	var msg;
	var empty_fields = "";
	
	for (var i = 0; i < FieldArray.length; i++) {
		var e = FieldArray[i];
		if (e == null) {
			//alert("Could not find required string field from FieldArray idx(possibly bad name): " + i);
			continue;
		}
		if ((e.type == "text") || (e.type == "textarea") || (e.type == "password") || (e.type == "hidden")) {
			if ((e.value == null) || (e.value == "") || (e.value == " ")) {
				empty_fields += "\n       - " + FieldArrayNames[i];
			}
			continue;
		}
		if ((e.type == "select-multiple") && (e.selectedIndex == -1)) {
			empty_fields += "\n       - " + FieldArrayNames[i];
			continue;
		}
		if (e.selectedIndex == 0) {
			empty_fields += "\n       - " + FieldArrayNames[i];
			continue;
		}
	}
	
	if (!empty_fields) {
		return true;
	}
	
	msg =  "________________________________________________  \n\n";
	msg += "This form has not been completed correctly. The   \n";
	msg += "following required fields have been left out.     \n";
	msg += "Please review the form and fill in all required   \n";
	msg += "fields (marked with an asterisk).              \n";
	msg += "________________________________________________  \n";
	
	if (empty_fields) {
		msg += empty_fields + "\n";
		alert(msg);
		return false;
	}
}

function CheckNumberFieldsWithNames(FormName,FieldArray, FieldArrayNames)
{
	var msg;
	var num_fields = "";

	for (var i = 0; i < FieldArray.length; i++)
	{
		var e = FieldArray[i];
		if (e == null) {
			//alert("Could not find required number field from FieldArray idx(possibly bad name): " + i);
			continue;
		}
		if (e.type == "text")
		{
			if ((e.value != null) && (e.value != "") && (e.value != " "))
			{
				if (parseInt(e.value) != e.value)
					num_fields += "\n       - " + FieldArrayNames[i];
				continue;
			}
		}
	}

	if (!num_fields)
	{
		return true;
	}

	msg =  "________________________________________________  	\n\n";
	msg += "This form has not been completed correctly. The   	\n";
	msg += "following numeric fields contain non numeric values.\n";
	msg += "________________________________________________  	\n";

	msg += num_fields + "\n";
	alert(msg);
	return false;
}

/* added by Choyce - 05/03/2001 */
/* this is just a direct copy of the CheckDateFields function */
/* Why should this be the only function that does not have the 'WithNames' appeanded to it */
function CheckDateFieldsWithNames(FormName,FieldArray, FieldArrayNames)
{
	var msg;
	var num_fields = "";
	
	for (var i = 0; i < FieldArray.length; i++) 
	{
		var e = FieldArray[i];
		if (e == null) {
			alert("Could not find required number field from FieldArray idx(possibly bad name): " + i);
			continue;
		}
		if (e.type == "text") 
		{
			if ((e.value != null) && (e.value != "") && (e.value != " ")) 
			{
				if (!isDateStr(e.value))
					num_fields += "\n       - " + FieldArrayNames[i];
				continue;
			}
		}
	}
	
	if (!num_fields) 
	{
		return true;
	}
	
	msg =  "________________________________________________  	\n\n";
	msg += "This form has not been completed correctly. The   	\n";
	msg += "following date fields contain non date values.		\n";
	msg += "Make sure dates are in 'MM/DD/YYYY' format.        	\n";
	msg += "________________________________________________  	\n";
	
	msg += num_fields + "\n";
	alert(msg);
	return false;
}