Ext.override(Ext.Panel,
{
   onShow: function()
   {
      if (this.floating)
         this.el.show();
      else
         Ext.Panel.superclass.onShow.call(this);
   },

   onHide: function()
   {
      if (this.floating)
         this.el.hide();
      else
         Ext.Panel.superclass.onHide.call(this);
   },

   makeFloating: function(cfg)
   {
        this.floating = true;
        this.el = new Ext.Layer(
            typeof cfg == 'object' ? cfg : {
                shadow: this.shadow !== undefined ? this.shadow : 'sides',
                shadowOffset: this.shadowOffset,
                constrain:false,
                useDisplay: true,
                shim: this.shim === false ? false : undefined
            }, this.el
        );
   }
}
);