<!--
//browser checking function
//To use create new lib_bwcheck object then use if(bw.ie4){}...
function lib_bwcheck()
{
  this.ver=navigator.appVersion;
  this.agent=navigator.userAgent;
  this.dom=document.getElementById?1:0;
  this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
  this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
  this.ie4=(document.all && !this.dom)?1:0;
  this.ie=this.ie4||this.ie5||this.ie6;
  this.mac=this.agent.indexOf("Mac")>-1;
  this.opera5=this.agent.indexOf("Opera 5")>-1;
  this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
  this.ns4=(document.layers && !this.dom)?1:0;
  this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom);
  return this;
}

//*****************************************************
// All script below is copyright by Evan Mounsey 2003 *
//*****************************************************

// function to get an image elements reference for netscape 4 based on cursor location
function getImage(l,t)
{
  for(i=0; i<document.images.length; i++)
  {
    var imX1 = document.images[i].x;
    var imX2 = imX1 + document.images[i].width;
    var imY1 = document.images[i].y;
    var imY2 = imY1 + document.images[i].height - 1;
    if((l >= imX1 && l <= imX2) && (t >= imY1 && t<= imY2))
    {
        return document.images[i];
    } 
  }    
}

// function to get the current image element reference
function checkNode(e)
{
  if(e.target=="[object Image]")
  {
    return e.target;
  }
  else
  {           
    var l = e.pageX;
    var t = e.pageY;
    return getImage(l,t);
  }
}

// function to map events in netscape to IE dom
function setupEventObject(e)
{
  // Map NS event object to IEs
  if(bw.ie) return; // IE returns - no need to map
  window.event = e;
  if(bw.ns4)
  {
    var targetObj = checkNode(e);
  }
  if(bw.ns6)
  {
    var targetObj = e.target;
  }
  window.event.fromElement = targetObj;
  window.event.toElement = targetObj;
  window.event.srcElement = targetObj;
  window.event.x = e.x;
  window.event.y = e.y;
}

// function to crop a string based on a start point and an end point
function cropStr(sStr,iStart,iEnd)
{
  var sStr = String(sStr);
  var croppedStr = sStr.slice(iStart,iEnd);
  return croppedStr;
}

// function to show the active image
function activate(e)
{
  setupEventObject(e);
  el = window.event.srcElement; //Global variable - needed for deactivate(e)
  oldSrc = el.src; //Global variable - needed for deactivate(e)
  var iSrcLength = String(el.src).length;
  if(cropStr(el.src,iSrcLength-7,iSrcLength) == 'off.gif')
  {
    el.src = (cropStr(el.src,0,iSrcLength-7) + 'on.gif');
  }
}

// function to show the inactive image
function deactivate(e)
{
  setupEventObject(e);
  el.src = oldSrc;
}

// function to dynamically preload the active state images
function preload(){
  for(var i=0;i<document.images.length;i++)
  {
    var el = document.images[i];
    var iSrcLength = String(el.src).length;
    if(cropStr(el.src,iSrcLength-7,iSrcLength) == 'off.gif')
    {
      eval("image" + i + " = new Image();");
      eval("image" + i + ".src = '" + cropStr(el.src,0,iSrcLength-7) + 'on.gif' + "';");
    }

  }
}

// perform the browser check
var bw = new lib_bwcheck();

// call the dynamic image preloader
window.onload = preload;

// set-up event capturing for Netscape 4 if necessary
if(bw.ns4) window.document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT | Event.LOAD)

// Event handelers
document.onmouseover = activate;
document.onmouseout = deactivate;
//-->