function onload() {
  redirect();
  sdocument.getElementById("body").style.fontFamily = "system-ui, sans-serif";
}

function toggleTheme() {
  // Obtains an array of all <link>
  // elements.
  // Select your element using indexing.
  if (document.getElementById("body").style.fontFamily !== "standardGalactic") {
    document.getElementById("body").style.fontFamily = "standardGalactic";
  } else {
    document.getElementById("body").style.fontFamily = "system-ui, sans-serif";
  }
}

function redirect() {
  let chromium = /Chrome|Chromium|OPR|Opera|Edge|UC|QQ|Brave/.test(
    navigator.userAgent
  );
  let disclaimer = `<div class="web-disclaimer">`;
  if ((chromium) && (screen.width >= 699)) window.location.replace("/bsod");
  if ((chromium) && (screen.width <= 699)) window.location.replace("/mobile-warn");
}

// Resizable textarea
const tx = document.getElementsByTagName("textarea");
for (let i = 0; i < tx.length; i++) {
  tx[i].setAttribute(
    "style",
    "height:" + tx[i].scrollHeight + "px;overflow-y:hidden;"
  );
  tx[i].addEventListener("input", OnInput, false);
}

function OnInput() {
  this.style.height = "auto";
  this.style.height = this.scrollHeight + "px";
}