(function(){function t(t){function f(n){var r=i.forumRoot+"/"+i.forumKeyType+"/"+i.forumKeyId,t,u="?_="+(new Date).getTime();return t=i.selectedPostingId?r+"/"+i.selectedPostingId:r,n&&n.noCache===!0&&(t=t+u),t}function e(n,t){for(var i in t)n[i]=t[i];return n}function o(n){if(typeof n!="function")throw new Error("jQuery not found. Please ensure jQuery is loaded.");r=n;n(document).ready(function(){n("#forumloading").show();n.ajax({url:f(),cache:!1}).done(function(t){var i=n.ajaxSetup().cache;n.ajaxSetup({cache:!0});n("#forumcontainer").html(t);n.ajaxSetup({cache:i})}).fail(function(n){s();h(n.responseText)}).always(function(){n("#forumloading").hide()})})}function s(){if(!i.isDebug)document.getElementById("forumcontainer").innerHTML="<p>Das Forum kann derzeit nicht geladen werden. Bitte versuchen Sie es in ein paar Minuten noch einmal.<\/p>"}function h(n){if(i.isDebug&&typeof r!="undefined"){var t=r.parseHTML(n),u=r("<div>").append(r(t[t.length-1]).clone()).html();alert("Forum konnte nicht geladen werden: "+u)}}var i=e({forumKeyType:null,forumKeyId:null,selectedPostingId:null,isDebug:!1,forumRoot:"/forum"},t),u=this,r=null;if(typeof i!="object"||typeof i.forumKeyType!="number"||typeof i.forumKeyId!="string")throw new Error("No forum parameters supplied");typeof i.selectedPostingId=="string"&&i.selectedPostingId.match(/^\d+$/)||(i.selectedPostingId=null);u.initialize=function(){var t=[i.forumRoot+"/bundles/js/jquery-1.11.1"];n(t,0,function(){o(window.jQuery)})}}function i(t,i){if(window.Forum===undefined){if(typeof i!="function")throw new Error("No callback function supplied");if(!(t instanceof Array)||t.length<1)throw new Error("Empty or no array of urls");n(t,0,i)}else i()}function n(t,i,r){function f(){i=i+1;n(t,i,r)}if(t[i]){var e=t[i],u=document.createElement("script");u.setAttribute("type","text/javascript");u.setAttribute("src",e);u.readyState?u.onreadystatechange=function(){(this.readyState==="complete"||this.readyState==="loaded")&&f()}:u.onload=f;(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(u)}else r()}function r(n){var r,i,u,f,e,t;if(typeof n=="string"&&n.length!==0){for(r=document.getElementsByTagName("link"),i=0,u=r.length;i<u;i++)if(f=r[i].getAttribute("href"),f.indexOf(n)>-1)return;e=document.head||document.getElementsByTagName("head")[0];t=document.createElement("link");t.setAttribute("rel","stylesheet");t.setAttribute("type","text/css");t.setAttribute("href",n);e.appendChild(t)}}typeof String.prototype.startsWith!="function"&&(String.prototype.startsWith=function(n){return this.substring(0,n.length)===n});window.ForumLoader=function(){return{init:function(n){var i=new t(n);i.initialize()},loadJsUrlArray:i,loadCssUrl:r}}()})()