text: var pledges={data:{startdate:new Date("2020-02-17"),maj:{startpledge:"sc2",pledges:["sc2","bc1","fg2","sc1","dc2","eh1","ws2","fg1","bc2","dc1","eh2","ws1"]},glirion:{startpledge:"dfk",pledges:["dfk","vom","coh2","coa1","ti","bh","ac","sw","coa2","coh1","vf","blc"]},urgarlag:{startpledge:"fv",pledges:["fv","mgf","lom","icp","rom","wgt","cos","brf","frh","fl","scp","mhk","mos","dom"]}},getDungeonDetailsById:function(e,t,n){fetch("https://ewigejagd.github.io/esodb/dungeon-de/"+e+".js").then(e=>e.json()).then(d=>n(e,t,d)).catch(d=>n(e,t,null))},getDungeonIdByPledge:function(e,t){var n=null;switch(e){case"maj":n=pledges.data.maj;break;case"glirion":n=pledges.data.glirion;break;case"urgarlag":n=pledges.data.urgarlag}var d=new Date((new Date).getTime()+864e5*t),g=parseInt((d.getTime()-pledges.data.startdate.getTime())/864e5),a=(n.pledges.indexOf(n.startpledge)+g%n.pledges.length)%n.pledges.length;return n.pledges[a]},load:function(){for(var e=document.getElementsByTagName("h2"),t=0,n=e.length;n>t;t++){var d=e[t].getAttribute("id"),g=parseInt(e[t].getAttribute("daysfromnow")),a=new Date((new Date).getTime()+864e5*g);document.getElementById(d).innerHTML="Gelöbnisse, "+a.toLocaleDateString("de-DE",{month:"2-digit",day:"2-digit"})}var s=document.getElementsByTagName("section");for(t=0,n=s.length;n>t;t++){var l=s[t].getAttribute("id"),m=s[t].getAttribute("npc"),r=(g=parseInt(s[t].getAttribute("daysfromnow")),pledges.getDungeonIdByPledge(m,g));pledges.getDungeonDetailsById(r,l,(e,t,n)=>{null!==n?(document.getElementById(t+"-image").style="background-image:url("+n.image+")",document.getElementById(t+"-name").innerHTML=n.name,document.getElementById(t+"-npc").innerHTML=n.npc,document.getElementById(t+"-monster").innerHTML=n.set.monster.name,document.getElementById(t+"-monster").href="https://www.elderscrollsbote.de/set="+n.set.monster.id,document.getElementById(t+"-light").innerHTML=n.set.light.name,document.getElementById(t+"-light").href="https://www.elderscrollsbote.de/set="+n.set.light.id,document.getElementById(t+"-medium").innerHTML=n.set.medium.name,document.getElementById(t+"-medium").href="https://www.elderscrollsbote.de/set="+n.set.medium.id,document.getElementById(t+"-heavy").innerHTML=n.set.heavy.name,document.getElementById(t+"-heavy").href="https://www.elderscrollsbote.de/set="+n.set.heavy.id):document.getElementById(t+"-name").innerHTML=e})}}};document.addEventListener("DOMContentLoaded",pledges.load);