Here is an alternative I wrote that seems to work flawlessly.
<script type="text/javascript">
  var bIsOnline = false;
  (function() {
    var anImage = document.createElement("img");
    anImage.onerror = function() { bIsOnline=false; }
    anImage.onload = function()  { bIsOnline=true; }
    anImage.src="http://www.quirksmode.org/pix/logo_quirksmode.gif?" + (Math.random()*100000 << 0);
  })();
  function test() {
    alert("You " + ((bIsOnline) ? "ARE" : "ARE NOT") + " online")
  }
</script>
<body onload="test();"></body>
Shannon Norrell
