

var __aspxExternalTableSuffix = "_ET";
var __aspxErrorCellSuffix = "_EC";
var __aspxErrorTextCellSuffix = "_ETC";
var __aspxErrorImageSuffix = "_EI";
var __aspxClientValidationStateNameSuffix = "$CVS";
ASPxClientEditBase = _aspxCreateClass(ASPxClientControl, {
    constructor: function(name) {
        this.constructor.prototype.constructor.call(this, name);
    },
    InlineInitialize: function(){
        this.InitializeEnabled(); // need to call even if enabled - assign initially attributes, events, etc
    },
    InitializeEnabled: function() {
        this.SetEnabledInternal(this.clientEnabled, true);
    },
    GetValue: function() {
        var element = this.GetMainElement();
        if(_aspxIsExistsElement(element))
            return element.innerHTML;
        return "";
    },
    GetValueString: function(){
        var value = this.GetValue();
        return (value == null) ? null : value.toString();
    },
    SetValue: function(value) {
        if(value == null)
            value = "";
        var element = this.GetMainElement();
        if(_aspxIsExistsElement(element))
            element.innerHTML = value;
    }, 
    GetEnabled: function(){
        return this.enabled && this.clientEnabled;
    }, 
    SetEnabled: function(enabled){
        if (this.clientEnabled != enabled) {
            this.clientEnabled = enabled;
            this.SetEnabledInternal(enabled, false);
        }
    },
    SetEnabledInternal: function(enabled, initialization){
        if(!this.enabled) return;
        if(!initialization || !enabled)
            this.ChangeEnabledStateItems(enabled);
        this.ChangeEnabledAttributes(enabled);
    },
    ChangeEnabledAttributes: function(enabled){
    },
    ChangeEnabledStateItems: function(enabled){
    }
});

ASPxValidationPattern = _aspxCreateClass(null, {
    constructor: function(errorText) {
        this.errorText = errorText;
    }
});

ASPxRequiredFieldValidationPattern = _aspxCreateClass(ASPxValidationPattern, {
    constructor: function(errorText) {
        this.constructor.prototype.constructor.call(this, errorText);
    },
    EvaluateIsValid: function(value) {
        if (typeof(value) == "boolean")
            return value;
        else
            return value != null && _aspxTrim(value.toString()) != "";
    }
});

ASPxRegularExpressionValidationPattern = _aspxCreateClass(ASPxValidationPattern, {
    constructor: function(errorText, pattern) {
        this.constructor.prototype.constructor.call(this, errorText);
        this.pattern = pattern;
    },
    EvaluateIsValid: function(value) {
        if (value == null) 
            return true;
        var strValue = value.toString();
        if (_aspxTrim(strValue).length == 0)
            return true;
        var regEx = new RegExp(this.pattern);
        var matches = regEx.exec(strValue);
        return matches != null && strValue == matches[0];
    }
});

function _aspxIsEditorFocusable(inputElement) {
    return _aspxIsFocusableCore(inputElement, function(container) {
        return container.getAttribute("errorFrame") == "errorFrame";
    });
}

var __aspxInvalidEditorToBeFocused = null;

