//////////////////////////////////
//    JavaScript Sourcefile 	//
//     for the RCS Website  	//
//   (C) 1999-2001 RCS, Inc.  	//
//////////////////////////////////

// DisplayMsg()
// ----------------------------------------------------------
// Display MessageText in the navigator window status bar, if the
// browser supports such status messages. In the HTML code, it must be 
// followed by "return document.returnValue" or "return true" in order
// for the message to be displayed. 
//
// Example: <A HREF="link.html" onMouseOver="DisplayMsg('This is a link.'); return document.returnValue;">
// -> Displays "This is a link" in the status bar when the mouse is
//    over the hyperlink to the file link.html.            
//
// NOTE: Netscape only supports the onMouseOver event for the <A> tag

var MessagesAllowed = navigator.userAgent != "Mozilla/4.0 (compatible; MSIE 4.0; Mac_PowerPC)";
function DisplayMsg(MessageText) 
{
 document.returnValue = false;
 if (MessagesAllowed)  {
   window.status = MessageText;  document.returnValue = true; 
 }
}

// LoadImage()
// ----------------------------------------------------------
// Load "on/off" image files associated with ImageName into ImageObject
//
// - ImageName is the "root" name associated with the file, and is the
//   name that appears within the <IMG NAME="[name]"> tag in the HTML 
//   source.
// - The files are of the format [ext], usually "gif" or "jpg,"
//   and reside in the /img/ directory.
//
// Example:  LoadImage('Button','bluebutton','gif');
// -> Creates an object called Button that is associated with
//    the images bluebutton_on.gif and bluebutton_off_.gif. In the 
//    HTML code, the image would be named "bluebutton" like this:
//    <IMG NAME="bluebutton">

function LoadImage(ImageObject,ImageName,ext) 
{
 if (document.images)  {
  eval(ImageObject+' = new Image()');
  eval(ImageObject+'.src = "/img/'+ImageName+'_on.'+ext+'"');
  eval(ImageObject+'.theName = "'+ImageName+'"');
  eval(ImageObject+'.offsrc = "/img/'+ImageName+'_off.'+ext+'"');
  eval(ImageObject+'.onsrc = "/img/'+ImageName+'_on.'+ext+'"');
 }
}


// TurnOn()
// ----------------------------------------------------------
// Replace the on-screen image associated with ImageObject with its 
// highlighted version.
//
// Example: TurnOn(Button); 
// -> Assuming Button is the same object as with the last example,
//    this replaces bluebutton_off.gif with bluebutton_on.gif.

function TurnOn(ImageObject)
{
 if (document.images) {
  document[ImageObject.theName].src = ImageObject.onsrc;
 }
}


// TurnOff()
// ----------------------------------------------------------
// Return the highlighted image associated with ImageObject to 
// its "normal" state.
//
// Example: TurnOff(Button);
// -> Assuming Button is the same object as with the last two examples,
//    this replaces bluebutton_on.gif with bluebutton_off.gif.

function TurnOff(ImageObject)
{
 if (document.images) {
  document[ImageObject.theName].src = ImageObject.offsrc;
 }
}


// RollOn()
// ----------------------------------------------------------
// Handles OnMouseOver routines that apply Style Sheet changes, 
// such as highlighting a link.
//
// Usage in HTML document: <BODY OnMouseOver="RollOn()">

function RollOn()
{
 if (window.event.srcElement.tagName != "A") return; 
 if (window.event.srcElement.className == "")
   window.event.srcElement.className = "Happy";
}


// RollOff()
// ----------------------------------------------------------
// Handles OnMouseOut routines that apply Style Sheet changes, 
// such as returning a highlighted ("Happy") link to normal.
//
// Usage in HTML document: <BODY OnMouseOut="RollOff()">

function RollOff()
{
 if (window.event.srcElement.className == "Happy")
   window.event.srcElement.className = "";
}
