   var currentLink = -1;
   var linksDiv = document.getElementById("links");
   var is_ie = (window.navigator.userAgent.toLowerCase().indexOf("msie") != -1) && !window.opera;
   var step = 0;

   function setOpacity(percent)
   {
      if (is_ie)
      {
         linksDiv.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + percent + ")";
         return;
      }
      if (percent == 100)
      {
         percent = 99; // to avoid a small visual glitch
      }
      linksDiv.style.opacity = percent / 100;
   }

   function nextLinkFadeout()
   {
      step -= 10;
      setOpacity(step);
      if (step <= 0)
      {
         nextLink();
      }
      else
      {
         setTimeout("nextLinkFadeout()", 100);
      }
   }

   function nextLinkFadein()
   {
      step += 10;
      setOpacity(step);
      if (step >= 100)
      {
         setTimeout("nextLinkFadeout()", 5000);
      }
      else
      {
         setTimeout("nextLinkFadein()", 100);
      }
   }

   function nextLink()
   {
      currentLink++;
      currentLink %= rotatingLinks.length;
      if (linksDiv.childNodes[0])
      {
         linksDiv.removeChild(linksDiv.childNodes[0]);
      }
      var curLink = rotatingLinks[currentLink];

      var theLink = document.createElement("A");

      var theContents;
      if (curLink.image)
      {
         theContents = document.createElement("IMG");
         theContents.src = curLink.image;
      }
      else
      {
         theContents = document.createTextNode(curLink.text);
      }
      theLink.appendChild(theContents);
      linksDiv.appendChild(theLink);

      setTimeout("nextLinkFadein()", 100);
   }

   nextLink();