ASPxValidationType = {
    PersonalOnValueChanged: "ValueChanged",
    PersonalViaScript: "CalledViaScript",
    MassValidation: "MassValidation"
};
ASPxClientEdit = _aspxCreateClass(ASPxClientEditBase, {
    constructor: function(name) {
        this.constructor.prototype.constructor.call(this, name);
        
        this.isASPxClientEdit = true;
        
        this.inputElement = null;
        this.convertEmptyStringToNull = true;
        this.readOnly = false;
        
        // size correction
        this.widthCorrectionRequired = false;
        this.heightCorrectionRequired = false;
        
        // validation
        this.customValidationEnabled = false;
        this.initialErrorText = "";
        this.causesValidation = false;
        this.validateOnLeave = true;
        this.validationGroup = "";
        this.sendPostBackWithValidation = null;
        this.validationPatterns = null;
        this.setFocusOnError = false;
        this.errorDisplayMode = "it";
        this.errorText = "";
        this.isValid = true;
        this.errorImageIsAssigned = false;
        this.clientValidationStateElement = null;
        
        // Keyboard support
        this.enterProcessed = false;
        this.keyDownHandlers = {};
        this.keyPressHandlers = {};
        this.keyUpHandlers = {};
        this.specialKeyboardHandlingUsed = false;
        this.onKeyDownHandler = null;
        this.onKeyPressHandler = null;
        this.onKeyUpHandler = null;
        this.onGotFocusHandler = null;
        this.onLostFocusHandler = null;
        this.GotFocus = new ASPxClientEvent();
        this.LostFocus = new ASPxClientEvent();
        this.Validation = new ASPxClientEvent();
        this.ValueChanged = new ASPxClientEvent();
        
        this.KeyDown = new ASPxClientEvent();
        this.KeyPress = new ASPxClientEvent();
        this.KeyUp = new ASPxClientEvent();
    },
    Initialize: function() {
        this.initialErrorText = this.errorText;
        ASPxClientEditBase.prototype.Initialize.call(this);
        this.InitializeKeyHandlers();
        this.UpdateClientValidationState();
    },
    InitSpecialKeyboardHandling: function(){
        this.onKeyDownHandler = _aspxCreateEventHandlerFunction("aspxKBSIKeyDown", this.name, true);
        this.onKeyPressHandler = _aspxCreateEventHandlerFunction("aspxKBSIKeyPress", this.name, true);
        this.onKeyUpHandler = _aspxCreateEventHandlerFunction("aspxKBSIKeyUp", this.name, true);
        this.onGotFocusHandler = _aspxCreateEventHandlerFunction("aspxESGotFocus", this.name, false);
        this.onLostFocusHandler = _aspxCreateEventHandlerFunction("aspxESLostFocus", this.name, false);
        this.specialKeyboardHandlingUsed = true;
    },
    InitializeKeyHandlers: function() {
    },
    AddKeyDownHandler: function(key, handler) {
        this.keyDownHandlers[key] = handler;
    },
    ChangeSpecialInputEnabledAttributes: function(element, method){
        element.autocomplete = "off";
        if(this.onKeyDownHandler != null)
            method(element, "keydown", this.onKeyDownHandler);
        if(this.onKeyPressHandler != null)
            method(element, "keypress", this.onKeyPressHandler);
        if(this.onKeyUpHandler != null)
            method(element, "keyup", this.onKeyUpHandler);
        if(this.onGotFocusHandler != null)
            method(element, "focus", this.onGotFocusHandler);
        if(this.onLostFocusHandler != null)
            method(element, "blur", this.onLostFocusHandler);
    },
    UpdateClientValidationState: function() {
        var mainElement = this.GetMainElement();
        if (_aspxIsExists(mainElement)) {
            var hiddenField = this.GetClientValidationStateHiddenField();
            if(_aspxIsExists(hiddenField))
                hiddenField.value = !this.GetIsValid() ? ("-" + this.GetErrorText()) : "";
        }
    },

    FindInputElement: function(){
        return null;
    },
    GetElementBySuffix: function(suffix) {
        return _aspxGetElementById(this.name + suffix);
    },
    GetErrorImage: function() {
        return this.GetElementBySuffix(__aspxErrorImageSuffix);
    },
    GetErrorTextCell: function() {
        return this.GetElementBySuffix(this.errorImageIsAssigned ? __aspxErrorTextCellSuffix : __aspxErrorCellSuffix);
    },
    GetExternalTable: function(){
        return this.GetElementBySuffix(__aspxExternalTableSuffix);
    },
    GetInputElement: function(){
        if(!_aspxIsExistsElement(this.inputElement))
            this.inputElement = this.FindInputElement();
        return this.inputElement;
    },
    GetClientValidationStateHiddenField: function() {
        if(!_aspxIsExists(this.clientValidationStateElement))
            this.clientValidationStateElement = this.CreateClientValidationStateHiddenField();
        return this.clientValidationStateElement;
    },
    CreateClientValidationStateHiddenField: function() {
        var mainElement = this.GetMainElement();
        var hiddenField = document.createElement("INPUT");
        hiddenField.setAttribute("name", this.uniqueID + __aspxClientValidationStateNameSuffix);
        hiddenField.setAttribute("type", "hidden");
        mainElement.parentNode.appendChild(hiddenField);
        return hiddenField;
    },
    
    GetVisible: function(){
        return !this.customValidationEnabled ? ASPxClientControl.prototype.GetVisible.call(this) : 
            this.GetClientVisibleWithErrorFrame();
    },
    SetVisible: function(isVisible){
        if(this.customValidationEnabled)
            this.SetClientVisibleWithErrorFrame(isVisible);
        else
            ASPxClientControl.prototype.SetVisible.call(this, isVisible);
    },
    SetClientVisibleWithErrorFrame: function(isVisible) {
        if (this.clientVisible && isVisible || !this.clientVisible && !isVisible)
            return;
            
        var errorFrame = this.GetExternalTable();
        var mainElement = this.GetMainElement();
        if (!isVisible) {
            errorFrame.__aspxSavedClientVisibility = errorFrame.style.visibility;
            errorFrame.__aspxSavedClientDisplay = errorFrame.style.display;
            _aspxSetElementDisplay(errorFrame, false);
            _aspxSetElementDisplay(mainElement, false);
            this.clientVisible = false;
        } else {
            _aspxSetElementDisplay(mainElement, true);
            if (_aspxIsExists(errorFrame.__aspxSavedClientVisibility) && _aspxIsExists(errorFrame.__aspxSavedClientDisplay)) {
                errorFrame.style.visibility = errorFrame.__aspxSavedClientVisibility;
                errorFrame.style.display = errorFrame.__aspxSavedClientDisplay;
                errorFrame.__aspxSavedClientVisibility = void(0);
                errorFrame.__aspxSavedClientDisplay = void(0);
            }
            this.clientVisible = true;
        }
        if(this.updateErrorFrameOnShown) {
            delete this.updateErrorFrameOnShown;
            this.UpdateErrorFrame();
        }
        if (isVisible)
            this.AdjustControl(__aspxCheckSizeCorrectedFlag);
    },
    GetClientVisibleWithErrorFrame: function() {
        return this.clientVisible;
    },
    
    GetValueInputToValidate: function() {
        return this.GetInputElement();
    },
    IsVisible: function() {
        if (!this.clientVisible)
            return false;
        var element = this.GetMainElement();
        while(_aspxIsExists(element) && element.tagName != "BODY") {
            if (element.getAttribute("errorFrame") != "errorFrame" && (!_aspxGetElementVisibility(element) || !_aspxGetElementDisplay(element)))
                return false;
            element = element.parentNode;
        }
        return true;
    },
    // Size correction
    AdjustControlCore: function() {
        var mainElement = this.GetMainElement();
        var mainElementCurStyle = _aspxGetCurrentStyle(mainElement);
        // collapse control
        this.CollapseControl();
        // correct width
        if (this.widthCorrectionRequired && mainElementCurStyle.width != "" && mainElementCurStyle.width != "auto")
            this.CorrectEditorWidth();
        else
            this.UnstretchInputElement();
        // correct height
        if (this.heightCorrectionRequired)
            this.CorrectEditorHeight();
    },
    CorrectEditorWidth: function() {
    },
    CorrectEditorHeight: function() {
    },
    UnstretchInputElement: function() {
    },
    OnFocus: function() {
        if (!this.isInitialized || this.specialKeyboardHandlingUsed) return;
        this.RaiseFocus();
    },
    OnLostFocus: function() {
        if (!this.isInitialized || this.specialKeyboardHandlingUsed) return;
        this.RaiseLostFocus();
        if (this.validateOnLeave)
            this.SetFocusOnError();
    },
    OnSpecialFocus: function() {
        if (!this.isInitialized) return;
        this.RaiseFocus();
    },
    OnSpecialLostFocus: function() {
        if (!this.isInitialized) return;
        this.RaiseLostFocus();
        if (this.validateOnLeave)
            this.SetFocusOnError();
    },
    OnValidation: function(validationType) {
        if (this.customValidationEnabled && this.isInitialized && _aspxIsExistsElement(this.GetExternalTable())) {
            this.SetIsValid(true);
            this.SetErrorText(this.initialErrorText);
            if(this.validateOnLeave || validationType != ASPxValidationType.PersonalOnValueChanged) {
                this.ValidateWithPatterns();
                this.RaiseValidation();
            }
            this.UpdateErrorFrame(validationType == ASPxValidationType.PersonalOnValueChanged && this.validateOnLeave && !this.GetIsValid());
        }
    },
    OnValueChanged: function() {
        var processOnServer = this.RaiseValueChangedEvent();
        processOnServer = this.RaiseValidationInternal() && processOnServer;
        if (processOnServer)
            this.SendPostBackInternal("");
    },
    ParseValue: function() {
    },
    RaisePersonalStandardValidation: function() {
        if (_aspxIsFunction(window.ValidatorOnChange)) {
            var inputElement = this.GetValueInputToValidate();
            if (_aspxIsExists(inputElement.Validators))
                window.ValidatorOnChange({ srcElement: inputElement });
        }
    },
    RaiseValidationInternal: function() {
        if (this.autoPostBack && this.causesValidation && this.validateOnLeave)
            return ASPxClientEdit.ValidateGroup(this.validationGroup);
        else {
            this.OnValidation(ASPxValidationType.PersonalOnValueChanged);
            return this.GetIsValid();
        }
    },
    RaiseValueChangedEvent: function(){
        return this.RaiseValueChanged();
    },
    SendPostBackInternal: function(postBackArg) {
        if (_aspxIsFunction(this.sendPostBackWithValidation))
            this.sendPostBackWithValidation(postBackArg);
        else
            this.SendPostBack(postBackArg);
    },
    SetElementToBeFocused: function() {
        if (this.IsVisible())
            __aspxInvalidEditorToBeFocused = this;
    },
    SetFocus: function(){
        var inputElement = this.GetInputElement();
        if (_aspxGetActiveElement() != inputElement && _aspxIsEditorFocusable(inputElement)) 
            _aspxSetFocus(inputElement);
    },
    SetFocusOnError: function() {
        if (__aspxInvalidEditorToBeFocused == this) {
            this.SetFocus();
            __aspxInvalidEditorToBeFocused = null;
        }
    },
    UpdateErrorFrame: function(setFocusOnError) {
        var externalTable = this.GetExternalTable();
        if (this.GetIsValid()) {
            externalTable.style.visibility = "hidden";
        } else {
            if(this.IsVisible()) {
                this.UpdateErrorCellContent();
                externalTable.style.visibility = "visible";
                if (setFocusOnError && this.setFocusOnError && __aspxInvalidEditorToBeFocused == null)
                    this.SetElementToBeFocused();
            } else {
                // [Victor] Is a hidden editor is being validated, we must postpone
                // it's error frame update to the moment it will be shown.
                this.updateErrorFrameOnShown = true;
            }
        }
    },
    UpdateErrorCellContent: function() {
        if (this.errorDisplayMode.indexOf("t") > -1)
            this.UpdateErrorText();
        if (this.errorDisplayMode == "i")
            this.UpdateErrorImage();
    },
    UpdateErrorImage: function() {
        var image = this.GetErrorImage();
        if (_aspxIsExistsElement(image)) {
            image.alt = this.errorText;
            image.title = this.errorText;
        } else {
            this.UpdateErrorText();
        }
    },
    UpdateErrorText: function() {
        var errorTextCell = this.GetErrorTextCell();
        if (_aspxIsExistsElement(errorTextCell)) {
            if (_aspxIsExistsElement(errorTextCell.firstChild))
                errorTextCell.replaceChild(document.createTextNode(this.errorText), errorTextCell.firstChild);
            else
                errorTextCell.appendChild(document.createTextNode(this.errorText));
        }     
    },
    ValidateWithPatterns: function() {
        if (this.validationPatterns != null) {
            var value = this.GetValue();
            for (var i = 0; i < this.validationPatterns.length; i++) {
                var validator = this.validationPatterns[i];
                if (!validator.EvaluateIsValid(value)) {
                    this.SetIsValid(false);
                    this.SetErrorText(validator.errorText);
                    return;
                }
            }
        }
    },
    // Keyboard support
    OnSpecialKeyDown: function(evt){
        this.RaiseKeyDown(evt);
        
        var handler = this.keyDownHandlers[evt.keyCode];
        if(_aspxIsExists(handler)) 
            return this[handler](evt);
        return false;
    },
    OnSpecialKeyPress: function(evt){
        this.RaiseKeyPress(evt);
        
        var handler = this.keyPressHandlers[evt.keyCode];
        if(_aspxIsExists(handler)) 
            return this[handler](evt);
        if(__aspxNS || __aspxOpera){
            if(evt.keyCode == ASPxKeyConsts.KEY_ENTER)
                return this.enterProcessed;
        }
        return false;
    },
    OnSpecialKeyUp: function(evt){
        this.RaiseKeyUp(evt);
        
        var handler = this.keyUpHandlers[evt.keyCode];
        if(_aspxIsExists(handler)) 
            return this[handler](evt);
        return false;
    },
    OnKeyDown: function(evt) {
        if(!this.specialKeyboardHandlingUsed)
            this.RaiseKeyDown(evt);
    },
    OnKeyPress: function(evt) {
        if(!this.specialKeyboardHandlingUsed)
            this.RaiseKeyPress(evt);
    },
    OnKeyUp: function(evt) {
        if(!this.specialKeyboardHandlingUsed)
            this.RaiseKeyUp(evt);
    },
    // API
    RaiseKeyDown: function(evt){
        if(!this.KeyDown.IsEmpty()){
            var args = new ASPxClientEditKeyEventArgs(evt);
            this.KeyDown.FireEvent(this, args);
        }
    },
    RaiseKeyPress: function(evt){
        if(!this.KeyPress.IsEmpty()){
            var args = new ASPxClientEditKeyEventArgs(evt);
            this.KeyPress.FireEvent(this, args);
        }
    },
    RaiseKeyUp: function(evt){
        if(!this.KeyUp.IsEmpty()){
            var args = new ASPxClientEditKeyEventArgs(evt);
            this.KeyUp.FireEvent(this, args);
        }
    },
    RaiseFocus: function(){
        if(!this.GotFocus.IsEmpty()){
            var args = new ASPxClientEventArgs();
            this.GotFocus.FireEvent(this, args);
        }
    },
    RaiseLostFocus: function(){
        if(!this.LostFocus.IsEmpty()){
            var args = new ASPxClientEventArgs();
            this.LostFocus.FireEvent(this, args);
        }
    },
    RaiseValidation: function() {
        if (this.customValidationEnabled && !this.Validation.IsEmpty()) {
            var currentValue = this.GetValue();
            var args = new ASPxClientEditValidationEventArgs(currentValue, this.errorText, this.GetIsValid());
            this.Validation.FireEvent(this, args);
            this.SetErrorText(args.errorText);
            this.SetIsValid(args.isValid);
            if (args.value != currentValue)
                this.SetValue(args.value);
        }
    },
    RaiseValueChanged: function(){
        var processOnServer = this.autoPostBack;
        if(!this.ValueChanged.IsEmpty()){
            var args = new ASPxClientProcessingModeEventArgs(processOnServer);
            this.ValueChanged.FireEvent(this, args);
            processOnServer = args.processOnServer;
        }
        return processOnServer;  
    },
    Focus: function(){
        this.SetFocus();
    },
    GetIsValid: function(){
        // B95671: requires the external table existence check
        var externalTable = this.GetExternalTable();
        return _aspxIsExistsElement(externalTable) ? this.isValid : true;
    },
    GetErrorText: function(){
        return this.errorText;
    },
    SetIsValid: function(isValid){
        if (this.customValidationEnabled) {
            this.isValid = isValid;
            this.UpdateErrorFrame(false /* setFocusOnError */);
            this.UpdateClientValidationState();
        }
    },
    SetErrorText: function(errorText){
        if (this.customValidationEnabled) {
            this.errorText = errorText;
            this.UpdateErrorFrame(false /* setFocusOnError */);
            this.UpdateClientValidationState();
        }
    },
    Validate: function(){
        this.ParseValue();
        this.OnValidation(ASPxValidationType.PersonalViaScript);
    }
});
ASPxClientEdit.ClearEditorsInContainer = function(container, validationGroup, clearInvisibleEditors) {
    __aspxInvalidEditorToBeFocused = null;
    _aspxProcessEditorsInContainer(container, _aspxClearProcessingProc, _aspxClearChoiceCondition, validationGroup, clearInvisibleEditors);
}
ASPxClientEdit.ClearEditorsInContainerById = function(containerId, validationGroup, clearInvisibleEditors) {
    var container = document.getElementById(containerId);
    this.ClearEditorsInContainer(container, validationGroup, clearInvisibleEditors);
}
ASPxClientEdit.ClearGroup = function(validationGroup, clearInvisibleEditors) {
    return this.ClearEditorsInContainer(null, validationGroup, clearInvisibleEditors);
}
ASPxClientEdit.ValidateEditorsInContainer = function(container, validationGroup, validateInvisibleEditors) {
    return _aspxProcessEditorsInContainer(container, _aspxValidateProcessingProc, _aspxValidateChoiceCondition, validationGroup, validateInvisibleEditors);
}
ASPxClientEdit.ValidateEditorsInContainerById = function(containerId, validationGroup, validateInvisibleEditors) {
    var container = document.getElementById(containerId);
    return this.ValidateEditorsInContainer(container, validationGroup, validateInvisibleEditors);
}
ASPxClientEdit.ValidateGroup = function(validationGroup, validateInvisibleEditors) {
    return this.ValidateEditorsInContainer(null, validationGroup, validateInvisibleEditors);
}
ASPxClientEditValidationEventArgs = _aspxCreateClass(ASPxClientEventArgs, {
    constructor: function(value, errorText, isValid) {
        this.constructor.prototype.constructor.call(this);
        this.errorText = errorText;
        this.isValid = isValid;
        this.value = value;
    }
});

