 var __aspxExternalTableSuffix="_ET";var __aspxErrorCellSuffix="_EC";var __aspxErrorTextCellSuffix="_ETC";var __aspxErrorImageSuffix="_EI";ASPxClientEditBase=_aspxCreateClass(ASPxClientControl,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);},InlineInitialize:function(){this.InitializeEnabled();},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)).toUpperCase()=="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;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 __aspxInvalidEditorElementToBeFocused=null;ASPxClientEdit=_aspxCreateClass(ASPxClientEditBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.isASPxClientEdit=true;this.inputElement=null;this.convertEmptyStringToNull=true;this.widthCorrectionRequired=false;this.heightCorrectionRequired=false;this.customValidationEnabled=false;this.initialErrorText="";this.causesValidation=false;this.readOnly=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.enterProcessed=false;this.keyDownHandlers={};this.keyPressHandlers={};this.keyUpHandlers={};this.specialKeyboardHandlingUsed=false;this.onKeyDownHandler=null;this.onKeyPressHandler=null;this.onKeyUpHandler=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();},InitSpecialKeyboardHandling:function(){this.onKeyDownHandler=_aspxCreateEventHandlerFunction("aspxKBSIKeyDown",this.name,true);this.onKeyPressHandler=_aspxCreateEventHandlerFunction("aspxKBSIKeyPress",this.name,true);this.onKeyUpHandler=_aspxCreateEventHandlerFunction("aspxKBSIKeyUp",this.name,true);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);},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;},GetClientVisible:function(){return!this.customValidationEnabled?ASPxClientControl.prototype.GetClientVisible.call(this):this.GetClientVisibleWithErrorFrame();},SetClientVisible:function(isVisible){if(this.customValidationEnabled)this.SetClientVisibleWithErrorFrame(isVisible);else ASPxClientControl.prototype.SetClientVisible.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(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;},AdjustControlCore:function(){var mainElement=this.GetMainElement();var mainElementCurStyle=_aspxGetCurrentStyle(mainElement);this.CollapseControl();if(this.widthCorrectionRequired&&mainElementCurStyle.width!=""&&mainElementCurStyle.width!="auto")this.CorrectEditorWidth();else this.UnstretchInputElement();if(this.heightCorrectionRequired)this.CorrectEditorHeight();},CorrectEditorWidth:function(){},CorrectEditorHeight:function(){},UnstretchInputElement:function(){},OnFocus:function(){if(!this.isInitialized)return;this.RaiseFocus();},OnLostFocus:function(){if(!this.isInitialized)return;this.RaiseLostFocus();if(this.validateOnLeave)this.SetFocusOnError();},OnValidation:function(isPersonalValidation){if(!this.isInitialized||!this.customValidationEnabled||!this.IsVisible())return;this.errorText=this.initialErrorText;this.isValid=true;this.ValidateWithPatterns();this.RaiseValidation();if(!isPersonalValidation)this.UpdateErrorFrame();else if(this.validateOnLeave||this.isValid)this.UpdateErrorFrame(!this.validateOnLeave);},OnValueChanged:function(){var processOnServer=this.RaiseValueChangedEvent();processOnServer=this.RaiseValidationInternal(true)&&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(isPersonalValidation){if(this.autoPostBack&&this.causesValidation&&this.validateOnLeave)return ASPxClientEdit.ValidateGroup(this.validationGroup);else{this.OnValidation(isPersonalValidation);return this.isValid;}},RaiseValueChangedEvent:function(){return this.RaiseValueChanged();},SendPostBackInternal:function(postBackArg){if(_aspxIsFunction(this.sendPostBackWithValidation))this.sendPostBackWithValidation(postBackArg);else this.SendPostBack(postBackArg);},SetElementToBeFocused:function(){var input=this.GetInputElement();if(_aspxIsExistsElement(input)&&_aspxIsExists(input.focus)&&this.IsVisible())__aspxInvalidEditorElementToBeFocused=input;},SetFocus:function(){var inputElement=this.GetInputElement();if(_aspxGetActiveElement()!=inputElement&&_aspxIsEditorFocusable(inputElement))_aspxSetFocus(inputElement);},SetFocusOnError:function(){var input=this.GetInputElement();if(__aspxInvalidEditorElementToBeFocused==input){input.focus();__aspxInvalidEditorElementToBeFocused=null;}},UpdateErrorFrame:function(doNotFocusOnError){var externalTable=this.GetExternalTable();if(this.isValid){externalTable.style.visibility="hidden";}else{this.UpdateErrorCellContent();externalTable.style.visibility="visible";if(!doNotFocusOnError&&this.setFocusOnError&&__aspxInvalidEditorElementToBeFocused==null)this.SetElementToBeFocused();}},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.isValid=false;this.errorText=validator.errorText;return;}}}},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);},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.isValid);this.Validation.FireEvent(this,args);this.errorText=args.errorText;this.isValid=args.isValid;if(currentValue!=args.value)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(){return this.isValid;},GetErrorText:function(){return this.errorText;},SetIsValid:function(isValid){if(this.customValidationEnabled){this.isValid=isValid;this.UpdateErrorFrame();}},SetErrorText:function(errorText){if(this.customValidationEnabled){this.errorText=errorText;this.UpdateErrorFrame();}},Validate:function(){this.ParseValue();this.OnValidation();}});ASPxClientEdit.ClearEditorsInContainer=function(container,validationGroup){__aspxInvalidEditorElementToBeFocused=null;_aspxProcessEditorsInContainer(container,_aspxClearProcessingProc,_aspxClearChoiceCondition,validationGroup);}
ASPxClientEdit.ClearEditorsInContainerById=function(containerId,validationGroup){var container=document.getElementById(containerId);if(container!=null)this.ClearEditorsInContainer(container,validationGroup);}
ASPxClientEdit.ClearGroup=function(validationGroup){return this.ClearEditorsInContainer(null,validationGroup);}
ASPxClientEdit.ValidateEditorsInContainer=function(container,validationGroup){var isValid=_aspxProcessEditorsInContainer(container,_aspxValidateProcessingProc,_aspxValidateChoiceCondition,validationGroup);return isValid;}
ASPxClientEdit.ValidateEditorsInContainerById=function(containerId,validationGroup){var container=document.getElementById(containerId);return(container!=null)?this.ValidateEditorsInContainer(container,validationGroup):true;}
ASPxClientEdit.ValidateGroup=function(validationGroup){return this.ValidateEditorsInContainer(null,validationGroup);}
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 aspxEValueChanged(name){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.OnValueChanged();}
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){var allProcessedSuccessfull=true;var firstFailured=null;__aspxInvalidEditorElementToBeFocused="lock";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))&&choiceCondition(control,validationGroup)){allProcessedSuccessfull=processingProc(control)&&allProcessedSuccessfull;if(!allProcessedSuccessfull&&control.setFocusOnError&&firstFailured==null&&control.IsVisible())firstFailured=control.GetInputElement();}}}if(firstFailured!=null)firstFailured.focus();__aspxInvalidEditorElementToBeFocused=firstFailured;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();return edit.isValid;}