
	//Define an object that will be used as validation functions return value.
	function ReturnInfo(iReturnCode, sErrorDescription, iErrorField) {
		this.ReturnCode = iReturnCode;
		this.ErrorDescription = sErrorDescription;
		this.ErrorField = iErrorField;
	}
	
	
	//Define an object that will be used to display error messages to the user.
	function UserError(sErrorField, sErrorMessage, iErrorLineID, iErrorSeverity) {
		this.ErrorField = sErrorField;
		this.ErrorMessage = sErrorMessage;
		this.ErrorLineID = iErrorLineID;
		this.ErrorSeverity = (iErrorSeverity==null?1:iErrorSeverity);
	}

	// Create and discard an initial Circle object.
	// This forces the prototype object to be created in JavaScript 1.1.
	new UserError(0, '', 0, 1);
	
	//Assign the a function to the DisplayError method of the UserError object.
	UserError.prototype.DisplayError = DisplayUserError;
	
	//=========================================================================
	// Clear the error messages and reset the field captions.
	//=========================================================================
	function ResetErrorDisplay() {
	var hErrorMessageLines = window.document.getElementsByTagName('LABEL');
	var iIndex;
	
		for (iIndex = 0; iIndex < hErrorMessageLines.length; iIndex++) {
			if (hErrorMessageLines[iIndex].title == 'ErrorMessageLine') {
				hErrorMessageLines[iIndex].parentNode.className = 'ErrorMessageOff';
				hErrorMessageLines[iIndex].innerHTML = '';
			}
				
			if (hErrorMessageLines[iIndex].title == 'FieldCaption')
				hErrorMessageLines[iIndex].style.color = "#000000";
		}
		
	}

	//=========================================================================
	// Display an error message and focus on the field with the error.	
	//=========================================================================
	function DisplayUserError() {
	var hInputCaption = window.document.getElementById('lbl' + this.ErrorField.slice(3));
	var hInputObject = window.document.getElementById(this.ErrorField);
	var sMessageLabel = 'lblErrorMessage' + this.ErrorLineID;
	var sErrorIcon;
	
		switch (this.ErrorSeverity) {
		case 1:
			sErrorIcon = '<IMG src="images/error_icon.gif" align="absmiddle" width="17" height="17">';
			break;
		case 2:
			sErrorIcon = '<IMG src="images/warning_icon.gif" align="absmiddle" width="17" height="17">';
			break;
		case 3:
			sErrorIcon = '<IMG src="images/info_icon.gif" align="absmiddle" width="17" height="17">';
		}
			
		with (window.document.getElementById(sMessageLabel)) {
			parentNode.className = 'ErrorMessageOn';
			innerHTML = sErrorIcon + '&nbsp;' + this.ErrorMessage;
			scrollIntoView();
		}

		if (hInputCaption != null)
			hInputCaption.style.color = '#ff0000';
		
		if (hInputObject != null)
			hInputObject.focus();
	}

