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);},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;}});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){return(value!=null)&&(value!="");}});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(this.Trim(strValue).length==0)return true;var regEx=new RegExp(this.pattern);var matches=regEx.exec(strValue);return(matches!=null&&strValue==matches[0]);},Trim:function(str){var match=str.match("^\\s*(\\S+(\\s+\\S+)*)\\s*$");return(match==null)?"":match[1];}});var __aspxInvalidEditorElementToBeFocused=null;ASPxClientEdit=_aspxCreateClass(ASPxClientEditBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.inputElement=null;this.initialErrorText="";this.causesValidation=false;this.validationGroup="";this.sendPostBackWithValidation=null;this.customValidationEnabled=false;this.validationPatterns=null;this.setFocusOnError=false;this.errorDisplayMode="t";this.errorText="";this.isValid=true;this.errorImageIsAssigned=false;this.convertEmptyStringToNull=true;this.needInputElementCorrect=false;this.needApplyVerticalStretch=false;this.inputElementCorrected=false;this.GotFocus=new ASPxClientEvent();this.LostFocus=new ASPxClientEvent();this.Validation=new ASPxClientEvent();this.ValueChanged=new ASPxClientEvent();},Initialize:function(){this.initialErrorText=this.errorText;this.constructor.prototype.Initialize.call(this);if(this.needInputElementCorrect){var element=this.GetMainElement();if(_aspxIsExists(element)){if(element.style.width!=""){if(element.offsetWidth==0)element.onresize=new Function("aspxEResize(\""+this.name+"\");");else this.CorrectInputElement();}else{this.UnstretchInputElement();}}}if(this.needApplyVerticalStretch){var element=this.GetMainElement();if(_aspxIsExists(element))this.ApplyVerticalStretch();}},FindInputElement:function(){return null;},GetElementBySuffix:function(suffix){return _aspxGetElementById(this.name+suffix);},GetErrorImage:function(){return this.GetElementBySuffix(__aspxErrorImageSuffix);},GetErrorTextCell:function(){var suffix;if(this.errorImageIsAssigned)suffix=__aspxErrorTextCellSuffix;else suffix=__aspxErrorCellSuffix;return this.GetElementBySuffix(suffix);},GetExternalTable:function(){return this.GetElementBySuffix(__aspxExternalTableSuffix);},GetInputElement:function(){if(!_aspxIsExistsElement(this.inputElement))this.inputElement=this.FindInputElement();return this.inputElement;},GetValueInputToValidate:function(){return this.GetInputElement();},IsVisible:function(){return this.IsElementInVisibleContainer(this.GetInputElement());},IsElementInVisibleContainer:function(element){if(_aspxIsExists(element.style)&&(_aspxIsExists(element.style.display)&&element.style.display=="none"||_aspxIsExists(element.style.visibility)&&element.style.visibility=="hidden")){return false;}else if(_aspxIsExistsElement(element.parentNode)&&element.parentNode!=element){return this.IsElementInVisibleContainer(element.parentNode);}return true;},CorrectInputElement:function(){if(this.inputElementCorrected)return;this.inputElementCorrected=true;this.ResetInputElementWidth();this.AdjustInputElementWidth();},AdjustInputElementWidth:function(){},ResetInputElementWidth:function(){},UnstretchInputElement:function(){},OnResize:function(){this.CorrectInputElement();},OnFocus:function(){if(!this.isInitialized)return;if(_aspxIsExists(this.RaiseFocus)){this.RaiseFocus();}},OnLostFocus:function(){if(!this.isInitialized)return;if(_aspxIsExists(this.RaiseLostFocus)){this.RaiseLostFocus();}
this.SetFocusOnError();},OnValidation:function(){if(!this.isInitialized||!this.customValidationEnabled)return;this.errorText=this.initialErrorText;this.isValid=true;this.ValidateWithPatterns();if(_aspxIsExists(this.RaiseValidation))this.RaiseValidation();this.Update();},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();var evt={srcElement:inputElement};window.ValidatorOnChange(evt);}},RaiseValidationInternal:function(){if(this.autoPostBack&&this.causesValidation)return ASPxClientEdit.ValidateGroup(this.validationGroup);else{this.OnValidation();return this.isValid;}},RaiseValueChangedEvent:function(){if(_aspxIsExists(this.RaiseValueChanged))return this.RaiseValueChanged();return this.autoPostBack;},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(document.activeElement!=inputElement&&_aspxIsFocusable(inputElement))inputElement.focus();},SetFocusOnError:function(){var input=this.GetInputElement();if(__aspxInvalidEditorElementToBeFocused==input){input.focus();__aspxInvalidEditorElementToBeFocused=null;}},Update:function(){var externalTable=this.GetExternalTable();if(this.isValid){externalTable.style.visibility="hidden";}else{this.UpdateErrorText();externalTable.style.visibility="visible";if(this.setFocusOnError&&__aspxInvalidEditorElementToBeFocused==null)this.SetElementToBeFocused();}},UpdateErrorText:function(){this.UpdateErrorTextInternal(this.errorDisplayMode);},UpdateErrorTextInternal:function(displayMode){switch(displayMode){case "t":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));}break;case "i":var image=this.GetErrorImage();if(_aspxIsExistsElement(image)){image.alt=this.errorText;image.title=this.errorText;}else{this.UpdateErrorTextInternal("t");}break;}},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;}}}}});ASPxClientEdit.ValidateEditorsInContainer=function(container,validationGroup){var isValid=_aspxProcessEditorsInContainer(container,_aspxValidateProcessingProc,_aspxValidateChoiceCondition,validationGroup);return isValid;}
ASPxClientEdit.ValidateGroup=function(validationGroup){return this.ValidateEditorsInContainer(null,validationGroup);}
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 aspxEResize(name){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.OnResize();}
_aspxElementIsChildOfParent=function(element,parent){if(element==null)return false;if(parent==null)return true;if(!_aspxIsExistsElement(element.parentNode))return false;return(element.parentNode==parent||_aspxElementIsChildOfParent(element.parentNode,parent));}
_aspxProcessEditorsInContainer=function(container,processingProc,choiceCondition,validationGroup){var allProcessedSuccessfull=true;var firstFailured=null;__aspxInvalidEditorElementToBeFocused="lock";var collection=aspxGetControlCollection();for(var key in collection.elements){var element=collection.elements[key];if(element!=null&&ASPxClientEdit.prototype.isPrototypeOf(element)){var inputElement=element.GetInputElement();if(_aspxElementIsChildOfParent(element.GetMainElement(),container)&&choiceCondition(element,validationGroup)){allProcessedSuccessfull=processingProc(element)&&allProcessedSuccessfull;if(!allProcessedSuccessfull&&element.setFocusOnError&&(firstFailured==null))firstFailured=inputElement;}}}if(firstFailured!=null)firstFailured.focus();__aspxInvalidEditorElementToBeFocused=firstFailured;return allProcessedSuccessfull;}
_aspxClearChoiceCondition=function(edit,validationGroup){return!_aspxIsExists(validationGroup)||(edit.validationGroup==validationGroup);}
_aspxValidateChoiceCondition=function(edit,validationGroup){return _aspxClearChoiceCondition(edit,validationGroup)&&edit.customValidationEnabled;}
_aspxClearProcessingProc=function(edit){edit.SetValue(null);edit.SetIsValid(true);return true;}
_aspxValidateProcessingProc=function(edit){edit.OnValidation();return edit.isValid;}