 ASPxClientListEdit.prototype.CreateItems=function(itemsProperties){for(var i=0;i<itemsProperties.length;i++)this.CreateItem(i,itemsProperties[i][0],itemsProperties[i][1],itemsProperties[i][2]);}
ASPxClientListEdit.prototype.CreateItem=function(index,text,value,imageUrl){var item=new ASPxClientListEditItem(this,index,text,value,imageUrl);_aspxArrayPush(this.items,item);}
ASPxClientListEdit.prototype.RaiseSelectedIndexChanged=function(){var processOnServer=this.autoPostBack;if(!this.SelectedIndexChanged.IsEmpty()){var args=new ASPxClientProcessingModeEventArgs(processOnServer);this.SelectedIndexChanged.FireEvent(this,args);processOnServer=args.processOnServer;}return processOnServer;}
ASPxClientListEdit.prototype.GetItem=function(index){return(0<=index&&index<this.items.length)?this.items[index]:null;}
ASPxClientListEdit.prototype.GetSelectedItem=function(){var index=this.GetSelectedIndexInternal();return this.GetItem(index);}
ASPxClientListEdit.prototype.GetSelectedIndex=function(){return this.GetSelectedIndexInternal();}
ASPxClientListEdit.prototype.SetSelectedItem=function(item){var index=(item!=null)?item.index:-1;this.SelectIndex(index);}
ASPxClientListEdit.prototype.SetSelectedIndex=function(index){this.SelectIndex(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;}});ASPxClientListBox.prototype.InitOnContainerMadeVisible=function(){this.InitializeDisplayed();}
ASPxClientListBox.prototype.SetSelectedIndex=function(index){if(index!=this.GetSelectedIndexInternal())this.SelectIndex(index,false);}
ASPxClientListBox.prototype.AddItem=function(text,value,imageUrl){if(!_aspxIsExists(imageUrl))imageUrl="";if(!_aspxIsExists(value))value=text;this.InsertItem(this.GetItemCount(),text,value,imageUrl);}
ASPxClientListBox.prototype.InsertItem=function(index,text,value,imageUrl){if(!_aspxIsExists(imageUrl))imageUrl="";if(!_aspxIsExists(value))value=text;var newItemRow=this.CreateNewItem();var imageCell=this.GetItemRowCell(newItemRow,true);var textCell=this.GetItemRowCell(newItemRow,false);var newIndex=this.FindFreeIndex();newItemRow.ListBoxId=this.name;newItemRow.id=this.CreateItemClientId(newIndex);if(imageCell!=null)imageCell.id=this.CreateItemImageCellId(newIndex);textCell.id=this.CreateItemTextCellId(newIndex);var listTable=this.GetListTable();listTable.rows[0].parentNode.insertBefore(newItemRow,this.GetItemRow(index));var newId=this.CreateItemId(newIndex);var sampleCellElement=this.GetSampleItemTextCell();aspxAddHoverClasses(this.name,this.CreateStyleClasses(sampleCellElement,newId,__aspxLBIPostfixes,true));aspxAddSelectedClasses(this.name,this.CreateStyleClasses(sampleCellElement,newId,__aspxLBIPostfixes,false));_aspxAttachEventToElement(newItemRow,"click",aspxLBIClick);if(this.isComboBoxList)_aspxAttachEventToElement(newItemRow,"mouseup",aspxLBIClick);this.ShowItem(index);this.AddItemClass(index,text,value,imageUrl);this.PrepareItem(index,text,value,imageUrl);if(index==this.GetSelectedIndexInternal())this.SetSelectedIndex(index+1);}
ASPxClientListBox.prototype.RemoveItem=function(index){if(0<=index&&index<this.GetItemCount()){var item=this.GetItemRow(index);if(_aspxIsExistsElement(item)){if(index==this.GetSelectedIndexInternal())this.SetSelectedIndexInternal(-1);item.parentNode.removeChild(item);}
this.RemoveItemClass(this.GetItem(index));}}
ASPxClientListBox.prototype.ClearItems=function(){for(var i=this.GetItemCount()-1;i>=0;i--){var item=this.GetItem(i);var itemRow=this.GetItemRow(i);itemRow.parentNode.removeChild(itemRow);this.RemoveItemClass(item);}
_aspxArrayClear(this.items);this.SetSelectedIndexInternal(-1);this.Synchronize();this.SetValue(null);}
ASPxClientListBox.prototype.BeginUpdate=function(){this.APILockCount++;}
ASPxClientListBox.prototype.EndUpdate=function(){this.APILockCount--;this.Synchronize();this.CorrectSizeByTimer();}
ASPxClientListBox.prototype.PrepareItem=function(index,text,value,imageUrl){var imageCell=this.GetItemImageCell(index);if(_aspxIsExistsElement(imageCell)){var image=_aspxGetChildByTagName(imageCell,'img',0);if(!_aspxIsExists(image)){image=document.createElement('img');imageCell.innerHTML="";imageCell.appendChild(image);}
this.SetImageSrc(image,imageUrl);}
var textCell=this.GetItemTextCell(index);if(_aspxIsExistsElement(textCell)){textCell.innerHTML=text;}}
ASPxClientListBox.prototype.SetImageSrc=function(image,src){var isFilterNeed=this.IsAlphaFilterNeed(src);image.src=isFilterNeed?__dxSpaceImageUrl:src;if(__aspxIE&&!__aspxIE7)image.style.filter=isFilterNeed?this.CreateImageFilterStyle(src):"";}
ASPxClientListBox.prototype.CreateImageFilterStyle=function(src){return "progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+src+", sizingMethod=scale)"}
ASPxClientListBox.prototype.IsAlphaFilterNeed=function(src){return(__aspxIE&&!__aspxIE7&&src.slice(-3).toLowerCase()==="png");}
ASPxClientListBox.prototype.AddItemClass=function(index,text,value,imageUrl){for(var i=index;i<this.GetItemCount();i++)this.GetItem(index).index=i+1;var item=new ASPxClientListEditItem(this,index,text,value,imageUrl);_aspxArrayInsert(this.items,item,index);_aspxArrayPush(this.insertedItems,item);this.Synchronize();}
ASPxClientListBox.prototype.RemoveItemClass=function(item){var item=new ASPxClientListEditItem(this,item.index,item.text,item.value,item.imageUrl);var index=this.FindItemInArray(this.insertedItems,item);if(index==-1)_aspxArrayPush(this.deletedItems,item);else _aspxArrayRemoveAt(this.insertedItems,index);_aspxArrayRemoveAt(this.items,this.FindItemInArray(this.items,item));this.Synchronize();}
ASPxClientListBox.prototype.FindItemInArray=function(array,item){for(var i=array.length-1;i>=0;i--){var currentItem=array[i];if(currentItem.text==item.text&&currentItem.value==item.value&&currentItem.imageUrl==item.imageUrl)break;}return i;}
ASPxClientListBox.prototype.CreateItemId=function(index){return __aspxLBIIdSuffix+index;}
ASPxClientListBox.prototype.CreateItemClientId=function(index){return this.name+"_"+__aspxLBIIdSuffix+index;}
ASPxClientListBox.prototype.CreateItemImageCellId=function(index){return this.CreateItemClientId(index)+__aspxLBIPostfixes[0];}
ASPxClientListBox.prototype.CreateItemTextCellId=function(index){return this.CreateItemClientId(index)+__aspxLBIPostfixes[1];}
ASPxClientListBox.prototype.CreateNewItem=function(){var newItemRow=this.GetSampleItem();if(_aspxIsExistsElement(newItemRow))newItemRow=newItemRow.cloneNode(true);return newItemRow;}
ASPxClientListBox.prototype.CreateStyleClasses=function(sampleElement,id,postfixes,isHover){var styleController=aspxGetStyleController();var item=isHover?styleController.GetHoverElement(sampleElement):styleController.GetSelectedElement(sampleElement);var kind=isHover?__aspxHoverStyleItemKind:__aspxSelectedStyleItemKind;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;}
ASPxClientListBox.prototype.CorrectSizeByTimer=function(){if(this.IsDisplayed())_aspxSetTimeout("aspxLBCorrectSizesByTimer(\""+this.name+"\");",0);}
ASPxClientListBox.prototype.FindFreeIndex=function(){return this.freeUniqIndex++;}
ASPxClientListBox.prototype.GetCorrectString=function(string){return _aspxIsExists(string)?string:"";}
ASPxClientListBox.prototype.GetSampleItemID=function(){return this.name+"_LBSI";}
ASPxClientListBox.prototype.GetSampleItem=function(){return _aspxGetElementById(this.GetSampleItemID());}
ASPxClientListBox.prototype.GetSampleItemTextCell=function(){if(!_aspxIsExistsElement(this.sampleItemTextCell))this.sampleItemTextCell=_aspxGetElementById(this.GetSampleItemID()+__aspxLBIPostfixes[1]);return this.sampleItemTextCell;}
ASPxClientListBox.prototype.GetSyncroHiddenInput=function(syncroType){return _aspxGetElementById(this.name+syncroType);}
ASPxClientListBox.prototype.ShowItem=function(index){var item=this.GetItemRow(index);if(_aspxIsExistsElement(item)){_aspxSetElementDisplay(item,true);_aspxSetElementVisibility(item,true);}}
ASPxClientListBox.prototype.Synchronize=function(){if(this.APILockCount==0){this.SynchronizeItems(this.deletedItems,"DeletedItems");this.SynchronizeItems(this.insertedItems,"InsertedItems");this.CorrectSizeByTimer();}}
ASPxClientListBox.prototype.SynchronizeItems=function(items,syncroType){var inputElement=this.GetSyncroHiddenInput(syncroType);if(_aspxIsExistsElement(inputElement)){var itemsState="";for(var i=0;i<items.length;i++){itemsState+=this.GetSynchronizedItemState(items[i]);if(i<items.length-1)itemsState+=";;";}
inputElement.value=itemsState;}}
ASPxClientListBox.prototype.GetSynchronizedItemState=function(item){if(_aspxIsExists(item)){var itemState=item.value;itemState+="::"+this.GetCorrectString(item.index);itemState+="::"+this.GetCorrectString(item.text);itemState+="::"+this.GetCorrectString(item.imageUrl);return itemState;}return "";}
function aspxLBCorrectSizesByTimer(name){var lb=aspxGetControlCollection().Get(name);if(lb!=null)lb.CorrectSizes();} 