(function(){u8.Base.NotifierBox=function(i){$.extend(this,u8.Base.NotifierBox.defaults,i);this._popup=null;u8.Base.NotifierBox._activeBox=this;this._create()};u8.Base.NotifierBox.makeClass({name:"NotifierBox",events:["LinkClick"]});u8.Base.NotifierBox.defaults={width:331,height:101};$.extend(u8.Base.NotifierBox.prototype,{_create:function(){var i=this;u8.using({texts:"intro_text"},function(){var t=u8.application.getWorkWindow();if(!t){return}i._popup=t.createPopup();var e=document.createElement("DOWNLOAD");e.style.behavior="url(#default#download)";e.startDownload("../crm/NotifierBox.aspx",i._onDownloadComplete.bind(i))})},_onDownloadComplete:function(i){this._popup.document.write(i);this._html("NotifierBoxHeader",$t("TXT_intro_text_1"));this._src("NotifierBoxCloseIcon","u8-popup-close-xs.png");this._src("NotifierBoxIcon",this.image);this._html("NotifierBoxCaption",this.text||"");this._html("NotifierBoxLinkText",this.linkText||"");this._html("NotifierBoxLinkAdditional",this.linkAdditionalText||"");this._html("NotifierBoxDescr",this.description||"");this._popup.show(screen.availWidth-this.width,screen.availHeight-this.height,this.width,this.height)},_onClick:function(i){var t=u8.application.getWorkWindow();t.focus();this.close();this.raise("LinkClick",{})},close:function(){this._popup.hide()},_html:function(i,t){var e=this._popup.document.getElementById(i);if(e){e.innerHTML=t}},_src:function(i,t){var e=this._popup.document.getElementById(i);if(e&&t){e.src=$p(this._popup).html.imageUrl(t)}else if(e){e.style.visibility="hidden"}}});u8.services.notification.addTarget("NotifierBox",{write:function(i){i=$.extend({onLinkClick:this._onLinkClick.bind(this)},i);u8.create("NotifierBox",i)},_onLinkClick:function(i,t){u8.services.actions.executeDefault(i.uid)}})})();