function readTextFile(file)
{
var rawFile = new XMLHttpRequest();
rawFile.open("GET", file, false);
rawFile.onreadystatechange = function ()
{
if(rawFile.readyState === 4)
{
if(rawFile.status === 200 || rawFile.status == 0)
{
var allText = rawFile.responseText;
document.getElementById("output").innerHTML=allText;
}
}
}
rawFile.send(null);
}
window.addEventListener('DOMContentLoaded', function()
{
const day = (new Date()).getDay();
let html = '<p>INFORMATION</p>';
if (day) html = readTextFile('admin/text/week/' + day + '.txt');
readTextFile(html);
}
);