function rollover(arg) {
   var oldSrc = arg.firstChild.src;
   var newSrc = oldSrc.replace(/plain\.gif$/, 'blue.gif');
   arg.firstChild.src = newSrc;
}
function rollout(arg) {
   var oldSrc = arg.firstChild.src;
   var newSrc = oldSrc.replace(/blue\.gif$/, 'plain.gif');
   arg.firstChild.src = newSrc;
}

// Make the link for this page red and remove href/rollover.
// First, find out what page we're on.
function fixLinkToCurrentPage() {
   var foundCurrentPage = 0;
   for(i = 0; i < document.anchors.length; i++){
      if (document.anchors[i].href == window.location) {
	     foundCurrentPage = 1;
	     updateFoundLink(document.anchors[i]);
      }
   }
   if (foundCurrentPage == 0) { updateFoundLink(document.anchors["index"]); }
}
// Second, update the anchor appropriately.
function updateFoundLink(arg) {
    // remove the link and rollover
    arg.removeAttribute("href");
    arg.removeAttribute("onmouseover");
    arg.removeAttribute("onmouseout");
    // make the image red
    var oldSrc = arg.firstChild.src;
    var newSrc = oldSrc.replace(/plain\.gif$/, 'red.gif');
    arg.firstChild.src = newSrc;
    // update the alt text
    var oldAlt = arg.firstChild.getAttribute("alt");
    var newAlt = 'Current Page: ' + oldAlt;
    arg.firstChild.setAttribute("alt", newAlt);
}
