<!-- hide script from old browsers
function showhideterms(vterm, modifier) {
   if (vterm == 'show') {
      if (document.getElementById('all_' + modifier)) {document.getElementById('all_' + modifier).style.display = 'block';}
      document.getElementById('hide_' + modifier).style.display = 'block';
      document.getElementById('show_' + modifier).style.display = 'none';
   }
   if (vterm == 'hide') {
      if (document.getElementById('all_' + modifier)) {document.getElementById('all_' + modifier).style.display = 'none';}
      document.getElementById('hide_' + modifier).style.display = 'none';
      document.getElementById('show_' + modifier).style.display = 'block';
   }
};

function getBrowserWidth() {
    if (document.documentElement && document.documentElement.clientWidth)
        return document.documentElement.clientWidth;
    else if (document.body && document.body.clientWidth)
        return document.body.clientWidth;
    else if (window.innerWidth)
        return window.innerWidth;
    else
        return 1000;
};

function show_waorc_carinfo(carnum) {
   var cgi_call = "/cgi-bin/waorc_carstats.cgi?car=" + escape(carnum);
   var cw_left = (screen.width - 420) / 2;
   var cw_top = (screen.height - 440) / 2;
   cw = window.open(cgi_call, carnum, "menubar=no, width=420, height=460, toolbar=no fullscreen=no top=" + cw_top + " left=" + cw_left);
};

function show_waorc_nameinfo(compname) {
   var cgi_call = "/cgi-bin/waorc_namestats.cgi?name=" + escape(compname);
   var cw_left = (screen.width - 420) / 2;
   var cw_top = (screen.height - 440) / 2;
   var re = /[^a-z]/gi;
   cw = window.open(cgi_call, compname.replace(re, ""), "menubar=no, width=420, height=460, toolbar=no fullscreen=no top=" + cw_top + " left=" + cw_left);
};

function show_aorc_carinfo(carnum) {
   var cgi_call = "/cgi-bin/aorc_carstats.cgi?car=" + escape(carnum);
   var cw_left = (screen.width - 420) / 2;
   var cw_top = (screen.height - 440) / 2;
   cw = window.open(cgi_call, carnum, "menubar=no, width=420, height=460, toolbar=no fullscreen=no top=" + cw_top + " left=" + cw_left);
};

function show_aorc_nameinfo(compname) {
   var cgi_call = "/cgi-bin/aorc_namestats.cgi?name=" + escape(compname);
   var cw_left = (screen.width - 420) / 2;
   var cw_top = (screen.height - 440) / 2;
   var re = /[^a-z]/gi;
   cw = window.open(cgi_call, compname.replace(re, ""), "menubar=no, width=420, height=460, toolbar=no fullscreen=no top=" + cw_top + " left=" + cw_left);
};

function eminfo(s1, s2, s3, s4, s5, s6, s7) {
   var bit1 = "m";bit1 = bit1 + "ai";bit1 = bit1 + "lto:";
   s1 = s1.replace(/^dot$/,".");s1 = s1.replace(/^at$/,"@");
   s2 = s2.replace(/^dot$/,".");s2 = s2.replace(/^at$/,"@");
   s3 = s3.replace(/^dot$/,".");s3 = s3.replace(/^at$/,"@");
   s4 = s4.replace(/^dot$/,".");s4 = s4.replace(/^at$/,"@");
   s5 = s5.replace(/^dot$/,".");s5 = s5.replace(/^at$/,"@");
   s6 = s6.replace(/^dot$/,".");s6 = s6.replace(/^at$/,"@");
   var text = s1 + s2 + s3 + s4 + s5 + s6;
   document.write("<a class=\"c\" href=\"" + bit1 + text + "\">" + s7 + "</a>");
}

window.onload = function() {
   // Only add the RHS banner if the page width is >1200px
   link = document.getElementsByTagName("link")[0];
   if (getBrowserWidth() >= 1200) {link.href = "/browser_lg.css";}

   // Highlight the menu item that corresponds to the current folder
   var txt = location.pathname.substr(1).replace(/\//g,"__");
   if (document.getElementsByName(txt).length > 0) {
      document.getElementsByName(txt)[0].style.backgroundColor = "#E0E0E0";
   }

   // Expand the menu structure, down to the currently viewed page
   path_array = window.location.pathname.split("/");loop = 0;
   // Ignore the last entry for the 'file', because it will never be a folder needing expansion
   while (loop < path_array.length - 1) {
      if (document.getElementById('all_' + path_array[loop])) {showhideterms('show', path_array[loop])}
      loop++;
   }
};

//-->
