/*
 * $Id: jeffc.js,v 3.0.2.1 2009-08-17 02:01:42 jeffrey Exp $
 * 
 * NOTICE
 * 
 * This document is copyright 1997-2003 by Jeffrey Carlyle.
 * No part of this document may be reproduced without
 * the permission of Jeffrey Carlyle.
 * 
 * <mailto:jeffrey@carlyle.org>
 * <../>
 *
 * GOAL: Make this work for browsers other than IE.
 *
 */

window.onload = windowOnLoad;

var curMsg, numMsgs = 7;
var msgs = new Array(
  "See Jeff's old apartment at <a class=\"header\" href=\"http://www.200b.org\">200b.org</a>.",
  "See pictures from <a class=\"header\" href=\"../england.html\">Jeff's semester in England</a>.",
  "Jeffrey Carlyle is the <a class=\"header\" href=\"http://www.rulerofearth.org/\">Ruler of Earth</a>!",
  "<a class=\"header\" href=\"http://www.thebadplace.com/smurfs/\">Smurfs and Shrooms?</a>",
  "Follow <a class=\"header\" href=\"http://twitter.com/jeffcarlyle\">Jeff on Twitter</a>.",
  "Learn about <a class=\"header\" href=\"http://www.kentuckyroads.com/\">Kentucky's Roads and Highways</a>.",
  "Run your own web cam with Jeff's <a class=\"header\" href=\"http://www.webcam2000.info/\">WebCam2000</a>."
  );

function windowOnLoad()
{
  curMsg = 0;

  onTimeout();
}

function onTimeout()
{
  var msgobj;

  if ( typeof(msg) != "undefined" )
  {
    msgobj = msg;
  }
  else if( isMozilla() )
  {
    msgobj = document.getElementById("msg");
  }

  msgobj.innerHTML = msgs[curMsg];
  curMsg = (++curMsg)%numMsgs;
  window.setTimeout("onTimeout();", 5000);
}

function isMozilla()
{
  var ua = window.navigator.userAgent;
  var mozilla = ua.indexOf("Mozilla");

  if(mozilla>=0)
  {
    return ( parseInt( ua.substring (mozilla+8, ua.indexOf(".", mozilla))) >= 5)
  }
  else
  {
    return false;
  }
}

function isMsie4orGreater()
{
  var ua = window.navigator.userAgent;
  var msie = ua.indexOf ( "MSIE " );

  if  (msie > 0)
    {return (parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) ) >=4) && (ua.indexOf("MSIE 4.0b") <0) ;}
  else
    {return false;}
}

function overEarth(obj)
{
  if ( isMsie4orGreater() && (typeof(obj) != "undefined") && (typeof(obj.style.filter) != "undefined") )
  {
	obj.style.filter="XRay FlipH";
  }
}

function outEarth(obj)
{
  if ( isMsie4orGreater() && (typeof(obj) != "undefined") && (typeof(obj.style.filter) != "undefined") )
  {
	obj.style.filter="";
  }
}

