var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS6 = (bName == "Netscape" && bVer >= 6);
var IE5 = (bName == "Microsoft Internet Explorer" && bVer >= 5);

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

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

  // create a new string for the link
  // change the link's class to clName (it was oldName before)
  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
}
//  End -->