function aspxEGotFocus(name){
    var edit = aspxGetControlCollection().Get(name); 
    if(edit != null)
        edit.OnFocus();
}
function aspxELostFocus(name){
    var edit = aspxGetControlCollection().Get(name);
    if(edit != null) 
        edit.OnLostFocus();
}
function aspxESGotFocus(name){
    var edit = aspxGetControlCollection().Get(name); 
    if(edit != null)
        edit.OnSpecialFocus();
}
function aspxESLostFocus(name){
    var edit = aspxGetControlCollection().Get(name);
    if(edit != null) 
        edit.OnSpecialLostFocus();
}
function aspxEValueChanged(name){
    var edit = aspxGetControlCollection().Get(name);
    if(edit != null)
        edit.OnValueChanged();
}

// Keyboard Support
function aspxKBSIKeyDown(name, evt){
    var control = aspxGetControlCollection().Get(name);
    if(control != null){
        var isProcessed = control.OnSpecialKeyDown(evt);
        if(isProcessed)
            return _aspxPreventEventAndBubble(evt);
    }
}
function aspxKBSIKeyPress(name, evt){
    var control = aspxGetControlCollection().Get(name);
    if(control != null){
        var isProcessed = control.OnSpecialKeyPress(evt);
        if(isProcessed)
            return _aspxPreventEventAndBubble(evt);
    }
}
function aspxKBSIKeyUp(name, evt){
    var control = aspxGetControlCollection().Get(name);
    if(control != null){
        var isProcessed = control.OnSpecialKeyUp(evt);
        if(isProcessed)
            return _aspxPreventEventAndBubble(evt);
    }
}
function aspxEKeyDown(name, evt){
    var edit = aspxGetControlCollection().Get(name);
    if(edit != null) edit.OnKeyDown(evt);
}
function aspxEKeyPress(name, evt){
    var edit = aspxGetControlCollection().Get(name);
    if(edit != null) edit.OnKeyPress(evt);
}
function aspxEKeyUp(name, evt){
    var edit = aspxGetControlCollection().Get(name);
    if(edit != null) edit.OnKeyUp(evt);
}

