((function(){var a,b,c,d,e,f,g,h,i;c=function(){var a;return a=[],typeof window.innerWidth!="undefined"?(a.width=window.innerWidth,a.height=window.innerHeight):typeof document.documentElement!="undefined"&&typeof document.documentElement.clientWidth!="undefined"&&document.documentElement.clientWidth!==0&&(a.width=document.documentElement.clientWidth,a.height=document.documentElement.clientHeight),a},d=!1,navigator.appName==="Microsoft Internet Explorer"&&(d=!0),e=new Image,b=function(){function a(a){var b;this.overlay=document.createElement("div"),this.overlay.setAttribute("id","alertservice_overlay"),this.overlay.style.backgroundColor="#000000",this.overlay.style.position="fixed",this.overlay.style.zIndex="100",this.overlay.style.top="0px",this.overlay.style.left="0px",this.overlay.style.opacity="0.6",d&&(this.overlay.style.filter="alpha(opacity=60)"),document.body.appendChild(this.overlay),this.widgetWrap=document.createElement("div"),this.widgetWrap.setAttribute("id","alertservice_widget_wrap"),this.widgetWrap.style.width="320px",this.widgetWrap.style.height="240px",this.widgetWrap.style.backgroundColor="#ffffff",this.widgetWrap.style.backgroundImage="url("+e.src+")",this.widgetWrap.style.backgroundPosition="center center",this.widgetWrap.style.backgroundRepeat="no-repeat",this.widgetWrap.style.borderRadius="5px",this.widgetWrap.style.position="fixed",this.widgetWrap.style.zIndex="100",this.widgetWrap.style.overflow="hidden",this.widgetWrap.style.padding="2px",this.widgetWrap.style.boxShadow="1px 1px 4px #000000",document.body.appendChild(this.widgetWrap),this.setOverlaySize(this.overlay),this.iframe=document.createElement("iframe"),this.iframe.setAttribute("id","alertservice_iframe"),this.iframe.setAttribute("src",a.widgetUrl),this.iframe.setAttribute("width","320"),this.iframe.setAttribute("height","0"),this.iframe.setAttribute("scrolling","no"),this.iframe.setAttribute("frameBorder","0"),this.iframe.setAttribute("style","border-radius: 5px; position:relative; z-index: 100; border:0px;"),this.iframe.onload=function(){return this.setAttribute("height","240")},this.widgetWrap.appendChild(this.iframe),d&&window.PIE&&(PIE.attach(this.widgetWrap),PIE.attach(this.iframe)),b=this,this.overlay.onclick=function(){return b.close()}}return a.prototype.setOverlaySize=function(){var a;if(this.overlay!==null){a=c(),this.overlay.style.width=""+a.width+"px",this.overlay.style.height=""+a.height+"px";if(this.widgetWrap!==null)return this.widgetWrap.style.top=""+(a.height/2-100)+"px",this.widgetWrap.style.left=""+(a.width/2-150)+"px"}},a.prototype.close=function(){return d&&window.PIE&&(PIE.detach(this.iframe),PIE.detach(this.widgetWrap)),this.widgetWrap.removeChild(this.iframe),document.body.removeChild(this.widgetWrap),document.body.removeChild(this.overlay),this.overlay=null,this.widgetWrap=null,this.iframe=null},a}(),a=function(){function a(a){var b,c,f,g,h,i,j,k,l,m;this.name=a,this.widget=document.getElementById(a),g=parseInt(this.widget.getAttribute("data-development")),g===1?c="http://localhost:3001":c="http://alert-service.pl",e.src=""+c+"/assets/ajax-loader.gif",b=this.widget.getAttribute("data-widget-id"),f=this.widget.getAttribute("data-company-name"),m=""+this.widget.getAttribute("data-width")+"px",l=""+this.widget.getAttribute("data-widget-header-style"),k=this.widget.getAttribute("data-widget-show-description"),this.widgetUrl=""+c+"/as-widget/"+b,this.widget.style.border="1px solid #246E7D",this.widget.style.width=m,this.widget.style.cursor="pointer",this.widget.style.borderRadius="5px",this.widget.style.position="relative",this.widget.style.zIndex="90",this.widget.style.fontFamily="Arial",this.widget.style.backgroundColor="#ffffff",this.widget.style.clear="both",this.widget.style.color="#173140",this.widget.style.overflow="hidden",i=document.createElement("div"),l==="standard"?(j=new Image,j.src=""+c+"/assets/widget_logo_big.png",i.style.height="52px",i.style.backgroundImage="url("+j.src+")",i.style.backgroundPosition="center top",i.style.backgroundRepeat="no-repeat",i.style.backgroundColor="#173140"):(i.style.backgroundColor="#246E7D",i.innerHTML="Alert Service",i.style.color="#ffffff",i.style.padding="10px",i.style.textAlign="center",i.style.fontWeight="bold",i.style.fontSize="14px"),this.widget.appendChild(i),k==="true"&&(h=document.createElement("div"),h.style.padding="7px",h.style.textAlign="center",h.style.fontSize="11px",h.innerHTML=unescape(this.widget.getAttribute("data-widget-description")),this.widget.appendChild(h)),d&&(document.write('<script type="text/javascript" src="'+c+'/PIE.js"></script>'),PIE.attach(this.widget))}return a}(),i=new a("alertservice-widget"),f=this,i.widget.onclick=function(){return f.widgetWindow=new b(i)},h=0,window.onresize=function(){return clearTimeout(h),h=setTimeout(function(){return f.widgetWindow.setOverlaySize()},100)},g=window.onload,window.onload=function(){typeof g!="undefined"&&g.call();if(d&&window.PIE)return PIE.attach(i.widget)}})).call(this)
