var __aspxClientValidationStateNameSuffix="$CVS";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){return value!=null&&(value.constructor==Array||_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"};ASPxErrorFrameDisplay={Static:"Static",Dynamic:"Dynamic"};ASPxEditElementSuffix={ExternalTable:"_ET",ControlCell:"_CC",ErrorCell:"_EC",ErrorTextCell:"_ETC",ErrorImage:"_EI"};ASPxClientEdit=_aspxCreateClass(ASPxClientEditBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.isASPxClientEdit=true;this.inputElement=null;this.elementCache={};this.convertEmptyStringToNull=true;this.readOnly=false;this.focused=false;this.focusEventsLocked=false;this.widthCorrectionRequired=false;this.heightCorrectionRequired=false;this.customValidationEnabled=false;this.display=ASPxErrorFrameDisplay.Static;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;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()):"";}},GetCachedElementByIdSuffix:function(idSuffix){var element=this.elementCache[idSuffix];if(!_aspxIsExistsElement(element)){element=_aspxGetElementById(this.name+idSuffix);this.elementCache[idSuffix]=element;}return element;},FindInputElement:function(){return null;},GetInputElement:function(){if(!_aspxIsExistsElement(this.inputElement))this.inputElement=this.FindInputElement();return this.inputElement;},GetErrorImage:function(){return this.GetCachedElementByIdSuffix(ASPxEditElementSuffix.ErrorImage);},GetExternalTable:function(){return this.GetCachedElementByIdSuffix(ASPxEditElementSuffix.ExternalTable);},GetControlCell:function(){return this.GetCachedElementByIdSuffix(ASPxEditElementSuffix.ControlCell);},GetErrorCell:function(){return this.GetCachedElementByIdSuffix(ASPxEditElementSuffix.ErrorCell);},GetErrorTextCell:function(){return this.GetCachedElementByIdSuffix(this.errorImageIsAssigned?ASPxEditElementSuffix.ErrorTextCell:ASPxEditElementSuffix.ErrorCell);},GetClientValidationStateHiddenField:function(){if(!_aspxIsExists(this.clientValidationStateElement))this.clientValidationStateElement=this.CreateClientValidationStateHiddenField();return this.clientValidationStateElement;},CreateClientValidationStateHiddenField:function(){var mainElement=this.GetMainElement();var hiddenField=_aspxCreateHiddenField(this.uniqueID+__aspxClientValidationStateNameSuffix);mainElement.parentNode.appendChild(hiddenField);return hiddenField;},SetVisible:function(isVisible){if(this.clientVisible==isVisible)return;if(this.customValidationEnabled){var errorFrame=this.GetExternalTable();if(_aspxIsExists(errorFrame)){if(isVisible){_aspxSetElementDisplay(errorFrame,true);this.UpdateErrorFrameAndFocus(false,true);}else{_aspxSetElementDisplay(errorFrame,false);}}} ASPxClientControl.prototype.SetVisible.call(this,isVisible);},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(){},IsFocusEventsLocked:function(){return this.focusEventsLocked;},LockFocusEvents:function(){if(!this.focused)return;this.focusEventsLocked=true;},UnlockFocusEvents:function(){this.focusEventsLocked=false;},OnFocusCore:function(){if(!this.IsFocusEventsLocked()){this.focused=true;this.RaiseFocus();}else this.UnlockFocusEvents();},OnLostFocusCore:function(){if(!this.IsFocusEventsLocked()){this.focused=false;this.RaiseLostFocus();if(this.validateOnLeave)this.SetFocusOnError();}},OnFocus:function(){if(this.isInitialized&&!this.specialKeyboardHandlingUsed)this.OnFocusCore();},OnLostFocus:function(){if(this.isInitialized&&!this.specialKeyboardHandlingUsed)this.OnLostFocusCore();},OnSpecialFocus:function(){if(this.isInitialized)this.OnFocusCore();},OnSpecialLostFocus:function(){if(this.isInitialized)this.OnLostFocusCore();},OnValidation:function(validationType){if(this.customValidationEnabled&&this.isInitialized&&_aspxIsExistsElement(this.GetExternalTable())){this.BeginErrorFrameUpdate();try{this.SetIsValid(true);this.SetErrorText(this.initialErrorText);if(this.validateOnLeave||validationType!=ASPxValidationType.PersonalOnValueChanged){this.ValidateWithPatterns();this.RaiseValidation();} this.UpdateErrorFrameAndFocus(validationType==ASPxValidationType.PersonalOnValueChanged&&this.validateOnLeave&&!this.GetIsValid());} finally{this.EndErrorFrameUpdate();}}},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;}},BeginErrorFrameUpdate:function(){if(!this.errorFrameUpdateLocked)this.errorFrameUpdateLocked=true;},EndErrorFrameUpdate:function(){this.errorFrameUpdateLocked=false;var args=this.updateErrorFrameAndFocusLastCallArgs;if(args){this.UpdateErrorFrameAndFocus(args[0],args[1]);delete this.updateErrorFrameAndFocusLastCallArgs;}},UpdateErrorFrameAndFocus:function(setFocusOnError,ignoreVisibilityCheck){if(this.errorFrameUpdateLocked){this.updateErrorFrameAndFocusLastCallArgs=[setFocusOnError,ignoreVisibilityCheck];return;} var externalTable=this.GetExternalTable();var isStaticDisplay=this.display==ASPxErrorFrameDisplay.Static;if(this.GetIsValid()){if(isStaticDisplay){externalTable.style.visibility="hidden";}else{this.HideErrorCell();this.SaveErrorFrameStyles();this.ClearErrorFrameElementsStyles();}}else{if(ignoreVisibilityCheck||this.IsVisible()){if(__aspxIE&&!isStaticDisplay)this.CollapseControl();this.UpdateErrorCellContent();if(isStaticDisplay){externalTable.style.visibility="visible";}else{this.EnsureErrorFrameStylesLoaded();this.RestoreErrorFrameElementsStyles();this.ShowErrorCell();}if(__aspxIE&&!isStaticDisplay)this.AdjustControl();if(setFocusOnError&&this.setFocusOnError&&__aspxInvalidEditorToBeFocused==null)this.SetElementToBeFocused();}}},ShowErrorCell:function(){var errorCell=this.GetErrorCell();if(_aspxIsExists(errorCell))_aspxSetElementDisplay(errorCell,true);},HideErrorCell:function(){var errorCell=this.GetErrorCell();if(_aspxIsExists(errorCell))_aspxSetElementDisplay(errorCell,false);},SaveErrorFrameStyles:function(){this.EnsureErrorFrameStylesLoaded();},EnsureErrorFrameStylesLoaded:function(){if(typeof(this.errorFrameStyles)=="undefined"){var externalTable=this.GetExternalTable();var controlCell=this.GetControlCell();this.errorFrameStyles={errorFrame:{cssClass:externalTable.className,style:this.ExtractElementStyleStringIgnoringVisibilityProps(externalTable)},controlCell:{cssClass:controlCell.className,style:this.ExtractElementStyleStringIgnoringVisibilityProps(controlCell)}};}},ClearErrorFrameElementsStyles:function(){this.ClearElementStyle(this.GetExternalTable());this.ClearElementStyle(this.GetControlCell());},RestoreErrorFrameElementsStyles:function(){var externalTable=this.GetExternalTable();externalTable.className=this.errorFrameStyles.errorFrame.cssClass;externalTable.style.cssText=this.errorFrameStyles.errorFrame.style;var controlCell=this.GetControlCell();controlCell.className=this.errorFrameStyles.controlCell.cssClass;controlCell.style.cssText=this.errorFrameStyles.controlCell.style;},ExtractElementStyleStringIgnoringVisibilityProps:function(element){var savedVisibility=element.style.visibility;var savedDisplay=element.style.display;element.style.visibility="";element.style.display="";var styleStr=element.style.cssText;element.style.visibility=savedVisibility;element.style.display=savedDisplay;return styleStr;},ClearElementStyle:function(element){if(!_aspxIsExists(element))return;element.className="";var savedVisibility=element.style.visibility;var savedDisplay=element.style.display;var savedWidth=element.style.width;element.style.cssText="";element.style.visibility=savedVisibility;element.style.display=savedDisplay;element.style.width=savedWidth;},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;itextLen)endPos=textLen;if(startPos>textLen)startPos=textLen;if(startPos>endPos)return;_aspxSetSelectionCore(inputElement,startPos,endPos);if(scrollToSelection&&inputElement.tagName=='TEXTAREA'){var scrollHeight=inputElement.scrollHeight;var approxCaretPos=startPos;var scrollTop=Math.max(Math.round(approxCaretPos*scrollHeight/textLen-inputElement.clientHeight/2),0);inputElement.scrollTop=scrollTop;}} function _aspxSetCaretPosition(inputElement,caretPos,scrollToSelection){if(!scrollToSelection)scrollToSelection=true;if(caretPos==-1)caretPos=inputElement.value.length;_aspxSetSelection(inputElement,caretPos,caretPos,scrollToSelection);} var __aspxItemAttrsSeparator="::";var __aspxItemsSeparator=";;";var __aspxLoadRangeItemsCallbackPrefix="LBCRI";var __aspxLBIPostfixes=['I','T'];var __aspxLBIIdSuffix="LBI";var __aspxLBSIIdSuffix=__aspxLBIIdSuffix+"-1";var __aspxLBTSIdSuffix="_TS";var __aspxLBBSIdSuffix="_BS";var __aspxLTableIdSuffix="_LBT";var __aspxLEVISuffix="_VI";var __aspxLBDSuffix="_D";var __aspxEmptyItemsRange="0:-1";var __aspxNbsp=" ";var __aspxNbspChar=String.fromCharCode(160);var __aspxCachedHoverItemKind="cached"+__aspxHoverItemKind;var __aspxCachedSelectedItemKind="cached"+__aspxSelectedItemKind;ASPxClientListEdit=_aspxCreateClass(ASPxClientEdit,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.SelectedIndexChanged=new ASPxClientEvent();this.savedSelectedIndex=-1;},RaiseValueChangedEvent:function(){var processOnServer=ASPxClientEdit.prototype.RaiseValueChangedEvent.call(this);processOnServer=this.RaiseSelectedIndexChanged(processOnServer);return processOnServer;},FindInputElement:function(){return this.FindStateInputElement();},FindStateInputElement:function(){return document.getElementById(this.name+__aspxLEVISuffix);},GetItemValue:function(index){throw "Not implemented";},GetValue:function(){return this.GetItemValue(this.GetSelectedIndexInternal());},GetSelectedIndexInternal:function(){return this.savedSelectedIndex;},SetSelectedIndexInternal:function(index){this.savedSelectedIndex=index;},RaiseItemDoubleClick:function(){var processOnServer=this.autoPostBack;if(!this.ItemDoubleClick.IsEmpty()){var args=new ASPxClientProcessingModeEventArgs(processOnServer);this.ItemDoubleClick.FireEvent(this,args);processOnServer=args.processOnServer;}return processOnServer;},RaiseSelectedIndexChanged:function(processOnServer){if(!this.SelectedIndexChanged.IsEmpty()){var args=new ASPxClientProcessingModeEventArgs(processOnServer);this.SelectedIndexChanged.FireEvent(this,args);processOnServer=args.processOnServer;}return processOnServer;},UpdateHiddenInputs:function(index){var element=this.FindStateInputElement();if(_aspxIsExistsElement(element)){var value=this.GetItemValue(index);if(value==null)value="";element.value=value;}},GetSelectedItem:function(){var index=this.GetSelectedIndexInternal();return this.GetItem(index);},GetSelectedIndex:function(){return this.GetSelectedIndexInternal();},SetSelectedItem:function(item){var index=(item!=null)?item.index:-1;this.SelectIndexSilent(index);},SetSelectedIndex:function(index){this.SelectIndexSilent(index);}});ASPxClientListEditItem=_aspxCreateClass(null,{constructor:function(listEditBase,index,text,value,imageUrl){this.listEditBase=listEditBase;this.index=index;this.imageUrl=imageUrl;this.text=text;this.value=value;}});_aspxListBoxScrollCallbackHelperBase=_aspxCreateClass(null,{constructor:function(listBoxControl){this.listBoxControl=listBoxControl;this.itemsRange="";this.defaultItemsRange="0:"+(this.listBoxControl.callbackPageSize-1);},OnScroll:function(){},Reset:function(){},IsScrolledToTopSpacer:function(){return false;},IsScrolledToBottomSpacer:function(){return false;},GetIsNeedToHideTopSpacer:function(){return false;},GetIsNeedCallback:function(){return false;},GetItemsRangeForLoad:function(){return this.defaultItemsRange;},SetItemsRangeForLoad:function(){}});_aspxListBoxScrollCallbackHelper=_aspxCreateClass(_aspxListBoxScrollCallbackHelperBase,{constructor:function(listBoxControl){this.constructor.prototype.constructor.call(this,listBoxControl);this.isScrolledToTopSpacer=false;this.isScrolledToBottomSpacer=false;},OnScroll:function(){this.DetectScrollDirection();this.ResetItemsRange();if(this.GetIsAnySpacerVisible())this.RecalcItemsRangeForLoad();},DetectScrollDirection:function(){var listBoxControl=this.listBoxControl;var divElement=listBoxControl.GetScrollDivElement();var listTable=listBoxControl.GetListTable();var scrollTop=divElement.scrollTop;var scrollBottom=divElement.scrollTop+divElement.clientHeight;var isTopSpacerVisible=listBoxControl.GetScrollSpacerVisibility(true);var isBottomSpacerVisible=listBoxControl.GetScrollSpacerVisibility(false);var topSpacerHeight=listBoxControl.isTopSpacerVisible?parseInt(listBoxControl.GetScrollSpacerElement(true).clientHeight):0;this.isScrolledToTopSpacer=(scrollTop=topSpacerHeight+listTable.clientHeight)&&isBottomSpacerVisible;},Reset:function(){this.ResetItemsRange();this.isScrolledToTopSpacer=false;this.isScrolledToBottomSpacer=false;},ResetItemsRange:function(){this.itemsRange="";},RecalcItemsRangeForLoad:function(){if(this.listBoxControl.isCallbackMode){if(this.isScrolledToTopSpacer||this.isScrolledToBottomSpacer)this.SetItemsRangeForLoad(this.isScrolledToTopSpacer);}},IsScrolledToTopSpacer:function(){return this.isScrolledToTopSpacer;},IsScrolledToBottomSpacer:function(){return this.isScrolledToBottomSpacer;},GetIsAnySpacerVisible:function(){return this.isScrolledToTopSpacer||this.isScrolledToBottomSpacer;},GetIsNeedCallback:function(){return!this.GetIsItemsRangeEmpty();},GetIsNeedToHideTopSpacer:function(){return this.isScrolledToTopSpacer&&this.GetIsItemsRangeEmpty();},GetItemsRangeForLoad:function(){return(!this.GetIsItemsRangeEmpty()?this.itemsRange:this.defaultItemsRange);},SetItemsRangeForLoad:function(isForTop){var listbox=this.listBoxControl;var beginIndex=isForTop?listbox.serverIndexOfFirstItem-listbox.callbackPageSize:listbox.serverIndexOfFirstItem+listbox.GetItemCount();beginIndex=beginIndex<0?0:beginIndex;var endIndex=isForTop?listbox.serverIndexOfFirstItem-1:beginIndex+listbox.callbackPageSize-1;this.itemsRange=beginIndex+":"+endIndex;this.isScrolledToTopSpacer=isForTop;this.isScrolledToBottomSpacer=!isForTop;},GetIsItemsRangeEmpty:function(){return(this.itemsRange==""||this.itemsRange==__aspxEmptyItemsRange);}});ASPxClientListBoxBase=_aspxCreateClass(ASPxClientListEdit,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.APILockCount=0;this.isComboBoxList=false;this.isSyncEnabled=true;this.ownerName="";this.deletedItems=[];this.insertedItems=[];this.itemsValue=[];this.ItemDoubleClick=new ASPxClientEvent();},GetItemCount:function(){return 0;},GetItemValue:function(index){if(0<=index&&index=0;i--){if(this.GetItemValue(i)==value)break;}return i;},SelectIndexSilent:function(index,initialize){},SelectIndex:function(index){if(this.SelectIndexSilent(index,false)){this.RaisePersonalStandardValidation();this.OnValueChanged();}},MakeItemVisible:function(index){},InitOnContainerMadeVisible:function(){},AddItem:function(text,value,imageUrl){var index=this.GetItemCount();this.InsertItemInternal(index,text,value,imageUrl);return index;},InsertItem:function(index,text,value,imageUrl){this.InsertItemInternal(index,text,value,imageUrl);},InsertItemInternal:function(index,text,value,imageUrl){},BeginUpdate:function(){this.APILockCount++;},EndUpdate:function(){this.APILockCount--;this.Synchronize();},ClearItems:function(){this.BeginUpdate();this.UpdateArraysItemsCleared();this.ClearItemsCore();this.EndUpdate();},ClearItemsCore:function(){},ClearItemsForPerformCallback:function(){this.itemsValue=[];this.ClearItemsCore();},RemoveItem:function(index){},GetItem:function(index){return null;},PerformCallback:function(arg){},GetCallbackArguments:function(){var args=this.GetCustomCallbackArg();args+=this.GetLoadItemsRangeCallbackArg();return args;},GetLoadItemsRangeCallbackArg:function(){return this.FormatCallbackArg(__aspxLoadRangeItemsCallbackPrefix,this.GetItemsRangeForLoad());},FormatCallbackArg:function(prefix,arg){arg=arg.toString();return(_aspxIsExists(arg)?prefix+"|"+arg.length+';'+arg+';':"");},GetItemsRangeForLoad:function(){return __aspxEmptyItemsRange;},GetCallbackOwnerControl:function(){if(this.ownerName!=""&&!_aspxIsExists(this.ownerControl))this.ownerControl=aspxGetControlCollection().Get(this.ownerName);return this.ownerControl;},GetCustomCallbackArg:function(){return this.GetSyncHiddenInput("CustomCallback").value;},SetCustomCallbackArg:function(arg){this.GetSyncHiddenInput("CustomCallback").value=arg;},FormatAndSetCustomCallbackArg:function(arg){var formatArg=this.FormatCallbackArg("LECC",_aspxIsExists(arg)?arg:"");this.SetCustomCallbackArg(formatArg);},SendCallback:function(){},AddItemClass:function(index,text,value,imageUrl){_aspxArrayInsert(this.itemsValue,value,index);if(this.isSyncEnabled){this.RefreshSynchroArraysIndex(index,true);var item=new ASPxClientListEditItem(this,index,text,value,imageUrl);_aspxArrayPush(this.insertedItems,item);this.Synchronize();}},UpdateSyncArraysItemDeleted:function(item,isValueRemovingRequired){if(isValueRemovingRequired)_aspxArrayRemoveAt(this.itemsValue,item.index);if(this.isSyncEnabled){var item=new ASPxClientListEditItem(this,item.index,item.text,item.value,item.imageUrl);var index=this.FindItemInArray(this.insertedItems,item);if(index==-1){this.RefreshSynchroArraysIndex(item.index,false);_aspxArrayPush(this.deletedItems,item);}else{this.RefreshSynchroArraysIndex(item.index,false);_aspxArrayRemoveAt(this.insertedItems,index);} this.Synchronize();}},UpdateArraysItemsCleared:function(){if(this.isSyncEnabled){for(var i=this.GetItemCount()-1;i>=0;i--)this.UpdateSyncArraysItemDeleted(this.GetItem(i),false);} this.itemsValue=[];},RefreshSynchroArraysIndex:function(startIndex,isIncrease){this.RefreshSynchroArrayIndexIndex(this.deletedItems,startIndex,isIncrease);this.RefreshSynchroArrayIndexIndex(this.insertedItems,startIndex,isIncrease);},RefreshSynchroArrayIndexIndex:function(array,startIndex,isIncrease){var delta=isIncrease?1:-1;for(var i=0;i=startIndex)array[i].index+=delta;}},FindItemInArray:function(array,item){for(var i=array.length-1;i>=0;i--){var currentItem=array[i];if(currentItem.text==item.text&¤tItem.value==item.value&¤tItem.imageUrl==item.imageUrl)break;}return i;},GetSyncHiddenInput:function(syncType){return _aspxGetElementById(this.name+syncType);},Synchronize:function(){if(this.APILockCount==0){if(this.isSyncEnabled){this.SynchronizeItems(this.deletedItems,"DeletedItems");this.SynchronizeItems(this.insertedItems,"InsertedItems");} this.CorrectSizeByTimer();}},CorrectSizeByTimer:function(){},SynchronizeItems:function(items,syncType){var inputElement=this.GetSyncHiddenInput(syncType);if(_aspxIsExistsElement(inputElement)){var itemsState="";for(var i=0;i0)this.scrollPageSize=Math.round(divElement.clientHeight/rows[0].offsetHeight)-1;},GenerateStateItems:function(){var count=this.GetItemCount();var constName=this.name+"_"+__aspxLBIIdSuffix;var name="";var controller=aspxGetStateController();var i=this.hasSampleItem?-1:0;for(;i0){var divHeight=divElement.offsetHeight;divElement.style.height=(divHeight-heightCorrection)+"px";extrudedeHeight=mainElement.offsetHeight;var paddingsHeightCorrection=extrudedeHeight-height;if(paddingsHeightCorrection>0)divElement.style.height=(divHeight-heightCorrection-paddingsHeightCorrection)+"px";}},CorrectWidth:function(){var divElement=this.GetScrollDivElement();if(__aspxIE){var mainElement=this.GetMainElement();var scrollBarWidth=this.GetVerticalScrollBarWidth();mainElement.style.width="";divElement.style.width="100%";if(!__aspxIE55)divElement.style.paddingRight="0px";if(this.width!=""){mainElement.style.width=this.width;divElement.style.width="0px";var widthCorrectrion=__aspxIE55?0:scrollBarWidth;divElement.style.width=(mainElement.clientWidth-widthCorrectrion)+"px";}else{var widthCorrectrion=__aspxIE55?scrollBarWidth:0;if(this.IsListBoxWidthLessThenList())widthCorrectrion-=scrollBarWidth;divElement.style.width=(mainElement.clientWidth+widthCorrectrion)+"px";}if(!__aspxIE55)divElement.style.paddingRight=scrollBarWidth+"px";}else{if(this.width==""){var listTable=this.GetListTable();var mainElement=this.GetMainElement();if(listTable.offsetWidth!=0||!__aspxMozilla){divElement.style.width=(listTable.offsetWidth+this.GetVerticalScrollBarWidth())+"px";if(__aspxFirefox)mainElement.style.width=divElement.offsetWidth+"px";}}}},EnsureSelectedItemVisible:function(){var index=this.GetSelectedIndexInternal();if(index!=-1)this.MakeItemVisible(index);},MakeItemVisible:function(index){if(!this.IsItemVisible(index))this.ScrollItemToTop(index);},IsItemVisible:function(index){var scrollDiv=this.GetScrollDivElement();var itemElement=this.GetItemElement(index);var topVisible=false;var bottomVisible=false;if(itemElement!=null){var itemOffsetTop=itemElement.offsetTop+this.GetTopScrollSpacerHeight();topVisible=itemOffsetTop>=scrollDiv.scrollTop;bottomVisible=itemOffsetTop+itemElement.offsetHeightitemOffsetTop;var itemBelow=scrollTop+scrollDivHeight=0;i--){var itemStringAttrs=itemStrings[i].split(__aspxItemAttrsSeparator);this.InsertItem(0,itemStringAttrs[1],itemStringAttrs[0],itemStringAttrs[2]);scrollHeightCorrection+=this.GetItemHeight(0);} this.GetScrollDivElement().scrollTop+=scrollHeightCorrection;this.serverIndexOfFirstItem-=itemStrings.length;if(this.serverIndexOfFirstItem<0)this.serverIndexOfFirstItem=0;}else{for(var i=0;i0;},OnScroll:function(){if(this.IsScrollHandlerLocked())return;if(!this.InCallback()&&(this.isTopSpacerVisible||this.isBottomSpacerVisible)){this.scrollHelper.OnScroll();if(this.scrollHelper.GetIsNeedToHideTopSpacer())this.SetTopScrollSpacerVisibility(false);if(this.scrollHelper.GetIsNeedCallback())this.SendCallback();}},OnResize:function(){var mainElement=this.GetMainElement();if(_aspxIsExistsElement(mainElement)&&mainElement.style.width.indexOf("%")>-1){this.CorrectSize();}},InitializeKeyHandlers:function(){this.AddKeyDownHandler(ASPxKey.PageUp,"OnPageUp");this.AddKeyDownHandler(ASPxKey.PageDown,"OnPageDown");this.AddKeyDownHandler(ASPxKey.End,"OnEndKeyDown");this.AddKeyDownHandler(ASPxKey.Home,"OnHomeKeyDown");this.AddKeyDownHandler(ASPxKey.Up,"OnArrowUp");this.AddKeyDownHandler(ASPxKey.Down,"OnArrowDown");},OnArrowUp:function(evt){this.SelectNeighbour(-1);return true;},OnArrowDown:function(evt){this.SelectNeighbour(1);return true;},OnPageUp:function(evt){this.SelectNeighbour(-this.scrollPageSize);return true;},OnPageDown:function(evt){this.SelectNeighbour(this.scrollPageSize);return true;},OnHomeKeyDown:function(evt){this.SelectNeighbour(-this.GetItemCount());return true;},OnEndKeyDown:function(evt){this.SelectNeighbour(this.GetItemCount());return true;},GetAdjustedIndex:function(index){if(index<0)index=0;else{var itemCount=this.GetItemCount();if(index>=itemCount)index=itemCount-1;}return index;},SelectNeighbour:function(step){var itemCount=this.GetItemCount();if(itemCount>0){this.changeSelectAfterCallback=0;var selectedIndex=this.GetSelectedIndexInternal();var isFirstPageDown=selectedIndex==-1&&step==this.scrollPageSize;selectedIndex=isFirstPageDown?step:selectedIndex+step;selectedIndex=this.GetAdjustedIndex(selectedIndex);this.SelectIndex(selectedIndex);if(this.GetIsNeedToCallbackLoadItemsToTop(selectedIndex,step,itemCount)){this.LoadItemsOnCallback(true,selectedIndex);}else if(this.GetIsNeedToCallbackLoadItemsToBottom(selectedIndex,step,itemCount)){this.LoadItemsOnCallback(false,selectedIndex);} this.ScrollToItemVisible(selectedIndex);}},GetIsNeedToCallbackLoadItemsToTop:function(selectedIndex,step,itemCount){return this.isCallbackMode&&this.isTopSpacerVisible&&this.serverIndexOfFirstItem>0&&((step<0&&selectedIndex<=0)||step<=-itemCount);},GetIsNeedToCallbackLoadItemsToBottom:function(selectedIndex,step,itemCount){return this.isCallbackMode&&this.isBottomSpacerVisible&&((step>0&&selectedIndex>=itemCount-1)||step>=itemCount);},LoadItemsOnCallback:function(isToTop,index){this.changeSelectAfterCallback=index-this.GetSelectedIndexInternal();this.scrollHelper.SetItemsRangeForLoad(isToTop);this.SendCallback();},FindInputElement:function(){return document.getElementById(this.name+"_KBS");},SetHoverElement:function(element){aspxGetStateController().SetCurrentHoverElementBySrcElement(element);},InitOnContainerMadeVisible:function(){this.AdjustControl(false);},SetSelectedIndex:function(index){if(index!=this.GetSelectedIndexInternal())this.SelectIndexSilent(index,false);},ClearItemsCore:function(){this.ClearListTableContent();this.SetSelectedIndexInternal(-1);this.SetValue(null);},RemoveItem:function(index){if(0<=index&&index0)return table.tBodies[0];return table;},ProtectWhitespaceSerieses:function(text){if(text=="")text=__aspxNbsp;else{if(text.charAt(0)==' ')text=__aspxNbsp+text.slice(1);if(text.charAt(text.length-1)==' ')text=text.slice(0,-1)+__aspxNbsp;text=text.replace(new RegExp(" ","g"),"  ");}return text;},InsertItemInternal:function(index,text,value,imageUrl){if(!_aspxIsExists(imageUrl))imageUrl="";if(!_aspxIsExists(value))value=text;var renderText=this.ProtectWhitespaceSerieses(text);var newItemRow=this.CreateNewItem();_aspxRemoveAttribute(newItemRow,"id");var listTable=this.GetListTable();var tbody=this.GetTableRowParent(listTable);var isAdd=listTable.rows.length<=index;if(isAdd)tbody.appendChild(newItemRow);else tbody.insertBefore(newItemRow,this.GetItemRow(index));var newIndex=this.FindFreeIndex();var newId=this.CreateItemId(newIndex);var newClientId=this.CreateItemClientId(newIndex);this.InitializeItemAttributes(newItemRow,newClientId,true);var sampleCellElement=this.GetSampleItemTextCell();aspxAddHoverItems(this.name,this.CreateStyleClasses(sampleCellElement,newId,__aspxLBIPostfixes,true));aspxAddSelectedItems(this.name,this.CreateStyleClasses(sampleCellElement,newId,__aspxLBIPostfixes,false));_aspxRemoveAttribute(sampleCellElement,__aspxCachedHoverItemKind);_aspxRemoveAttribute(sampleCellElement,__aspxCachedSelectedItemKind);this.PrepareItem(newItemRow,text,renderText,imageUrl);this.AddItemClass(index,text,value,imageUrl);var selectedIndex=this.GetSelectedIndexInternal();if(index<=selectedIndex&&selectedIndex!=-1){this.SetSelectedIndexInternal(selectedIndex+1);}},PrepareItem:function(newItemRow,text,renderText,imageUrl){if(newItemRow.cells.length==2){var imageCell=newItemRow.cells[0];var image=_aspxGetChildByTagName(imageCell,'img',0);if(!_aspxIsExists(image)){image=document.createElement('img');imageCell.innerHTML="";imageCell.appendChild(image);} ASPxImageUtils.SetImageSrc(image,imageUrl);newItemRow.cells[1].innerHTML=renderText;if(text=="")_aspxSetAttribute(newItemRow.cells[1],"DXText",text);}else{newItemRow.cells[0].innerHTML=renderText;if(text=="")_aspxSetAttribute(newItemRow.cells[0],"DXText",text);}},ClearListTableContent:function(){var tBody=this.GetTableRowParent(this.GetListTable());if(__aspxIE)tBody.innerText="";else tBody.innerHTML="";},CreateItemId:function(index){return __aspxLBIIdSuffix+index;},CreateItemClientId:function(index){return this.name+"_"+__aspxLBIIdSuffix+index;},CreateNewItem:function(){var newItemRow=this.GetSampleItem();if(_aspxIsExistsElement(newItemRow))newItemRow=newItemRow.cloneNode(true);return newItemRow;},CreateStyleClasses:function(sampleElement,id,postfixes,isHover){var styleController=aspxGetStateController();var item=isHover?styleController.GetHoverElement(sampleElement):styleController.GetSelectedElement(sampleElement);var kind=isHover?__aspxHoverItemKind:__aspxSelectedItemKind;var classes=[];if(_aspxIsExists(item)&&_aspxIsExists(item[kind])){classes[0]=[];classes[0][0]=item[kind].className;classes[0][1]=item[kind].cssText;classes[0][2]=[];classes[0][2][0]=id;classes[0][3]=postfixes;}return classes;},CorrectSizeByTimer:function(){if(this.APILockCount==0&&this.IsDisplayed())_aspxSetTimeout("aspxLBCorrectSizeByTimer(\""+this.name+"\");",0);},FindFreeIndex:function(){return this.freeUniqIndex++;},GetSampleItemID:function(){return this.name+"_"+__aspxLBSIIdSuffix;},GetSampleItem:function(){if(this.SampleItem==null)this.SampleItem=_aspxGetElementById(this.GetSampleItemID());return this.SampleItem;},GetSampleItemTextCell:function(){if(!_aspxIsExistsElement(this.sampleItemTextCell))this.sampleItemTextCell=_aspxGetElementById(this.GetSampleItemID()+__aspxLBIPostfixes[1]);return this.sampleItemTextCell;},ChangeEnabledAttributes:function(enabled){this.ChangeListTableEvents(this.GetListTable(),_aspxChangeEventsMethod(enabled));var inputElement=this.GetInputElement();if(_aspxIsExists(inputElement))this.ChangeSpecialInputEnabledAttributes(inputElement,_aspxChangeEventsMethod(enabled));},ChangeEnabledStateItems:function(enabled){var controller=aspxGetStateController();controller.SetElementEnabled(this.GetMainElement(),enabled);var count=this.GetItemCount();var i=this.hasSampleItem?-1:0;for(;i=0;i--){var itemStringAttrs=itemStrings[i].split(__aspxItemAttrsSeparator);this.InsertItem(0,itemStringAttrs[1],itemStringAttrs[0],itemStringAttrs[2]);} this.EndUpdate();}});ASPxClientRadioButtonList=_aspxCreateClass(ASPxClientListEdit,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.items=[];},InlineInitialize:function(){var selectedIndex=this.GetSelectedIndex();this.UpdateHiddenInputs(selectedIndex);ASPxClientListEdit.prototype.InlineInitialize.call(this);},SetFocus:function(){var index=this.GetSelectedIndexInternal();if(index==-1)index=0;var itemElement=this.GetItemElement(index);if(itemElement!=null&&_aspxGetActiveElement()!=itemElement&&_aspxIsEditorFocusable(itemElement))_aspxSetFocus(itemElement);},GetInputElement:function(){var index=this.GetSelectedIndexInternal();return this.GetItemElement(index);},GetValueInputElement:function(){if(this.valueInput==null){this.valueInput=_aspxCreateHiddenField(null,this.name+"_ValueInput");var stateInput=this.FindStateInputElement();stateInput.parentNode.insertBefore(this.valueInput,stateInput);}return this.valueInput;},GetValueInputToValidate:function(){return this.GetValueInputElement();},GetItemElement:function(index){return this.GetChild("_RB"+index+"_I");},GetItemMainElement:function(index){return this.GetChild("_RB"+index);},GetItemCount:function(){return this.items.length;},OnItemClick:function(index){if(this.GetSelectedIndexInternal()!=index){this.SelectIndexSilent(index);this.RaisePersonalStandardValidation();this.OnValueChanged();}},OnItemClickReadonly:function(){var index=this.GetSelectedIndexInternal();this.SelectIndexSilent(index);},UpdateHiddenInputs:function(index){var stateInput=this.FindStateInputElement();if(_aspxIsExistsElement(stateInput))stateInput.value=index;var valueInput=this.GetValueInputElement();if(_aspxIsExistsElement(valueInput)){var value=this.GetValue();valueInput.value=_aspxIsExists(value)?value:" ";}},SelectIndexSilent:function(index){var itemCount=this.GetItemCount();var isValidIndex=(-1<=index&&index-1&&index0){var collection=aspxGetControlCollection();var control;for(var i in collection.elements){control=collection.elements[i];if(ASPxIdent.IsASPxClientRadioButton(control)){var controlGroupName=control.GetGroupName();if(controlGroupName!=null&&controlGroupName==groupName)result.push(control);}}}else{result.push(this);}return result;},GetChecked:function(){return this.GetValue()==true;},SetChecked:function(isChecked){this.SetValue(isChecked);}});ASPxIdent.IsASPxClientRadioButton=function(obj){return _aspxIsExists(obj.isASPxClientRadioButton)&&obj.isASPxClientRadioButton;};function aspxChkOnClick(name){var edit=aspxGetControlCollection().Get(name);if(_aspxIsExists(edit))edit.OnClick();} function aspxERBOnReadonlyClick(name){var rb=aspxGetControlCollection().Get(name);if(_aspxIsExists(rb))rb.OnReadonlyClick();} var __aspxTEInputSuffix="_I";ASPxClientTextEdit=_aspxCreateClass(ASPxClientEdit,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.raiseValueChangedOnEnter=true;this.savedValueChangedText="";this.TextChanged=new ASPxClientEvent();},Initialize:function(){ASPxClientEdit.prototype.Initialize.call(this);var element=this.GetInputElement();if(_aspxIsExists(element))this.savedValueChangedText=element.value;},FindInputElement:function(){return this.isNative?this.GetMainElement():_aspxGetElementById(this.name+__aspxTEInputSuffix);},GetValue:function(){var input=this.GetInputElement();return(input.value==""&&this.convertEmptyStringToNull)?null:input.value;},SetValue:function(value){if(value==null)value="";var element=this.GetInputElement();if(_aspxIsExistsElement(element)){element.value=value;this.savedValueChangedText=value;}},CollapseControl:function(checkSizeCorrectedFlag){if(checkSizeCorrectedFlag&&this.sizeCorrectedOnce)return;var mainElement=this.GetMainElement();if(!_aspxIsExistsElement(mainElement))return;var mainElementCurStyle=_aspxGetCurrentStyle(mainElement);if(_aspxIsExistsElement(mainElement)&&this.widthCorrectionRequired&&mainElementCurStyle.width!=""&&mainElementCurStyle.width!="auto")this.GetInputElement().style.width="0";},CorrectEditorWidth:function(){var inputElement=this.GetInputElement();_aspxSetOffsetWidth(inputElement,_aspxGetClearClientWidth(_aspxFindOffsetParent(inputElement)));},UnstretchInputElement:function(){var inputElement=this.GetInputElement();var mainElement=this.GetMainElement();var mainElementCurStyle=_aspxGetCurrentStyle(mainElement);if(_aspxIsExistsElement(mainElement)&&_aspxIsExistsElement(inputElement)&&inputElement.style.width=="100%"&&(mainElementCurStyle.width==""||mainElementCurStyle.width=="auto"))inputElement.style.width="";},OnValueChanged:function(){var element=this.GetInputElement();if(_aspxIsExists(element)&&this.savedValueChangedText!=element.value){ASPxClientEdit.prototype.OnValueChanged.call(this);this.savedValueChangedText=element.value;}},RaiseValueChangedEvent:function(){var processOnServer=ASPxClientEdit.prototype.RaiseValueChangedEvent.call(this);processOnServer=this.RaiseTextChanged(processOnServer);return processOnServer;},OnKeyDown:function(evt){ASPxClientEdit.prototype.OnKeyDown.call(this,evt);if(!this.specialKeyboardHandlingUsed&&this.raiseValueChangedOnEnter&&evt.keyCode==ASPxKey.Enter){var element=this.GetInputElement();if(_aspxIsExists(element)&&_aspxIsExists(element.onchange)){element.onchange();return true;}}},RaiseTextChanged:function(processOnServer){if(!this.TextChanged.IsEmpty()){var args=new ASPxClientProcessingModeEventArgs(processOnServer);this.TextChanged.FireEvent(this,args);processOnServer=args.processOnServer;}return processOnServer;},GetText:function(){var value=this.GetValue();return value!=null?value:"";},SetText:function(value){this.SetValue(value);},SelectAll:function(){this.SetSelection(0,-1,false);},SetCaretPosition:function(pos){var inputElement=this.GetInputElement();_aspxSetCaretPosition(inputElement,pos);},SetSelection:function(startPos,endPos,scrollToSelection){var inputElement=this.GetInputElement();_aspxSetSelection(inputElement,startPos,endPos,scrollToSelection);},ChangeEnabledAttributes:function(enabled){if(this.isNative)this.GetMainElement().disabled=!enabled;var inputElement=this.GetInputElement();if(_aspxIsExists(inputElement)){this.ChangeInputEnabledAttributes(inputElement,_aspxChangeAttributesMethod(enabled),enabled);if(this.specialKeyboardHandlingUsed)this.ChangeSpecialInputEnabledAttributes(inputElement,_aspxChangeEventsMethod(enabled));if(!this.isNative)this.ChangeReadOnlyAttribute(inputElement,enabled);}},ChangeEnabledStateItems:function(enabled){if(!this.isNative)aspxGetStateController().SetElementEnabled(this.GetMainElement(),enabled);},ChangeReadOnlyAttribute:function(element,enabled){element.readOnly=!enabled||this.readOnly;},ChangeInputEnabledAttributes:function(element,method,enabled){method(element,"tabIndex");if(!enabled)element.tabIndex=-1;method(element,"onclick");method(element,"onfocus");method(element,"onblur");method(element,"onkeydown");method(element,"onkeypress");method(element,"onkeyup");}});ASPxClientTextBoxBase=_aspxCreateClass(ASPxClientTextEdit,{});ASPxClientTextBox=_aspxCreateClass(ASPxClientTextBoxBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.isASPxClientTextBox=true;}});ASPxIdent.IsASPxClientTextBox=function(obj){return _aspxIsExists(obj.isASPxClientTextBox)&&obj.isASPxClientTextBox;};var __aspxMMinHeight=34;ASPxClientMemo=_aspxCreateClass(ASPxClientTextEdit,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.isASPxClientMemo=true;this.raiseValueChangedOnEnter=false;},CollapseControl:function(checkSizeCorrectedFlag){if(checkSizeCorrectedFlag&&this.sizeCorrectedOnce)return;var mainElement=this.GetMainElement();var inputElement=this.GetInputElement();if(!_aspxIsExistsElement(mainElement)||!_aspxIsExistsElement(inputElement))return;ASPxClientTextEdit.prototype.CollapseControl.call(this,checkSizeCorrectedFlag);var mainElementCurStyle=_aspxGetCurrentStyle(mainElement);if(this.heightCorrectionRequired&&_aspxIsExists(mainElement)&&_aspxIsExists(inputElement)){if(mainElement.style.height=="100%"||mainElementCurStyle.height=="100%"){mainElement.style.height="0";mainElement.wasCollapsed=true;} inputElement.style.height="0";}},CorrectEditorHeight:function(){var mainElement=this.GetMainElement();if(mainElement.wasCollapsed){mainElement.wasCollapsed=null;_aspxSetOffsetHeight(mainElement,_aspxGetClearClientHeight(_aspxFindOffsetParent(mainElement)));}if(!this.isNative){var inputElement=this.GetInputElement();var inputClearClientHeight=_aspxGetClearClientHeight(_aspxFindOffsetParent(inputElement))-2;if(__aspxIE){var calculatedMainElementStyle=_aspxGetCurrentStyle(mainElement);inputClearClientHeight+=_aspxPxToInt(calculatedMainElementStyle.borderTopWidth)+_aspxPxToInt(calculatedMainElementStyle.borderBottomWidth);}if(inputClearClientHeight<__aspxMMinHeight)inputClearClientHeight=__aspxMMinHeight;_aspxSetOffsetHeight(inputElement,inputClearClientHeight);mainElement.style.height="100%";}}});ASPxIdent.IsASPxClientMemo=function(obj){return _aspxIsExists(obj.isASPxClientMemo)&&obj.isASPxClientMemo;};ASPxClientButtonEditBase=_aspxCreateClass(ASPxClientTextBoxBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.allowUserInput=true;this.buttonCount=0;this.ButtonClick=new ASPxClientEvent();},GetButton:function(number){return this.GetChild("_B"+number);},ProcessInternalButtonClick:function(number){return false;},OnButtonClick:function(number){var processOnServer=this.RaiseButtonClick(number);if(!this.ProcessInternalButtonClick(number)&&processOnServer)this.SendPostBack('BC:'+number);},SelectInputElement:function(){var element=this.GetInputElement();if(_aspxIsExistsElement(element)){_aspxSetFocus(element);element.select();}},RaiseButtonClick:function(number){var processOnServer=this.autoPostBack||this.IsServerEventAssigned("ButtonClick");if(!this.ButtonClick.IsEmpty()){var args=new ASPxClientButtonEditClickEventArgs(processOnServer,number);this.ButtonClick.FireEvent(this,args);processOnServer=args.processOnServer;}return processOnServer;},ChangeEnabledAttributes:function(enabled){ASPxClientTextEdit.prototype.ChangeEnabledAttributes.call(this,enabled);for(var i=0;i=0?lb.GetValue():text;this.islastSuccessValueInit=true;},GetValue:function(){return this.islastSuccessValueInit?this.lastSuccessValue:this.GetValueInternal();},GetValueInternal:function(){var text=this.GetInputElement().value;var lb=this.GetListBoxControl();if(_aspxIsExists(lb)){var index=this.FindItemIndexByText(lb,text);lb.SelectIndexSilent(index,false);if(index!=-1)return lb.GetValue();}return ASPxClientDropDownEdit.prototype.GetValue.call(this);},SetValue:function(value){var lb=this.GetListBoxControl();lb.SetValue(value);var item=lb.GetSelectedItem();var text=_aspxIsExists(item)?item.text:value;this.SetTextInternal(text);this.SetLastSuccessTest(text);this.lastSuccessValue=item!=null?item.value:text;this.islastSuccessValueInit=true;this.UpdateValueInput();},FindItemIndexByText:function(lb,text){if(!_aspxIsExists(lb))return;for(var i=0;i0)return;var lb=this.GetListBoxControl();var item=lb.GetSelectedItem();var text=item!=null?item.text:"";this.SetLastSuccessTest(text);this.lastSuccessValue=item!=null?item.value:text;this.islastSuccessValueInit=true;this.SetTextInternal(text);this.OnChange();if(!this.isToolbarItem)this.SelectInputElement();},OnCallback:function(result){},OnChange:function(){this.UpdateValueInput();this.RaisePersonalStandardValidation();this.OnValueChanged();},UpdateValueInput:function(){},RaiseValueChangedEvent:function(){var processOnServer=ASPxClientTextEdit.prototype.RaiseValueChangedEvent.call(this);processOnServer=this.RaiseSelectedIndexChanged(processOnServer);return processOnServer;},RaiseSelectedIndexChanged:function(processOnServer){if(!this.SelectedIndexChanged.IsEmpty()){var args=new ASPxClientProcessingModeEventArgs(processOnServer);this.SelectedIndexChanged.FireEvent(this,args);processOnServer=args.processOnServer;}return processOnServer;},AddItem:function(text,value,imageUrl){var index=this.GetListBoxControl().AddItem(text,value,imageUrl);this.CollectionChanged();return index;},InsertItem:function(index,text,value,imageUrl){this.GetListBoxControl().InsertItem(index,text,value,imageUrl);this.CollectionChanged();},RemoveItem:function(index){this.GetListBoxControl().RemoveItem(index);this.CollectionChanged();},ClearItems:function(){this.GetListBoxControl().ClearItems();this.ClearItemsInternal();},BeginUpdate:function(){this.GetListBoxControl().BeginUpdate();},EndUpdate:function(){this.GetListBoxControl().EndUpdate();this.CollectionChanged();},MakeItemVisible:function(index){},GetItem:function(index){return this.GetListBoxControl().GetItem(index);},GetItemCount:function(){return this.GetListBoxControl().GetItemCount();},GetSelectedIndex:function(){return this.GetListBoxControl().GetSelectedIndexInternal();},SetSelectedIndex:function(index){this.SelectIndex(index,false);},GetSelectedItem:function(){var lb=this.GetListBoxControl();var index=lb.GetSelectedIndexInternal();return lb.GetItem(index);},SetSelectedItem:function(item){var index=(item!=null)?item.index:-1;this.SelectIndex(index,false);},GetText:function(){return this.lastSuccessText;},PerformCallback:function(arg){},ClearItemsInternal:function(){this.SetValue(null);this.CollectionChanged();}});ASPxClientComboBox=_aspxCreateClass(ASPxClientComboBoxBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.filterTimerId=-1;this.allowMultipleCallbacks=false;this.isApplyAndCloseAfterCallback=false;this.isCallbackMode=false;this.isPerformCallback=false;this.changeSelectAfterCallback=0;this.isFilterEnabled=false;this.isEnterLocked=false;this.isLastFilteredKeyWasTab=false;this.filter="";this.filterTimer=100;this.isPostponedFiltration=false;this.isToolbarItem=false;this.isDropDownListStyle=true;this.dropDownHeight="";this.dropDownWidth="";},Initialize:function(){var lb=this.GetListBoxControl();this.InitializeListBoxOwnerName();var mainElement=this.GetMainElement();if(_aspxIsExists(mainElement))_aspxAttachEventToElement(mainElement,__aspxNS?"DOMMouseScroll":"mousewheel",aspxCBMouseWheel);var input=this.GetInputElement();var ddbutton=this.GetDropDownButton();if(_aspxIsExists(ddbutton))_aspxAttachEventToElement(ddbutton,"mousemove",aspxCBDDButtonMMove);if(this.isFilterEnabled)_aspxAttachEventToElement(input,"keyup",aspxCBKeyUp);if(this.isDropDownListStyle&&__aspxIE){_aspxPreventElementDragAndSelect(mainElement,true);_aspxPreventElementDragAndSelect(input,true);if(_aspxIsExists(ddbutton))_aspxPreventElementDragAndSelect(ddbutton,true);}if(this.isToolbarItem){mainElement.unselectable="on";input.unselectable="on";if(_aspxIsExists(input.offsetParent))input.offsetParent.unselectable="on";if(_aspxIsExists(ddbutton))ddbutton.unselectable="on";if(_aspxIsExists(lb)){var table=lb.GetListTable();for(var i=0;i7)height=((listHeight/count)*7)+"px";else height=count==0?"0px":listHeight+"px";lbScrollDiv.style.height=height;lbHeight=lbScrollDiv.offsetHeight;}else{var lbMainElement=lb.GetMainElement();lbMainElement.style.height="0px";lbScrollDiv.style.height="0px";lbMainElement.style.height=height;var trueLbOffsetHeight=lbMainElement.offsetHeight;var trueLbClientHeight=lbMainElement.clientHeight;lbScrollDiv.style.height=lbMainElement.clientHeight+"px";lbHeightCorrection=lbMainElement.offsetHeight-trueLbOffsetHeight;lbScrollDiv.style.height=(trueLbClientHeight-lbHeightCorrection)+"px";lbHeight=lbMainElement.offsetHeight;} lb.InitializePageSize();return lbHeight;},InitListBoxWidth:function(){this.InitMainElementCache();var mainElement=this.GetMainElement();var lbScrollDiv=this.GetListBoxScrollDivElement();var lb=this.GetListBoxControl();var lbMainElement=lb.GetMainElement();var lbTable=lb.GetListTable();lbMainElement.style.width="";lbScrollDiv.style.paddingRight="0px";lbScrollDiv.style.width="100%";if(this.dropDownWidth!=""){lbMainElement.style.width=this.dropDownWidth;var width=lbMainElement.clientWidth;width=this.SetLbScrollDivAndCorrectionForScroll(lb,width,false);if(!__aspxIE){var difference=lbTable.offsetWidth-lbScrollDiv.clientWidth;if(difference>0){lbMainElement.style.width=(lbMainElement.offsetWidth+difference)+"px";lbScrollDiv.style.width=(lbMainElement.clientWidth)+"px";}}}else{var pc=this.GetPopupControl();var width=lbTable.offsetWidth;width=this.SetLbScrollDivAndCorrectionForScroll(lb,width,true);if(__aspxFirefox&&lbMainElement.offsetWidth0){lbScrollDiv.style.width=(width+widthDifference)+"px";var twoBorderSize=(lbMainElement.offsetWidth-lbMainElement.clientWidth);lbMainElement.style.width=(width+widthDifference+twoBorderSize)+"px";}}return lbScrollDiv.offsetWidth;},SetLbScrollDivAndCorrectionForScroll:function(lb,width,widthByContent){var isBrowserPutsScrollOnContent=!__aspxIE||__aspxIE55;var isBrowserAbleAnimScroll=!__aspxMozilla||__aspxFirefox||!pc.enableAnimation;var lbScrollDiv=this.GetListBoxScrollDivElement();var scrollWidth=lb.GetVerticalScrollBarWidth();if(!isBrowserPutsScrollOnContent){width-=scrollWidth;lbScrollDiv.style.paddingRight=scrollWidth+"px";}else if(widthByContent&&isBrowserAbleAnimScroll)width+=scrollWidth;lbScrollDiv.style.width=width+"px";return width;},SelectIndexSilent:function(lb,index){this.lbEventLockCount++;lb.SelectIndexSilent(index);this.lbEventLockCount--;},SelectInputText:function(){var input=this.GetInputElement();_aspxSetInputSelection(input,0,input.value.length);},ShowDropDownArea:function(isRaiseEvent){var lb=this.GetListBoxControl();if(!_aspxIsExists(lb)||lb.GetItemCount()==0)return;var pc=this.GetPopupControl();ASPxClientDropDownEdit.prototype.ShowDropDownArea.call(this,isRaiseEvent);var text=ASPxClientDropDownEdit.prototype.GetValue.call(this);var lbItem=lb.GetSelectedItem();var lbText=lbItem!=null?lbItem.text:"";if(text!=lbText&&text!=null&&lbText!=""){var newSelectedIndex=this.FindItemIndexByText(lb,text);lb.SelectIndexSilent(newSelectedIndex,false);} lb.EnsureSelectedItemVisible();lb.CallbackSpaceInit();},HideDropDownArea:function(isRaiseEvent){this.FilteringStop();ASPxClientDropDownEdit.prototype.HideDropDownArea.call(this,isRaiseEvent);this.PreventScrollSpoilDDShowing();},IsScrollSpoilDDShowing:function(){var pc=this.GetPopupControl();return((__aspxMozilla||__aspxFirefox)&&pc.enableAnimation);},EnableLBDivOverflow:function(){var divElement=this.GetListBoxScrollDivElement();divElement.style.overflow="auto";},DisableLBDivOverflow:function(){var divElement=this.GetListBoxScrollDivElement();divElement.style.overflow="hidden";},PreventScrollSpoilDDShowing:function(){if(this.IsScrollSpoilDDShowing())this.DisableLBDivOverflow();},ChangeReadOnlyAttribute:function(element,enabled){if(!this.isDropDownListStyle||this.isFilterEnabled)ASPxClientTextEdit.prototype.ChangeReadOnlyAttribute.call(this,element,enabled);},IsCtrlV:function(evt,keyCode){return evt.ctrlKey&&keyCode==118;},IsInputValueChangingEventKeyCode:function(evt){var keyCode=_aspxGetKeyCode(evt);if(evt.ctrlKey)return this.IsCtrlV(evt,keyCode);var isSystemKey=ASPxKey.Windows<=keyCode&&keyCode<=ASPxKey.ContextMenu;var isFKey=ASPxKey.F1<=keyCode&&keyCode<=127;return ASPxKey.Delete<=keyCode&&!isSystemKey&&!isFKey||keyCode==ASPxKey.Backspace||keyCode==ASPxKey.Space;},OnFilteringKeyUp:function(evt){if(!this.isFilterEnabled||this.InCallback())return;if(this.IsInputValueChangingEventKeyCode(evt)){this.FilterStopTimer();var input=this.GetInputElement();var newFilter=input.value.toLowerCase();if(evt.keyCode==ASPxKey.Backspace&&_aspxHasInputSelection(input)&&newFilter==this.filter)this.FilteringBackspace();else this.FilterStartTimer();}},IsFilterTimerActive:function(){return(this.filterTimerId!=-1);},FilterStartTimer:function(){this.isEnterLocked=true;this.filterTimerId=_aspxSetTimeout("aspxCBFilterByTimer('"+this.name+"')",this.filterTimer);},FilterStopTimer:function(){this.filterTimerId=_aspxClearTimer(this.filterTimerId);},EnshureShowDropDownArea:function(){if(!this.droppedDown)this.ShowDropDownArea(true);},Filtering:function(){this.FilterStopTimer();this.isPostponedFiltration=false;var input=this.GetInputElement();var newFilter=input.value.toLowerCase();if(this.filter!=newFilter){this.filter=newFilter;this.EnshureShowDropDownArea();if(this.isCallbackMode)this.FilteringOnServer();else this.FilteringOnClient(input);}else this.isEnterLocked=false;},FilteringBackspace:function(){if(this.isFilterEnabled){var input=this.GetInputElement();input.value=input.value.slice(0,-1);this.FilterStartTimer();}},GetCallbackArguments:function(){var args=ASPxClientComboBoxBase.prototype.GetCallbackArguments.call(this);if(this.isCallbackMode)args+=this.GetCallbackArgumentsInternal();return args;},GetCallbackArgumentsInternal:function(){var args="";if(this.filter!="")args=this.GetCallbackArgumentFilter(this.filter);return args;},GetCallbackArgumentFilter:function(value){var callbackPrefix=this.isDropDownListStyle?__aspxCorrectFilterCallbackPrefix:__aspxLoadFilteredItemsCallbackPrefix;return this.FormatCallbackArg(callbackPrefix,value);},FilteringOnServer:function(){if(!this.InCallback()){var listBox=this.GetListBoxControl();listBox.ClearItems();listBox.serverIndexOfFirstItem=0;listBox.SetScrollSpacerVisibility(true,false);listBox.SetScrollSpacerVisibility(false,false);this.SendCallback();}},FilteringOnClient:function(input){var filter=this.filter.toLowerCase();var lb=this.GetListBoxControl();var listTable=lb.GetListTable();var count=lb.GetItemCount();var text="";var isSatisfy=false;var isFirstSatisfyItemFinded=false;if(this.isDropDownListStyle){var coincide=new Array(count);var maxCoincide=0;for(var i=count-1;i>=0;i--){coincide[i]=this.GetCoincideCharCount(lb.GetItem(i).text.toLowerCase(),filter);if(coincide[i]>maxCoincide)maxCoincide=coincide[i];} filter=filter.substr(0,maxCoincide);input.value=filter;}for(var i=0;i0?1:-1;var startIndex=this.GetSelectedIndex();var count=lb.GetItemCount();var listTable=lb.GetListTable();var needVisibleItemCount=Math.abs(step);var outermostVisibleIndex=startIndex;for(var index=startIndex+stepDirection;needVisibleItemCount>0;index+=stepDirection){if(index<0||count<=index)break;if(_aspxGetElementDisplay(listTable.rows[index])){outermostVisibleIndex=index;needVisibleItemCount--;}} step=outermostVisibleIndex-this.GetSelectedIndex();}return step;},OnSpecialKeyDown:function(evt){if(this.isFilterEnabled&&this.IsInputValueChangingEventKeyCode(evt)){this.FilterStopTimer();this.isPostponedFiltration=true;}return ASPxClientEdit.prototype.OnSpecialKeyDown.call(this,evt);},OnArrowUp:function(evt){var isProcessed=ASPxClientDropDownEdit.prototype.OnArrowUp.call(this,evt);if(!isProcessed)this.SelectNeighbour(-1);return true;},OnArrowDown:function(evt){var isProcessed=ASPxClientDropDownEdit.prototype.OnArrowDown.call(this,evt);if(!isProcessed)this.SelectNeighbour(1);return true;},OnPageUp:function(){return this.OnPageButtonDown(false);},OnPageDown:function(){return this.OnPageButtonDown(true);},OnPageButtonDown:function(isDown){var lb=this.GetListBoxControl();if(_aspxIsExists(lb)){var direction=isDown?1:-1;this.SelectNeighbour(lb.scrollPageSize*direction);}return true;},OnHomeKeyDown:function(evt){return this.OnHomeEndKeyDown(evt,true);},OnEndKeyDown:function(evt){return this.OnHomeEndKeyDown(evt,false);},OnHomeEndKeyDown:function(evt,isHome){var input=this.GetValueInput();if(input.readOnly||evt.ctrlKey){var lb=this.GetListBoxControl();var count=lb.GetItemCount();this.SelectNeighbour(isHome?-count:count);return true;}return false;},OnEnter:function(){this.enterProcessed=this.droppedDown;if(!this.isEnterLocked)this.OnApplyChangesAndCloseWithEvents();return this.enterProcessed;},OnTab:function(evt){if(this.IsFilterTimerActive()||this.isPostponedFiltration){this.isLastFilteredKeyWasTab=true;this.Filtering();}if(this.InCallback())this.isApplyAndCloseAfterCallback=true;else this.OnApplyChangesAndCloseWithEvents();},OnApplyChanges:function(){if(this.isDropDownListStyle&&!this.isFilterEnabled)return;this.OnApplyChangesInternal();},OnApplyChangesAndCloseWithEvents:function(){this.OnApplyChangesInternal();this.HideDropDownArea(true);},OnApplyChangesInternal:function(){var text=this.GetInputElement().value;var isChanged=this.lastSuccessText!=text;if(isChanged){var lb=this.GetListBoxControl();if(this.isDropDownListStyle&&this.FindItemIndexByText(lb,text)<0){var lbItem=lb.GetSelectedItem();text=lbItem!=null?lbItem.text:this.lastSuccessText;}} this.SetText(text);if(isChanged)this.OnChange();},OnButtonClick:function(number){if(number!=this.dropDownButtonIndex){this.HideDropDownArea(true);} ASPxClientButtonEditBase.prototype.OnButtonClick.call(this,number);},OnCancelChanges:function(){var isCancelProcessed=ASPxClientDropDownEdit.prototype.OnCancelChanges.call(this);var lb=this.GetListBoxControl();var index=this.FindItemIndexByText(lb,this.lastSuccessText);this.SelectIndexSilent(lb,index);return isCancelProcessed;},OnCloseUp:function(evt){var evt=_aspxGetEvent(evt);var scrollDiv=this.GetListBoxControl().GetScrollDivElement();var scrollDivID=_aspxIsExists(scrollDiv)?scrollDiv.id:"";if(__aspxFirefox&&evt.type=="mouseup"&&(_aspxGetEventSource(evt).tagName=="DIV"&&scrollDivID==_aspxGetEventSource(evt).id))return;ASPxClientDropDownEdit.prototype.OnCloseUp.call(this,evt);},OnDDButtonMouseMove:function(evt){return(this.droppedDown?_aspxCancelBubble(evt):true);},OnDocumentMouseDown:function(){this.OnApplyChangesInternal();ASPxClientDropDownEdit.prototype.OnDocumentMouseDown.call(this);},IsCanToDropDown:function(){return(this.GetListBoxControl().GetItemCount()>0);},OnPopupControlShown:function(){if(this.IsScrollSpoilDDShowing())_aspxSetTimeout("aspxCBMozillaOverflowOn(\""+this.name+"\")",100);if(this.lockListBoxClick)delete this.lockListBoxClick;},OnItemClick:function(){if(!this.lockListBoxClick){this.OnSelectChanged();this.OnClick();}},OnListBoxClick:function(evt){if(!this.lockListBoxClick&&!this.InCallback()&&_aspxGetIsLeftButtonPressed(evt)){this.OnApplyChangesInternal();this.OnCloseUp(evt);}},OnMouseWheel:function(evt){if(!this.droppedDown){var wheelDelta=_aspxGetWheelDelta(evt);if(wheelDelta>0)this.SelectNeighbour(-1);else if(wheelDelta<0)this.SelectNeighbour(1);return _aspxPreventEvent(evt);}},OnSetFocus:function(isFocused){if(isFocused&&this.isFilterEnabled&&!this.isToolbarItem)this.SelectInputText();ASPxClientDropDownEdit.prototype.OnSetFocus.call(this,isFocused);},OnOpenAnotherDropDown:function(){this.OnApplyChangesAndCloseWithEvents();},OnClick:function(){if(!this.isToolbarItem)ASPxClientDropDownEdit.prototype.OnClick.call(this);},ParseValue:function(){var newText=ASPxClientButtonEditBase.prototype.GetValue.call(this);var oldText=this.GetText();if(oldText!=newText){this.SetText(newText);this.OnChange();}},MakeItemVisible:function(index){var lb=this.GetListBoxControl();lb.MakeItemVisible(index);},PerformCallback:function(arg){this.isPerformCallback=true;this.filter="";this.ClearItemsInternal();this.GetListBoxControl().PerformCallback(arg);},ClearItemsInternal:function(){ASPxClientComboBoxBase.prototype.ClearItemsInternal.call(this);var lbScrollDiv=this.GetListBoxScrollDivElement();if(_aspxIsExists(lbScrollDiv))lbScrollDiv.scrollTop="0px";}});ASPxClientNativeComboBox=_aspxCreateClass(ASPxClientComboBoxBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.initSelectedIndex=-1;this.raiseValueChangedOnEnter=false;},Initialize:function(){var lb=this.GetListBoxControl();if(lb!=null)lb.SetMainElement(this.GetMainElement());ASPxClientComboBoxBase.prototype.Initialize.call(this);},InitLastSuccessText:function(){this.SelectIndex(this.initSelectedIndex,true);},FindInputElement:function(){return this.GetMainElement();},GetDropDownInnerControlName:function(suffix){return this.name+suffix;},PerformCallback:function(arg){this.GetListBoxControl().PerformCallback(arg);},SetText:function(text){var lb=this.GetListBoxControl();var index=this.FindItemIndexByText(lb,text);this.SelectIndex(index,false);this.SetLastSuccessTest((index>-1)?text:"");this.lastSuccessValue=(index>-1)?lb.GetValue():null;this.islastSuccessValueInit=true;},GetValue:function(){var selectedItem=this.GetSelectedItem();return(selectedItem!=null)?selectedItem.value:null;},SetValue:function(value){var lb=this.GetListBoxControl();lb.SetValue(value);var item=lb.GetSelectedItem();var text=_aspxIsExists(item)?item.text:value;this.SetLastSuccessTest((item!=null)?text:"");this.lastSuccessValue=(item!=null)?item.value:null;this.islastSuccessValueInit=true;},OnCallback:function(result){this.GetListBoxControl().OnCallback(result);if(this.GetItemCount()>0)this.SetSelectedIndex(0);},OnTextChanged:function(){this.OnChange();},SetTextInternal:function(text){},ChangeEnabledAttributes:function(enabled){this.GetMainElement().disabled=!enabled;}});var __aspxDropDownCollection=null;function aspxGetDropDownCollection(){if(__aspxDropDownCollection==null)__aspxDropDownCollection=new ASPxClientDropDownCollection();return __aspxDropDownCollection;} _aspxAttachEventToDocument("mousedown",aspxDropDownDocumentMouseDown);function aspxDropDownDocumentMouseDown(evt){return aspxGetDropDownCollection().OnDocumentMouseDown(evt);} _aspxAttachEventToDocument("mouseup",aspxDropDownDocumentMouseUp);function aspxDropDownDocumentMouseUp(evt){return aspxGetDropDownCollection().OnDocumentMouseUp(evt);} _aspxAttachEventToElement(window,"resize",aspxCBWindowResize);function aspxCBWindowResize(evt){aspxGetDropDownCollection().OnResize(evt);} function aspxDDDropDown(name,evt){if(_aspxGetIsLeftButtonPressed(evt)){var dd=aspxGetControlCollection().Get(name);if(_aspxIsExists(dd))return dd.OnDropDown(evt);}} function aspxDDCloseUp(name,evt){var dd=aspxGetControlCollection().Get(name);dd.OnCloseUp(evt);} function aspxEdDECMainElementClick(name){var dateEdit=aspxGetControlCollection().Get(name);if(dateEdit)dateEdit.OnCalendarMainElementClick();} function aspxDDMainElementClick(name,evt){var dd=aspxGetControlCollection().Get(name);if(dd!=null)dd.OnClick();} function aspxCBPCShown(name,evt){var cb=aspxGetControlCollection().Get(name);if(cb!=null)cb.OnPopupControlShown();} function aspxCBIClick(name,evt){var cb=aspxGetControlCollection().Get(name);if(cb!=null)cb.OnItemClick();} function aspxCBLBClick(name,evt){var cb=aspxGetControlCollection().Get(name);if(cb!=null)cb.OnListBoxClick(evt);} function aspxCBMozillaOverflowOn(name){var cb=aspxGetControlCollection().Get(name);cb.EnableLBDivOverflow();} function aspxCBDDButtonMMove(evt){return aspxGetDropDownCollection().OnDDButtonMouseMove(evt);} function aspxCBMouseWheel(evt){var cb=aspxGetDropDownCollection().GetFocusedDropDown();if(cb!=null)return cb.OnMouseWheel(evt);} function aspxCBKeyUp(evt){var cb=aspxGetDropDownCollection().GetFocusedDropDown();if(cb!=null)cb.OnFilteringKeyUp(evt);} function aspxCBFilterByTimer(name){var cb=aspxGetControlCollection().Get(name);if(cb!=null)cb.Filtering();} var __aspxCalendarWeekCount=6;var __aspxCalendarMsPerDay=86400000;var __aspxActiveCalendar=null;ASPxClientCalendar=_aspxCreateClass(ASPxClientEdit,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.SelectionChanging=new ASPxClientEvent();this.SelectionChanged=new ASPxClientEvent();this.VisibleMonthChanged=new ASPxClientEvent();this.isMouseDown=false;this.forceMouseDown=false;this.selection=new ASPxClientCalendarSelection();this.selectionTransaction=null;this.selectionStartDate=null;this.selectionPrevStartDate=null;this.lastSelectedDate=null;this.selectionCtrl=false;this.selectionByWeeks=false;this.nodeCache={};this.visibleDate=new Date();this.firstDayOfWeek=0;this.columns=1;this.rows=1;this.enableFast=true;this.enableMulti=false;this.minDate=null;this.maxDate=null;this.customDraw=false;this.showWeekNumbers=true;this.showDayHeaders=true;this.isDateEditCalendar=false;this.isDateChangingByKeyboard=false;this.MainElementClick=new ASPxClientEvent();},Initialize:function(){if(this.enableFast)this.fastNavigation=new ASPxClientCalendarFastNavigation(this);this.selectionTransaction=new ASPxClientCalendarSelectionTransaction(this);this.selectionPrevStartDate=this.selection.GetFirstDate();this.SaveClientState();ASPxClientEdit.prototype.Initialize.call(this);},InlineInitialize:function(){this.CreateViews();this.InitSpecialKeyboardHandling();this.MakeDisabledStateItems();ASPxClientEditBase.prototype.InlineInitialize.call(this);},MakeDisabledStateItems:function(){for(var key in this.views){var view=this.views[key];if(view.constructor!=ASPxClientCalendarView)continue;view.MakeDisabledStateItems();}},FindInputElement:function(){return this.GetChild("_KBS");},FindStateInputElement:function(){return _aspxGetElementById(this.name+"_STATE");},GetClearButton:function(){return this.GetChild("_BC");},GetTodayButton:function(){return this.GetChild("_BT");},GetValue:function(){return this.selection.GetFirstDate();},GetValueString:function(){var value=this.GetValue();return value==null?null:_aspxGetInvariantDateString(value);},SetValue:function(date){if(date!=null)this.SetVisibleDate(date);this.SetSelectedDate(date);},GetFastNavigation:function(){return this.fastNavigation;},GetViewKey:function(row,column){return row+"x"+column;},GetView:function(row,column){var key=this.GetViewKey(row,column);return this.views[key];},CreateViews:function(){this.views={};var key;for(var row=0;row=startDate)&&(date1||this.rows>1;},IsDateInRange:function(date){return date==null||((this.minDate==null||date>=this.minDate)&&(this.maxDate==null||date<=this.maxDate));},GetCachedElementById:function(id){if(!_aspxIsExistsElement(this.nodeCache[id]))this.nodeCache[id]=_aspxGetElementById(id);return this.nodeCache[id];},Update:function(){if(this.customDraw)this.SendPostBack("");else this.UpdateInternal();},UpdateInternal:function(){for(var key in this.views){var view=this.views[key];if(view.constructor!=ASPxClientCalendarView)continue;view.Update();}},ApplySelectionByDiff:function(selection,save){var toShow=[];var toHide=[];var dates=selection.GetDates();var oldDates=this.selection.GetDates();var date;for(var i=0;i0)state+=":"+this.FormatDates(this.selection.GetDates(),":");element.value=state;}},FormatDates:function(dates,separator){var result="";for(var i=0;i0)result+=separator;result+=_aspxGetInvariantDateString(dates[i]);}return result;},InitializeKeyHandlers:function(){this.AddKeyDownHandler(ASPxKey.Enter,"OnEnter");this.AddKeyDownHandler(ASPxKey.Esc,"OnEscape");this.AddKeyDownHandler(ASPxKey.PageUp,"OnPageUp");this.AddKeyDownHandler(ASPxKey.PageDown,"OnPageDown");this.AddKeyDownHandler(ASPxKey.End,"OnEndKeyDown");this.AddKeyDownHandler(ASPxKey.Home,"OnHomeKeyDown");this.AddKeyDownHandler(ASPxKey.Left,"OnArrowLeft");this.AddKeyDownHandler(ASPxKey.Right,"OnArrowRight");this.AddKeyDownHandler(ASPxKey.Up,"OnArrowUp");this.AddKeyDownHandler(ASPxKey.Down,"OnArrowDown");},OnArrowUp:function(evt){if(this.IsFastNavigationActive())this.GetFastNavigation().OnArrowUp(evt);else if(!this.readOnly){var newDate=this.GetNearestDayForToday();if(_aspxIsExists(this.lastSelectedDate))newDate=ASPxClientCalendar.GetPrevWeekDate(this.lastSelectedDate);this.CorrectVisibleMonth(newDate,false);this.DoKeyboardSelection(newDate,evt.shiftKey);}return true;},OnArrowDown:function(evt){if(this.IsFastNavigationActive())this.GetFastNavigation().OnArrowDown(evt);else if(!this.readOnly){var newDate=this.GetNearestDayForToday();if(_aspxIsExists(this.lastSelectedDate))newDate=ASPxClientCalendar.GetNextWeekDate(this.lastSelectedDate);this.CorrectVisibleMonth(newDate,true);this.DoKeyboardSelection(newDate,evt.shiftKey);}return true;},OnArrowLeft:function(evt){if(this.IsFastNavigationActive())this.GetFastNavigation().OnArrowLeft(evt);else if(!this.readOnly){var newDate=this.GetNearestDayForToday();if(_aspxIsExists(this.lastSelectedDate))newDate=ASPxClientCalendar.GetTomorrowDate(this.lastSelectedDate);this.CorrectVisibleMonth(newDate,false);this.DoKeyboardSelection(newDate,evt.shiftKey);}return true;},OnArrowRight:function(evt){if(this.IsFastNavigationActive())this.GetFastNavigation().OnArrowRight(evt);else if(!this.readOnly){var newDate=this.GetNearestDayForToday();if(_aspxIsExists(this.lastSelectedDate))newDate=ASPxClientCalendar.GetYesterDate(this.lastSelectedDate);this.CorrectVisibleMonth(newDate,true);this.DoKeyboardSelection(newDate,evt.shiftKey);}return true;},OnPageUp:function(evt){if(this.IsFastNavigationActive())this.GetFastNavigation().OnPageUp(evt);else if(!this.readOnly){var newDate=this.GetNearestDayForToday();if(_aspxIsExists(this.lastSelectedDate)){if(evt.ctrlKey)newDate=ASPxClientCalendar.GetPrevYearDate(this.lastSelectedDate);else newDate=ASPxClientCalendar.GetPrevMonthDate(this.lastSelectedDate);} this.CorrectVisibleMonth(newDate,false);this.DoKeyboardSelection(newDate);}return true;},OnPageDown:function(evt){if(this.IsFastNavigationActive())this.GetFastNavigation().OnPageDown(evt);else if(!this.readOnly){var newDate=this.GetNearestDayForToday();if(_aspxIsExists(this.lastSelectedDate)){if(evt.ctrlKey)newDate=ASPxClientCalendar.GetNextYearDate(this.lastSelectedDate);else newDate=ASPxClientCalendar.GetNextMonthDate(this.lastSelectedDate);} this.CorrectVisibleMonth(newDate,true);this.DoKeyboardSelection(newDate);}return true;},OnEndKeyDown:function(evt){if(!this.readOnly&&!this.IsFastNavigationActive()){var newDate=this.GetNearestDayForToday();if(_aspxIsExists(this.lastSelectedDate))newDate=ASPxClientCalendar.CloneDate(this.lastSelectedDate);newDate=ASPxClientCalendar.GetLastDayInMonthDate(newDate);this.CorrectVisibleMonth(newDate,false);this.DoKeyboardSelection(newDate,evt.shiftKey);}return true;},OnHomeKeyDown:function(evt){if(!this.readOnly&&!this.IsFastNavigationActive()){var newDate=this.GetNearestDayForToday();if(_aspxIsExists(this.lastSelectedDate))newDate=ASPxClientCalendar.CloneDate(this.lastSelectedDate);newDate=ASPxClientCalendar.GetFirstDayInMonthDate(newDate);this.CorrectVisibleMonth(newDate,false);this.DoKeyboardSelection(newDate,evt.shiftKey);}return true;},OnEnter:function(){if(this.IsFastNavigationActive())this.GetFastNavigation().OnEnter();return true;},OnEscape:function(){if(this.IsFastNavigationActive())this.GetFastNavigation().OnEscape();return true;},OnShiftMonth:function(offset){if(offset){var date=ASPxClientCalendar.AddMonths(this.visibleDate,offset);this.OnVisibleMonthChanged(date);}},OnDayMouseDown:function(date,shift,ctrl,byWeeks){this.isMouseDown=true;this.selectionByWeeks=byWeeks;this.selectionTransaction.Start();if(this.enableMulti){if(ctrl){this.selectionCtrl=true;this.selectionTransaction.CopyFromBackup();}else this.selectionCtrl=false;if(shift&&_aspxIsExists(this.selectionPrevStartDate)){this.selectionStartDate=this.selectionPrevStartDate;this.selectionTransaction.selection.AddRange(this.selectionStartDate,date);if(byWeeks)this.selectionTransaction.selection.AddWeek(date);}else{this.selectionStartDate=date;this.selectionPrevStartDate=date;if(byWeeks)this.selectionTransaction.selection.AddWeek(date);else this.selectionTransaction.selection.Add(date);}}else this.selectionTransaction.selection.Add(date);this.ApplySelectionByDiff(this.selectionTransaction.selection,false);},OnDayMouseOver:function(date){if(this.enableMulti){if(this.selectionCtrl)this.selectionTransaction.CopyFromBackup();else this.selectionTransaction.selection.Clear();this.selectionTransaction.selection.AddRange(this.selectionStartDate,date);if(this.selectionByWeeks){this.selectionTransaction.selection.AddWeek(date);this.selectionTransaction.selection.AddWeek(this.selectionStartDate);}}else{this.selectionTransaction.selection.Clear();this.selectionTransaction.selection.Add(date);} this.ApplySelectionByDiff(this.selectionTransaction.selection,false);},OnDayMouseUp:function(date){if(!__aspxIE&&this.isMouseDown)this.OnMainElementClick();this.isMouseDown=false;if(this.enableMulti&&this.selectionCtrl&&this.selectionTransaction.backup.Contains(date)&&ASPxClientCalendar.AreDatesEqual(date,this.selectionStartDate)){if(this.selectionByWeeks)this.selectionTransaction.selection.RemoveWeek(date);else this.selectionTransaction.selection.Remove(date);} this.lastSelectedDate=ASPxClientCalendar.CloneDate(date);this.OnSelectionChanging();},OnTodayClick:function(){var now=new Date();var date=new Date(now.getFullYear(),now.getMonth(),now.getDate());if(this.IsDateInRange(date)){this.selectionTransaction.Start();this.selectionTransaction.selection.Add(date);this.OnSelectionChanging();if(!ASPxClientCalendar.AreDatesOfSameMonth(date,this.visibleDate))this.OnVisibleMonthChanged(date);}},OnClearClick:function(){this.selectionTransaction.Start();this.OnSelectionChanging();this.selectionStartDate=null;this.selectionPrevStartDate=null;this.lastSelectedDate=null;},OnSelectMonth:function(row,column){var txn=this.selectionTransaction;txn.Start();var date=ASPxClientCalendar.CloneDate(this.GetView(row,column).visibleDate);date.setDate(1);do{if(this.IsDateInRange(date))txn.selection.Add(date);date=ASPxClientCalendar.AddDays(date,1);}while(date.getDate()>1);this.OnSelectionChanging();},OnTitleClick:function(row,column){this.fastNavigation.activeView=this.GetView(row,column);this.fastNavigation.Prepare();this.fastNavigation.Show();},OnMainElementClick:function(){this.SetFocus();this.MainElementClick.FireEvent(this);},OnSelectionChanging:function(){if(!this.SelectionChanging.IsEmpty()){var args=new ASPxClientCalendarSelectionEventArgs(false,this.selectionTransaction.selection);this.SelectionChanging.FireEvent(this,args);} var changed=this.selectionTransaction.IsChanged();this.selectionTransaction.Commit();if(changed)this.OnValueChanged();},OnVisibleMonthChanged:function(date){var offsetInternal=ASPxClientCalendar.GetOffsetInMonths(this.visibleDate,date);this.SetVisibleDate(date);var processOnServer=this.RaiseVisibleMonthChanged(offsetInternal);if(processOnServer)this.SendPostBackInternal("");},OnSelectionCancelled:function(){this.isMouseDown=false;this.selectionTransaction.Rollback();},RaiseValueChangedEvent:function(){var processOnServer=ASPxClientEdit.prototype.RaiseValueChangedEvent.call(this);processOnServer=this.RaiseSelectionChanged(processOnServer);return processOnServer;},SetVisibleDate:function(date){var old=this.visibleDate;this.visibleDate=date;this.SaveClientState();if(!ASPxClientCalendar.AreDatesOfSameMonth(date,old))this.Update();},SetSelectedDate:function(date){if(this.IsDateInRange(date)){var selection=new ASPxClientCalendarSelection();if(date!=null){selection.Add(date);this.lastSelectedDate=ASPxClientCalendar.CloneDate(date);} this.ApplySelectionByDiff(selection,true);}},CorrectVisibleMonth:function(newDate,isForwardDirection){var offset=ASPxClientCalendar.GetOffsetInMonths(this.visibleDate,newDate);if(this.IsMultiView()&&offset!=0){var view=isForwardDirection?this.GetView(this.rows-1,this.columns-1):this.GetView(0,0);offset=this.IsDateVisible(newDate)?0:ASPxClientCalendar.GetOffsetInMonths(view.visibleDate,newDate);}if(!this.IsDateInRange(newDate))offset=0;if(offset!=0)this.OnShiftMonth(offset);},DoKeyboardSelection:function(date,shift){if(this.IsDateInRange(date)){this.isDateChangingByKeyboard=true;this.selectionTransaction.Start();if(this.enableMulti&&shift&&_aspxIsExists(this.selectionStartDate))this.selectionTransaction.selection.AddRange(this.selectionStartDate,date);else{this.selectionTransaction.selection.Add(date);this.selectionStartDate=date;} this.lastSelectedDate=ASPxClientCalendar.CloneDate(date);this.OnSelectionChanging();this.isDateChangingByKeyboard=false;}},GetNearestDayForToday:function(){var now=new Date();var ret=new Date(now.getFullYear(),now.getMonth(),now.getDate());if(_aspxIsExists(this.minDate)&&!this.IsDateInRange(ret))ret=ASPxClientCalendar.CloneDate(this.minDate);return ret;},GetSelectedDate:function(){return this.GetValue();},GetVisibleDate:function(){return this.visibleDate;},SelectDate:function(date){if(_aspxIsExists(date)){this.selection.Add(date);this.Update();}},SelectRange:function(start,end){if(_aspxIsExists(start)&&_aspxIsExists(end)){this.selection.AddRange(start,end);this.Update();}},DeselectDate:function(date){if(_aspxIsExists(date)){this.selection.Remove(date);this.Update();}},DeselectRange:function(start,end){if(_aspxIsExists(start)&&_aspxIsExists(end)){this.selection.RemoveRange(start,end);this.Update();}},ClearSelection:function(){this.selection.Clear();this.Update();},GetSelectedDates:function(){return this.selection.GetDates();},RaiseSelectionChanged:function(processOnServer){if(!this.SelectionChanged.IsEmpty()){var args=new ASPxClientProcessingModeEventArgs(processOnServer);this.SelectionChanged.FireEvent(this,args);processOnServer=args.processOnServer;}return processOnServer;},RaiseVisibleMonthChanged:function(offsetInternal){var processOnServer=this.autoPostBack;if(!this.VisibleMonthChanged.IsEmpty()){var args=new ASPxClientProcessingModeEventArgs(processOnServer);args.offsetInternal=offsetInternal;this.VisibleMonthChanged.FireEvent(this,args);processOnServer=args.processOnServer;}return processOnServer;},ChangeEnabledAttributes:function(enabled){_aspxChangeDocumentEventsMethod(enabled)("mouseup",aspxCalDocMouseUp);_aspxChangeEventsMethod(enabled)(this.GetMainElement(),"click",new Function("aspxCalMainElemClick('"+this.name+"');"));var inputElement=this.GetInputElement();if(_aspxIsExists(inputElement))this.ChangeSpecialInputEnabledAttributes(inputElement,_aspxChangeEventsMethod(enabled));var btnElement=this.GetTodayButton();if(_aspxIsExists(btnElement))this.ChangeButtonEnabledAttributes(btnElement,_aspxChangeAttributesMethod(enabled));btnElement=this.GetClearButton();if(_aspxIsExists(btnElement))this.ChangeButtonEnabledAttributes(btnElement,_aspxChangeAttributesMethod(enabled));for(var key in this.views){var view=this.views[key];if(view.constructor!=ASPxClientCalendarView)continue;view.ChangeEnabledAttributes(enabled);}},ChangeEnabledStateItems:function(enabled){aspxGetStateController().SetElementEnabled(this.GetMainElement(),enabled);var btnElement=this.GetTodayButton();if(_aspxIsExists(btnElement))aspxGetStateController().SetElementEnabled(btnElement,enabled);btnElement=this.GetClearButton();if(_aspxIsExists(btnElement))aspxGetStateController().SetElementEnabled(btnElement,enabled);for(var key in this.views){var view=this.views[key];if(view.constructor!=ASPxClientCalendarView)continue;view.ChangeEnabledStateItems(enabled);} this.UpdateInternal();},ChangeButtonEnabledAttributes:function(element,method){method(element,"onclick");method(element,"ondblclick");}});ASPxClientCalendar.AreDatesEqual=function(date1,date2){if(date1==date2)return true;if(!date1||!date2)return false;return date1.getFullYear()==date2.getFullYear()&&date1.getMonth()==date2.getMonth()&&date1.getDate()==date2.getDate();} ASPxClientCalendar.AreDatesOfSameMonth=function(date1,date2){if(!date1||!date2)return false;return date1.getFullYear()==date2.getFullYear()&&date1.getMonth()==date2.getMonth();} ASPxClientCalendar.GetUTCTime=function(date){return Date.UTC(date.getFullYear(),date.getMonth(),date.getDate());} ASPxClientCalendar.GetFirstDayOfYear=function(date){return new Date(date.getFullYear(),0,1);} ASPxClientCalendar.GetDayOfYear=function(date){var ms=ASPxClientCalendar.GetUTCTime(date)-ASPxClientCalendar.GetUTCTime(ASPxClientCalendar.GetFirstDayOfYear(date));return 1+Math.floor(ms/__aspxCalendarMsPerDay);} ASPxClientCalendar.GetISO8601WeekOfYear=function(date){var firstDate=new Date(date.getFullYear(),0,1);var firstDayOfWeek=firstDate.getDay();if(firstDayOfWeek==0)firstDayOfWeek=7;var daysInFirstWeek=8-firstDayOfWeek;var lastDate=new Date(date.getFullYear(),11,31);var lastDayOfWeek=lastDate.getDay();if(lastDayOfWeek==0)lastDayOfWeek=7;var daysInLastWeek=8-lastDayOfWeek;var fullWeeks=Math.ceil((ASPxClientCalendar.GetDayOfYear(date)-daysInFirstWeek)/7);var result=fullWeeks;if(daysInFirstWeek>3)result++;var isThursday=firstDayOfWeek==4||lastDayOfWeek==4;if(result>52&&!isThursday)result=1;if(result==0)return ASPxClientCalendar.GetISO8601WeekOfYear(new Date(date.getFullYear()-1,11,31));return result;} ASPxClientCalendar.GetNextWeekDate=function(date){var ret=new Date(date.getTime());var newDay=date.getDate()+7;ret.setDate(newDay);return ret;} ASPxClientCalendar.GetPrevWeekDate=function(date){var ret=new Date(date.getTime());var newDay=date.getDate()-7;ret.setDate(newDay);return ret;} ASPxClientCalendar.GetTomorrowDate=function(date){var ret=new Date(date.getTime());ret.setDate(ret.getDate()-1);return ret;} ASPxClientCalendar.GetYesterDate=function(date){var ret=new Date(date.getTime());ret.setDate(ret.getDate()+1);return ret;} ASPxClientCalendar.GetNextMonthDate=function(date){var ret=new Date(date.getTime());var maxDateInNextMonth=ASPxClientCalendar.GetDaysInMonth(ret.getMonth()+1,ret.getFullYear());if(ret.getDate()>maxDateInNextMonth)ret.setDate(maxDateInNextMonth);ret.setMonth(ret.getMonth()+1);return ret;} ASPxClientCalendar.GetNextYearDate=function(date){var ret=new Date(date.getTime());var maxDateInPrevYearMonth=ASPxClientCalendar.GetDaysInMonth(ret.getMonth(),ret.getFullYear()+1);if(ret.getDate()>maxDateInPrevYearMonth)ret.setDate(maxDateInPrevYearMonth);ret.setFullYear(ret.getFullYear()+1);return ret;} ASPxClientCalendar.GetPrevMonthDate=function(date){var ret=new Date(date.getTime());var maxDateInPrevMonth=ASPxClientCalendar.GetDaysInMonth(ret.getMonth()-1,ret.getFullYear());if(ret.getDate()>maxDateInPrevMonth)ret.setDate(maxDateInPrevMonth);ret.setMonth(ret.getMonth()-1);return ret;} ASPxClientCalendar.GetPrevYearDate=function(date){var ret=new Date(date.getTime());var maxDateInPrevYearMonth=ASPxClientCalendar.GetDaysInMonth(ret.getMonth(),ret.getFullYear()-1);if(ret.getDate()>maxDateInPrevYearMonth)ret.setDate(maxDateInPrevYearMonth);ret.setFullYear(ret.getFullYear()-1);return ret;} ASPxClientCalendar.GetFirstDayInMonthDate=function(date){var ret=new Date(date.getTime());ret.setDate(1);return ret;} ASPxClientCalendar.GetLastDayInMonthDate=function(date){var ret=new Date(date.getTime());var maxDateInYearMonth=ASPxClientCalendar.GetDaysInMonth(ret.getMonth(),ret.getFullYear());ret.setDate(maxDateInYearMonth);return ret;} ASPxClientCalendar.AddDays=function(date,count){var newDate=ASPxClientCalendar.CloneDate(date);newDate.setUTCDate(count+newDate.getUTCDate());var offset=newDate.getTimezoneOffset()-date.getTimezoneOffset();if(offset>0)newDate.setMinutes(newDate.getMinutes()+offset);return newDate;} ASPxClientCalendar.AddMonths=function(date,count){var newDate=ASPxClientCalendar.CloneDate(date);newDate.setMonth(count+newDate.getMonth());if(newDate.getDate()0){this.dates={};this.count=0;}},Equals:function(selection){if(this.count!=selection.count)return false;for(var key in this.dates){if(this.dates[key].constructor!=Date)continue;if(!selection.ContainsKey(key))return false;}return true;},Contains:function(date){var key=this.GetKey(date);return this.ContainsKey(key);},ContainsKey:function(key){return _aspxIsExists(this.dates[key]);},Add:function(date){var key=this.GetKey(date);if(!this.ContainsKey(key)){this.dates[key]=ASPxClientCalendar.CloneDate(date);this.count++;}},AddArray:function(dates){for(var i=0;i52)weekNumber=ASPxClientCalendar.GetISO8601WeekOfYear(ASPxClientCalendar.AddDays(date,offset));}},UpdateTitle:function(){this.GetTitleElement().innerHTML=__aspxDateFormatInfo.monthNames[this.visibleDate.getMonth()]+" "+this.visibleDate.getFullYear();},UpdateSelection:function(dates,showSelection){var index;var maxIndex=7*__aspxCalendarWeekCount-1;for(var i=0;imaxIndex||!this.IsDateVisible(dates[i]))continue;this.ApplySelectionToCell(index,showSelection);}},ApplySelectionToCell:function(index,showSelection){var cell=this.GetDayCell(index);if(showSelection){var info;if(!_aspxIsExists(this.dayStyleCache[index])){var backup=new ASPxClientCalendarStyleInfo();backup.Import(cell);this.dayStyleCache[index]=backup;info=backup.Clone();}else info=this.dayStyleCache[index].Clone();this.calendar.ImportEtalonStyle(info,"DS");}else info=this.dayStyleCache[index];info.Apply(cell);},ApplyDayCellStyle:function(cell,date){cell.style.cursor="";var cal=this.calendar;var info=new ASPxClientCalendarStyleInfo();var needPointer=false;cal.ImportEtalonStyle(info,"D");if(this.IsDateVisible(date)){if(cal.IsDateWeekend(date))cal.ImportEtalonStyle(info,"DW");if(this.IsDateOtherMonth(date))cal.ImportEtalonStyle(info,"DA");if(!cal.IsDateInRange(date))cal.ImportEtalonStyle(info,"DO");if(ASPxClientCalendar.AreDatesEqual(new Date(),date))cal.ImportEtalonStyle(info,"DT");if(!cal.clientEnabled)cal.ImportEtalonStyle(info,"DD");else if(!cal.enableMulti)needPointer=true;} info.Apply(cell);if(needPointer)_aspxSetPointerCursor(cell);},GetIDPostfix:function(){return "_"+this.row.toString()+"x"+this.column.toString();},GetCachedElementById:function(postfix){if(this.calendar.IsMultiView())postfix+=this.GetIDPostfix();return this.calendar.GetCachedElementById(this.calendar.name+"_"+postfix);},IsDateVisible:function(date){var result=!this.calendar.IsMultiView()||!this.IsDateOtherMonth(date);if(!result){result=result||this.isLowBoundary&&date<=this.visibleDate||this.isHighBoundary&&date>=this.visibleDate;}return result;},MakeDisabledStateItems:function(){var cells=this.GetAuxCells();for(var i=0;i0&&this.calendar.showWeekNumbers)this.auxCells.push(row.cells[0]);}}return this.auxCells;},GetAuxId:function(index){return this.calendar.name+"_AUX_"+this.row+"_"+this.column+"_"+index;}});ASPxClientCalendarFastNavigation=_aspxCreateClass(null,{constructor:function(calendar){this.calendar=calendar;this.activeMonth=-1;this.activeYear=-1;this.startYear=-1;this.activeView=null;this.InitializeUI();},InitializeUI:function(){var item;var prefix=this.GetId();for(var m=0;m<12;m++){item=this.GetMonthItem(m);if(!_aspxIsExistsElement(item))break;item.id=prefix+"_M"+m;_aspxAttachEventToElement(item,"click",new Function("aspxCalFNMClick('"+this.calendar.name+"', "+m+")"));}for(var i=0;i<10;i++){item=this.GetYearItem(i);if(!_aspxIsExistsElement(item))break;item.id=prefix+"_Y"+i;_aspxAttachEventToElement(item,"click",new Function("aspxCalFNYClick('"+this.calendar.name+"', "+i+")"));} _aspxAttachEventToElement(this.GetPopup().GetWindowElement(-1),"click",new Function("aspxCalMainElemClick('"+this.calendar.name+"')"));},Show:function(){this.GetPopup().ShowAtElement(this.activeView.GetTitleElement());},Hide:function(){this.GetPopup().Hide();},SetMonth:function(month){if(month!=this.activeMonth){var prevCell=this.GetMonthItem(this.activeMonth);var cell=this.GetMonthItem(month);if(_aspxIsExistsElement(prevCell))this.ApplyItemStyle(prevCell,false,"M");this.ApplyItemStyle(cell,true,"M");this.activeMonth=month;}},ShiftMonth:function(offset){var month=(this.activeMonth+offset)%12;month=(month<0)?month+12:month;this.SetMonth(month);},SetYear:function(year){var startYear=Math.floor(year/10)*10;this.SetStartYear(startYear);this.SetYearIndex(year-startYear);},SetYearIndex:function(index){var prevIndex=this.activeYear-this.startYear;if(index!=prevIndex){var prevCell=this.GetYearItem(prevIndex);if(_aspxIsExistsElement(prevCell))this.ApplyItemStyle(prevCell,false,"Y");var cell=this.GetYearItem(index);this.ApplyItemStyle(cell,true,"Y");this.activeYear=index+this.startYear;}},SetStartYear:function(year){if(this.startYear==year)return;this.startYear=year;this.PrepareYearList();},ShiftYear:function(offset){this.SetYear(this.activeYear+offset);},ShiftStartYear:function(offset){this.SetStartYear(this.startYear+offset);},ApplyChanges:function(){this.GetPopup().Hide();var offset=ASPxClientCalendar.GetOffsetInMonths(this.calendar.visibleDate,new Date(this.activeYear,this.activeMonth,1));offset-=this.activeView.row*this.calendar.columns+this.activeView.column;if(offset!=0){var date=ASPxClientCalendar.AddMonths(this.calendar.visibleDate,offset);this.calendar.OnVisibleMonthChanged(date);} this.calendar.OnMainElementClick();},CancelChanges:function(){this.GetPopup().Hide();this.calendar.OnMainElementClick();},Prepare:function(){var date=this.activeView.visibleDate;this.activeYear=date.getFullYear();this.activeMonth=date.getMonth();this.startYear=ASPxClientCalendar.GetDecadeStartYear(this.activeYear);this.PrepareMonthList();this.PrepareYearList();},PrepareMonthList:function(){var item;for(var month=0;month<12;month++){item=this.GetMonthItem(month);if(item==null)return;this.ApplyItemStyle(item,month==this.activeMonth,"M");}},PrepareYearList:function(){var year=this.startYear;var item;for(var index=0;index<10;index++){item=this.GetYearItem(index);if(item==null)return;item.innerHTML=year;this.ApplyItemStyle(item,year==this.activeYear,"Y");year++;}},GetMonthItem:function(month){var t=this.GetCachedElementById("m");if(!_aspxIsExistsElement(t))return null;var colIndex=month%4;var rowIndex=(month-colIndex)/4;return t.rows[rowIndex].cells[colIndex];},GetYearItem:function(index){var t=this.GetCachedElementById("y");if(!_aspxIsExistsElement(t)||index<0||index>9)return null;var colIndex=index%5;var rowIndex=(index-colIndex)/5;if(rowIndex==0)colIndex++;return t.rows[rowIndex].cells[colIndex];},GetPopup:function(){return aspxGetControlCollection().Get(this.GetId());},ApplyItemStyle:function(item,isSelected,type){var info=new ASPxClientCalendarStyleInfo();this.calendar.ImportEtalonStyle(info,"FN"+type);if(isSelected)this.calendar.ImportEtalonStyle(info,"FN"+type+"S");info.Apply(item);},GetCachedElementById:function(postfix){return this.calendar.GetCachedElementById(this.GetId()+"_"+postfix);},GetId:function(){return this.calendar.name+"_FNP";},OnArrowUp:function(evt){if(!evt.shiftKey)this.ShiftYear(-5);else this.ShiftMonth(-4);},OnArrowDown:function(evt){if(!evt.shiftKey)this.ShiftYear(5);else this.ShiftMonth(4);},OnArrowLeft:function(evt){if(!evt.shiftKey)this.ShiftYear(-1);else this.ShiftMonth(-1);},OnArrowRight:function(evt){if(!evt.shiftKey)this.ShiftYear(1);else this.ShiftMonth(1);},OnPageUp:function(evt){this.ShiftYear(-10);},OnPageDown:function(evt){this.ShiftYear(10);},OnEnter:function(){this.ApplyChanges();},OnEscape:function(){this.CancelChanges();},OnMonthClick:function(month){this.SetMonth(month);},OnYearClick:function(index){this.SetYearIndex(index);},OnYearShuffle:function(offset){this.ShiftStartYear(offset);},OnOkClick:function(){this.ApplyChanges();},OnCancelClick:function(){this.CancelChanges();}});ASPxClientCalendarStyleInfo=_aspxCreateClass(null,{constructor:function(){this.className="";this.cssText="";},Clone:function(){var clone=new ASPxClientCalendarStyleInfo();clone.className=this.className;clone.cssText=this.cssText;return clone;},Apply:function(element){if(element.className!=this.className)element.className=this.className;if(element._style!=this.cssText){element.style.cssText=this.cssText;element._style=this.cssText;}},Import:function(element){if(element.className.length>0){if(this.className.length>1)this.className+=" ";this.className+=element.className;} var cssText=element.style.cssText;if(cssText.length>0){var pos=cssText.length-1;while(pos>-1&&cssText.charAt(pos)==" ")--pos;if(cssText.charAt(pos)!=";")cssText+=";";this.cssText+=cssText;}}});ASPxClientCalendarSelectionEventArgs=_aspxCreateClass(ASPxClientProcessingModeEventArgs,{constructor:function(processOnServer,selection){this.constructor.prototype.constructor.call(this,processOnServer);this.selection=selection;}});function aspxCalShiftMonth(name,monthOffset){if(monthOffset!=0){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.OnShiftMonth(monthOffset);}} function aspxCalDayMouseEvt(name,row,column,index,e,byWeeks){var cal=aspxGetControlCollection().Get(name);if(cal!=null){var view=cal.GetView(row,column);var date=view.GetDateByIndex(index);if(byWeeks)date=ASPxClientCalendar.AddDays(date,cal.firstDayOfWeek-date.getDay());var allowed=cal.IsDateInRange(date)&&(view.IsDateVisible(date)||byWeeks);switch(e.type){case "mousedown":if(allowed&&_aspxGetIsLeftButtonPressed(e))cal.OnDayMouseDown(date,e.shiftKey,e.ctrlKey,byWeeks);break;case "mouseover":if(allowed){if(cal.forceMouseDown)cal.OnDayMouseDown(date,false,false,false);else if(cal.isMouseDown)cal.OnDayMouseOver(date);}break;case "mouseup":if(cal.isMouseDown){if(allowed)cal.OnDayMouseUp(date);else cal.OnSelectionCancelled();}break;}}} function aspxCalTodayClick(name){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.OnTodayClick();} function aspxCalClearClick(name){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.OnClearClick();} function aspxCalSelectMonth(name,row,column){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.OnSelectMonth(row,column);} function aspxCalTitleClick(name,row,column){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.OnTitleClick(row,column);} function aspxCalFNMClick(name,month){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.fastNavigation.OnMonthClick(month);} function aspxCalFNYClick(name,index){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.fastNavigation.OnYearClick(index);} function aspxCalFNYShuffle(name,offset){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.fastNavigation.OnYearShuffle(offset);} function aspxCalFNBClick(name,action){var edit=aspxGetControlCollection().Get(name);if(edit!=null){switch(action){case "ok":edit.fastNavigation.OnOkClick();break;case "cancel":edit.fastNavigation.OnCancelClick();break;}}} function aspxCalMainElemClick(name){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.OnMainElementClick();} function aspxCalDocMouseUp(evt){var target=_aspxGetEventSource(evt);if(__aspxActiveCalendar!=null&&_aspxIsExistsElement(target)){__aspxActiveCalendar.forceMouseDown=false;if(__aspxActiveCalendar.isMouseDown){for(var key in __aspxActiveCalendar.views){var view=__aspxActiveCalendar.views[key];if(view.constructor!=ASPxClientCalendarView)continue;var monthCell=view.GetMonthCell();var parent=target.parentNode;while(_aspxIsExistsElement(parent)){if(parent==monthCell)return;parent=parent.parentNode;}} __aspxActiveCalendar.OnSelectionCancelled();} __aspxActiveCalendar=null;}} function aspxCalCancelSelect(){if(__aspxActiveCalendar!=null){__aspxActiveCalendar.forceMouseDown=false;__aspxActiveCalendar.OnSelectionCancelled();}} var __aspxLabelValueSuffix="_V";ASPxClientStaticEdit=_aspxCreateClass(ASPxClientEditBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.Click=new ASPxClientEvent();},OnClick:function(htmlEvent){this.RaiseClick(this.GetMainElement(),htmlEvent);},RaiseClick:function(htmlElement,htmlEvent){if(!this.Click.IsEmpty()){var args=new ASPxClientEditClickEventArgs(htmlElement,htmlEvent);this.Click.FireEvent(this,args);}},ChangeEnabledAttributes:function(enabled){this.ChangeMainElementAttributes(this.GetMainElement(),_aspxChangeAttributesMethod(enabled));},ChangeEnabledStateItems:function(enabled){aspxGetStateController().SetElementEnabled(this.GetMainElement(),enabled);},ChangeMainElementAttributes:function(element,method){method(element,"onclick");}});ASPxClientEditClickEventArgs=_aspxCreateClass(ASPxClientEventArgs,{constructor:function(htmlElement,htmlEvent){this.constructor.prototype.constructor.call(this);this.htmlElement=htmlElement;this.htmlEvent=htmlEvent;}});ASPxClientHyperLink=_aspxCreateClass(ASPxClientStaticEdit,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);},GetNavigateUrl:function(){var element=this.GetMainElement();if(_aspxIsExistsElement(element))return element.href;return "";},SetNavigateUrl:function(url){var element=this.GetMainElement();if(_aspxIsExistsElement(element))element.href=url;},GetText:function(){return this.GetValue();},SetText:function(value){this.SetValue(value);},ChangeMainElementAttributes:function(element,method){ASPxClientStaticEdit.prototype.ChangeMainElementAttributes.call(this,element,method);method(element,"href");}});ASPxClientImageBase=_aspxCreateClass(ASPxClientStaticEdit,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);},GetWidth:function(){return this.GetSize(true);},GetHeight:function(){return this.GetSize(false);},SetSize:function(width,height){var image=this.GetMainElement();if(_aspxIsExistsElement(image))ASPxImageUtils.SetSize(image,width,height);},GetSize:function(isWidth){var image=this.GetMainElement();if(_aspxIsExistsElement(image))return ASPxImageUtils.GetSize(image,isWidth);return-1;}});ASPxClientImage=_aspxCreateClass(ASPxClientImageBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.isEmpty=false;},GetValue:function(){if(this.isEmpty)return "";var image=this.GetMainElement();if(_aspxIsExistsElement(image))return ASPxImageUtils.GetImageSrc(image);return "";},SetValue:function(value){if(value==null)value="";this.isEmpty=value=="";var image=this.GetMainElement();if(_aspxIsExistsElement(image))ASPxImageUtils.SetImageSrc(image,value);},GetImageUrl:function(url){return this.GetValue();},SetImageUrl:function(url){this.SetValue(url);}});ASPxClientBinaryImage=_aspxCreateClass(ASPxClientImageBase,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);},GetValue:function(){return "";},SetValue:function(value){}});ASPxClientLabel=_aspxCreateClass(ASPxClientStaticEdit,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);},GetValue:function(){var element=this.GetMainElement();if(_aspxIsExistsElement(element))return element.innerHTML;},SetValue:function(value){if(value==null)value="";var element=this.GetMainElement();if(_aspxIsExistsElement(element))element.innerHTML=value;},SetVisible:function(visible){if(this.clientVisible!=visible){this.clientVisible=visible;var element=this.GetMainElement();if(!visible)element.style.display="none";else if((element.style.width!=""||element.style.height!="")&&!__aspxNS)element.style.display="inline-block";else element.style.display="";}},GetText:function(){return this.GetValue();},SetText:function(value){this.SetValue(value);},ChangeMainElementAttributes:function(element,method){ASPxClientStaticEdit.prototype.ChangeMainElementAttributes.call(this,element,method);method(element,"htmlFor");}});function aspxSEClick(name,evt){var edit=aspxGetControlCollection().Get(name);if(edit!=null)edit.OnClick(evt);} ASPxClientButton=_aspxCreateClass(ASPxClientControl,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.isASPxClientButton=true;this.allowFocus=true;this.autoPostBackFunction=null;this.causesValidation=true;this.checked=false;this.clickLocked=false;this.groupName="";this.focusElementSelected=false;this.pressed=false;this.useSubmitBehavior=true;this.validationGroup="";this.validationContainerID=null;this.buttonCell=null;this.contentDiv=null;this.checkedInput=null;this.buttonImage=null;this.internalButton=null;this.textElement=null;this.textControl=null;this.textContainer=null;this.isTextEmpty=false;this.CheckedChanged=new ASPxClientEvent();this.GotFocus=new ASPxClientEvent();this.LostFocus=new ASPxClientEvent();this.Click=new ASPxClientEvent();},InlineInitialize:function(){this.InitializeEvents();this.InitializeEnabled();this.InitializeChecked();this.PreventButtonImageDragging();},InitializeEnabled:function(){this.SetEnabledInternal(this.clientEnabled,true);},InitializeChecked:function(){this.SetCheckedInternal(this.checked,true);},InitializeEvents:function(){if(!this.isNative){var element=this.GetInternalButton();if(_aspxIsExists(element))element.onfocus=null;var textControl=this.GetTextControl();if(_aspxIsExists(textControl)){if(__aspxIE)_aspxAttachEventToElement(textControl,"onmouseup",_aspxClearSelection);_aspxPreventElementDragAndSelect(textControl,false);}} var name=this.name;this.onClick=function(){var processOnServer=aspxBClick(name);if(!processOnServer){var evt=_aspxGetEvent(arguments[0]);if(evt)_aspxPreventEvent(evt);}return processOnServer;};this.onGotFocus=function(){aspxBGotFocus(name);};this.onLostFocus=function(){aspxBLostFocus(name);};this.onKeyUp=function(evt){aspxBKeyUp(evt,name);};this.onKeyDown=function(evt){aspxBKeyDown(evt,name);};if(!this.isNative){this.AttachNativeHandlerToMainElement("focus","SetFocus");this.AttachNativeHandlerToMainElement("click","DoClick");var element=this.GetInternalButton();if(_aspxIsExists(element))element.name=this.uniqueID;}},PreventButtonImageDragging:function(){var image=this.GetButtonImage();if(_aspxIsExists(image)){if(__aspxNS)image.onmousedown=function(evt){evt.cancelBubble=true;return false;};else image.ondragstart=function(){return false;};}},AttachNativeHandlerToMainElement:function(handlerName,correspondingMethodName){var mainElement=this.GetMainElement();if(!_aspxIsExistsElement(mainElement))return;eval("mainElement."+handlerName+" = function() { _aspxBCallButtonMethod('"+this.name+"', '"+correspondingMethodName+"'); }");},GetContentDiv:function(){if(!_aspxIsExistsElement(this.contentDiv))this.contentDiv=this.GetChild("_CD");return this.contentDiv;},GetButtonCell:function(){if(!_aspxIsExistsElement(this.buttonCell))this.buttonCell=this.GetChild("_B");return this.buttonCell;},GetButtonCheckedInput:function(){if(!_aspxIsExistsElement(this.checkedInput))this.checkedInput=_aspxGetElementById(this.name+"_CH");return this.checkedInput;},GetButtonImage:function(){if(!_aspxIsExistsElement(this.buttonImage))this.buttonImage=_aspxGetChildByTagName(this.GetButtonCell(),"IMG",0);return this.buttonImage;},GetInternalButton:function(){if(!_aspxIsExistsElement(this.internalButton))this.internalButton=this.isNative?this.GetMainElement():_aspxGetChildByTagName(this.GetMainElement(),"INPUT",0);return this.internalButton;},GetInternalButtonForClick:function(){var button=this.GetInternalButton();if(!_aspxIsExists(button)&&__aspxSafariFamily)button=this.CreateInternalButton();return button;},CreateInternalButton:function(){var button=document.createElement("INPUT");button.type="submit";button.name=this.uniqueID;button.style.width="0";button.style.height="0";button.style.padding="0";button.style.borderStyle="none";button.style.backgroundColor="Transparent";var mainElement=this.GetMainElement();mainElement.appendChild(button);return button;},GetTextContainer:function(){if(!_aspxIsExists(this.textContainer)){var textElement=this.GetTextElement();this.textContainer=_aspxGetChildByTagName(textElement,"SPAN",0);}return this.textContainer;},GetTextElement:function(){if(!_aspxIsExistsElement(this.textElement)){var contentDiv=this.GetContentDiv();if(this.GetButtonImage()==null)this.textElement=contentDiv;else{this.textElement=_aspxGetChildByTagName(contentDiv,"TD",0);var img=_aspxGetChildByTagName(this.textElement,"IMG",0);if(_aspxIsExists(img))this.textElement=_aspxGetChildByTagName(contentDiv,"TD",1);}}return this.textElement;},GetTextControl:function(){if(!_aspxIsExistsElement(this.textControl))this.textControl=_aspxGetParentByTagName(this.GetTextElement(),"table");if(!_aspxIsExistsElement(this.textControl)||(this.textControl.id==this.name))this.textControl=this.GetTextElement();return this.textControl;},GetPostfixes:function(){return this.isNative?[""]:["_B"];},IsHovered:function(){var hoverElement=this.isNative?this.GetMainElement():this.GetButtonCell();return aspxGetStateController().currentHoverItemName==hoverElement.id;},SetEnabledInternal:function(enabled,initialization){if(!this.enabled)return;if(!initialization||!enabled)this.ChangeEnabledStateItems(enabled);this.ChangeEnabledAttributes(enabled);},ChangeEnabledAttributes:function(enabled){if(this.isNative)this.GetMainElement().disabled=!enabled;else{var element=this.GetInternalButton();if(_aspxIsExists(element))element.disabled=!enabled;} this.ChangeEnabledEventsAttributes(_aspxChangeEventsMethod(enabled));},ChangeEnabledEventsAttributes:function(method){var element=this.GetMainElement();method(element,"click",this.onClick);if(this.allowFocus){if(!this.isNative)element=this.GetInternalButton();if(_aspxIsExists(element)){method(element,"focus",this.onGotFocus);method(element,"blur",this.onLostFocus);if(!this.isNative){method(element,"keyup",this.onKeyUp);method(element,"blur",this.onKeyUp);method(element,"keydown",this.onKeyDown);}}}},ChangeEnabledStateItems:function(enabled){if(!this.isNative){aspxGetStateController().SetElementEnabled(this.GetButtonCell(),enabled);this.UpdateFocusedStyle();}},OnFocus:function(){if(!this.allowFocus)return false;this.focused=true;if(this.isInitialized)this.RaiseFocus();this.UpdateFocusedStyle();},OnLostFocus:function(){if(!this.allowFocus)return false;this.focused=false;if(this.isInitialized)this.RaiseLostFocus();this.UpdateFocusedStyle();},CauseValidation:function(){if(this.causesValidation&&_aspxIsExistsType(typeof(ASPxClientEdit)))return(this.validationContainerID!=null)?ASPxClientEdit.ValidateEditorsInContainerById(this.validationContainerID,this.validationGroup):ASPxClientEdit.ValidateGroup(this.validationGroup);else return true;},OnClick:function(){if(this.clickLocked)return true;else if(this.checked&&this.groupName!=""&&this.GetCheckedGroupList().length>1)return;this.SetFocus();var isValid=this.CauseValidation();var processOnServer=this.autoPostBack;if(this.groupName!=""){if(this.GetCheckedGroupList().length==1)this.SetCheckedInternal(!this.checked,false);else{this.SetCheckedInternal(true,false);this.ClearButtonGroupChecked(true);} processOnServer=this.RaiseCheckedChanged();if(processOnServer&&isValid)this.SendPostBack("CheckedChanged");} processOnServer=this.RaiseClick();if(processOnServer&&isValid){this.SendPostBack("Click");return true;}return false;},OnKeyUp:function(evt){if(this.pressed)this.SetUnpressed();},OnKeyDown:function(evt){if(evt.keyCode==ASPxKey.Enter||evt.keyCode==ASPxKey.Space)this.SetPressed();},GetChecked:function(){return this.groupName!=""?this.GetButtonCheckedInput().value=="1":false;},GetCheckedGroupList:function(){var collection=aspxGetControlCollection();var result=new Array();for(var name in collection.elements){var element=collection.elements[name];if(element!=null&&ASPxIdent.IsASPxClientButton(element)&&(element.groupName==this.groupName))_aspxArrayPush(result,element);}return result;},ClearButtonGroupChecked:function(raiseCheckedChanged){var list=this.GetCheckedGroupList();for(var i=0;i1){var difHeight=Math.floor(absDif/2);if(incBtnHeight>dcBtnHeight){incBtnHeight-=difHeight;dcBtnHeight+=difHeight;}else{dcBtnHeight-=difHeight;incBtnHeight+=difHeight;}}if(__aspxOpera){var d=decButton.offsetHeight-incButton.offsetHeight;dcBtnHeight=dcBtnHeight-d;incBtnHeight=incBtnHeight+d;} this.SetElementHeigth(incButton,incBtnHeight);this.SetElementHeigth(decButton,dcBtnHeight);}},ChangeNumber:function(offset){if(!this.readOnly){var newNumber=this.GetValidNumber(this.ParseNumber((this.number+offset).toPrecision(10),"Decimal"),this.number);if(newNumber!=this.number){this.SetNumberInternal(newNumber);this.OnValueChanged();} this.SelectInputElement();}},ProcessInternalButtonClick:function(number){var ret=false;this.ParseValueAfterPaste();if(this.largeDecButtonIndex==number){this.ChangeNumber(-this.largeInc);ret=true;}else if(this.incButtonIndex==number){this.ChangeNumber(this.inc);ret=true;}else if(this.decButtonIndex==number){this.ChangeNumber(-this.inc);ret=true;}else if(this.largeIncButtonIndex==number){this.ChangeNumber(this.largeInc);ret=true;}return ret;},GetButtonNumber:function(id){var pos=id.lastIndexOf(__aspxSpindButtonIdPostfix);if(pos>-1)return id.substring(pos+__aspxSpindButtonIdPostfix.length,id.length);return null;},GetCorrectNumberInRange:function(number){if(this.UseRestrictions()&&number>this.maxValue)number=this.maxValue;if(this.UseRestrictions()&&numberthis.number))validNumber=this.minValue;else if(this.UseRestrictions()&&number>this.maxValue&&(this.number==null||number=this.minValue))validNumber=number;else validNumber=this.number;if(!this.IsFloatNumber())validNumber=Math.round(validNumber);if((this.maxLength>0)&&(validNumber.toString().length>this.maxLength))validNumber=oldNumber;return validNumber;},GetValueType:function(){return this.IsFloatNumber()?"Decimal":"Int";},GetFormattedNumber:function(number){if(number==null)return "";var value=String(number);if(__aspxNumberDecimalSeparator!="."){if(value.indexOf(".")!=-1)value=value.replace(".",__aspxNumberDecimalSeparator);} value=this.GetCorrectFormattedNumberString(value);return value;},GetNextTimerInterval:function(iterationIndex){var coef=1/iterationIndex;if(coef<0.13)coef=0.13;return coef*__aspxSERepeatBtnMaxIntervalDelay;},IsFloatNumber:function(){return this.numberType=="f";},DoRepeatButtonClick:function(num,iterationIndex){this.ProcessInternalButtonClick(num);var timerInterval=this.GetNextTimerInterval(iterationIndex);if(iterationIndex<50)iterationIndex++;this.SetButtonRepeatClickTimer(num,timerInterval,iterationIndex);},ParseValue:function(){var inputElement=this.GetInputElement();if(_aspxIsExistsElement(inputElement)){var valueString=inputElement.value;var newNumber=(valueString!="")?this.ParseValueInternal(valueString):null;if((newNumber!=null)&&!isNaN(newNumber)){if(newNumber!=this.number){newNumber=this.GetCorrectNumberInRange(newNumber);this.SetNumberInternal(newNumber);this.OnValueChanged();}}else{if(this.allowNull)this.SetNumberInternal(null);else this.SetNumberInternal(this.GetCorrectNumberInRange(0));this.OnValueChanged();}}},ParseValueAfterPaste:function(){if(this.isChangingCheckProcessed){this.ParseValue();this.isChangingCheckProcessed=false;}},ParseValueOnPaste:function(){var inputElement=this.GetInputElement();if(_aspxIsExistsElement(inputElement)){var valueString=inputElement.value;if(valueString!=""){if(!this.IsValidNumberString(valueString)){valueString=this.lastValue;inputElement.value=this.lastValue;}else this.lastValue=valueString;} var newNumber=(valueString!="")?this.ParseValueInternal(valueString):null;if(newNumber!=null)this.SetNumberInternal(newNumber);}},ParseValueInternal:function(value){if(value==null||value.toString()=="")return null;if(__aspxNumberDecimalSeparator!="."){if(value.indexOf(__aspxNumberDecimalSeparator)!=-1)value=value.replace(__aspxNumberDecimalSeparator,".");}if(typeof(value)=="number")return value;return this.ParseNumber(value.toString(),this.GetValueType());},ParseNumber:function(value,type){if(type=="Decimal")return parseFloat(value,10);return parseInt(value,10);},RaiseValueChangedEvent:function(){return this.OnNumberChanged();},SetNumberInternal:function(value){this.number=value;var inputElement=this.GetInputElement();if(inputElement!=null){this.UpdateSelectionStartAndEndPosition(inputElement);var formattedNumber=this.GetFormattedNumber(this.number);if(formattedNumber.toString()!=inputElement.value)inputElement.value=formattedNumber;_aspxSetSelectionCore(inputElement,inputElement.selectionStart,inputElement.selectionEnd);this.UpdateLastCorrectValueString();}},UseRestrictions:function(){return(this.maxValue!=0||this.minValue!=0);},UpdateLastCorrectValueString:function(){this.lastValue=this.GetInputElement().value;},GetValue:function(){var input=this.GetInputElement();if(!_aspxIsExistsElement(input))return null;if(this.allowNull&&input.value=="")return null;else if(!this.allowNull&&this.number==null)return this.GetCorrectNumberInRange(0);else return this.number;},SetValue:function(number){this.number=number;ASPxClientButtonEditBase.prototype.SetValue.call(this,this.GetFormattedNumber(this.number));},ChangeEnabledAttributes:function(enabled){ASPxClientButtonEditBase.prototype.ChangeEnabledAttributes.call(this,enabled);var btnElement=this.GetIncrementButton();if(_aspxIsExists(btnElement))this.ChangeButtonEnabledAttributes(btnElement,_aspxChangeAttributesMethod(enabled));btnElement=this.GetDecrementButton();if(_aspxIsExists(btnElement))this.ChangeButtonEnabledAttributes(btnElement,_aspxChangeAttributesMethod(enabled));btnElement=this.GetLargeIncrementButton();if(_aspxIsExists(btnElement))this.ChangeButtonEnabledAttributes(btnElement,_aspxChangeAttributesMethod(enabled));btnElement=this.GetLargeDecrementButton();if(_aspxIsExists(btnElement))this.ChangeButtonEnabledAttributes(btnElement,_aspxChangeAttributesMethod(enabled));},ChangeEnabledStateItems:function(enabled){this.ClearButtonRepeatClickTimer();ASPxClientButtonEditBase.prototype.ChangeEnabledStateItems.call(this,enabled);var btnElement=this.GetIncrementButton();if(_aspxIsExists(btnElement))aspxGetStateController().SetElementEnabled(btnElement,enabled);btnElement=this.GetDecrementButton();if(_aspxIsExists(btnElement))aspxGetStateController().SetElementEnabled(btnElement,enabled);btnElement=this.GetLargeIncrementButton();if(_aspxIsExists(btnElement))aspxGetStateController().SetElementEnabled(btnElement,enabled);btnElement=this.GetLargeDecrementButton();if(_aspxIsExists(btnElement))aspxGetStateController().SetElementEnabled(btnElement,enabled);},OnAfterSetPressed:function(id){var num=this.GetButtonNumber(id);if(num!=null)this.SetButtonRepeatClickTimer(num,300,1);},OnAfterClearPressed:function(id){this.ClearButtonRepeatClickTimer();},OnButtonMouseDown:function(evt){if(!__aspxNS)this.LockFocusEvents();if(__aspxNS)evt.preventDefault();},OnKeyPress:function(evt){ASPxClientTextEdit.prototype.OnKeyPress.call(this,evt);var inputElement=this.GetInputElement();if(!_aspxIsExists(inputElement)){if(this.pasteTimerID!=-1)this.ClearTextChangingTimer();return;} this.keyUpProcessing=true;if(!__aspxIE&&this.IsPasteShortcut(evt))this.keyUpProcessing=false;if(evt.altKey||evt.ctrlKey)return true;var keyCode=_aspxGetKeyCode(evt);if(this.IsSpecialKey(evt,false)){this.keyUpProcessing=true;return true;} this.UpdateSelectionStartAndEndPosition(inputElement);var selectionStart=inputElement.selectionStart;var selectionEnd=inputElement.selectionEnd;var pressed=String.fromCharCode(keyCode);if(!this.IsAllowableSymbol(pressed)){this.keyUpProcessing=false;return _aspxPreventEvent(evt);}if(this.IsSignSymbol(pressed)){var isAllowTypeNumberSignSymbol=this.IsAllowTypeNumberSignSymbol(selectionStart,selectionEnd);this.keyUpProcessing=isAllowTypeNumberSignSymbol;return isAllowTypeNumberSignSymbol?true:_aspxPreventEvent(evt);}if(this.IsDecimalSeparatorSymbol(pressed)){var isAllowTypeDecimalSeparator=this.IsAllowTypeDecimalSeparatorSymbol(selectionStart,selectionEnd);if(isAllowTypeDecimalSeparator)this.TypeDecimalSeparator(selectionStart,selectionEnd);this.keyUpProcessing=isAllowTypeDecimalSeparator;return _aspxPreventEvent(evt);}if(!this.IsAllowTypeDigitToCurrentPosition(selectionStart,selectionEnd,pressed)){this.keyUpProcessing=false;return _aspxPreventEvent(evt);}return true;},OnKeyUp:function(evt){ASPxClientTextEdit.prototype.OnKeyUp.call(this,evt);if(this.keyUpProcessing){this.UpdateLastCorrectValueString();this.keyUpProcessing=false;}if(this.IsPageOrArrowKey(evt))this.OnPageOrArrowKeyUp();},OnKeyDown:function(evt){if(evt.keyCode==ASPxKey.Enter)this.OnTextChanged();ASPxClientTextEdit.prototype.OnKeyDown.call(this,evt);if(this.IsPageOrArrowKey(evt))this.OnPageOrArrowKeyDown(evt);if((__aspxIE)&&this.IsSpecialKey(evt,true))this.keyUpProcessing=true;},OnPageOrArrowKeyDown:function(evt){var btnIndex=this.GetButtonIndexByKeyCode(_aspxGetKeyCode(evt),evt.ctrlKey);if(__aspxOpera)this.SetButtonRepeatClickTimer(btnIndex,60,1);else{this.ProcessInternalButtonClick(btnIndex);_aspxPreventEvent(evt);}},OnPageOrArrowKeyUp:function(evt){if(__aspxOpera)this.ClearButtonRepeatClickTimer();},OnFocus:function(){if(__aspxIE||__aspxFirefox2)this.SaveIEOnValueChangedEmulationData();ASPxClientEdit.prototype.OnFocus.call(this);this.SetTextChangingTimer();},OnLostFocus:function(){if(__aspxFirefox2)this.EmulateIEOnValueChanged();ASPxClientEdit.prototype.OnLostFocus.call(this);this.ClearTextChangingTimer();if(__aspxIE)this.EmulateIEOnValueChanged();},OnNumberChanged:function(){var processOnServer=ASPxClientEdit.prototype.RaiseValueChangedEvent.call(this);processOnServer=this.RaiseNumberChanged(processOnServer);if(this.focused)this.valueChangedProcsCalledBeforeLostFocus=true;return processOnServer;},OnValueChanged:function(){if(this.valueChangedDelay==0)this.OnValueChangedTimer();else{if(this.valueChangedTimerID>-1){window.clearTimeout(this.valueChangedTimerID);this.valueChangedTimerID=-1;} this.valueChangedTimerID=window.setTimeout("aspxSEValueChanged(\""+this.name+"\")",this.valueChangedDelay);}},OnValueChangedTimer:function(){if(this.valueChangedTimerID>-1){window.clearTimeout(this.valueChangedTimerID);this.valueChangedTimerID=-1;} this.valueChangedCalledBeforeLostFocus=true;this.RaisePersonalStandardValidation();ASPxClientEdit.prototype.OnValueChanged.call(this);},OnMouseOver:function(evt){if(_aspxGetIsLeftButtonPressed(evt))this.OnTextChangingCheck();},OnMouseWheel:function(evt){if(!this.allowMouseWheel)return;var wheelDelta=_aspxGetWheelDelta(evt);if(wheelDelta>0)this.ChangeNumber(this.inc);else if(wheelDelta<0)this.ChangeNumber(-this.inc);_aspxPreventEvent(evt);},OnTextChangingCheck:function(evt){var input=this.GetInputElement();if(!_aspxIsExists(input))return;var curValueString=input.value.toString();this.isChangingCheckProcessed=true;if((this.lastValue!=curValueString)&&!this.keyUpProcessing)this.OnPaste();},OnPaste:function(){this.ParseValueOnPaste();},OnTextChanged:function(){this.ParseValue();},OnSpinButtonImageLoad:function(){this.loadedSpinButtonImageCount++;if(this.loadedSpinButtonImageCount==this.spinButtonImageCount)this.CorrectSpinButtonsHeightWithImage();},SaveIEOnValueChangedEmulationData:function(){this.valueChangedCalledBeforeLostFocus=false;this.valueChangedProcsCalledBeforeLostFocus=false;var input=this.GetInputElement();if(_aspxIsExistsElement(input))this.inputValueBeforeFocus=input.value;},EmulateIEOnValueChanged:function(){if(!this.valueChangedProcsCalledBeforeLostFocus){var input=this.GetInputElement();if(_aspxIsExistsElement(input)&&input.value!=this.inputValueBeforeFocus){this.OnTextChanged();this.RaiseValidationInternal();this.RaisePersonalStandardValidation();}}},SetTextChangingTimer:function(){var str="aspxSETextChangingCheck(\""+this.name+"\")";this.pasteTimerID=_aspxSetInterval(str,__aspxSETextChangingCheckIntervalDelay);},ClearTextChangingTimer:function(){this.pasteTimerID=_aspxClearInterval(this.pasteTimerID);},SetButtonRepeatClickTimer:function(num,timerInterval,iterationIndex){var str="aspxSRepeatButtonClick(\""+this.name+"\","+num.toString()+","+iterationIndex.toString()+")";this.repeatButtonTimerID=_aspxSetTimeout(str,timerInterval);},ClearButtonRepeatClickTimer:function(){this.repeatButtonTimerID=_aspxClearTimer(this.repeatButtonTimerID);},IsAllowableSymbol:function(symbol){return this.allowSymbolRegExp.test(symbol);},IsAllowTypeNumberSignSymbol:function(selectionStart,selectionEnd){var curValueString=this.GetInputElement().value.toString();if((curValueString!=null)&&this.IsSignSymbol(curValueString.charAt(0)))return(selectionStart==0)&&(selectionEnd>0);else return(selectionStart==0);},IsAllowTypeDecimalSeparatorSymbol:function(selectionStart,selectionEnd){var curValueString=this.GetInputElement().value.toString();var decimalSepIndex=curValueString.indexOf(__aspxNumberDecimalSeparator);if((this.decimalPlaces!=0)&&(decimalSepIndex==-1)){var possibleValueString=this.GetPossibleValueString(selectionStart,selectionEnd,__aspxNumberDecimalSeparator);return this.IsValidFormattedNumberString(possibleValueString);}return decimalSepIndex==-1;},IsAllowTypeDigitToCurrentPosition:function(selectionStart,selectionEnd,pressedSymbol){var possibleValueString=this.GetPossibleValueString(selectionStart,selectionEnd,pressedSymbol);var decimalSepIndex=possibleValueString.indexOf(__aspxNumberDecimalSeparator);if((this.decimalPlaces!=0)&&(decimalSepIndex!=-1))return this.IsValidFormattedNumberString(possibleValueString);return true;},IsValidNumberString:function(numString){return this.validNumberRegExp.test(numString);},IsValidFormattedNumberString:function(numString){return this.validFormattedNumberRegExp.test(numString);},GetCorrectFormattedNumberString:function(numString){var ret=numString;if(!this.IsValidFormattedNumberString(numString)){if(numString.toLowerCase().indexOf("e")>-1)numString=ASPxClientSpinEdit.RemoveExponentialNotation(numString);var decimalSepIndex=numString.indexOf(__aspxNumberDecimalSeparator);if(decimalSepIndex>-1){ret=numString.substring(0,decimalSepIndex);if(this.IsFloatNumber())ret+=numString.substr(decimalSepIndex,this.decimalPlaces+1);}else ret=numString;}return ret;},GetPossibleValueString:function(selectionStart,selectionEnd,pressedSymbol){var curValueString=this.GetInputElement().value.toString();var newValueString=curValueString.substring(0,selectionStart);newValueString+=pressedSymbol;var selectionLength=selectionEnd-selectionStart;newValueString+=curValueString.substr(selectionEnd,curValueString.length-selectionLength);return newValueString;},IsDecimalSeparatorSymbol:function(symbol){for(var i=0;i<__aspxPossibleNumberDecimalSeparators.length;i++)if(__aspxPossibleNumberDecimalSeparators[i]==symbol)return true;return false;},IsPasteShortcut:function(evt){var keyCode=_aspxGetKeyCode(evt);return(evt.ctrlKey&&(keyCode==118||(keyCode==86)))||(evt.shiftKey&&!evt.ctrlKey&&!evt.altKey&&(keyCode==ASPxKey.Insert));},IsValidMinMaxValue:function(minValue,maxValue){if(typeof(maxValue)!="number")maxValue=this.ParseValueInternal(maxValue.toString());if(typeof(minValue)!="number")minValue=this.ParseValueInternal(minValue.toString());return(isNaN(maxValue)||isNaN(minValue))?false:(maxValue>=minValue);},IsSpecialKey:function(evt,inKeyDown){var keyCode=_aspxGetKeyCode(evt);return keyCode==0||keyCode==ASPxKey.Backspace||(inKeyDown&&keyCode==ASPxKey.Delete)||keyCode>60000;},IsPageOrArrowKey:function(evt){var keyCode=_aspxGetKeyCode(evt);if(__aspxOpera&&evt.ctrlKey&&(keyCode==ASPxKey.Up||keyCode==ASPxKey.Down))return false;else return keyCode==ASPxKey.Up||keyCode==ASPxKey.Down||keyCode==ASPxKey.PageUp||keyCode==ASPxKey.PageDown;},IsSignSymbol:function(symbol){return _aspxIsExists(symbol)&&(symbol==__aspxNumberNegativeSymbol);},GetButtonIndexByKeyCode:function(keyCode,ctrl){var ret=0;switch(keyCode){case ASPxKey.Up:ret=ctrl?this.largeIncButtonIndex:this.incButtonIndex;break;case ASPxKey.Down:ret=ctrl?this.largeDecButtonIndex:this.decButtonIndex;break;case ASPxKey.PageUp:ret=this.largeIncButtonIndex;break;case ASPxKey.PageDown:ret=this.largeDecButtonIndex;break;}return ret;},TypeDecimalSeparator:function(selectionStart,selectionEnd){var possibleValueString=this.GetPossibleValueString(selectionStart,selectionEnd,__aspxNumberDecimalSeparator);var inputElement=this.GetInputElement();inputElement.value=possibleValueString;var decimalSepIndex=possibleValueString.indexOf(__aspxNumberDecimalSeparator);_aspxSetCaretPosition(inputElement,decimalSepIndex+1);},UpdateSelectionStartAndEndPosition:function(inputElement){if(__aspxIE&&_aspxIsExists(document.selection)){inputElement.selectionStart=0;inputElement.selectionEnd=0;var curRange=document.selection.createRange();var copyRange=curRange.duplicate();curRange.move('character',-inputElement.value.length);curRange.setEndPoint('EndToStart',copyRange);inputElement.selectionStart=curRange.text.length;inputElement.selectionEnd=inputElement.selectionStart+copyRange.text.length;}},SetActualElementHeigth:function(element,expectedHeight){element.style.height=expectedHeight+"px";if(__aspxIE){var actualHeight=element.clientHeight;var d=actualHeight-expectedHeight;if(d>0){expectedHeight=expectedHeight-d;element.style.height=expectedHeight+"px";}}},SetElementHeigth:function(element,expectedHeight){element.style.height=expectedHeight+"px";},RaiseNumberChanged:function(processOnServer){if(!this.NumberChanged.IsEmpty()){var args=new ASPxClientProcessingModeEventArgs(processOnServer);this.NumberChanged.FireEvent(this,args);processOnServer=args.processOnServer;}return processOnServer;},SetNumber:function(number){this.SetValue(number);},GetNumber:function(){return this.number;},GetText:function(){return ASPxClientButtonEditBase.prototype.GetValue.call(this);},SetMinValue:function(value){if(this.IsValidMinMaxValue(value,this.maxValue)){this.minValue=this.ParseValueInternal(value.toString());this.EnsureCurrentNumberInBoundries();}},GetMinValue:function(){return this.minValue;},SetMaxValue:function(value){if(this.IsValidMinMaxValue(this.minValue,value)){this.maxValue=this.ParseValueInternal(value.toString());this.EnsureCurrentNumberInBoundries();}},GetMaxValue:function(){return this.maxValue;},EnsureCurrentNumberInBoundries:function(){var value=this.GetValue();if(value!=null)this.SetNumber(this.GetCorrectNumberInRange(value));},GetParsedNumber:function(){var inputElement=this.GetInputElement();var valueString=inputElement.value;var newNumber=valueString!=""?this.ParseValueInternal(valueString):null;if((newNumber!=null)&&!isNaN(newNumber)){if(newNumber!=this.number)newNumber=this.GetCorrectNumberInRange(newNumber);}else newNumber=this.GetCorrectNumberInRange(0);return newNumber;},RestoreSelectionStartAndEndPosition:function(){var inputElement=this.GetInputElement();_aspxSetSelectionCore(inputElement,inputElement.selectionStart,inputElement.selectionEnd)},SaveSelectionStartAndEndPosition:function(){this.UpdateSelectionStartAndEndPosition(this.GetInputElement());}});ASPxClientSpinEdit.RemoveExponentialNotation=function(numString){var mantissaPossition=numString.toLowerCase().indexOf("e");var ret=numString;if(mantissaPossition>-1){var isNegative=numString.indexOf("-")==0;var isNegativeMantissa=numString.indexOf("-")>0;var mantissa=numString.replace(new RegExp('^[+-]?([0-9]*\.?[0-9]+|[0-9]+\.?[0-9]*)([eE][+-]?)'),"");var numberBase=numString.replace(new RegExp('([eE][+-]?[0-9]+)'),"");numberBase=numberBase.replace("+","");numberBase=numberBase.replace("-","");var decimalDecimalSeparator=".";if(numberBase.indexOf(decimalDecimalSeparator)==-1){numberBase=numberBase.replace(decimalDecimalSeparator,__aspxNumberDecimalSeparator);decimalDecimalSeparator=__aspxNumberDecimalSeparator;} var numberParts=numberBase.split(decimalDecimalSeparator);var zeroNumbers=parseInt(mantissa,10)-numberParts[1].length;if(isNegativeMantissa)ret="0"+__aspxNumberDecimalSeparator+ASPxClientSpinEdit.GetZeros(zeroNumbers+1)+numberParts[0]+numberParts[1];else ret=numberParts[0]+numberParts[1]+ASPxClientSpinEdit.GetZeros(zeroNumbers);if(isNegative)ret+="-";}return ret;} ASPxClientSpinEdit.GetZeros=function(length){var zeros=[];for(var i=0;i-1)return id.substring(0,pos);pos=id.lastIndexOf(__aspxTEInputSuffix);if(pos>-1)return id.substring(0,pos);return id;}});ASPxClientFilterControl=_aspxCreateClass(ASPxClientControl,{constructor:function(name){this.constructor.prototype.constructor.call(this,name);this.callBacksEnabled=true;this.nodeIndex=-1;this.editorIndex="";this.prevEditorValue=null;this.imagemouseoversrc=null;this.ownerControl=null;this.isCallbackInProcess=false;this.isApplied=false;this.lpTimer=-1;this.lpDelay=500;this.Applied=new ASPxClientEvent();},GetChildElementById:function(childName){return _aspxGetElementById(this.name+"_"+childName);},GetFilterExpression:function(){return this.GetChildElementById("E").value;},GetAppliedFilterExpression:function(){return this.GetChildElementById("AE").value;},GetEditor:function(editorIndex){return aspxGetControlCollection().Get(this.name+"_"+"DXEdit"+editorIndex.toString());},GetNodeIndexByEditor:function(editorIndex){return Math.round(editorIndex/1000);},GetValueIndexByEditor:function(editorIndex){return editorIndex%1000;},GetRootTable:function(){return _aspxGetElementById(this.name);},GetRootTD:function(){var table=this.GetRootTable();if(!_aspxIsExists(table))return null;return table.rows[0].cells[0];},WakeLoadingPanel:function(){if(this.lpTimer>-1)return;this.CreateLoadingDiv(this.GetRootTD());var js="aspxFCShowLoadingPanel('"+this.name+"')";this.lpTimer=_aspxSetTimeout(js,this.lpDelay);},ShowLoadingPanel:function(){this.ClearLoadingPanelTimer();var div=this.GetLoadingDiv();if(div)div.style.cursor="wait";var cell=this.GetRootTD();if(cell)this.CreateLoadingPanelWithAbsolutePosition(cell);},ClearLoadingPanelTimer:function(){this.lpTimer=_aspxClearTimer(this.lpTimer);},HideLoadingPanel:function(){this.ClearLoadingPanelTimer();this.constructor.prototype.HideLoadingPanel.call(this);},FilterCallback:function(action,index,params){if(!_aspxIsExists(index)){index=this.nodeIndex;} this.nodeIndex=-1;var args=action+'|'+index.toString()+'|'+params;if(!_aspxIsExists(this.callBack)||!this.callBacksEnabled){this.SendPostBack(args);return;}if(!this.isCallbackInProcess){this.isCallbackInProcess=true;this.WakeLoadingPanel();this.CreateCallback(args,"");}},OnCallback:function(result){this.ClearEditorsValues();if(this.ownerControl!=null){this.ownerControl.OnCallback(result);this.ownerControl=null;}else{var rootTD=this.GetRootTD();if(rootTD!=null){rootTD.innerHTML=result;}} this.isCallbackInProcess=false;if(this.isApplied){this.RaiseFilterApplied();} this.isApplied=false;},OnCallbackError:function(result,data){this.isCallbackInProcess=false;this.isApplied=false;alert(result);if(this.editorIndex>-1){var editor=this.GetEditor(this.editorIndex);editor.SetFocus();}},ShowPopupMenu:function(menuName,evt,index,propertyType){if(this.CheckEditor())return;this.nodeIndex=index;var menu=aspxGetControlCollection().Get(this.name+"_"+menuName);if(menu!=null){if(_aspxIsExists(propertyType)){this.CheckOperationMenuItemVisibility(menu,propertyType);} menu.ShowAtElement(_aspxGetEventSource(evt));}},ShowFieldNamePopup:function(evt,index){this.ShowPopupMenu("FieldNamePopup",evt,index);},ShowOperationPopup:function(evt,index,propertyType){this.ShowPopupMenu("OperationPopup",evt,index,propertyType);},ShowGroupPopup:function(evt,index){this.ShowPopupMenu("GroupPopup",evt,index);},ChangeFieldName:function(fieldName,index){this.FilterCallback("FieldName",index,fieldName);},ChangeOperation:function(operation,index){this.FilterCallback("Operation",index,this.RemoveDivider(operation));},ChangeGroup:function(group,index){if(group.indexOf("|")==0){this.FilterCallback(group.substr(1),index,"");}else{this.FilterCallback("GroupType",index,group);}},Apply:function(ownerControl,onClose){if(this.isCallbackInProcess)return;if(ownerControl&&ownerControl.HideFilterControlPopup)ownerControl.HideFilterControlPopup();this.ownerControl=ownerControl;this.isApplied=true;this.FilterCallback("Apply",-1,onClose?'T':'F');},Reset:function(){if(this.isCallbackInProcess)return;this.FilterCallback("Reset",-1,"");},RemoveNode:function(index){this.FilterCallback("Remove",index,"");},AddConditionNode:function(index){this.FilterCallback("AddCondition",index,"");},AddValue:function(index){this.FilterCallback("AddValue",index,"");},ShowEditor:function(editorIndex){if(this.CheckEditor())return;var editor=this.ChangeEditorVisibility(editorIndex,true);if(editor!=null){editor.Filter=this;editor.Focus();this.prevEditorValue=editor.GetValue();this.editorIndex=editorIndex;}},HideEditor:function(){if(this.editorIndex<0)return;this.ChangeEditorVisibility(this.editorIndex,false);var editor=this.GetEditor(this.editorIndex);if(editor!=null){editor.SetValue(this.prevEditorValue);} this.ClearEditorsValues();},ChangeEditorVisibility:function(editorIndex,visible){var link=this.GetChildElementById("DXValue"+editorIndex);var editor=this.GetEditor(editorIndex);if(link!=null&&editor!=null){link.style.display=visible?"none":"";editor.SetVisible(visible);return editor;}return null;},CheckEditor:function(){if(this.editorIndex<0)return false;var editor=this.GetEditor(this.editorIndex);if(editor==null)return false;if(editor.GetValue()==this.prevEditorValue){this.HideEditor();return false;} var editorIndex=this.editorIndex;var value=editor.GetValueString();if(value==null)value="";var params=this.GetValueIndexByEditor(editorIndex).toString()+'|'+value;this.FilterCallback("Value",this.GetNodeIndexByEditor(editorIndex),params);return true;},ClearEditorsValues:function(){this.prevEditorValue=null;this.editorIndex=-1;},OnImageMouseOver:function(image,hotImageName){var hotImage=this.GetChildElementById(hotImageName);if(!_aspxIsExists(hotImage))return;this.imagemouseoversrc=image.src;image.src=hotImage.src;image.style.cursor="pointer";},OnImageMouseOut:function(image){if(this.imagemouseoversrc!=null){image.src=this.imagemouseoversrc;this.imagemouseoversrc=null;}},CheckOperationMenuItemVisibility:function(menu,propertyType){for(var i=0;i0&&str.indexOf(propertyType)>-1);}},RemoveDivider:function(str){var pos=str.indexOf('|');if(pos<0)return str;return str.substr(pos+1);},GetBeforeDivider:function(str){var pos=str.indexOf('|');if(pos<0)return "";return str.substr(0,pos);},RaiseFilterApplied:function(){if(this.Applied.IsEmpty())return;var args=new ASPxClientFilterAppliedEventArgs(this.GetFilterExpression());this.Applied.FireEvent(this,args);}});ASPxClientFilterAppliedEventArgs=_aspxCreateClass(ASPxClientEventArgs,{constructor:function(filterExpression){this.constructor.prototype.constructor.call(this);this.filterExpression=filterExpression;}});function aspxFCApply(name,ownerControlName,onClose){var control=aspxGetControlCollection().Get(name);var ownerControl=aspxGetControlCollection().Get(ownerControlName);if(control!=null&&ownerControl!=null){control.Apply(ownerControl,onClose);}} function aspxFCShowFieldNamePopup(name,evt,index){var control=aspxGetControlCollection().Get(name);if(control!=null){control.ShowFieldNamePopup(evt,index);}} function aspxFCShowOperationPopup(name,evt,index,propertyType){var control=aspxGetControlCollection().Get(name);if(control!=null){control.ShowOperationPopup(evt,index,propertyType);}} function aspxFCShowGroupPopup(name,evt,index){var control=aspxGetControlCollection().Get(name);if(control!=null){control.ShowGroupPopup(evt,index);}} function aspxFCChangeFieldName(name,fieldName){var control=aspxGetControlCollection().Get(name);if(control!=null){control.ChangeFieldName(fieldName);}} function aspxFCChangeOperation(name,operation){var control=aspxGetControlCollection().Get(name);if(control!=null){control.ChangeOperation(operation);}} function aspxFCAddValue(name,index){var control=aspxGetControlCollection().Get(name);if(control!=null){control.AddValue(index);}} function aspxFCChangeGroup(name,group){var control=aspxGetControlCollection().Get(name);if(control!=null){control.ChangeGroup(group);}} function aspxFCRemoveNode(name,index){var control=aspxGetControlCollection().Get(name);if(control!=null){control.RemoveNode(index);}} function aspxFCAddConditionNode(name,index){var control=aspxGetControlCollection().Get(name);if(control!=null){control.AddConditionNode(index);}} function aspxFCNodeValueClick(name,index){var control=aspxGetControlCollection().Get(name);if(control!=null){control.ShowEditor(index);}} function aspxFCEditorKeyDown(s,e){var keyCode=_aspxGetKeyCode(e.htmlEvent);if(keyCode==ASPxKey.Enter)_aspxPreventEventAndBubble(e.htmlEvent);} function aspxFCEditorKeyUp(s,e){var filter=s.Filter;if(!filter)return;var keyCode=_aspxGetKeyCode(e.htmlEvent);if(keyCode==ASPxKey.Enter){filter.CheckEditor();}else if(keyCode==ASPxKey.Esc){filter.HideEditor();}} function aspxFCEditorLostFocus(s,e){if(s.Filter)s.Filter.CheckEditor();} function aspxFCImageMouseOver(name,e,hotImage){var control=aspxGetControlCollection().Get(name);if(control!=null){control.OnImageMouseOver(_aspxGetEventSource(e),hotImage);}} function aspxFCImageMouseOut(name,e){var control=aspxGetControlCollection().Get(name);if(control!=null){control.OnImageMouseOut(_aspxGetEventSource(e));}} function aspxFCPopupInit(s,e){s.Show();} function aspxFCPopupShown(s,e){s.GetWindowContentElement(-1).style.height=0;} function aspxFCShowLoadingPanel(name){var obj=aspxGetControlCollection().Get(name);if(obj)obj.ShowLoadingPanel();}