	MinLengthValidator.prototype = new ValidatorDecorator();

	MinLengthValidator.constructor = MinLengthValidator;
    MinLengthValidator.baseConstructor = ValidatorDecorator;
	MinLengthValidator.superclass = ValidatorDecorator.prototype;


	function MinLengthValidator(validatorObject, errMsg, minLength) {
		if(arguments.length > 0)
		{
			MinLengthValidator.baseConstructor.call(this, errMsg, validatorObject);
            this.minLength = minLength;
		}
	}

	MinLengthValidator.prototype.isValid = function(id) {
            // console.log("BEGIN: MinLengthValidator.isValid()");
			var minInput = document.getElementById(id);
            var isValid = null;
            var inputValue = Trim(minInput.value);

            
            // It is not the job of the MinLengthValidator to
            // check if the input field is not blank,
            // That is the job of the NotBlankValidator
            // or alternately the BlankOkValidator.
            if(inputValue.length == 0)
            {
                // console.log("The length of the field is zero ignoring");
                isValid = true;
            }
            else
            {
                isValid = (inputValue.length >= this.minLength);

                // console.log("isValid: " + isValid);
            }

            // console.log("END: MinLengthValidator.isValid()");
			return isValid;
	};