CKEDITOR.plugins.add('menu',{beforeInit:function(a){var b=a.config.menu_groups.split(','),c=a._.menuGroups={},d=a._.menuItems={};for(var e=0;e<b.length;e++)c[b[e]]=e+1;a.addMenuGroup=function(f,g){c[f]=g||100;};a.addMenuItem=function(f,g){if(c[g.group])d[f]=new CKEDITOR.menuItem(this,f,g);};a.addMenuItems=function(f){for(var g in f)this.addMenuItem(g,f[g]);};a.getMenuItem=function(f){return d[f];};},requires:['floatpanel']});(function(){CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(b,c){var f=this;c=f._.definition=c||{};f.id='cke_'+CKEDITOR.tools.getNextNumber();f.editor=b;f.items=[];f._.level=c.level||1;var d=CKEDITOR.tools.extend({},c.panel,{css:b.skin.editor.css,level:f._.level-1,block:{}}),e=d.block.attributes=d.attributes||{};!e.role&&(e.role='menu');f._.panelDefinition=d;},_:{showSubMenu:function(b){var j=this;var c=j._.subMenu,d=j.items[b],e=d.getItems&&d.getItems();if(!e){j._.panel.hideChild();return;}var f=j._.panel.getBlock(j.id);f._.focusIndex=b;if(c)c.removeAll();else{c=j._.subMenu=new CKEDITOR.menu(j.editor,CKEDITOR.tools.extend({},j._.definition,{level:j._.level+1},true));c.parent=j;c.onClick=CKEDITOR.tools.bind(j.onClick,j);c.onEscape=j.onEscape;}for(var g in e){var h=j.editor.getMenuItem(g);if(h){h.state=e[g];c.add(h);}}var i=j._.panel.getBlock(j.id).element.getDocument().getById(j.id+String(b));c.show(i,2);}},proto:{add:function(b){if(!b.order)b.order=this.items.length;this.items.push(b);},removeAll:function(){this.items=[];},show:function(b,c,d,e){var f=this.items,g=this.editor,h=this._.panel,i=this._.element;if(!h){h=this._.panel=new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),this._.panelDefinition,this._.level);h.onEscape=CKEDITOR.tools.bind(function(r){if(this.onEscape&&this.onEscape(r)===false)return false;},this);h.onHide=CKEDITOR.tools.bind(function(){this.onHide&&this.onHide();},this);var j=h.addBlock(this.id,this._.panelDefinition.block);j.autoSize=true;var k=j.keys;k[40]='next';k[9]='next';k[38]='prev';k[CKEDITOR.SHIFT+9]='prev';k[32]='click';k[g.lang.dir=='rtl'?37:39]='click';i=this._.element=j.element;i.addClass(g.skinClass);var l=i.getDocument();l.getBody().setStyle('overflow','hidden');l.getElementsByTag('html').getItem(0).setStyle('overflow','hidden');this._.itemOverFn=CKEDITOR.tools.addFunction(function(r){var s=this;clearTimeout(s._.showSubTimeout);s._.showSubTimeout=CKEDITOR.tools.setTimeout(s._.showSubMenu,g.config.menu_subMenuDelay,s,[r]);},this);this._.itemOutFn=CKEDITOR.tools.addFunction(function(r){clearTimeout(this._.showSubTimeout);
},this);this._.itemClickFn=CKEDITOR.tools.addFunction(function(r){var t=this;var s=t.items[r];if(s.state==CKEDITOR.TRISTATE_DISABLED){t.hide();return;}if(s.getItems)t._.showSubMenu(r);else t.onClick&&t.onClick(s);},this);}a(f);var m=['<div class="cke_menu" role="presentation">'],n=f.length,o=n&&f[0].group;for(var p=0;p<n;p++){var q=f[p];if(o!=q.group){m.push('<div class="cke_menuseparator" role="separator"></div>');o=q.group;}q.render(this,p,m);}m.push('</div>');i.setHtml(m.join(''));if(this.parent)this.parent._.panel.showAsChild(h,this.id,b,c,d,e);else h.showBlock(this.id,b,c,d,e);g.fire('menuShow',[h]);},hide:function(){this._.panel&&this._.panel.hide();}}});function a(b){b.sort(function(c,d){if(c.group<d.group)return-1;else if(c.group>d.group)return 1;return c.order<d.order?-1:c.order>d.order?1:0;});};})();CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(a,b,c){var d=this;CKEDITOR.tools.extend(d,c,{order:0,className:'cke_button_'+b});d.group=a._.menuGroups[d.group];d.editor=a;d.name=b;},proto:{render:function(a,b,c){var j=this;var d=a.id+String(b),e=typeof j.state=='undefined'?CKEDITOR.TRISTATE_OFF:j.state,f=' cke_'+(e==CKEDITOR.TRISTATE_ON?'on':e==CKEDITOR.TRISTATE_DISABLED?'disabled':'off'),g=j.label;if(j.className)f+=' '+j.className;var h=j.getItems;c.push('<span class="cke_menuitem"><a id="',d,'" class="',f,'" href="javascript:void(\'',(j.label||'').replace("'",''),'\')" title="',j.label,'" tabindex="-1"_cke_focus=1 hidefocus="true" role="menuitem"'+(h?'aria-haspopup="true"':'')+(e==CKEDITOR.TRISTATE_DISABLED?'aria-disabled="true"':'')+(e==CKEDITOR.TRISTATE_ON?'aria-pressed="true"':''));if(CKEDITOR.env.opera||CKEDITOR.env.gecko&&CKEDITOR.env.mac)c.push(' onkeypress="return false;"');if(CKEDITOR.env.gecko)c.push(' onblur="this.style.cssText = this.style.cssText;"');var i=(j.iconOffset||0)*-16;c.push(' onmouseover="CKEDITOR.tools.callFunction(',a._.itemOverFn,',',b,');" onmouseout="CKEDITOR.tools.callFunction(',a._.itemOutFn,',',b,');" onclick="CKEDITOR.tools.callFunction(',a._.itemClickFn,',',b,'); return false;"><span class="cke_icon_wrapper"><span class="cke_icon"'+(j.icon?' style="background-image:url('+CKEDITOR.getUrl(j.icon)+');background-position:0 '+i+'px;"':'')+'></span></span>'+'<span class="cke_label">');if(h)c.push('<span class="cke_menuarrow">','<span>&#',j.editor.lang.dir=='rtl'?'9668':'9658',';</span>','</span>');c.push(g,'</span></a></span>');}}});CKEDITOR.config.menu_subMenuDelay=400;CKEDITOR.config.menu_groups='clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';
