/*!
 * Ext JS Library 3.1.1
 * Copyright(c) 2006-2010 Ext JS, LLC
 * licensing@extjs.com
 * http://www.extjs.com/license
 */
Ext.infoDilalog = function(){
    var msgCt;

    function createBox(t, s){
        return ['<div class="x-window x-window-plain x-window-dlg">',
					'<div class="x-window-tl">',
						'<div class="x-window-tr">',
							'<div class="x-window-tc">',
								'<div class="x-window-header">',
									'<span class="x-window-header-text">', t, '</span>',
								'</div>',
							'</div>',
						'</div>',
					'</div>',
					'<div class="x-window-bwrap">',
						'<div class="x-window-ml">',
							'<div class="x-window-mr">',
								'<div class="x-window-mc">',
									'<div class="x-window-body">',
										'<div class="ext-mb-content">',
											'<span class="ext-mb-text">', s,'</span>',
										'</div>',
									'</div>',
								'</div>',
							'</div>',
						'</div>',
						'<div class="x-window-bl">',
							'<div class="x-window-br">',
								'<div class="x-window-bc">',
									'<div class="x-window-footer"></div>',
								'</div>',
							'</div>',
						'</div>',
					'</div>',
                '</div>'].join('');
    }
    return {
        msg : function(title, format){
            if(!msgCt){
                msgCt = Ext.DomHelper.insertFirst(document.body, {id:'msg-div'}, true);
            }
            var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1));
            var m = Ext.DomHelper.append(msgCt, {html:createBox(title, s)}, true);
            m.slideIn('b').pause(2).ghost('b', {remove:true});
        }
    };
}();

