App.Module = function(cfg){
    Ext.apply(this, cfg);
    App.Module.superclass.constructor.call(this);
    this.addEvents({
        'ready' : true,
        'beforeunload' : true
    });
};

Ext.extend(App.Module, Ext.util.Observable, {

	id : '',						// linking name in Application
	title : '',
	description : '',
	icoCls : '', 					// used for button
	logoCls : '', 					// used for logo	
	
	app : null,						//backlink to Application
	
    init : Ext.emptyFn,
	
	start : Ext.emptyFn,
	
	onReady : function(fn, scope){
        if(!this.isReady){
            this.on('ready', fn, scope);
        }else{
            fn.call(scope, this);
        }
    },
    
	onUnload : function(e){
        if(this.fireEvent('beforeunload', this) === false){
            e.stopEvent();
			this._desctruct();
        }
    },	
	
	_destruct : Ext.emptyFn
	
});