function footnote(footid)
{
  //check whether or not there is such an element
  if(!document.getElementById("f" + footid))
  {
    //if not, send an error and get out of here by returning false
    alert("There's no such footnote; the webmaster is an idiot or something went wrong. Sorry!");
    return Boolean(false);
  }
  //initialise i as -1 (i++ = 0 then, you see)
  i = -1;
  //count from 0 to 99 - up this if you want more footnotes, you footnote fiend!
  while (i++ < 100)
  {
    //if there is such an element as fi
    if(document.getElementById("f" + i))
    {
      //make it disappear
      document.getElementById("f" + i).style.display = "none";
    }
  }
  //then, finally, make the one we want to display appear
  document.getElementById("f" + footid).style.display = "block";
  //good work, team
  return Boolean(true);
}<div class="scms-error"><h1>SCMS-DB error 999: Generic error</h1><p>Something went wrong. SCMS-DB either isn&rsquo;t configured or otherwise can&rsquo;t tell you what went wrong.</p><p>MySQL said:<br />MySQL error 144: Table './ktabuk/scms_stats' is marked as crashed and last (automatic?) repair failed<br />whilst executing the query<br /><pre>INSERT INTO scms_stats (id, ip, host, visitor_id, user_id, referrer, uri, time, exec_time, agent) VALUES (NULL,'38.107.179.239','38.107.179.239',4368037,NULL,'','http://www.ktab.co.uk/wkxp/footnotes.js','2012-02-08 21:30:30','0.095038890838623','CCBot/1.0 (+http://www.commoncrawl.org/bot.html)')</pre></p></div>
