	var a_required = new Array();

	var clear_arrow = new Image();
		clear_arrow.src = "clear.gif"

//	var fill_arrow = new Image();
//		fill_arrow.src = "./images/arrow_left.gif"


	function editFormSubmit(theform, a_required) {
		a_empty = new Array();
		var tmp = '';
		
		for (x = 0; x < a_required.length; x++) {
			if (document[a_required[x] + '_image']) {
				document[a_required[x] + '_image'].src = clear_arrow.src;
			}
		}		

		for (x = 0; x < a_required.length; x++) {
			if (theform[a_required[x] + '_month']) {
				tmp = validate_date(a_required[x], theform);
			} else {	
				tmp = validate_field(theform[a_required[x]], theform, a_required[x]);
			}
			
			if (tmp == false) {
				a_empty[a_empty.length] = a_required[x];
			}
		}
		
		if (a_empty.length > 0) {
			fill_arrows(a_empty);
			alert ('Some required fields were left empty.  Please review your form to make sure that you completed all required fields.');
		} else {
			//theform.submit();
			return true;
		}

		return;
	}
	
	
	function fill_arrows(a_do_these) {
		if (a_do_these.length > 0) {
			for (x = 0; x < a_do_these.length; x++) {
				if (document[a_do_these[x] + '_image']) {
					document[a_do_these[x] + '_image'].src = fill_arrow.src;
				}
			}
		}
	}
	

	function validate_date (component_name, theform) {
		var ok = 1;

		if (theform[component_name + '_month']) {
			if (theform[component_name + '_month'].value < 1) {
				ok = -1;
			}
		}
		if (theform[component_name + '_day']) {
			if (theform[component_name + '_day'].value < 1) {
				ok = -1;
			}
		}
		if (theform[component_name + '_year']) {
			if (theform[component_name + '_year'].value < 1) {
				ok = -1;
			}
		}
		
		if (ok > 0) {
			return true;
		} else {
			return false;
		}
	}

	function validate_field (theobject, theform, field_name) {
		var tmp = 0;
		var x;
		var ok;
		if (theobject) {
			if (theobject.type == "select-one") {
				if (theobject.selectedIndex > 0) {
					return true;
				}
			} else if (theobject.type == "text" || theobject.type == "textarea") {
				if (theobject.value.length > 0) {
					return true;
				}
			} else if (theobject.type == "password") {
				if (theobject.value.length > 0) {
					return true;
				}
			} else if (theobject[0].type == "radio") {
				for (x = 0; x < theobject.length; x++) {
					if (theobject[x].checked == true) return true;
				}
				return false;
			}
		} else if (theform[field_name + '_' + '0']) {
			x = 0;
			ok = -1;
			while (theform[field_name + '_' + x]) {
				tmp = theform[field_name + '_' + x].checked;
				if (tmp == true) {
					ok = 1;
				}
				x++;
			}
			
			if (ok > 0) {
				return true;
			} else {
				return false;
			}
		} else if (theform[field_name + '_' + '1']) {
			x = 1;
			ok = -1;
			while (theform[field_name + '_' + x]) {
				if (theform[field_name + '_' + x].value) {
					ok = 1;
				}
				x++;
			}
			
			if (ok > 0) {
				return true;
			} else {
				return false;
			}
		}

		return false;
	}

