text: if (location.protocol !== "https:") {
    location.replace(
      `https:${location.href.substring(location.protocol.length)}`
    );
  }
  function loggedIn() {
    if (getCookie("username") != "") {
      document.getElementById("login").firstElementChild.firstElementChild.innerHTML = '&nbsp;Log Out&nbsp;';
      document.getElementById("login").href = "/#";
      document.getElementById("login").onclick = function () {
        document.cookie =
          "username=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
        document.cookie =
          "usercoursedata=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
        window.location.reload();
      };
    }
  }
  function getCookie(cname) {
    let name = cname + "=";
    let decodedCookie = decodeURIComponent(document.cookie);
    let ca = decodedCookie.split(";");
    for (let i = 0; i < ca.length; i++) {
      let c = ca[i];
      while (c.charAt(0) == " ") {
        c = c.substring(1);
      }
      if (c.indexOf(name) == 0) {
        return c.substring(name.length, c.length);
      }
    }
    return "";
  }
  
  function delete_cookie(name, path, domain) {
    if (getCookie(name)) {
      document.cookie =
        name +
        "=" +
        (path ? ";path=" + path : "") +
        (domain ? ";domain=" + domain : "") +
        ";expires=Thu, 01 Jan 1970 00:00:01 GMT";
    }
  }