var IntoTextareaPlugin_Code = Class.create(
{
  initialize: function (textarea)
  {
    this._el = null;
    this._textarea = textarea;
    this._create();
  },

  _create: function ()
  {
    this._el = new Element('button').update('Code').observe('click', function (evt)
    {
      var selection = this._textarea.getSelection();

//      if (!selection.empty())
        this._textarea.wrapSelection('[code]', '[/code]');
//      else
//        this._textarea.

      evt.stop();
    }.bind(this));
  },

  toElement: function ()
  {
    return this._el;
  }
});
