ontos.ContentPanel = function(cfg) {
	this.dispatcher = cfg.dispatcher;
	ontos.ContentPanel.superclass.constructor.call(this, cfg);
	
	this.maskState = false;
}

Ext.extend(ontos.ContentPanel, Ext.Panel, {
	doFireEvent : function(evname, evargs) {
		if (this.dispatcher) {
			this.dispatcher.fireEvent(evname, evargs);
		} else {
			this.fireEvent(evname, evargs);
		}
	},
	updateLoadMask : function() {
		if (!this.loadMask) return;
		
		if (this.maskState) {
			this.loadMask.onBeforeLoad();
		} else {
			this.loadMask.onLoad();
		}
	},
	render: function (c, pos) {
		ontos.ContentPanel.superclass.render.call(this, c, pos);
		if (!this.loadMask && this.getEl()) {
			this.loadMask = new Ext.LoadMask(this.getEl(), {msg:ontos.locale.loading});			
		}
		this.updateLoadMask();
	},
	setSize : function(width, height){
		ontos.ContentPanel.superclass.setSize.call(this, width, height);
		this.updateLoadMask();
    }/*,
    initComponent : function(){
       weblib.ContentPanel.superclass.initComponent.call(this);
       
    }*/
});
