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){if((typeof(value)).toUpperCase()=="BOOLEAN")return value;else return(value!=null)&&(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.inputElement=null;this.convertEmptyStringToNull=true;this.widthCorrectionRequired=false;this.heightCorrectionRequired=false;this.initialErrorText="";this.causesValidation=false;this.validationGroup="";this.sendPostBackWithValidation=null;this.customValidationEnabled=false;this.validationPatterns=null;this.setFocusOnError=false;this.errorDisplayMode="it";this.errorText="";this.isValid=true;this.errorImageIsAssigned=false;this.GotFocus=new ASPxClientEvent();this.LostFocus=new ASPxClientEvent();this.Validation=new ASPxClientEvent();this.ValueChanged=new ASPxClientEvent();},AfterInitialize:function(){this.CorrectSize(__aspxCheckSizeCorrectedFlag);this.constructor.prototype.AfterInitialize.call(this);},Initialize:function(){this.initialErrorText=this.errorText;this.constructor.prototype.Initialize.call(this);},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;},GetValueInputToValidate:function(){return this.GetInputElement();},IsDisplayed:function(){var element=this.GetMainElement();while(element!=null&&element.tagName!="BODY"){if(!_aspxGetElementDisplay(element))return false;element=_aspxGetParentNode(element);}return true;},IsVisible:function(){return this.IsElementInVisibleContainer(this.GetMainElement());},IsElementInVisibleContainer:function(element){var curElement=element;while(_aspxIsExists(curElement)&&_aspxIsExists(curElement.tagName)&&curElement.tagName!="BODY"){if(curElement.getAttribute("errorFrame")!="errorFrame"){if(_aspxIsExists(curElement.style.display)&&curElement.style.display=="none"||_aspxIsExists(curElement.style.visibility)&&curElement.style.visibility=="hidden"){return false;}}
curElement=curElement.parentNode;}return true;},CorrectSize:function(checkSizeCorrectedFlag){if(checkSizeCorrectedFlag&&this.sizeCorrectedOnce)return;var mainElement=this.GetMainElement();if(!_aspxIsExists(mainElement)||!this.IsVisible())return;var mainElementCurStyle=_aspxGetCurrentStyle(mainElement);this.CollapseControl(checkSizeCorrectedFlag);if(this.widthCorrectionRequired&&mainElementCurStyle.width!=""&&mainElementCurStyle.width!="auto")this.CorrectEditorWidth();else this.UnstretchInputElement();if(this.heightCorrectionRequired)this.CorrectEditorHeight();this.sizeCorrectedOnce=true;},CorrectEditorWidth:function(){},CorrectEditorHeight:function(){},UnstretchInputElement:function(){},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||!this.IsVisible())return;this.errorText=this.initialErrorText;this.isValid=true;this.ValidateWithPatterns();if(_aspxIsExists(this.RaiseValidation))this.RaiseValidation();this.UpdateErrorFrame();},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)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.FindInputElement();if(_aspxGetActiveElement()!=inputElement&&_aspxIsEditorFocusable(inputElement))_aspxSetFocus(inputElement);},SetFocusOnError:function(){var input=this.GetInputElement();if(__aspxInvalidEditorElementToBeFocused==input){input.focus();__aspxInvalidEditorElementToBeFocused=null;}},UpdateErrorFrame:function(){var externalTable=this.GetExternalTable();if(this.isValid){externalTable.style.visibility="hidden";}else{this.UpdateErrorCellContent();externalTable.style.visibility="visible";if(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;}}}}});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 _aspxAttachKBSupportEventsToElement(element,controlName){_aspxAttachEventToElement(element,"keydown",_aspxCreateEventHandlerFunction("aspxKBSIKeyDown",controlName,true));if(__aspxNS||__aspxOpera)_aspxAttachEventToElement(element,"keypress",_aspxCreateEventHandlerFunction("aspxKBSIKeyPress",controlName,true));_aspxAttachEventToElement(element,"focus",_aspxCreateEventHandlerFunction("aspxKBSOnFocus",controlName,false));_aspxAttachEventToElement(element,"blur",_aspxCreateEventHandlerFunction("aspxKBSOnBlur",controlName,false));}
function aspxKBSIKeyPress(name,evt){var control=aspxGetControlCollection().Get(name);if(control!=null){var isProcessed=false;switch(evt.keyCode){case 13:if(control.OnEnter)isProcessed=_aspxIsExists(control.enterProcessed)&&control.enterProcessed;break;}if(isProcessed)return _aspxPreventEventAndBubble(evt);}}
function aspxKBSIKeyDown(name,evt){var control=aspxGetControlCollection().Get(name);if(control!=null){var isProcessed=false;switch(evt.keyCode){case 13:if(control.OnEnter)isProcessed=control.OnEnter(evt);control.enterProcessed=isProcessed;break;case 27:if(control.OnEscape)isProcessed=control.OnEscape();break;case 33:if(control.OnPageUp)isProcessed=control.OnPageUp(evt);break;case 34:if(control.OnPageDown)isProcessed=control.OnPageDown(evt);break;case 35:if(control.OnEndKeyDown)isProcessed=control.OnEndKeyDown(evt);break;case 36:if(control.OnHomeKeyDown)isProcessed=control.OnHomeKeyDown(evt);break;case 37:if(control.OnArrowLeft)isProcessed=control.OnArrowLeft(evt);break;case 38:if(control.OnArrowUp)isProcessed=control.OnArrowUp(evt);break;case 39:if(control.OnArrowRight)isProcessed=control.OnArrowRight(evt);break;case 40:if(control.OnArrowDown)isProcessed=control.OnArrowDown(evt);break;}if(!isProcessed&&control.OnKBSKeyDown)isProcessed=control.OnKBSKeyDown(evt);if(isProcessed)return _aspxPreventEventAndBubble(evt);}}
function aspxKBSOnFocus(name){aspxKBSSetFocused(name,true);}
function aspxKBSOnBlur(name){aspxKBSSetFocused(name,false);}
function aspxKBSSetFocused(name,isFocused){var control=aspxGetControlCollection().Get(name);if(control!=null&&_aspxIsExists(control.OnSetFocus))control.OnSetFocus(isFocused);}
_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;}