// Create user extension namespace (Application)
Ext.namespace('Application');

/**
  *  Application.guestCustomPagePanel Extension class
  * 
  *  @author Seabor
  *  @version 1.0
  *  
  *  @class Application.guestCustomPagePanel
  *  @extends Ext.Panel
  *  @constructor
  *  @param {Object} config Configuration options
  */

Application.guestCustomPagePanel = function(config) {

    // call parent constructor
    Application.guestCustomPagePanel.superclass.constructor.call(this, config);

}; // end of Application.guestCustomPagePanel constructor

Ext.extend(Application.guestCustomPagePanel, Ext.Panel, {

	// configurables
    // anything what is here can be configured from outside
    xtype: 'panel'
    ,id: 'custom_page'
    ,bodyStyle: 'padding:10px;background:#142f4c'
    ,closable: true
    ,autoScroll: true
    ,token: ''
    ,layout: 'fit'
    ,pageName: ''
    ,initComponent: function() {
        
        //call parent
        Application.guestCustomPagePanel.superclass.initComponent.call(this, arguments);
        
        this.on({
            scope: this
            ,render: function() {
                this.on({
                	scope: this
                    ,deactivate: function() {
                        //Ext.History.add('');
                    }
                    ,activate: function() {
                        Ext.History.add(this.token);
                    }
                    ,close: function() {
                        //this.fireEvent('deactivate', this);
                        Ext.History.add('');
                    }
                });
            }
        });
    }
});

// register new xtype
Ext.reg('guestCustomPagePanel', Application.guestCustomPagePanel);
