
//
// $Id: rti-common.js,v 1.2 2000/12/15 15:01:43 ronald.rowlett Exp $
//
// $Log: rti-common.js,v $
// Revision 1.2  2000/12/15 15:01:43  ronald.rowlett
// Removed the ^M at the end of each line.
//
// Revision 1.1  2000/12/15 14:50:14  ronald.rowlett
// Initial Version - Moved from scripts/
//
//

// Section class
//
// This class keeps track of the information to be displayed when the mouse
// moves over one of the section links in the top banner.
//
// Parameters:
//    name      Name of <IMG> tag to replace
//    on_img    Name of image to use when mouseover
//    off_img   Name of image to use when mouseout
//    status    Text for status pane when mouseover
//
// Methods:
//    turnOn    Called when the mouseover event triggers
//    turnOff   Called when the mouseout event triggers

function Section (name, off_img, on_img, status)
{
  // Assign status rollover text.
  this.status = status;

  // Do image rollovers only on version 4 or better browsers.
  if (browserLev4)
  {
    this.name        = name;
    this.on_img      = new Image();
    this.on_img.src  = on_img;
    this.off_img     = new Image();
    this.off_img.src = off_img;
  }

  // Assign methods
  this.turnOn  = turnOn;
  this.turnOff = turnOff;
}

function turnOn()
{
  // Do image rollovers only on version 4 or better browsers.
  if (browserLev4)
  {
    window.document.images[this.name].src = this.on_img.src;
  }
  
  // Change status if one was assigned.
  if (this.status != "")
  {  
    window.status = this.status;
  }
}

function turnOff()
{
  // Do image rollovers only on version 4 or better browsers.
  if (browserLev4)
  {
    window.document.images[this.name].src = this.off_img.src;
  }

  // Change status if one was assigned.
  if (this.status != "")
  {  
    window.status = "";
  }
}


// Determine which browser the viewer is using.

var browserName = navigator.appName;
var browserVer  = parseFloat(navigator.appVersion);

if (browserName == "Microsoft Internet Explorer" &&
    browserVer  == 2)
{
  browserVer = "3.02";
}

var browserLev4 = ((browserName == "Netscape" && browserVer >= 3) || (browserName == "Microsoft Internet Explorer" && browserVer >= 4));
