(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='

 Autor: '+p.author+'#'+postnum+'

Fecha: '+postdate.toString()+'

'; body='
'+decodeURIComponent(p.text)+'
'; postsarray[toppost-postnum]='
'+header+body+'
' /*+JSON.stringify(p) */; } function clearpost(postnum) { postsarray[toppost-postnum]=undefined; } function displayposts() { var contents=[] for(var i=0;i