/*jslint browser: true, continue: true, eqeq: true, plusplus: true, vars: true, white: true */ var FlattrLoader=function(){"use strict";var a={instance:!1,queryString:!1,validParams:["mode","https","uid","category","button","language","html5-key-prefix","popout","revsharekey"],validButtonParams:["uid","owner","category","button","language","hidden","tags","title","url","description","revsharekey","popout"],options:{},POPOUT_WIDTH:401,POPOUT_HEIGHT:230,TIMEOUT:1500,createIframe:function(b){var c=b.button=="compact",d=document.createElement("iframe");return d.setAttribute("src",(this.getParam("https")==1?"https":"http")+"://"+this.getParam("domain","api.flattr.com")+"/button/view/?"+this.encodeData(b)),d.setAttribute("class","FlattrButton"),d.setAttribute("width",c==1?110:55),d.setAttribute("height",c==1?20:62),d.setAttribute("frameBorder",0),d.setAttribute("scrolling","no"),d.setAttribute("title","Flattr"),d.setAttribute("border",0),d.setAttribute("marginHeight",0),d.setAttribute("marginWidth",0),d.setAttribute("allowTransparency","true"),d.data=b,b.popout!=0&&(d.onmouseover=function(){this.popoutIframe===undefined&&(a.removeAllOpenPopoutIframes(),a.showPopoutForButton(this),this.popoutIframe.onmouseover=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=undefined)},this.popoutIframe.onmouseout=function(){this.parentNode&&(this.timeout=setTimeout(function(){d.popoutIframe&&a.removePopoutForButton(d)},a.TIMEOUT))})},d.onmouseout=function(){this.popoutIframe&&(this.popoutIframe.timeout=setTimeout(function(){d.popoutIframe&&a.removePopoutForButton(d)},a.TIMEOUT))}),d},getAbsolutePositionForElement:function(a){var b={x:0,y:0};if(a.offsetParent)do b.x+=a.offsetLeft,b.y+=a.offsetTop,a=a.offsetParent;while(a);return b},showPopoutForButton:function(a){var b,c="s",d="e",e=window.innerWidth!==undefined?window.innerWidth:document.documentElement.clientWidth,f=window.innerHeight!==undefined?window.innerHeight:document.documentElement.clientHeight,g=this.getAbsolutePositionForElement(a);g.x>e/2&&(d="w"),g.y+Number(a.height)+this.POPOUT_HEIGHT>f&&(c="n"),b=c+d,a.data.dir=b,a.popoutIframe=this.createPopoutIframe(a.data),d==="w"?a.popoutIframe.style.left=Number(g.x)-Number(this.POPOUT_WIDTH)+Number(a.width)+"px":d==="e"&&(a.popoutIframe.style.left=g.x+"px"),c==="n"?a.popoutIframe.style.top=Number(g.y)-Number(this.POPOUT_HEIGHT)+"px":c==="s"&&(a.popoutIframe.style.top=Number(g.y)+Number(a.height)+"px"),document.querySelector("body").appendChild(a.popoutIframe)},createPopoutIframe:function(a){var b=document.createElement("iframe");return b.setAttribute("src",(this.getParam("https")==1?"https":"http")+"://"+this.getParam("domain","api.flattr.com")+"/button/popout/?"+this.encodeData(a)),b.setAttribute("frameBorder",0),b.setAttribute("allowTransparency","true"),b.setAttribute("style","position: absolute; display:block; z-index: 9999;"),b.setAttribute("width",this.POPOUT_WIDTH),b.setAttribute("height",this.POPOUT_HEIGHT),b},removePopoutForButton:function(a){a.popoutIframe.timeout&&clearTimeout(a.popoutIframe.timeout),a.popoutIframe.parentNode.removeChild(a.popoutIframe),a.popoutIframe=undefined},removeAllOpenPopoutIframes:function(){var a=document.querySelectorAll("iframe.FlattrButton"),b,c;for(b=0;b"),c.length>1e3&&(c=c.substring(0,1e3))),c=c.replace(/^\s+|\s+$/g,"").replace(/\s{2,}|\t+/g," "),d+=b+"="+encodeURIComponent(c)+"&");return d},getParam:function(a,b){return typeof this.options[a]!="undefined"?this.options[a]:b},init:function(){var b,c,d,e,f,g,h,i,j,k,l,m,n=document.getElementsByTagName("script");try{for(b=n.length-1;b>=0;b--){c=n[b];if(!c.hasAttribute("src"))continue;d=c.src,e=new RegExp("^(http(?:s?))://(api\\.(?:.*\\.?)flattr\\.(?:com|dev))","i"),f=d.match(e);if(f){this.options.domain=f[2].toString(),this.options.https=f[1].toString()=="https"?1:0,g=d.indexOf("?");if(g){h=d.substring(++g),i=h.split("&");for(k=0;k=0;b--)/FlattrButton/.test(a[b].className)&&(c[c.length]=a[b])}for(b=c.length-1;b>=0;b--)this.loadButton(c[b])},stripTags:function(a,b){var c="",d=!1,e=[],f=[],g="",h=0,i="",j="",k=function(a,b,c){return c.split(a).join(b)};b&&(f=b.match(/([a-zA-Z0-9]+)/gi)),a+="",e=a.match(/(<\/?[\S][^>]*>)/gi);for(c in e)if(e.hasOwnProperty(c)){if(isNaN(c))continue;j=e[c].toString(),d=!1;for(i in f)if(f.hasOwnProperty(i)){g=f[i],h=-1,h!=0&&(h=j.toLowerCase().indexOf("<"+g+">")),h!=0&&(h=j.toLowerCase().indexOf("<"+g+" ")),h!=0&&(h=j.toLowerCase().indexOf("