///////////////////////////////////////////////////////////////////////////////
//  overLIB 3.10  --  This notice must be left untouched at all times.
//  Copyright Erik Bosrup 1998-2000. All rights reserved.
//
//  By Erik Bosrup (erik@bosrup.com).  Last modified 2000-03-30.
//  Portions by Dan Steinman (dansteinman.com).
//  Additions by other people are listed on the overLIB homepage.
//
//  Configured and bastardised by Pete Ryland (pdr@pdr.cx) - if you want to use
//  this, you may as well get the original from the location below.
//
//  Get the latest version at http://www.bosrup.com/web/overlib/
//
//  This script is published under an open source license. Please read the
//  license agreement online at: http://www.bosrup.com/web/overlib/license.html
//  If you have questions regard the license please contact erik@bosrup.com.
//
//  This script library was originally created for personal use. By request it
//  has later been made public. This is free software. Do not try to sell this
//  as your own work, or remove this copyright notice. For full details on
//  copying this script please read the license agreement at the link above.
//
//  Please give credit on sites that use overLIB and submit changes of the
//  script so other people can use them as well. This script is free to use,
//  don't abuse.
///////////////////////////////////////////////////////////////////////////////

var o3_x = 0;
var o3_y = 0;
var o3_allowmove = 0;

var over = null;

var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false
var ie5 = false;
var moz = false;
if (!(ns4 || ie4)) {
  moz = (document.getElementsByTagName("DIV"))? true:false;
}

if (ie4) {
  moz = false;
  if (navigator.userAgent.indexOf('MSIE 5')>0) {
    ie5 = true;
  }
}

if (ns4 || ie4 || moz) {
  document.onmousemove = mouseMove;
    if (ns4) {
      document.captureEvents(Event.MOUSEMOVE);
      over = self.document.overDiv;
    }
    if (ie4) { over = self.overDiv.style; }
    if (moz) {
      over = document.getElementsByTagName("DIV").item(0);
    }
} else {
  overlib1  = no_overlib;
  nd        = no_overlib;
}

function no_overlib() {
  return true;
}

function nd() {
  o3_allowmove = 0;
  hideObject();
  return true;
}

function overlib1(text) {
  hideObject();
  if (moz) {
    document.getElementsByName("overtext").item(0).firstChild.data = text;
  } else {
    layertext = "<TABLE WIDTH=200 BORDER=0 CELLPADDING=1 CELLSPACING=0 BGCOLOR=\"#333399\"><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=2 CELLSPACING=0 BGCOLOR=\"#CCCCFF\"><TR><TD VALIGN=TOP><FONT FACE=\"Verdana,Arial,Helvetica\" COLOR=\"#000000\" SIZE=\"1\">"+text+"</FONT></TD></TR></TABLE></TD></TR></TABLE>";
    if (ns4) {
      var lyr = self.document.overDiv.document;
      lyr.write(layertext);
      lyr.close();
    }
    if (ie4) { self.document.all["overDiv"].innerHTML = layertext; }
  }
  o3_allowmove = 0;
  placeLayer();
  showObject();
  o3_allowmove = 1;
  return true;
}

function placeLayer() {
  if (moz) {
    over.style.setProperty("left", o3_x+10, "");
    over.style.setProperty("top", o3_y+10, "");
  } else {
    over.left = o3_x+10;
    over.top = o3_y+10;
  }
}

function mouseMove(e) {
  if (ns4 || moz) {o3_x=e.pageX; o3_y=e.pageY;}
  if (ie4) {o3_x=event.x; o3_y=event.y;}
  if (ie5) {o3_x=event.x+self.document.body.scrollLeft; o3_y=event.y+self.document.body.scrollTop;}

  if (o3_allowmove) {
    placeLayer();
  }
}

function showObject() {
  if (ns4) { over.visibility = "show"; }
  if (ie4) { over.visibility = "visible"; }
  if (moz) { over.style.setProperty("visibility", "visible", ""); }
}

function hideObject() {
  if (moz) {
    over.style.setProperty("visibility", "hidden", "");
    over.style.setProperty("left", 0, "");
    over.style.setProperty("top", 0, "");
  } else {
    if (ns4) { over.visibility = "hide"; }
    if (ie4) { over.visibility = "hidden"; }
    over.left = 0;
    over.top = 0;
  }
}
