function MessageQueue(b){var a=this;if(b==undefined)b={};a._items=[];a._container=b.container!=undefined?b.container:undefined;a.MSGERROR=1;a.MSGALERT=2;a._isinit=false;a._fadespeed=50;a._removesmallmsg=5e3;a._removelargemsg=1e4}MessageQueue.prototype.init=function(){if(this._isinit)return;this._isinit=true};MessageQueue.prototype.container=function(c){var a=this;a.init();if(c!=null&&c!=undefined)a._container=$(c);if(a._container==undefined||a._container.length<=0){var b=$("#phMessageContainer");if(b.length<=0){var b=$('<div id="phMessageContainer" class="messagecontainer"></div>');$("body").add(b);a._container=b}else a._container=b}return a._container};MessageQueue.prototype.count=function(){return this.container().find(".sysmessage").length};MessageQueue.prototype.createMessage=function(i,g){var e=".sysmessage",d=".closebutton",a=this,c=a,f="";switch(i){case a.MSGERROR:f="msgerror";break;case a.MSGALERT:f="msgalert"}var b=$('<div class="syscontainer"><div class="sysmessage '+f+'" style="display:none"><div class="text">'+g+'</div><div style="display:none" class="closebutton">x</div></div><div class="clr"></div></div>');a.container().append(b);a.container().css("z-index",$.topZIndex()+1);b.find(d).unbind().click(function(){var a=$(this).parents(".sysmessage:first");a.fadeOut(c._fadespeed,function(){$(this).parent().remove()})});var h=g.length>100?a._removelargemsg:a._removesmallmsg;setTimeout(function(){b.find(e).fadeIn(c._fadespeed,function(){b.find(d).fadeIn(100)})},c.count()*c._fadespeed);setTimeout(function(){b.find(e).fadeOut(c._fadespeed,function(){$(this).parent().remove()})},h)};MessageQueue.prototype.createError=function(a){this.createMessage(this.MSGERROR,a)};MessageQueue.prototype.createAlert=function(a){this.createMessage(this.MSGALERT,a)};var messageQueue=new MessageQueue