 ASPxClientMenuBase.prototype.CreateItems=function(itemsProperties){this.rootItem=new ASPxClientMenuItem(this,null,0,"");this.rootItem.CreateItems(itemsProperties);}
ASPxClientMenuBase.prototype.GetItemByIndexPath=function(indexPath){if(indexPath=="")return null;else{var item=this.rootItem;if(item!=null){var indexes=this.GetItemIndexes(indexPath);for(var i=0;i<indexes.length;i++)item=item.GetItem(indexes[i]);}return item;}}
ASPxClientMenuBase.prototype.CheckSelectedItem=function(indexPath){var selectedItem=this.GetSelectedItem();if(selectedItem!=null&&selectedItem.GetIndexPath()==indexPath)this.SetSelectedItem(null);}
ASPxClientMenuBase.prototype.SetItemChecked=function(indexPath,checked){var inputElement=this.GetCheckedItemsInputElement();if(inputElement!=null){var itemsGroup=this.GetItemsGroup(indexPath);if(itemsGroup!=null){if(!checked&&this.IsCheckedItem(indexPath)){_aspxArrayRemove(this.checkedItems,indexPath);this.DeselectItem(indexPath);}else if(checked&&!this.IsCheckedItem(indexPath)){if(itemsGroup.length>1){for(var i=0;i<itemsGroup.length;i++){if(itemsGroup[i]==indexPath)continue;if(this.IsCheckedItem(itemsGroup[i])){_aspxArrayRemove(this.checkedItems,itemsGroup[i]);this.DeselectItem(itemsGroup[i]);}}}
this.SelectItem(indexPath);_aspxArrayPush(this.checkedItems,indexPath);}
this.UpdateCheckedInputElement(inputElement);}}}
ASPxClientMenuBase.prototype.ChangeEnabledAttributes=function(indexPath,method,styleMethod){var itemElement=this.IsVertical(indexPath)?this.GetItemElement(indexPath):null;if(_aspxIsExists(itemElement))method(itemElement,"onclick");var templateElement=this.GetItemTemplateCell(indexPath);if(_aspxIsExists(templateElement))method(templateElement,"onclick");var imageElement=this.GetItemImageCell(indexPath);if(_aspxIsExists(imageElement)){method(imageElement,"onclick");styleMethod(imageElement,"cursor");var link=_aspxGetChildByTagName(imageElement,"A",0);if(link!=null){method(link,"onclick");method(link,"href");}}
var textElement=this.GetItemTextCell(indexPath);if(_aspxIsExists(textElement)){method(textElement,"onclick");styleMethod(textElement,"cursor");var link=_aspxGetChildByTagName(textElement,"A",0);if(link!=null){method(link,"onclick");method(link,"href");}
link=_aspxGetChildByTagName(textElement,"A",1);if(link!=null){method(link,"onclick");method(link,"href");}}
var popOutImageElement=this.GetItemPopOutImageCell(indexPath);if(_aspxIsExists(indentElement)){method(indentElement,"onclick");styleMethod(indentElement,"cursor");}
var indentElement=this.GetItemIndentCell(indexPath);if(_aspxIsExists(popOutImageElement)){method(popOutImageElement,"onclick");styleMethod(popOutImageElement,"cursor");}}
ASPxClientMenuBase.prototype.GetItemEnabled=function(indexPath){var element=this.GetItemTextCell(indexPath);if(element==null)element=this.GetItemImageCell(indexPath);if(element!=null)return!_aspxIsExists(element.enabled)||element.enabled;return true;}
ASPxClientMenuBase.prototype.SetItemEnabled=function(indexPath,enabled){if(this.GetItemEnabled(indexPath)==enabled)return;var element=this.GetItemTextCell(indexPath);if(element==null)element=this.GetItemImageCell(indexPath);if(element!=null){element.enabled=enabled;if(enabled){aspxGetStateController().EnableElement(element);this.ChangeEnabledAttributes(indexPath,_aspxRestoreAttribute,_aspxRestoreStyleAttribute);}else{this.CheckSelectedItem(indexPath);aspxGetStateController().DisableElement(element);this.ChangeEnabledAttributes(indexPath,_aspxResetAttribute,_aspxResetStyleAttribute);}}}
ASPxClientMenuBase.prototype.GetItemImageUrl=function(indexPath){var element=this.GetItemImageCell(indexPath);if(element!=null){var img=_aspxGetChildByTagName(element,"IMG",0);if(img!=null)return img.src;}
element=this.GetItemTextCell(indexPath);if(element!=null){var img=_aspxGetChildByTagName(element,"IMG",0);if(img!=null)return img.src;}return "";}
ASPxClientMenuBase.prototype.SetItemImageUrl=function(indexPath,url){var element=this.GetItemImageCell(indexPath);if(element!=null){var img=_aspxGetChildByTagName(element,"IMG",0);if(img!=null)img.src=url;}
element=this.GetItemTextCell(indexPath);if(element!=null){var img=_aspxGetChildByTagName(element,"IMG",0);if(img!=null)img.src=url;}}
ASPxClientMenuBase.prototype.GetItemNavigateUrl=function(indexPath){var element=this.GetItemTextCell(indexPath);if(element!=null){var link=_aspxGetChildByTagName(element,"A",0);if(link!=null)return link.href;}
element=this.GetItemImageCell(indexPath);if(element!=null){var link=_aspxGetChildByTagName(element,"A",0);if(link!=null)return link.href;}return "";}
ASPxClientMenuBase.prototype.SetItemNavigateUrl=function(indexPath,url){var element=this.GetItemTextCell(indexPath);if(element!=null){var link=_aspxGetChildByTagName(element,"A",0);if(link!=null)link.href=url;link=_aspxGetChildByTagName(element,"A",1);if(link!=null)link.href=url;}
element=this.GetItemImageCell(indexPath);if(element!=null){var link=_aspxGetChildByTagName(element,"A",0);if(link!=null)link.href=url;}}
ASPxClientMenuBase.prototype.GetItemText=function(indexPath){var element=this.GetItemTextCell(indexPath);if(element!=null){var textNode=_aspxGetChildTextNode(element,0);if(textNode!=null)return textNode.nodeValue;}return "";}
ASPxClientMenuBase.prototype.SetItemText=function(indexPath,text){var element=this.GetItemTextCell(indexPath);if(element!=null){var textNode=_aspxGetChildTextNode(element,0);if(textNode!=null)textNode.nodeValue=text;}}
ASPxClientMenuBase.prototype.GetItemVisible=function(indexPath){var element=null;if(this.IsVertical(indexPath))element=this.GetItemElement(indexPath);else{element=this.GetItemTextCell(indexPath);if(element==null)element=this.GetItemTemplateCell(indexPath);if(element==null)element=this.GetItemImageCell(indexPath);}return(element!=null)?_aspxGetElementDisplay(element):false;}
ASPxClientMenuBase.prototype.SetItemVisible=function(indexPath,visible){if(!visible)this.CheckSelectedItem(indexPath);var element=null;if(this.IsVertical(indexPath)){element=this.GetItemElement(indexPath);if(element!=null)_aspxSetElementDisplay(element,visible);}else{element=this.GetItemTemplateCell(indexPath);if(element!=null)_aspxSetElementDisplay(element,visible);element=this.GetItemImageCell(indexPath);if(element!=null)_aspxSetElementDisplay(element,visible);element=this.GetItemTextCell(indexPath);if(element!=null)_aspxSetElementDisplay(element,visible);element=this.GetItemPopOutImageCell(indexPath);if(element!=null)_aspxSetElementDisplay(element,visible);}
element=this.GetItemIndentElement(indexPath);if(element!=null)_aspxSetElementDisplay(element,visible);this.SetItemSeparatorVisible(indexPath,visible);var item=this.GetItemByIndexPath(indexPath);for(var i=0;i<item.parent.GetItemCount();i++){if(i<item.index&&item.parent.GetItem(i).GetVisible())break;if(i>item.index&&item.parent.GetItem(i).GetVisible()){var itemIndexPath=item.parent.GetItem(i).GetIndexPath();this.SetItemSeparatorVisible(itemIndexPath,visible);break;}}}
ASPxClientMenuBase.prototype.SetItemSeparatorVisible=function(indexPath,visible){var element=this.GetItemSeparatorElement(indexPath);if(element!=null)_aspxSetElementDisplay(element,visible);element=this.GetItemSeparatorIndentElement(indexPath);if(element!=null)_aspxSetElementDisplay(element,visible);}
ASPxClientMenuBase.prototype.GetItemIndentElement=function(indexPath){return _aspxGetElementById(this.name+__aspxMIIdSuffix+indexPath+"_II");}
ASPxClientMenuBase.prototype.GetItemSeparatorElement=function(indexPath){return _aspxGetElementById(this.name+__aspxMIIdSuffix+indexPath+"_IS");}
ASPxClientMenuBase.prototype.GetItemSeparatorIndentElement=function(indexPath){return _aspxGetElementById(this.name+__aspxMIIdSuffix+indexPath+"_ISI");}
ASPxClientMenuBase.prototype.RaiseItemClick=function(indexPath,htmlEvent){var processOnServer=this.autoPostBack||this.IsServerEventAssigned("ItemClick");if(!this.ItemClick.IsEmpty()){var item=this.GetItemByIndexPath(indexPath);var htmlElement=this.GetClickableItemElement(indexPath);var args=new ASPxClientMenuItemClickEventArgs(processOnServer,item,htmlElement,htmlEvent);this.ItemClick.FireEvent(this,args);processOnServer=args.processOnServer;}return processOnServer;}
ASPxClientMenuBase.prototype.RaiseItemMouseOver=function(indexPath){var item=this.GetItemByIndexPath(indexPath);if(!this.ItemMouseOver.IsEmpty()){var args=new ASPxClientMenuItemEventArgs(false,item);this.ItemMouseOver.FireEvent(this,args);}}
ASPxClientMenuBase.prototype.RaiseItemMouseOut=function(indexPath){var item=this.GetItemByIndexPath(indexPath);if(!this.ItemMouseOut.IsEmpty()){var args=new ASPxClientMenuItemEventArgs(false,item);this.ItemMouseOut.FireEvent(this,args);}}
ASPxClientMenuBase.prototype.RaisePopUp=function(indexPath){var item=this.GetItemByIndexPath(indexPath);if(!this.PopUp.IsEmpty()){var args=new ASPxClientMenuItemEventArgs(false,item);this.PopUp.FireEvent(this,args);}}
ASPxClientMenuBase.prototype.RaiseCloseUp=function(indexPath){var item=this.GetItemByIndexPath(indexPath);if(!this.CloseUp.IsEmpty()){var args=new ASPxClientMenuItemEventArgs(false,item);this.CloseUp.FireEvent(this,args);}}
ASPxClientMenuBase.prototype.GetItemCount=function(){return(this.rootItem!=null)?this.rootItem.GetItemCount():0;}
ASPxClientMenuBase.prototype.GetItem=function(index){return(this.rootItem!=null)?this.rootItem.GetItem(index):null;}
ASPxClientMenuBase.prototype.GetItemByName=function(name){return(this.rootItem!=null)?this.rootItem.GetItemByName(name):null;}
ASPxClientMenuBase.prototype.GetSelectedItem=function(){var inputElement=this.GetSelectedItemInputElement();if(inputElement!=null&&inputElement.value!="")return this.GetItemByIndexPath(inputElement.value);return null;}
ASPxClientMenuBase.prototype.SetSelectedItem=function(item){var indexPath=(item!=null)?item.GetIndexPath():"";this.SetSelectedItemInternal(indexPath,false);}
ASPxClientMenuBase.GetMenuCollection=function(){return aspxGetMenuCollection();}
ASPxClientMenuItem=_aspxCreateClass(null,{constructor:function(menu,parent,index,name){this.menu=menu;this.parent=parent;this.index=index;this.name=name;this.items=[];},CreateItems:function(itemsProperties){for(var i=0;i<itemsProperties.length;i++){var item=new ASPxClientMenuItem(this.menu,this,i,itemsProperties[i][0]);_aspxArrayPush(this.items,item);item.CreateItems(itemsProperties[i][1]);}},GetIndexPath:function(){var indexPath="";var item=this;while(item.parent!=null){indexPath=(indexPath!="")?item.index.toString()+__aspxItemIndexSeparator+indexPath:item.index.toString();item=item.parent;}return indexPath.toString();},GetItemCount:function(){return this.items.length;},GetItem:function(index){return(0<=index&&index<this.items.length)?this.items[index]:null;},GetItemByName:function(name){for(var i=0;i<this.items.length;i++)if(this.items[i].name==name)return this.items[i];for(var i=0;i<this.items.length;i++){var item=this.items[i].GetItemByName(name);if(item!=null)return item;}return null;},GetChecked:function(){var indexPath=this.GetIndexPath();return this.menu.IsCheckedItem(indexPath);},SetChecked:function(value){var indexPath=this.GetIndexPath();this.menu.SetItemChecked(indexPath,value);},GetEnabled:function(){var indexPath=this.GetIndexPath();return this.menu.GetItemEnabled(indexPath);},SetEnabled:function(value){var indexPath=this.GetIndexPath();this.menu.SetItemEnabled(indexPath,value);},GetImageUrl:function(){var indexPath=this.GetIndexPath();return this.menu.GetItemImageUrl(indexPath);},SetImageUrl:function(value){var indexPath=this.GetIndexPath();this.menu.SetItemImageUrl(indexPath,value);},GetNavigateUrl:function(){var indexPath=this.GetIndexPath();return this.menu.GetItemNavigateUrl(indexPath);},SetNavigateUrl:function(value){var indexPath=this.GetIndexPath();this.menu.SetItemNavigateUrl(indexPath,value);},GetText:function(){var indexPath=this.GetIndexPath();return this.menu.GetItemText(indexPath);},SetText:function(value){var indexPath=this.GetIndexPath();this.menu.SetItemText(indexPath,value);},GetVisible:function(){var indexPath=this.GetIndexPath();return this.menu.GetItemVisible(indexPath);},SetVisible:function(value){var indexPath=this.GetIndexPath();this.menu.SetItemVisible(indexPath,value);}});ASPxClientMenuCollection.prototype.HideAll=function(){this.DoHidePopupMenus(null,0,"",false,"");}
ASPxClientMenuItemEventArgs=_aspxCreateClass(ASPxClientProcessingModeEventArgs,{constructor:function(processOnServer,item){this.constructor.prototype.constructor.call(this,processOnServer);this.item=item;}});ASPxClientMenuItemClickEventArgs=_aspxCreateClass(ASPxClientMenuItemEventArgs,{constructor:function(processOnServer,item,htmlElement,htmlEvent){this.constructor.prototype.constructor.call(this,processOnServer,item);this.htmlElement=htmlElement;this.htmlEvent=htmlEvent;}}); 