(function () { "use strict"; function request(querytext, func, errorfunc) { var req = new XMLHttpRequest(); req.onreadystatechange = function() { if (req.readyState !== 4) { return; } if (req.status !== 200) { errorfunc(); return; } func(req.responseText); }; req.open("GET",querytext); req.send(); } gotonewpost.onclick = function(e) { window.location="/newpost.html"+window.location.search }; document.getElementById("posts").innerHTML='Loading posts...'; var postsarray=[]; var lastpost=-1; var toppost=-1; var postsperpage=5; function changepost(postnum,data) { var p=JSON.parse(data); var postdate=new Date(0); postdate.setUTCSeconds(parseInt(p.date)); var header=[]; var body=[]; header.push('
'); header.push(decodeURIComponent(p.title)); header.push('#'); header.push(postnum); header.push('
'); header.push(' '); header.push('