function _aspxProcessEditorsInContainer(container, processingProc, choiceCondition, validationGroup, processInvisibleEditors) {
    var allProcessedSuccessfull = true;
    var firstFailured = null;
    var collection = aspxGetControlCollection();
    for (var key in collection.elements) {
        var control = collection.elements[key];
        if (control != null && ASPxIdent.IsASPxClientEdit(control)) {
            var mainElement = control.GetMainElement();
            if (_aspxIsExists(mainElement) &&
                (container == null || _aspxGetIsParent(container, mainElement)) &&
                (processInvisibleEditors || control.IsVisible()) &&
                choiceCondition(control, validationGroup)) {
                allProcessedSuccessfull = processingProc(control) && allProcessedSuccessfull;
                if (!allProcessedSuccessfull && control.setFocusOnError && firstFailured == null && control.IsVisible())
                    firstFailured = control;
            }
        }
    }
    if (firstFailured != null)
        firstFailured.SetFocus();
    return allProcessedSuccessfull;
}

function _aspxClearChoiceCondition(edit, validationGroup) {
    return !_aspxIsExists(validationGroup) || (edit.validationGroup == validationGroup);
}
function _aspxValidateChoiceCondition(edit, validationGroup) {
    return _aspxClearChoiceCondition(edit, validationGroup) && edit.customValidationEnabled;
}
function _aspxClearProcessingProc(edit) {
    edit.SetValue(null);
    edit.SetIsValid(true);
    return true;
}
function _aspxValidateProcessingProc(edit) {
    edit.OnValidation(ASPxValidationType.MassValidation);
    return edit.GetIsValid();
}