mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 07:05:24 +00:00
1 line
41 KiB
JavaScript
1 line
41 KiB
JavaScript
YAHOO.widget.MenuModule=function(_1,_2){if(arguments.length>0){YAHOO.widget.MenuModule.superclass.constructor.call(this,_1,_2);}};YAHOO.widget.MenuModule.prototype=new YAHOO.widget.Overlay();YAHOO.widget.MenuModule.prototype.constructor=YAHOO.widget.MenuModule;YAHOO.widget.MenuModule.superclass=YAHOO.widget.Overlay.prototype;YAHOO.widget.MenuModule.prototype.CSS_CLASS_NAME="yuimenu";YAHOO.widget.MenuModule.prototype.ITEM_TYPE=null;YAHOO.widget.MenuModule.prototype.GROUP_TITLE_TAG_NAME="H6";YAHOO.widget.MenuModule.prototype._aGroupTitleElements=null;YAHOO.widget.MenuModule.prototype._aItemGroups=null;YAHOO.widget.MenuModule.prototype._aListElements=null;YAHOO.widget.MenuModule.prototype._oEventUtil=YAHOO.util.Event;YAHOO.widget.MenuModule.prototype._oDom=YAHOO.util.Dom;YAHOO.widget.MenuModule.prototype._oCurrentItem=null;YAHOO.widget.MenuModule.prototype._bFiredMouseOverEvent=false;YAHOO.widget.MenuModule.prototype._bFiredMouseOutEvent=false;YAHOO.widget.MenuModule.prototype.activeItem=null;YAHOO.widget.MenuModule.prototype.parent=null;YAHOO.widget.MenuModule.prototype.srcElement=null;YAHOO.widget.MenuModule.prototype.mouseOverEvent=null;YAHOO.widget.MenuModule.prototype.mouseOutEvent=null;YAHOO.widget.MenuModule.prototype.mouseDownEvent=null;YAHOO.widget.MenuModule.prototype.mouseUpEvent=null;YAHOO.widget.MenuModule.prototype.clickEvent=null;YAHOO.widget.MenuModule.prototype.keyPressEvent=null;YAHOO.widget.MenuModule.prototype.keyDownEvent=null;YAHOO.widget.MenuModule.prototype.keyUpEvent=null;YAHOO.widget.MenuModule.prototype.init=function(_3,_4){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuModuleItem;}this._aItemGroups=[];this._aListElements=[];this._aGroupTitleElements=[];var _5;if(typeof _3=="string"){_5=document.getElementById(_3);}else{if(_3.tagName){_5=_3;}}if(_5){switch(_5.tagName){case "DIV":this.srcElement=_5;YAHOO.widget.MenuModule.superclass.init.call(this,_5);this.beforeInitEvent.fire(YAHOO.widget.MenuModule);var _6=this.body.firstChild,i=0;do{switch(_6.tagName){case this.GROUP_TITLE_TAG_NAME:this._aGroupTitleElements[i]=_6;break;case "UL":this._aListElements[i]=_6;this._aItemGroups[i]=[];i++;break;}}while((_6=_6.nextSibling));if(this._aListElements[0]){this._oDom.addClass(this._aListElements[0],"first");}break;case "SELECT":this.srcElement=_5;var _7=this._oDom.generateId();YAHOO.widget.MenuModule.superclass.init.call(this,_7);this.beforeInitEvent.fire(YAHOO.widget.MenuModule);break;}}else{YAHOO.widget.MenuModule.superclass.init.call(this,_3);this.beforeInitEvent.fire(YAHOO.widget.MenuModule);}if(this.element){this._oDom.addClass(this.element,this.CSS_CLASS_NAME);this._oEventUtil.addListener(this.element,"mouseover",this._onElementMouseOver,this,true);this._oEventUtil.addListener(this.element,"mouseout",this._onElementMouseOut,this,true);this._oEventUtil.addListener(this.element,"mousedown",this._onDOMEvent,this,true);this._oEventUtil.addListener(this.element,"mouseup",this._onDOMEvent,this,true);this._oEventUtil.addListener(this.element,"click",this._onElementClick,this,true);this._oEventUtil.addListener(this.element,"keydown",this._onDOMEvent,this,true);this._oEventUtil.addListener(this.element,"keyup",this._onDOMEvent,this,true);this._oEventUtil.addListener(this.element,"keypress",this._onDOMEvent,this,true);var _8=YAHOO.util.CustomEvent;this.mouseOverEvent=new _8("mouseOverEvent",this);this.mouseOutEvent=new _8("mouseOutEvent",this);this.mouseDownEvent=new _8("mouseDownEvent",this);this.mouseUpEvent=new _8("mouseUpEvent",this);this.clickEvent=new _8("clickEvent",this);this.keyPressEvent=new _8("keyPressEvent",this);this.keyDownEvent=new _8("keyDownEvent",this);this.keyUpEvent=new _8("keyUpEvent",this);this.beforeRenderEvent.subscribe(this._onBeforeRender,this,true);this.renderEvent.subscribe(this._onRender,this,true);this.showEvent.subscribe(this._onShow,this,true);this.hideEvent.subscribe(this._onHide,this,true);if(_4){this.cfg.applyConfig(_4,true);}this.cfg.queueProperty("visible",false);if(this.srcElement){this._initSubTree();}}this.initEvent.fire(YAHOO.widget.MenuModule);};YAHOO.widget.MenuModule.prototype._getFirstEnabledItem=function(){var _9=this._aItemGroups.length,oItem,aItemGroup;for(var i=0;i<_9;i++){aItemGroup=this._aItemGroups[i];if(aItemGroup){var _b=aItemGroup.length;for(var n=0;n<_b;n++){oItem=aItemGroup[n];if(!oItem.cfg.getProperty("disabled")){return oItem;}oItem=null;}}}};YAHOO.widget.MenuModule.prototype._checkPosition=function(_d){if(typeof _d=="string"){var _e=_d.toLowerCase();return ("dynamic,static".indexOf(_e)!=-1);}};YAHOO.widget.MenuModule.prototype._addItemToGroup=function(_f,_10,_11){if(typeof _11=="number"){var _12=typeof _f=="number"?_f:0,aGroup=this._getItemGroup(_12);if(!aGroup){aGroup=this._createItemGroup(_12);}var _13=(_11>=aGroup.length);if(aGroup[_11]){aGroup.splice(_11,0,_10);}else{aGroup[_11]=_10;}var _14=aGroup[_11];if(_14){if(_13&&!_14.element.parentNode){this._aListElements[_12].appendChild(_14.element);}else{function getNextItemSibling(_15,_16){return (_15[_16]||getNextItemSibling(_15,(_16+1)));}var _17=getNextItemSibling(aGroup,(_11+1));if(_17&&!_14.element.parentNode){this._aListElements[_12].insertBefore(_14.element,_17.element);}}_14.parent=this;this._subscribeToItemEvents(_14);this._configureItemSubmenuModule(_14);this._updateItemProperties(_12);return _14;}}else{var _12=typeof _f=="number"?_f:0,aGroup=this._getItemGroup(_12);if(!aGroup){aGroup=this._createItemGroup(_12);}var _18=aGroup.length;aGroup[_18]=_10;var _14=aGroup[_18];if(_14){if(!this._oDom.isAncestor(this._aListElements[_12],_14.element)){this._aListElements[_12].appendChild(_14.element);}_14.element.setAttribute("groupindex",_12);_14.element.setAttribute("index",_18);_14.parent=this;_14.index=_18;_14.groupIndex=_12;this._subscribeToItemEvents(_14);this._configureItemSubmenuModule(_14);if(_18===0){this._oDom.addClass(_14.element,"first");}return _14;}}};YAHOO.widget.MenuModule.prototype._removeItemFromGroupByIndex=function(_19,_1a){var _1b=typeof _19=="number"?_19:0,aGroup=this._getItemGroup(_1b);if(aGroup){var _1c=aGroup.splice(_1a,1),oItem=_1c[0];if(oItem){this._updateItemProperties(_1b);if(aGroup.length===0){var oUL=this._aListElements[_1b];if(this.body&&oUL){this.body.removeChild(oUL);}this._aItemGroups.splice(_1b,1);this._aListElements.splice(_1b,1);oUL=this._aListElements[0];if(oUL){this._oDom.addClass(oUL,"first");}}return oItem;}}};YAHOO.widget.MenuModule.prototype._removeItemFromGroupByValue=function(_1e,_1f){var _20=this._getItemGroup(_1e);if(_20){var _21=_20.length,nItemIndex=-1;if(_21>0){var i=_21-1;do{if(_20[i]==_1f){nItemIndex=i;break;}}while(i--);if(nItemIndex>-1){return this._removeItemFromGroupByIndex(_1e,nItemIndex);}}}};YAHOO.widget.MenuModule.prototype._updateItemProperties=function(_23){var _24=this._getItemGroup(_23),nItems=_24.length;if(nItems>0){var i=nItems-1,oItem,oLI;do{oItem=_24[i];if(oItem){oLI=oItem.element;oItem.index=i;oItem.groupIndex=_23;oLI.setAttribute("groupindex",_23);oLI.setAttribute("index",i);this._oDom.removeClass(oLI,"first");}}while(i--);if(oLI){this._oDom.addClass(oLI,"first");}}};YAHOO.widget.MenuModule.prototype._createItemGroup=function(_26){if(!this._aItemGroups[_26]){this._aItemGroups[_26]=[];var oUL=document.createElement("ul");this._aListElements[_26]=oUL;return this._aItemGroups[_26];}};YAHOO.widget.MenuModule.prototype._getItemGroup=function(_28){var _29=((typeof _28=="number")?_28:0);return this._aItemGroups[_29];};YAHOO.widget.MenuModule.prototype._configureItemSubmenuModule=function(_2a){var _2b=_2a.cfg.getProperty("submenu");if(_2b){this.cfg.configChangedEvent.subscribe(this._onParentMenuModuleConfigChange,_2b,true);this.renderEvent.subscribe(this._onParentMenuModuleRender,_2b,true);_2b.beforeShowEvent.subscribe(this._onSubmenuBeforeShow,_2b,true);_2b.showEvent.subscribe(this._onSubmenuShow,_2b,true);_2b.hideEvent.subscribe(this._onSubmenuHide,_2b,true);}};YAHOO.widget.MenuModule.prototype._subscribeToItemEvents=function(_2c){var _2d=[this,_2c];_2c.focusEvent.subscribe(this._onItemFocus,_2d);_2c.blurEvent.subscribe(this._onItemBlur,_2d);_2c.cfg.configChangedEvent.subscribe(this._onItemConfigChange,_2d);};YAHOO.widget.MenuModule.prototype._getOffsetWidth=function(){var _2e=this.element.cloneNode(true);this._oDom.setStyle(_2e,"width","");document.body.appendChild(_2e);var _2f=_2e.offsetWidth;document.body.removeChild(_2e);return _2f;};YAHOO.widget.MenuModule.prototype._fireItemEvent=function(_30,_31,_32){var me=this;function getItemElement(_34){if(_34==me.element){return;}else{if(_34.tagName=="LI"){return _34;}else{if(_34.parentNode){return getItemElement(_34.parentNode);}}}}var _35=getItemElement(_30);if(_35){var _36=parseInt(_35.getAttribute("groupindex"),10),nIndex=parseInt(_35.getAttribute("index"),10),oItem=this._aItemGroups[_36][nIndex];if(!oItem.cfg.getProperty("disabled")){oItem[_31].fire(_32);return oItem;}}};YAHOO.widget.MenuModule.prototype._onDOMEvent=function(_37,_38){var _39={"mousedown":"mouseDownEvent","mouseup":"mouseUpEvent","keydown":"keyDownEvent","keyup":"keyUpEvent","keypress":"keyPressEvent"},sCustomEventType=_39[_37.type],oTarget=this._oEventUtil.getTarget(_37,true);this._fireItemEvent(oTarget,sCustomEventType,_37);this[sCustomEventType].fire(_37);this._oEventUtil.stopPropagation(_37);};YAHOO.widget.MenuModule.prototype._onElementMouseOver=function(_3a,_3b){var _3c=this._oEventUtil.getTarget(_3a,true);if((_3c==this.element||this._oDom.isAncestor(this.element,_3c))&&!this._bFiredMouseOverEvent){this.mouseOverEvent.fire(_3a);this._bFiredMouseOverEvent=true;this._bFiredMouseOutEvent=false;}if(!this._oCurrentItem){this._oCurrentItem=this._fireItemEvent(_3c,"mouseOverEvent",_3a);}this._oEventUtil.stopPropagation(_3a);};YAHOO.widget.MenuModule.prototype._onElementMouseOut=function(_3d,_3e){var _3f=this._oEventUtil.getRelatedTarget(_3d),bLIMouseOut=true,bMovingToSubmenu=false;if(this._oCurrentItem&&_3f){if(_3f==this._oCurrentItem.element||this._oDom.isAncestor(this._oCurrentItem.element,_3f)){bLIMouseOut=false;}var _40=this._oCurrentItem.cfg.getProperty("submenu");if(_40&&(_3f==_40.element||this._oDom.isAncestor(_40.element,_3f))){bMovingToSubmenu=true;}}if(this._oCurrentItem&&(bLIMouseOut||bMovingToSubmenu)){this._oCurrentItem.mouseOutEvent.fire(_3d);this._oCurrentItem=null;}if(!this._bFiredMouseOutEvent&&(!this._oDom.isAncestor(this.element,_3f)||bMovingToSubmenu)){this.mouseOutEvent.fire(_3d);this._bFiredMouseOutEvent=true;this._bFiredMouseOverEvent=false;}this._oEventUtil.stopPropagation(_3d);};YAHOO.widget.MenuModule.prototype._onElementClick=function(_41,_42){var _43=this._oEventUtil.getTarget(_41,true),oItem=this._fireItemEvent(_43,"clickEvent",_41),bCurrentPageURL;if(oItem){var _44=oItem.cfg.getProperty("url"),oSubmenu=oItem.cfg.getProperty("submenu");bCurrentPageURL=(_44.substr((_44.length-1),1)=="#");if(_43==oItem.subMenuIndicator&&oSubmenu){if(oSubmenu.cfg.getProperty("visible")){oSubmenu.hide();}else{var _45=this.activeItem;if(_45&&_45!=this){this.clearActiveItem();}this.activeItem=oItem;oItem.cfg.setProperty("selected",true);oSubmenu.show();}}else{if(!bCurrentPageURL){document.location=_44;}}}switch(_43.tagName){case "A":if(bCurrentPageURL){this._oEventUtil.preventDefault(_41);}else{break;}default:this._oEventUtil.stopPropagation(_41);break;}this.clickEvent.fire(_41);};YAHOO.widget.MenuModule.prototype._initSubTree=function(){var _46;switch(this.srcElement.tagName){case "DIV":if(this._aListElements.length>0){var i=this._aListElements.length-1;do{_46=this._aListElements[i].firstChild;do{switch(_46.tagName){case "LI":this.addItem(new this.ITEM_TYPE(_46),i);break;}}while((_46=_46.nextSibling));}while(i--);}break;case "SELECT":_46=this.srcElement.firstChild;do{switch(_46.tagName){case "OPTGROUP":case "OPTION":this.addItem(new this.ITEM_TYPE(_46));break;}}while((_46=_46.nextSibling));break;}};YAHOO.widget.MenuModule.prototype._onBeforeRender=function(_48,_49,_4a){if(this.cfg.getProperty("position")=="static"){this.cfg.queueProperty("iframe",false);this.cfg.queueProperty("visible",true);}var _4b=this._aListElements.length;if(_4b>0){var i=0,bFirstList=true,oUL,oGroupTitle;do{oUL=this._aListElements[i];if(oUL){if(bFirstList){this._oDom.addClass(oUL,"first");bFirstList=false;}if(!this._oDom.isAncestor(this.element,oUL)){this.appendToBody(oUL);}oGroupTitle=this._aGroupTitleElements[i];if(oGroupTitle){if(!this._oDom.isAncestor(this.element,oGroupTitle)){oUL.parentNode.insertBefore(oGroupTitle,oUL);}this._oDom.addClass(oUL,"hastitle");}}i++;}while(i<_4b);}};YAHOO.widget.MenuModule.prototype._onRender=function(_4d,_4e,_4f){if(this.cfg.getProperty("position")=="dynamic"){var _50=this.element.parentNode.tagName=="BODY"?this.element.offsetWidth:this._getOffsetWidth();this.cfg.setProperty("width",(_50+"px"));}};YAHOO.widget.MenuModule.prototype._onShow=function(_51,_52,_53){this.setInitialFocus();};YAHOO.widget.MenuModule.prototype._onHide=function(_54,_55,_56){if(this.activeItem){if(this.activeItem.cfg.getProperty("selected")){this.activeItem.cfg.setProperty("selected",false);this.activeItem.blur();}var _57=this.activeItem.cfg.getProperty("submenu");if(_57&&_57.cfg.getProperty("visible")){_57.hide();}}};YAHOO.widget.MenuModule.prototype._onParentMenuModuleConfigChange=function(_58,_59,_5a){var _5b=_59[0][0],oPropertyValue=_59[0][1];switch(_5b){case "iframe":case "constraintoviewport":case "submenualignment":_5a.cfg.setProperty(_5b,oPropertyValue);break;}};YAHOO.widget.MenuModule.prototype._onParentMenuModuleRender=function(_5c,_5d,_5e){var _5f=_5e.parent.parent;_5e.cfg.applyConfig({constraintoviewport:_5f.cfg.getProperty("constraintoviewport"),xy:[0,0],iframe:_5f.cfg.getProperty("iframe")});if(this._oDom.inDocument(this.element)){this.render();}else{this.render(this.parent.element);}};YAHOO.widget.MenuModule.prototype._onSubmenuBeforeShow=function(_60,_61,_62){var _63=this.parent.parent.cfg.getProperty("submenualignment");this.cfg.setProperty("submenualignment",[_63[0],_63[1]]);this.cfg.setProperty("context",[this.parent.element,_63[0],_63[1]]);this.parent.subMenuIndicator.alt=this.parent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;};YAHOO.widget.MenuModule.prototype._onSubmenuShow=function(_64,_65,_66){this.parent.subMenuIndicator.alt=this.parent.EXPANDED_SUBMENU_INDICATOR_ALT_TEXT;};YAHOO.widget.MenuModule.prototype._onSubmenuHide=function(_67,_68,_69){if(this.parent.parent.cfg.getProperty("visible")){this.parent.cfg.setProperty("selected",false);this.parent.focus();}this.parent.subMenuIndicator.alt=this.parent.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;};YAHOO.widget.MenuModule.prototype._onItemFocus=function(_6a,_6b,_6c){var me=_6c[0],oItem=_6c[1];me.activeItem=oItem;};YAHOO.widget.MenuModule.prototype._onItemBlur=function(_6e,_6f,_70){var me=_70[0],oItem=_70[1],oSubmenu=oItem.cfg.getProperty("submenu");if(!oSubmenu||(oSubmenu&&!oSubmenu.cfg.getProperty("visible"))){me.activeItem=null;}};YAHOO.widget.MenuModule.prototype._onItemConfigChange=function(_72,_73,_74){var _75=_73[0][0],me=_74[0],oItem=_74[1];switch(_75){case "submenu":var _76=_73[0][1];if(_76){me._configureItemSubmenuModule(oItem);}break;case "text":case "helptext":if(me.element.style.width){var _77=me._getOffsetWidth()+"px";me._oDom.setStyle(me.element,"width",_77);}break;}};YAHOO.widget.MenuModule.prototype.enforceConstraints=function(_78,_79,obj){var pos=_79[0],x=pos[0],y=pos[1],bod=document.getElementsByTagName("body")[0],htm=document.getElementsByTagName("html")[0],bodyOverflow=YAHOO.util.Dom.getStyle(bod,"overflow"),htmOverflow=YAHOO.util.Dom.getStyle(htm,"overflow"),offsetHeight=this.element.offsetHeight,offsetWidth=this.element.offsetWidth,viewPortWidth=YAHOO.util.Dom.getClientWidth(),viewPortHeight=YAHOO.util.Dom.getClientHeight(),scrollX=window.scrollX||document.body.scrollLeft,scrollY=window.scrollY||document.body.scrollTop,topConstraint=scrollY+10,leftConstraint=scrollX+10,bottomConstraint=scrollY+viewPortHeight-offsetHeight-10,rightConstraint=scrollX+viewPortWidth-offsetWidth-10,aContext=this.cfg.getProperty("context"),oContextElement=aContext?aContext[0]:null;if(x<10){x=leftConstraint;}else{if((x+offsetWidth)>viewPortWidth){if(oContextElement&&((x-oContextElement.offsetWidth)>offsetWidth)){x=(x-(oContextElement.offsetWidth+offsetWidth));}else{x=rightConstraint;}}}if(y<10){y=topConstraint;}else{if(y>bottomConstraint){if(oContextElement&&(y>offsetHeight)){y=((y+oContextElement.offsetHeight)-offsetHeight);}else{y=bottomConstraint;}}}this.cfg.setProperty("x",x,true);this.cfg.setProperty("y",y,true);};YAHOO.widget.MenuModule.prototype.configPosition=function(_7c,_7d,_7e){var _7f=_7d[0]=="static"?"static":"absolute";this._oDom.setStyle(this.element,"position",_7f);};YAHOO.widget.MenuModule.prototype.setItemGroupTitle=function(_80,_81){if(typeof _80=="string"&&_80.length>0){var _82=typeof _81=="number"?_81:0,oTitle=this._aGroupTitleElements[_82];if(oTitle){oTitle.innerHTML=_80;}else{oTitle=document.createElement(this.GROUP_TITLE_TAG_NAME);oTitle.innerHTML=_80;this._aGroupTitleElements[_82]=oTitle;}var i=this._aGroupTitleElements.length-1,nFirstIndex;do{if(this._aGroupTitleElements[i]){this._oDom.removeClass(this._aGroupTitleElements[i],"first");nFirstIndex=i;}}while(i--);if(nFirstIndex!==null){this._oDom.addClass(this._aGroupTitleElements[nFirstIndex],"first");}}};YAHOO.widget.MenuModule.prototype.addItem=function(_84,_85){if(_84&&_84 instanceof YAHOO.widget.MenuModuleItem){return this._addItemToGroup(_85,_84);}};YAHOO.widget.MenuModule.prototype.insertItem=function(_86,_87,_88){if(_86&&_86 instanceof YAHOO.widget.MenuModuleItem){return this._addItemToGroup(_88,_86,_87);}};YAHOO.widget.MenuModule.prototype.removeItem=function(_89,_8a){if(typeof _89!="undefined"){var _8b;if(_89 instanceof YAHOO.widget.MenuModuleItem){_8b=this._removeItemFromGroupByValue(_8a,_89);}else{if(typeof _89=="number"){_8b=this._removeItemFromGroupByIndex(_8a,_89);}}if(_8b){_8b.destroy();return _8b;}}};YAHOO.widget.MenuModule.prototype.getItemGroups=function(){return this._aItemGroups;};YAHOO.widget.MenuModule.prototype.getItem=function(_8c,_8d){if(typeof _8c=="number"){var _8e=this._getItemGroup(_8d);if(_8e){return _8e[_8c];}}};YAHOO.widget.MenuModule.prototype.destroy=function(){this._oEventUtil.removeListener(this.element,"mouseover",this._onElementMouseOver);this._oEventUtil.removeListener(this.element,"mouseout",this._onElementMouseOut);this._oEventUtil.removeListener(this.element,"click",this._onElementClick);this._oEventUtil.removeListener(this.element,"mousedown",this._onDOMEvent);this._oEventUtil.removeListener(this.element,"mouseup",this._onDOMEvent);this._oEventUtil.removeListener(this.element,"keydown",this._onDOMEvent);this._oEventUtil.removeListener(this.element,"keyup",this._onDOMEvent);this._oEventUtil.removeListener(this.element,"keypress",this._onDOMEvent);this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();this.beforeMoveEvent.unsubscribeAll();var _8f=this._aItemGroups.length,nItems,i,n;if(_8f>0){i=_8f-1;do{if(this._aItemGroups[i]){nItems=this._aItemGroups[i].length;if(nItems>0){n=nItems-1;do{if(this._aItemGroups[i][n]){this._aItemGroups[i][n].destroy();}}while(n--);}}}while(i--);}YAHOO.widget.MenuModule.superclass.destroy.call(this);};YAHOO.widget.MenuModule.prototype.setInitialFocus=function(){var _90=this._getFirstEnabledItem();if(_90){_90.focus();}};YAHOO.widget.MenuModule.prototype.setInitialSelection=function(){var _91=this._getFirstEnabledItem();if(_91){_91.cfg.setProperty("selected",true);}};YAHOO.widget.MenuModule.prototype.clearActiveItem=function(){var _92=this.activeItem;if(_92){_92.cfg.setProperty("selected",false);var _93=_92.cfg.getProperty("submenu");if(_93){_93.hide();}}};YAHOO.widget.MenuModule.prototype.initDefaultConfig=function(){YAHOO.widget.MenuModule.superclass.initDefaultConfig.call(this);this.cfg.addProperty("position",{value:"dynamic",handler:this.configPosition,validator:this._checkPosition});this.cfg.refireEvent("position");this.cfg.addProperty("submenualignment",{value:["tl","tr"]});};YAHOO.widget.MenuModuleItem=function(_94,_95){if(_94){this.init(_94,_95);}};YAHOO.widget.MenuModuleItem.prototype={SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght9_nrm_1.gif",SELECTED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght9_hov_1.gif",DISABLED_SUBMENU_INDICATOR_IMAGE_PATH:"nt/ic/ut/alt1/menuarorght9_dim_1.gif",COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT:"Collapsed. Click to expand.",EXPANDED_SUBMENU_INDICATOR_ALT_TEXT:"Expanded. Click to collapse.",DISABLED_SUBMENU_INDICATOR_ALT_TEXT:"Disabled.",CSS_CLASS_NAME:"yuimenuitem",SUBMENU_TYPE:null,SUBMENU_ITEM_TYPE:null,_oAnchor:null,_oText:null,_oHelpTextEM:null,_oSubmenu:null,_oDom:YAHOO.util.Dom,_sUserAgent:window.navigator.userAgent.toLowerCase(),constructor:YAHOO.widget.MenuModuleItem,imageRoot:YAHOO.widget.Module.IMG_ROOT,isSecure:function(){if(window.location.href.toLowerCase().indexOf("https")===0){this.imageRoot=YAHOO.widget.Module.IMG_ROOT_SSL;return true;}else{return false;}}(),index:null,groupIndex:null,parent:null,element:null,srcElement:null,value:null,subMenuIndicator:null,browser:function(){var _96=navigator.userAgent.toLowerCase();if(_96.indexOf("opera")!=-1){return "opera";}else{if(_96.indexOf("msie 7")!=-1){return "ie7";}else{if(_96.indexOf("msie")!=-1){return "ie";}else{if(_96.indexOf("safari")!=-1){return "safari";}else{if(_96.indexOf("gecko")!=-1){return "gecko";}else{return false;}}}}}}(),destroyEvent:null,mouseOverEvent:null,mouseOutEvent:null,mouseDownEvent:null,mouseUpEvent:null,clickEvent:null,keyPressEvent:null,keyDownEvent:null,keyUpEvent:null,focusEvent:null,blurEvent:null,init:function(_97,_98){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.MenuModule;}if(!this.SUBMENU_ITEM_TYPE){this.SUBMENU_ITEM_TYPE=YAHOO.widget.MenuModuleItem;}this.cfg=new YAHOO.util.Config(this);this.cfg.addProperty("text",{value:"",handler:this.configText,validator:this._checkString,suppressEvent:true});this.cfg.addProperty("helptext",{handler:this.configHelpText});this.cfg.addProperty("url",{value:"#",handler:this.configURL,suppressEvent:true});this.cfg.addProperty("emphasis",{value:false,handler:this.configEmphasis,validator:this.cfg.checkBoolean,suppressEvent:true});this.cfg.addProperty("strongemphasis",{value:false,handler:this.configStrongEmphasis,validator:this.cfg.checkBoolean,suppressEvent:true});this.cfg.addProperty("disabled",{value:false,handler:this.configDisabled,validator:this.cfg.checkBoolean,suppressEvent:true});this.cfg.addProperty("selected",{value:false,handler:this.configSelected,validator:this.cfg.checkBoolean,suppressEvent:true});this.cfg.addProperty("submenu",{handler:this.configSubmenu});if(this._checkString(_97)){this._createRootNodeStructure();this.cfg.setProperty("text",_97);}else{if(this._checkDOMNode(_97)){switch(_97.tagName){case "OPTION":this._createRootNodeStructure();this.cfg.setProperty("text",_97.text);this.srcElement=_97;break;case "OPTGROUP":this._createRootNodeStructure();this.cfg.setProperty("text",_97.label);this.srcElement=_97;this._initSubTree();break;case "LI":var _99=this._getFirstElement(_97,"A"),sURL=null,sText=null;if(_99){sURL=_99.getAttribute("href");if(_99.innerText){sText=_99.innerText;}else{var _9a=_99.ownerDocument.createRange();_9a.selectNodeContents(_99);sText=_9a.toString();}}else{var _9b=_97.firstChild;sText=_9b.nodeValue;_99=document.createElement("a");_97.replaceChild(_99,_9b);_99.appendChild(_9b);}this.srcElement=_97;this.element=_97;this._oAnchor=_99;var _9c=this._getFirstElement(_99),bEmphasis=false,bStrongEmphasis=false;if(_9c){this._oText=_9c.firstChild;switch(_9c.tagName){case "EM":bEmphasis=true;break;case "STRONG":bStrongEmphasis=true;break;}}else{this._oText=_99.firstChild;}this.cfg.setProperty("text",sText,true);this.cfg.setProperty("url",sURL,true);this.cfg.setProperty("emphasis",bEmphasis,true);this.cfg.setProperty("strongemphasis",bStrongEmphasis,true);this._initSubTree();break;}}}if(this.element){this._oDom.addClass(this.element,this.CSS_CLASS_NAME);var _9d=YAHOO.util.CustomEvent;this.destroyEvent=new _9d("destroyEvent",this);this.mouseOverEvent=new _9d("mouseOverEvent",this);this.mouseOutEvent=new _9d("mouseOutEvent",this);this.mouseDownEvent=new _9d("mouseDownEvent",this);this.mouseUpEvent=new _9d("mouseUpEvent",this);this.clickEvent=new _9d("clickEvent",this);this.keyPressEvent=new _9d("keyPressEvent",this);this.keyDownEvent=new _9d("keyDownEvent",this);this.keyUpEvent=new _9d("keyUpEvent",this);this.focusEvent=new _9d("focusEvent",this);this.blurEvent=new _9d("blurEvent",this);if(_98){this.cfg.applyConfig(_98);}this.cfg.fireQueue();}},_getFirstElement:function(_9e,_9f){var _a0;if(_9e.firstChild&&_9e.firstChild.nodeType==1){_a0=_9e.firstChild;}else{if(_9e.firstChild&&_9e.firstChild.nextSibling&&_9e.firstChild.nextSibling.nodeType==1){_a0=_9e.firstChild.nextSibling;}}if(_9f){return (_a0&&_a0.tagName==_9f)?_a0:false;}return _a0;},_checkString:function(_a1){return (typeof _a1=="string");},_checkDOMNode:function(_a2){return (_a2&&_a2.tagName);},_createRootNodeStructure:function(){this.element=document.createElement("li");this._oText=document.createTextNode("");this._oAnchor=document.createElement("a");this._oAnchor.appendChild(this._oText);this.cfg.refireEvent("url");this.element.appendChild(this._oAnchor);},_initSubTree:function(){var _a3=this.SUBMENU_TYPE,MenuModuleItem=this.SUBMENU_ITEM_TYPE;if(this.srcElement.childNodes.length>0){var _a4=this.srcElement.firstChild,aOptions=[];do{switch(_a4.tagName){case "DIV":this.cfg.setProperty("submenu",(new _a3(_a4)));break;case "OPTION":aOptions[aOptions.length]=_a4;break;}}while((_a4=_a4.nextSibling));var _a5=aOptions.length;if(_a5>0){this.cfg.setProperty("submenu",(new _a3(this._oDom.generateId())));for(var n=0;n<_a5;n++){this._oSubmenu.addItem((new MenuModuleItem(aOptions[n])));}}}},configText:function(_a7,_a8,_a9){var _aa=_a8[0];if(this._oText){this._oText.nodeValue=_aa;}},configHelpText:function(_ab,_ac,_ad){var _ae=_ac[0],aNodes=[this.element,this._oAnchor],me=this;function initHelpText(){me._oDom.addClass(aNodes,"hashelptext");if(me.cfg.getProperty("disabled")){me.cfg.refireEvent("disabled");}if(me.cfg.getProperty("selected")){me.cfg.refireEvent("selected");}}function removeHelpText(){me._oDom.removeClass(aNodes,"hashelptext");me.element.removeChild(me._oHelpTextEM);me._oHelpTextEM=null;}if(this._checkDOMNode(_ae)){if(this._oHelpTextEM){var _af=this._oHelpTextEM.parentNode;_af.replaceChild(_ae,this._oHelpTextEM);}else{this._oHelpTextEM=_ae;this.element.insertBefore(this._oHelpTextEM,this.subMenuIndicator);}initHelpText();}else{if(this._checkString(_ae)){if(_ae.length===0){removeHelpText();}else{if(!this._oHelpTextEM){this._oHelpTextEM=document.createElement("em");this.element.insertBefore(this._oHelpTextEM,this.subMenuIndicator);}this._oHelpTextEM.innerHTML=_ae;initHelpText();}}else{if(!_ae&&this._oHelpTextEM){removeHelpText();}}}},configURL:function(_b0,_b1,_b2){var _b3=_b1[0];if(!_b3){_b3="#";}this._oAnchor.setAttribute("href",_b3);},configEmphasis:function(_b4,_b5,_b6){var _b7=_b5[0];if(_b7&&this.cfg.getProperty("strongemphasis")){this.cfg.setProperty("strongemphasis",false);}if(this._oAnchor){var oEM;if(_b7){oEM=document.createElement("em");oEM.appendChild(this._oText);this._oAnchor.appendChild(oEM);}else{oEM=this._getFirstElement(this._oAnchor,"EM");this._oAnchor.removeChild(oEM);this._oAnchor.appendChild(this._oText);}}},configStrongEmphasis:function(_b9,_ba,_bb){var _bc=_ba[0];if(_bc&&this.cfg.getProperty("emphasis")){this.cfg.setProperty("emphasis",false);}if(this._oAnchor){var _bd;if(_bc){_bd=document.createElement("strong");_bd.appendChild(this._oText);this._oAnchor.appendChild(_bd);}else{_bd=this._getFirstElement(this._oAnchor,"STRONG");this._oAnchor.removeChild(_bd);this._oAnchor.appendChild(this._oText);}}},configDisabled:function(_be,_bf,_c0){var _c1=_bf[0],aNodes=[this.element,this._oAnchor],sImageId,sImageAlt;if(this._oHelpTextEM){aNodes[2]=this._oHelpTextEM;}if(_c1){if(this.cfg.getProperty("selected")){this.cfg.setProperty("selected",false);}this._oAnchor.removeAttribute("href");this._oDom.addClass(aNodes,"disabled");sImageId="yuidisabledsubmenuindicator";sImageAlt=this.DISABLED_SUBMENU_INDICATOR_ALT_TEXT;}else{this._oAnchor.setAttribute("href",this.cfg.getProperty("url"));this._oDom.removeClass(aNodes,"disabled");sImageId="yuisubmenuindicator";sImageAlt=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;}if(this.subMenuIndicator){this.subMenuIndicator.src=document.getElementById(sImageId).src;this.subMenuIndicator.alt=sImageAlt;}},configSelected:function(_c2,_c3,_c4){var _c5=_c3[0],aNodes=[this.element,this._oAnchor],sImageId;if(this._oHelpTextEM){aNodes[2]=this._oHelpTextEM;}if(_c5){this._oDom.addClass(aNodes,"selected");sImageId="yuiselectedsubmenuindicator";}else{this._oDom.removeClass(aNodes,"selected");sImageId="yuisubmenuindicator";}if(this.subMenuIndicator){this.subMenuIndicator.src=document.getElementById(sImageId).src;}},configSubmenu:function(_c6,_c7,_c8){var _c9=_c7[0],aNodes=[this.element,this._oAnchor];if(_c9){_c9.parent=this;this._oSubmenu=_c9;if(!this.subMenuIndicator){var _ca=document.getElementById("yuisubmenuindicator");if(!_ca){_ca=document.createElement("img");_ca.src=(this.imageRoot+this.SUBMENU_INDICATOR_IMAGE_PATH);_ca.alt=this.COLLAPSED_SUBMENU_INDICATOR_ALT_TEXT;_ca.id="yuisubmenuindicator";var _cb=document.createElement("img");_cb.src=(this.imageRoot+this.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH);_cb.id="yuiselectedsubmenuindicator";var _cc=document.createElement("img");_cc.src=(this.imageRoot+this.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH);_cc.id="yuidisabledsubmenuindicator";var _cd=document.createElement("div");_cd.style.position="absolute";_cd.style.left="-1000px";_cd.appendChild(_ca);_cd.appendChild(_cb);_cd.appendChild(_cc);document.body.appendChild(_cd);}var _ce=_ca.cloneNode(false);_ce.removeAttribute("id");this.subMenuIndicator=_ce;this.element.appendChild(this.subMenuIndicator);this._oDom.addClass(aNodes,"hassubmenu");if(this.cfg.getProperty("disabled")){this.cfg.refireEvent("disabled");}if(this.cfg.getProperty("selected")){this.cfg.refireEvent("selected");}}}else{this._oDom.removeClass(aNodes,"hassubmenu");if(this.subMenuIndicator){this.element.removeChild(this.subMenuIndicator);}if(this._oSubmenu){this._oSubmenu.destroy();}}},getNextEnabledSibling:function(){if(this.parent instanceof YAHOO.widget.MenuModule){function getNextArrayItem(_cf,_d0){return _cf[_d0]||getNextArrayItem(_cf,(_d0+1));}var _d1=this.parent.getItemGroups(),oNextItem;if(this.index<(_d1[this.groupIndex].length-1)){oNextItem=getNextArrayItem(_d1[this.groupIndex],(this.index+1));}else{var _d2;if(this.groupIndex<(_d1.length-1)){_d2=this.groupIndex+1;}else{_d2=0;}var _d3=getNextArrayItem(_d1,_d2);oNextItem=getNextArrayItem(_d3,0);}return oNextItem.cfg.getProperty("disabled")?oNextItem.getNextEnabledSibling():oNextItem;}},getPreviousEnabledSibling:function(){if(this.parent instanceof YAHOO.widget.MenuModule){function getPreviousArrayItem(_d4,_d5){return _d4[_d5]||getPreviousArrayItem(_d4,(_d5-1));}function getFirstItemIndex(_d6,_d7){return _d6[_d7]?_d7:getFirstItemIndex(_d6,(_d7+1));}var _d8=this.parent.getItemGroups(),oPreviousItem;if(this.index>getFirstItemIndex(_d8[this.groupIndex],0)){oPreviousItem=getPreviousArrayItem(_d8[this.groupIndex],(this.index-1));}else{var _d9;if(this.groupIndex>getFirstItemIndex(_d8,0)){_d9=this.groupIndex-1;}else{_d9=_d8.length-1;}var _da=getPreviousArrayItem(_d8,_d9);oPreviousItem=getPreviousArrayItem(_da,(_da.length-1));}return oPreviousItem.cfg.getProperty("disabled")?oPreviousItem.getPreviousEnabledSibling():oPreviousItem;}},focus:function(){if(!this.cfg.getProperty("disabled")&&this.parent&&this.parent.cfg.getProperty("visible")){var _db=this.parent.activeItem;if(_db){_db.blur();}this._oAnchor.focus();if(this.parent&&this.parent.browser=="opera"&&this._oSubmenu){this._oAnchor.focus();}this.focusEvent.fire();}},blur:function(){if(!this.cfg.getProperty("disabled")&&this.parent&&this.parent.cfg.getProperty("visible")){this._oAnchor.blur();this.blurEvent.fire();}},destroy:function(){if(this.element){this.mouseOverEvent.unsubscribeAll();this.mouseOutEvent.unsubscribeAll();this.mouseDownEvent.unsubscribeAll();this.mouseUpEvent.unsubscribeAll();this.clickEvent.unsubscribeAll();this.keyPressEvent.unsubscribeAll();this.keyDownEvent.unsubscribeAll();this.keyUpEvent.unsubscribeAll();this.focusEvent.unsubscribeAll();this.blurEvent.unsubscribeAll();this.cfg.configChangedEvent.unsubscribeAll();var _dc=this.element.parentNode;if(_dc){_dc.removeChild(this.element);this.destroyEvent.fire();}this.destroyEvent.unsubscribeAll();}}};YAHOO.widget.Menu=function(_dd,_de){if(arguments.length>0){YAHOO.widget.Menu.superclass.constructor.call(this,_dd,_de);}};YAHOO.widget.Menu.prototype=new YAHOO.widget.MenuModule();YAHOO.widget.Menu.prototype.constructor=YAHOO.widget.Menu;YAHOO.widget.Menu.superclass=YAHOO.widget.MenuModule.prototype;YAHOO.widget.Menu.prototype.init=function(_df,_e0){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuItem;}YAHOO.widget.Menu.superclass.init.call(this,_df);this.beforeInitEvent.fire(YAHOO.widget.Menu);this.mouseOverEvent.subscribe(this._onMouseOver,this,true);this.keyDownEvent.subscribe(this._onKeyDown,this,true);if(_e0){this.cfg.applyConfig(_e0,true);}this.initEvent.fire(YAHOO.widget.Menu);};YAHOO.widget.Menu.prototype._onMouseOver=function(_e1,_e2,_e3){if(this.parent){this.parent.cfg.setProperty("selected",true);}};YAHOO.widget.Menu.prototype._onKeyDown=function(_e4,_e5,_e6){if(this.cfg.getProperty("position")=="dynamic"){var _e7=_e5[0];if(_e7.keyCode==27){this.hide();if(this.parent){this.parent.focus();if(this.parent.parent instanceof YAHOO.widget.Menu){this.parent.cfg.setProperty("selected",true);}}}}};YAHOO.widget.MenuItem=function(_e8,_e9){if(_e8){YAHOO.widget.MenuItem.superclass.constructor.call(this,_e8,_e9);}};YAHOO.widget.MenuItem.prototype=new YAHOO.widget.MenuModuleItem();YAHOO.widget.MenuItem.prototype.constructor=YAHOO.widget.MenuItem;YAHOO.widget.MenuItem.superclass=YAHOO.widget.MenuModuleItem.prototype;YAHOO.widget.MenuItem.prototype.init=function(_ea,_eb){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}if(!this.SUBMENU_ITEM_TYPE){this.SUBMENU_ITEM_TYPE=YAHOO.widget.MenuItem;}YAHOO.widget.MenuItem.superclass.init.call(this,_ea);this.keyDownEvent.subscribe(this._onKeyDown,this,true);this.mouseOverEvent.subscribe(this._onMouseOver,this,true);this.mouseOutEvent.subscribe(this._onMouseOut,this,true);if(_eb){this.cfg.applyConfig(_eb,true);}this.cfg.fireQueue();};YAHOO.widget.MenuItem.prototype._onKeyDown=function(_ec,_ed,_ee){var _ef=_ed[0];switch(_ef.keyCode){case 38:case 40:var _f0=this.parent.activeItem;if(this==_f0&&!this.cfg.getProperty("selected")){this.cfg.setProperty("selected",true);}else{var _f1=(_ef.keyCode==38)?this.getPreviousEnabledSibling():this.getNextEnabledSibling();if(_f1){this.parent.clearActiveItem();_f1.cfg.setProperty("selected",true);_f1.focus();}}YAHOO.util.Event.preventDefault(_ef);break;case 39:this.parent.clearActiveItem();this.cfg.setProperty("selected",true);this.focus();var _f2=this.cfg.getProperty("submenu");if(_f2){_f2.show();_f2.setInitialSelection();}else{if(YAHOO.widget.MenuBarItem&&this.parent.parent&&this.parent.parent instanceof YAHOO.widget.MenuBarItem){this.parent.hide();var _f3=this.parent.parent;if(_f3){_f3.focus();_f3.cfg.setProperty("selected",true);}}}YAHOO.util.Event.preventDefault(_ef);break;case 37:if(this.parent.parent){this.parent.hide();var _f3=this.parent.parent;if(_f3){_f3.focus();_f3.cfg.setProperty("selected",true);}}YAHOO.util.Event.preventDefault(_ef);break;}};YAHOO.widget.MenuItem.prototype._onMouseOver=function(_f4,_f5,_f6){var _f7=this.parent.activeItem;if(_f7&&_f7!=this){this.parent.clearActiveItem();}this.cfg.setProperty("selected",true);this.focus();var _f8=this.cfg.getProperty("submenu");if(_f8){_f8.show();}};YAHOO.widget.MenuItem.prototype._onMouseOut=function(_f9,_fa,_fb){this.cfg.setProperty("selected",false);var _fc=this.cfg.getProperty("submenu");if(_fc){var _fd=_fa[0],oRelatedTarget=YAHOO.util.Event.getRelatedTarget(_fd);if(!(oRelatedTarget==_fc.element||this._oDom.isAncestor(_fc.element,oRelatedTarget))){_fc.hide();}}};YAHOO.widget.ContextMenu=function(_fe,_ff){if(arguments.length>0){YAHOO.widget.ContextMenu.superclass.constructor.call(this,_fe,_ff);}};YAHOO.widget.ContextMenu.prototype=new YAHOO.widget.Menu();YAHOO.widget.ContextMenu.prototype.constructor=YAHOO.widget.ContextMenu;YAHOO.widget.ContextMenu.superclass=YAHOO.widget.Menu.prototype;YAHOO.widget.ContextMenu.prototype.init=function(_100,_101){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.ContextMenuItem;}YAHOO.widget.ContextMenu.superclass.init.call(this,_100);this.beforeInitEvent.fire(YAHOO.widget.ContextMenu);if(_101){this.cfg.applyConfig(_101,true);}this.initEvent.fire(YAHOO.widget.ContextMenu);};YAHOO.widget.ContextMenu.prototype._onDocumentMouseDown=function(_102,_103){var _104=this._oEventUtil.getTarget(_102,true);if(_104!=this._oTargetElement||!this._oDom.isAncestor(this._oTargetElement,_104)){this.hide();}};YAHOO.widget.ContextMenu.prototype._onTriggerClick=function(_105,_106){if(_105.ctrlKey){this._oEventUtil.stopEvent(_105);}};YAHOO.widget.ContextMenu.prototype._onTriggerContextMenu=function(_107,_108){if(_107.type=="mousedown"){if(!_107.ctrlKey){return;}this._oEventUtil.stopEvent(_107);}this.contextEventTarget=this._oEventUtil.getTarget(_107,true);var nX=this._oEventUtil.getPageX(_107),nY=this._oEventUtil.getPageY(_107);this.cfg.applyConfig({x:nX,y:nY,visible:true});this.cfg.fireQueue();this._oEventUtil.preventDefault(_107);};YAHOO.widget.ContextMenu.prototype.contextEventTarget=null;YAHOO.widget.ContextMenu.prototype.initDefaultConfig=function(){YAHOO.widget.ContextMenu.superclass.initDefaultConfig.call(this);this.cfg.addProperty("trigger",{handler:this.configTrigger});};YAHOO.widget.ContextMenu.prototype.configTrigger=function(_10a,_10b,_10c){var _10d=_10b[0];if(_10d){var _10e=(this.browser=="opera");var _10f=_10e?"mousedown":"contextmenu";this._oEventUtil.addListener(_10d,_10f,this._onTriggerContextMenu,this,true);if(_10e){this._oEventUtil.addListener(_10d,"click",this._onTriggerClick,this,true);}this._oEventUtil.addListener(document,"mousedown",this._onDocumentMouseDown,this,true);}};YAHOO.widget.ContextMenuItem=function(_110,_111){if(_110){YAHOO.widget.ContextMenuItem.superclass.constructor.call(this,_110,_111);}};YAHOO.widget.ContextMenuItem.prototype=new YAHOO.widget.MenuItem();YAHOO.widget.ContextMenuItem.prototype.constructor=YAHOO.widget.ContextMenuItem;YAHOO.widget.ContextMenuItem.superclass=YAHOO.widget.MenuItem.prototype;YAHOO.widget.ContextMenuItem.prototype.init=function(_112,_113){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.ContextMenu;}if(!this.SUBMENU_ITEM_TYPE){this.SUBMENU_ITEM_TYPE=YAHOO.widget.ContextMenuItem;}YAHOO.widget.ContextMenuItem.superclass.init.call(this,_112);if(_113){this.cfg.applyConfig(_113,true);}this.cfg.fireQueue();};YAHOO.widget.MenuBar=function(_114,_115){if(arguments.length>0){YAHOO.widget.MenuBar.superclass.constructor.call(this,_114,_115);}};YAHOO.widget.MenuBar.prototype=new YAHOO.widget.MenuModule();YAHOO.widget.MenuBar.prototype.constructor=YAHOO.widget.MenuBar;YAHOO.widget.MenuBar.superclass=YAHOO.widget.MenuModule.prototype;YAHOO.widget.MenuBar.prototype.init=function(_116,_117){if(!this.ITEM_TYPE){this.ITEM_TYPE=YAHOO.widget.MenuBarItem;}YAHOO.widget.MenuBar.superclass.init.call(this,_116);this.beforeInitEvent.fire(YAHOO.widget.MenuBar);if(!_117||(_117&&!_117.position)){this.cfg.queueProperty("position","static");}if(!_117||(_117&&!_117.submenualignment)){this.cfg.queueProperty("submenualignment",["tl","bl"]);}if(_117){this.cfg.applyConfig(_117,true);}this.initEvent.fire(YAHOO.widget.MenuBar);};YAHOO.widget.MenuBar.prototype.CSS_CLASS_NAME="yuimenubar";YAHOO.widget.MenuBarItem=function(_118,_119){if(_118){YAHOO.widget.MenuBarItem.superclass.constructor.call(this,_118,_119);}};YAHOO.widget.MenuBarItem.prototype=new YAHOO.widget.MenuModuleItem();YAHOO.widget.MenuBarItem.prototype.constructor=YAHOO.widget.MenuBarItem;YAHOO.widget.MenuBarItem.superclass=YAHOO.widget.MenuModuleItem.prototype;YAHOO.widget.MenuBarItem.prototype.init=function(_11a,_11b){if(!this.SUBMENU_TYPE){this.SUBMENU_TYPE=YAHOO.widget.Menu;}if(!this.SUBMENU_ITEM_TYPE){this.SUBMENU_ITEM_TYPE=YAHOO.widget.MenuItem;}YAHOO.widget.MenuBarItem.superclass.init.call(this,_11a);this.keyDownEvent.subscribe(this._onKeyDown,this,true);if(_11b){this.cfg.applyConfig(_11b,true);}this.cfg.fireQueue();};YAHOO.widget.MenuBarItem.prototype.CSS_CLASS_NAME="yuimenubaritem";YAHOO.widget.MenuBarItem.prototype.SUBMENU_INDICATOR_IMAGE_PATH="nt/ic/ut/bsc/menuarodwn9_nrm_1.gif";YAHOO.widget.MenuBarItem.prototype.SELECTED_SUBMENU_INDICATOR_IMAGE_PATH="nt/ic/ut/bsc/menuarodwn9_clk_1.gif";YAHOO.widget.MenuBarItem.prototype.DISABLED_SUBMENU_INDICATOR_IMAGE_PATH="nt/ic/ut/bsc/menuarodwn9_dim_1.gif";YAHOO.widget.MenuBarItem.prototype._onKeyDown=function(_11c,_11d,_11e){var _11f=_11d[0];switch(_11f.keyCode){case 37:case 39:var _120=this.parent.activeItem;if(this==_120&&!this.cfg.getProperty("selected")){this.cfg.setProperty("selected",true);}else{var _121=(_11f.keyCode==37)?this.getPreviousEnabledSibling():this.getNextEnabledSibling();if(_121){this.parent.clearActiveItem();_121.cfg.setProperty("selected",true);_121.focus();}}YAHOO.util.Event.preventDefault(_11f);break;case 40:this.parent.clearActiveItem();this.cfg.setProperty("selected",true);this.focus();var _122=this.cfg.getProperty("submenu");if(_122){_122.show();_122.setInitialSelection();}YAHOO.util.Event.preventDefault(_11f);break;}}; |