<!-- 		
	var frmCheckArray = new Array();	// an array which stores the form elements to check
	var frm_TEXT = 1;  // declare constants for the type of form element to check
	var frm_SELECT = 2;
	var frm_EMAIL = 4;
	var frm_NUMERIC = 8;	
	var frm_PASSWORD = 16;	
	var frm_NUMERIC_required = "0123456789.-";

	var frm_EMAIL_required = "@.";
	var frm_EMAIL_disallowed = "'%£$\"!^*";
	
	// change this to display an appropriate message in the dialog boxes when a form is filled in incorrectly
	var frmMessage = 'Please note that we need all the fields \nmarked with an asterisk (*) to be completed \ncorrectly before you can proceed.';
	
	
	// Added by Mun to check for Unicode input (11 July 2001)
	// Returns true if unicode is found in checkString (CharCode is outside 0-255 range).  Otherwise, false is returned
	function containsUnicode(checkString)	{
		for (var i=0; i < checkString.length; i++) { var y = checkString.charCodeAt(i); if ( (y < 0) || (y > 255) ) { return (false) } }
		return (false);
	}
	
	
	function stringContains (haystack, needle, all, only) {
		var noMatches = 0;
		if (!only) {
			// searches the haystack for needle, and returns true if found;
			// if all is true, only returns true if all needle chars are found;
			for (i = 0; i < String(needle).length; i++) {
				if (String(haystack).indexOf (String(needle).substring (i, i+1)) >= 0) {
					noMatches++;
				}
			}
		} else {
			// this search checks if haystack only contains chars from needle
			for (i = 0; i < String(haystack).length; i++) {
				if (String(needle).indexOf (String(haystack).substring (i, i+1)) < 0) {
					return (false); // char from haystack was not found in needle chars
				}
			}
			return (true);
		}
		
		if (all) {
			if (noMatches == needle.length) { // if all is true, then all the needles must be found
				return (true);
			} 
		} else {
			if (noMatches) {
				return (true);
			}
		}
		return (false);
	}
	
	function frmVerify(frmObject) {
		for (fieldI in frmCheckArray) {
			field = frmCheckArray[fieldI]; 
			
			if (!frmObject[field.name]) {
				// item doesn't exist in the form, alert user
				alert ('On inital search, the form element ' + field.name + ' was not found');
				return (false);
			}
			frmElement = frmObject[field.name]; // declare the frmElement to be the form element we are dealing with

			// *** now verify the fields *** //
			if (field.type == frm_TEXT) {
			
				// Added by Mun to check for Unicode input in client area (11 July 2001)
				if ( (containsUnicode(String(frmElement.value))) && (String(window.location.href).indexOf('/admin/') >= 0) ) {
					var showHelp = window.confirm('It appears that you have entered non-Ascii characters\n\nTo view a further explanation on what this means\nand how to avoid this problem, click OK.\n\nTo return to the form, click cancel');
					if (showHelp) window.open('/help/wordcon.asp', 'helpwin', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=450,height=500');
					return (false);
				}
			
				if (String(frmElement.value).length == 0) {
					alert (frmMessage); return (false);
				}
			} else if (field.type == frm_SELECT) {
				if ( (!frmElement.options)||(frmElement.options.length == 0) ) {
					alert ('The form element ' + field.name + ' does not appear to be a select list or is empty');
					return (false);
				}
				if (frmElement.options[frmElement.selectedIndex].value.length == 0) {
					alert (frmMessage);
					return (false);
				}
			} else if (field.type == frm_EMAIL) {

				if (String(frmElement.value).length == 0) {
					alert ('You forgot to enter your e-mail address'); return (false);
				}
				if (!stringContains (frmElement.value, frm_EMAIL_required, true)) {
					alert ('The e-mail address you have entered seems to be invalid'); return (false);
				}
				if (stringContains (frmElement.value, frm_EMAIL_disallowed, false)) {
					alert ('The e-mail address you have entered seems to be invalid'); return (false);
				}				
			} else if (field.type == frm_NUMERIC) {
				if (String(frmElement.value).length == 0) {
					alert (frmMessage); return (false);
				}
				if (!stringContains (frmElement.value, frm_NUMERIC_required, true, true)) {
					alert (frmMessage); return (false);
				}
			} else if (field.type == frm_PASSWORD) {
				if (String(frmElement.value).length == 0) {
					alert (frmMessage); return (false);
				}
				if (!frmObject[field.extra]) {
					alert ('The password form element to compare against is missing !');
					return (false);
				}
				if (String(frmElement.value) != String(frmObject[field.extra].value)) {
					alert ('The passwords that have been entered are not the same!'); return (false);
				}
			} else {
				// no Type
				alert ('The form element ' + field + ' does not have a type');
			}
		}
		return (true);
	}
	
	function frmItem (name, type, extra) {
		// adds items to the Array of form elements to verify
		frmCheckArray[frmCheckArray.length] = new Object();
		frmCheckArray[frmCheckArray.length-1].name = name;
		frmCheckArray[frmCheckArray.length-1].type = type;
		frmCheckArray[frmCheckArray.length-1].extra = extra;
	}

//	formItem variables
//	frmItem (elementName, dataType);
//	frmItem ("email", frm_EMAIL);
//	frmItem ("text", frm_TEXT);
//	frmItem ("select", frm_SELECT);
//	frmItem ("numeric", frm_NUMERIC);

// -->