var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);

function display(id, str) {
  if (NS4 || IE4) { // if browser supports style sheets
    if (NS4) { // if Navigator 4.0+
      with (document[id].document) {
        open(); // open document
        write(str); // write to document
        close(); // close document
      }
    } else { // Internet Explorer 4.0+
      document.all[id].innerHTML = str; // "assign" to element
    }
  }
}

function swapClass(text, spName, urlName, oldName, clName, over) {
  if (bVer < 4) { // old browser
    return; // terminate the function
  }  

  // create a new string for the link
  var str = "<A CLASS='" + clName + "' HREF='" + urlName + "'";
  if (over) {
    // replace onMouseOver with onMouseOut
    // replace true with false
    str += " onMouseOut=\"swapClass(\'" + text + "\', \'" + spName +
           "\', \'" + urlName + "\', \'" + clName +
           "\', \'" + oldName + "\', false)\">";
  } else {
    // replace onMouseOut with onMouseOver
    // replace false with true
    str += " onMouseOver=\"swapClass(\'" + text + "\', \'" + spName +
           "\', \'" + urlName + "\', \'" + clName +
           "\', \'" + oldName + "\', true)\">";
  }
  str += text + "</A>";
  display(spName, str); // update the code
}