Ext.namespace('mm.loadmask.tmpl.base');
mm.loadmask.tmpl.base = '<div class="mm-loadmask-base"> <div class="mask"></div> <div class="animation"> <div class="loader"></div> <div class="text"><h4>please wait...</h4></div> </div> </div>';
Ext.namespace('mm.loadmask.base');
mm.loadmask.base.construct = function(autoconstruct){
	this.templates = {base:mm.loadmask.tmpl.base};
	this.el = null;
	this.overlay = null;
	this.constructor = function(config)
	{
		var parent = config.parent;
		var template = new Ext.XTemplate(this.templates.base);
		this.el = $(template.apply({}));
		$(parent).append(this.el);
		var css = {
			width: $(parent).width(),
			height: $(parent).height()
		};
		var anim = this.el.find('.animation');
		this.el.find('.animation').css({
			top: ($(parent).height() - anim.height()) / 2,
			left: ($(parent).width() - anim.width()) / 2
		});
		this.el.find('.mask').css(css);
		this.el.disableSelection();
		
	};
	this.hide = function()
	{
		if (this.el != null)
		{
			this.el.hide();
			this.el.remove();
		}
		if (this.overlay != null)
		{
			this.overlay.hide();
			this.overlay.remove();
		}
	};
	this.constructor(autoconstruct);
};
mm.loadmask.base.construct.prototype.domname = 'mm-loadmask-base';
mm.loadmask.base.construct.prototype.namespace = mm.loadmask.base;


