(function(){if(!window.beyondo){window.beyondo={}}if(!beyondo.util){beyondo.util={widget:{},widget_index:-1,parseJSParams:function(g,d){var b=document.getElementsByTagName("script");for(var e=0;e<b.length;e++){var c=b[e].src;if(c.indexOf(d)>0){var f=c.indexOf("?");if(f>0){var a=c.substr(f+1);var h=a.indexOf("?");if(h>0){this.parseURLParameters(a.substr(0,h),g)}else{this.parseURLParameters(a,g)}}}}},parseURLParameters:function(a,c){var e=a.split("&");for(var b=0;b<e.length;b++){var d=e[b].split("=");c[d[0]]=d[1]}},includeCss:function(c,a){var b={};b=document.createElement("link");b.type="text/css";b.rel="stylesheet";b.href=a;c.appendChild(b)},includeJs:function(c,b){var a={};a=document.createElement("script");a.type="text/javascript";a.language="JavaScript";a.charset="UTF-8";a.src=b;c.appendChild(a)},messageFormat:function(c,a){if(typeof a=="object"&&a.length){for(var b=0;b<a.length;b++){c=c.replace(new RegExp("{["+b+"]}","g"),a[b])}}else{c=c.replace(new RegExp("{[0]}","g"),a)}return c},hc:function(a){this.widget[a.index].complete(a)}}}if(!beyondo.Widget){beyondo.Widget=function(a,d,e,c){this.index=a;for(var b in c){this.conf[b]=c[b]}this.init(d,e)},beyondo.Widget.prototype={conf:{w:600,h:400,logo:"http://cdn1.kau-switch.com/all/modules/b_api/img/Beyondo_LOGO.jpg",css:"http://www.kau-switch.com/sites/all/modules/b_api/css/bbp-type-{0}.css",db:"http://www.kau-switch.com/b_api/bbp15/{0}/title/?cb=beyondo.util.hc&t={1}",library:"http://cdn1.kau-switch.com/all/modules/b_api/js/librarys-min.14.1.js",type:"http://www.kau-switch.com/sites/all/modules/b_api/js/bbp-type-{0}.js"},init:function(e,f){var a=this;if(e){beyondo.util.parseJSParams(this.conf,"bbp-common.js")}this.conf.widget="byd_widget_"+this.index;var c='<div class="byd-widget" id="'+this.conf.widget+'" style="width:'+this.conf.w+"px;height:"+this.conf.h+'px;"><div class="container"><img src="'+this.conf.logo+'" width="'+this.conf.w+'" height="'+this.conf.h+'"/></div></div>';(typeof f=="undefined")?document.write(c):document.getElementById(f).innerHTML=c;var b=false;window.setTimeout(function(){a.isLogoReady=true},3000);var d=document.getElementById(this.conf.widget);beyondo.util.includeJs(d,this.conf.library);beyondo.util.includeJs(d,beyondo.util.messageFormat(this.conf.db,[this.index,encodeURI(document.title)]))},error:function(a){this.container.append('<span class="error">#'+a.code+":"+a.msg+"</span>")},complete:function(c){var a=this;var d=document.getElementById(this.conf.widget);this.data=c;var b=window.setInterval(function(){if(a.isLogoReady&&("bbpjQuery" in window)){window.clearInterval(b);a.container=bbpjQuery("#"+a.conf.widget).find(".container");if(a.data.error){a.error(a.data.error)}else{beyondo.util.includeCss(d,beyondo.util.messageFormat(a.conf.css,(a.data.bbp["tid"]?a.data.bbp["tid"]:1)));beyondo.util.includeJs(d,beyondo.util.messageFormat(a.conf.type,(a.data.bbp["tid"]?a.data.bbp["tid"]:1)))}}},500)}}}})();beyondo.util.widget_index++;beyondo.util.widget[beyondo.util.widget_index]=new beyondo.Widget(beyondo.util.widget_index,true);