Ext.namespace("Axi","Axi.UI");Axi.Messenger=function(){if(typeof Axi.Messenger.instance!="undefined"){return false}Axi.Messenger.instance=this;var B=0;var A;var C;var E=[];function F(){var H=Ext.DomHelper.insertFirst(document.body,{tag:"table",style:"z-index: 20000; width: 650px; left: 50%; margin-left: -325px; position: absolute;",html:'<tr><td id="x-message-container" align="center"></td></tr>'},true);var G=Ext.DomQuery.selectNode("#x-message-container");return G?G:false}function D(M,I,N,L){var H,G;if(!C){C=F()}H='<table class="x-axi-window-message x-axi-window-message-'+I+'" cellpadding="0" cellspacing="0"><tr><td class="x-box-ml"></td><td class="x-box-mc">'+M+'</td><td class="x-box-mr"><a href="#" class="close"></a></td></tr><tr><td class="x-box-bl"></td><td class="x-box-bc"></td><td class="x-box-br"></td></tr></table>';var K=Ext.DomQuery.select(".x-axi-window-message");if(!K.length){G=Ext.DomHelper.insertFirst(C,{html:H},true)}else{if(E[E.length-1].fxQueue.length===3){L=L||++B;D.defer(200,this,[M,I,N,L]);
if(!A){A=L}return true}else{if(L&&A&&A!=L){D.defer(200,this,arguments);return true}}A=null;G=Ext.DomHelper.insertAfter(K[K.length-1].parentNode,{html:H},true)}E.push(G);G.slideIn("t").pause(N).slideOut("t",{callback:function(){E.shift()},remove:true});var J=new Ext.Element(Ext.DomQuery.selectNode("a.close",G.dom));J.on("click",function(){var P=this.findParentNode("div");for(var O=E.length;O>0;--O){if(E[O-1]&&E[O-1].dom==P){E[O-1].stopFx()}if(E[O-1]&&E[O-1].dom==P){E[O-1].remove()}if(E[O-1]&&E[O-1].dom==P){E.remove(E[O-1])}}})}this.constructor=function(){};this.info=function(G){D(G,"info",5)};this.warn=function(G){D(G,"warning",10)};this.error=function(G){D(G,"error",10)};this.clearMessages=function(){for(var H=0,G=E.length;H<G;++H){if(E[H]){E[H].stopFx()}if(E[H]){E[H].remove()}}E=[]};this.getCounter=function(){return E.length};this.constructor.apply(this,arguments)};Axi.Messenger.instance;Axi.Messenger.getInstance=function(){return Axi.Messenger.instance};
