// Support Script (287)
function colorAsRGBHex(s)
{
	return swapRedBlue(colorAsHex(s));
}

function colorAsHex(s)
{
	lColor = parseColor(s);
	color = lColor.toString(16);
	while (color.length < 6)
		color = "0" + color;

	return color;
}

function swapRedBlue(s)
{
	retColor = s;
	if (s.length == 6 && !isNaN(parseInt("0x" + s)))
	{
			r = s.substr(4,2);
			g = s.substr(2,2);
			b = s.substr(0,2);
			retColor = r + g + b;
	}
	else alert("swapRedBlue: Illegal input " + s);

	return retColor;
}

function parseColor(s)
{
	sInit = s;
	retColor = 0x0F000000;  // illegal color value

	s = s.replace(/^\s+/, "");  // trim leading and trailing white space
	s = s.replace(/\s+$/, "");

	if (s.substr(0,3) == "rgb")     // rgb(rrr,ggg,bbb)
		s = s.substr(3, s.length);

	if (s.substr(0,1) == "(")       // (rrr,ggg,bbb)
	{
		s = s.substr(0, s.length -1);
		s = s.substr(1, s.length -1);
		rgb = s.split(",");
		retColor = parseInt(rgb[0])*0x10000 + parseInt(rgb[1])*0x100 + parseInt(rgb[2]);
	}
	else
	{
		if (s.charAt(0) == "#")                          // #rrggbb
		{
			s = s.substr(1,6);
			retColor = parseInt("0x" + s);
		}
		else
		{
			if (s.substr(0,2) == "0x" && s.length > 2)       // Oxrrggbb OR 0xHHH (not 6 digit hex)
			{
				s = s.substr(2, s.length);
				retColor = parseInt("0x" + s);
			}
			else
			{
				if (!isNaN(parseInt(s)))                       // ddddddd (decimal) OR 0xrrggbb (hex)
				{
					retColor = parseInt(s);
				}
			}
		}
	}

	if (isNaN(retColor) || retColor == 0x0F000000)
	{
		retColor = 0xC0C0C0;
		alert("parseColor: color value not parsed (using default gray) " + sInit);
	}

	return retColor;
}

// Support Script (537)
// Copyright (c) 1998 by Elemental Software, Inc. - ALL RIGHTS RESERVED.
//
// This class finds the named object in either 4.0 DOM and 
// gathers information about it.
//
function objectInfo(objName)
{
	this.fullName = ""; // if this does not get filled the object could not be found.

	if (objName.length == 0) return;

	this.hide = objectInfoHide;
	this.show = objectInfoShow;
	this.setLeft = objectInfoSetLeft;
	this.setTop  = objectInfoSetTop;
	this.getPosition  = objectInfoGetPosition;
	this.isValid      = objectInfoIsValid;
	this.isValidIE    = objectInfoIsValidIE;
	this.getZindex    = objectInfoGetZindex;
	this.setZindex    = objectInfoSetZindex;
	this.getDimension = objectInfoGetDimension;
	this.setDimension = objectInfoSetDimension;
 this.shiftTo      = objectInfoShiftTo;

	// find the named object in the DOM and then get the properties

	if (document.all) // IE
	{
		while (true)
		{
			if (eval("document.all.DBStyle" + objName))
			{
				if (eval("document.all.DBStyle" + objName + ".offsetWidth"))
				{
					this.fullName = "document.all.DBStyle" + objName;
					this.tagName  = this.fullName;
				}
			}
			else if (eval("document.all." + objName))
			{
				if (eval("document.all." + objName + ".offsetWidth"))
				{
					// Text in DIV tags are caught here
					this.fullName = "document.all." + objName;
					this.tagName  = this.fullName;
				}
				else if (eval("document.all." + objName + "." + objName) != null)
				{
					// Other tags are caught here.
					if (eval("document.all." + objName + "[1].tagName")  != "DIV")
					{
						this.fullName = "document.all." + objName + "[0]";
						this.tagName  = "document.all." + objName + "[1]";
					}
				}
			}

			// strip underscores out of input and try one more time
			if (this.fullName.length > 0) break;
			objName2 = objName.replace(/_/, "");
			if (objName2 == objName) break;
			objName = objName2;
		}

		
		if (this.fullName.length > 0)
		{
			this.styleKey = '.style'; // used to access style info
			this.width  = eval(this.fullName + ".offsetWidth");
			this.height = eval(this.fullName + ".offsetHeight");
		}
	}
	else  // NC
	{
		if (document.layers)
		{
			sectionNumber = 0;
			while (true)
			{
				sectionName = "LyrSection" + sectionNumber.toString();
				if (eval("document.layers." + sectionName) == null) break;  // can't find object in DOM

				// see if this is an object in the DOM
				if (eval("document.layers." + sectionName + ".document"))
				{
					while (true)
					{
						if (eval("document.layers." + sectionName + ".document.layers.LyrDBStyle" + objName))
						{
							this.fullName = "document.layers." + sectionName + ".document.layers.LyrDBStyle" + objName;
							this.tagName  = "document.layers." + sectionName + ".document." + objName; 
							break;
						}
						else if (eval("document.layers." + sectionName + ".document.layers.Lyr" + objName))
						{
							this.fullName = "document.layers." + sectionName + ".document.layers.Lyr" + objName;
							this.tagName  = "document.layers." + sectionName + ".document." + objName; 
							break;
						}
						else if (eval("document.layers." + sectionName + ".document.layers." + objName))
						{
							this.fullName = "document.layers." + sectionName + ".document.layers." + objName;
							this.tagName  = "document.layers." + sectionName + ".document." + objName; 
							break;
						}

						// strip underscores out of input and try one more time
						if (this.fullName.length > 0) break;
						objName2 = objName.replace(/_/, "");
						if (objName2 == objName) break;
						objName = objName2;
					}

				} else alert("objectInfo: " + "document.layers." + sectionName + ".document" + " is not an object");

				sectionNumber++;
			} // end while (looping over all SectionN relative positioning layers)

			if (this.fullName.length > 0 && "undefined" != typeof(eval(this.fullName + ".pageX")))
			{
				this.styleKey = '';

				if (eval(this.fullName + ".dbWidth"))
				{
					// we have previously set the values - get them from here, since if we changed
					// the clipping region the size will be wrong (it will be clipping size - not native size).
					this.width  = eval(this.fullName + ".dbWidth");
					this.height = eval(this.fullName + ".dbHeight");
				}
				else
				{
					// get the clipping size and save it off since we haven't yet clipped this guy.
					this.width  = eval(this.fullName + ".clip.width");
					this.height = eval(this.fullName + ".clip.height");
					eval(this.fullName + ".dbWidth  = this.width");
					eval(this.fullName + ".dbHeight = this.height");
				}
			}
			else
			{
				this.fullName = "";
				this.tagName  = "";
			}
		}  // end if (document.layers  e.g. NC)
	}
	this.object = null;
	if (this.fullName.length > 0)
		this.object = eval(this.fullName);
}

function objectInfoHide()
{	
	if (this.fullName.length > 0)
		eval(this.fullName + this.styleKey + ".visibility = 'hidden';");
}

function objectInfoShow()
{
	if (this.fullName.length > 0)
		eval(this.fullName + this.styleKey + ".visibility = 'visible';");
}

function objectInfoSetLeft(left)
{
	if (this.fullName.length > 0)
		eval(this.fullName + this.styleKey + ".left = left");
}

function objectInfoSetTop(top)
{
	if (this.fullName.length > 0)
		eval(this.fullName + this.styleKey + ".top = top");
}

function objectInfoGetPosition()
{
	ret = null;
	if (this.fullName.length > 0)
	{
		if ("undefined" != typeof(eval(this.fullName + ".offsetLeft")))
		{
			ret = new Object;
			ret.left   = eval(this.fullName + ".offsetLeft");
			ret.top    = eval(this.fullName + ".offsetTop");
		}
		else if ("undefined" != typeof(eval(this.fullName + ".pageX")))
		{
			ret = new Object;
			ret.left = eval(this.fullName + ".pageX");
			ret.top  = eval(this.fullName + ".pageY");
		}
	}
	return ret;
}

function objectInfoIsValid()
{
	return (this.fullName.length > 0 && this.object);
}

function objectInfoIsValidIE()
{
	return (this.fullName.length > 0 && this.object && document.all);
}


function objectInfoGetZindex()
{
	  if (this.fullName.length > 0)
  	{
	   ret = eval(this.fullName + this.styleKey + ".zIndex");
	   return (ret);
  	}
}

function objectInfoSetZindex(ind)
{
  if (this.fullName.length > 0 )
  {
    eval(this.fullName + this.styleKey + ".zIndex = ind");
  }
}

function objectInfoGetDimension()
{

   ret = null;
   ret = new Object;
   if (document.all) {  // IE
      ret.width = eval(this.fullName + ".offsetWidth");
      ret.height = eval(this.fullName + ".offsetHeight");
   }
   else {  // NC
      if (eval(this.fullName + ".dbWidth")) {
         ret.width  = eval(this.fullName + ".dbWidth");
         ret.height = eval(this.fullName + ".dbHeight");
      }
      else {
         ret.width = eval(this.fullName + ".clip.width");
         ret.height = eval(this.fullName + ".clip.height");
      }
   }
    
   return (ret);
}       

function objectInfoSetDimension(w, h)
{
   if (document.all) { // IE
     eval(this.fullName + this.styleKey + ".width = w");
     eval(this.fullName + this.styleKey + ".height = h");
   }
   else { // NC
     if (eval(this.fullName + ".clip.width")) {
        eval(this.fullName + ".clip.width = w");
        eval(this.fullName + ".clip.height = h");
     }
     eval(this.fullName + ".dbWidth = w");
     eval(this.fullName + ".dbHeight = h");
   }
   this.width = w;
   this.height = h;
}

function objectInfoShiftTo(x, y)
{
   if (document.all) { // IE
      eval(this.fullName + this.styleKey + ".left = x");
      eval(this.fullName + this.styleKey + ".top  = y");
   }
   else { // NC
      eval(this.fullName + ".moveTo(x,y)");
   }
}
// Support Script (408)
DurationToSeconds = new Array(3);
DurationToSeconds["Slow"]   = 6;
DurationToSeconds["Medium"] = 3;
DurationToSeconds["Fast"]   = 1;

// Support Script (536)
// Copyright (c) 1998 by Elemental Software, Inc. - ALL RIGHTS RESERVED.
// Get browser info. This only gets the client size at this time
//
function browserInfo()
{
	this.width  = 0;  // default return value - indicates undetermined value.
	this.height = 0;

	if (document.body && document.body.clientWidth) // IE
	{
		this.width  = document.body.clientWidth;
		this.height = document.body.clientHeight;
	}
	else if (window.innerWidth)
	{
		this.width  = window.innerWidth;
		this.height = window.innerHeight;
	}
}

// Determine the browser type and check if version 4 browser
// is used.

   IE4 = (document.all) ? 1 : 0;
   NC4 = (document.layers) ? 1 : 0;
   ver4 = (IE4 || NC4) ? 1 : 0;


// Support Script (248)
// Copyright (c) 1998 by Elemental Software, Inc. - ALL RIGHTS RESERVED.
//
// Compute a position that is currently off the visible screen.
//
function offScreenPos(ObjInfo, BrowserInfo, Direction)
{
	margin = 25;  // this is extra space off the screen to place the object

	pos = ObjInfo.getPosition();

	this.left = pos.left;
	if (Direction.toUpperCase().indexOf("LEFT") >= 0)
		this.left = -ObjInfo.width -margin;
	else if (Direction.toUpperCase().indexOf("RIGHT") >= 0)
		this.left = BrowserInfo.width + margin;
		
	this.top  = pos.top;
	if (Direction.toUpperCase().indexOf("TOP") >= 0)
		this.top = -ObjInfo.height -margin;
	else if (Direction.toUpperCase().indexOf("BOTTOM") >= 0)
		this.top = BrowserInfo.height + margin;
}

// Support Script (249)
// Copyright (c) 1998 by Elemental Software, Inc. - ALL RIGHTS RESERVED.
//
// This class slides a browser object to a new position over a given time.
// The object to slide is identified via a objectInfo object.
// 
function slideTo(objInfo, xFinal, yFinal, duration)
{
	// add properties to the input named object so that the iterative function
	// slideToExecute can iterate on the object and move it across the screen
	
	// Length of each incremental move of the object in milliseconds.
	// larger values make for jerkier motion, smaller values use more CPU cycles
	var incPeriod = 20; // milliseconds

	var slName = objInfo.fullName;
	if (slName.length > 0) // make sure we found the named object in DOM
	{
		// compute new Y value due to possible divider element on page
		// this is an IE only fix - NC still exhibits some weird behavour.
		yFinal = parseInt(yFinal);
		if (objInfo.object.parentElement != null)
			if (objInfo.object.parentElement.offsetTop != null) 
				yFinal -= objInfo.object.parentElement.offsetTop;

		// add properties to the DOM object so they are available later
		pos = objInfo.getPosition();
		if (pos)
		{
			eval(slName + ".slStyleKey = objInfo.styleKey");
			eval(slName + ".xInit = " + "pos.left");
			eval(slName + ".yInit = " + "pos.top");
			eval(slName + ".slName = slName"); // the qualified name of the object in the DOM
			eval(slName + ".xFinal = xFinal"); // final position
			eval(slName + ".yFinal = yFinal");
			eval(slName + ".iStep = 0");       // counter
			eval(slName + ".incPeriod = incPeriod");  // period of each increment
			eval(slName + ".nSteps = (duration * 1000) / " + slName + ".incPeriod"); // number of steps
			eval(slName + ".slideToExecute = slideToExecute");

			if (duration > 0)
				eval(slName + ".slideToExecute()");
			else // duration of 0 implies just move it.
			{
				objInfo.setLeft(xFinal);
				objInfo.setTop (yFinal);
			}
		} else alert("slideTo: could not get position of element");
	}
}

function slideToExecute()
{
	// increment the counter and compute the next intermediate position.
	// set the new position using DOM specific code generated above

	this.iStep++;
	xNow = this.xInit + (((this.xFinal - this.xInit) * this.iStep) / this.nSteps);
	eval(this.slName + this.slStyleKey + ".left = Math.round(xNow).toString()");

	yNow = this.yInit + (((this.yFinal - this.yInit) * this.iStep) / this.nSteps);
	eval(this.slName + this.slStyleKey + ".top = Math.round(yNow).toString()");

	if (this.iStep < this.nSteps) // are we done yet?
	{
		setTimeout(this.slName + ".slideToExecute()", this.incPeriod);
	}
	else // we are done - force the final position.
	{
		eval(this.slName + this.slStyleKey + ".left = this.xFinal.toString()");
		eval(this.slName + this.slStyleKey + ".top  = this.yFinal.toString()");
	}
}

function document_onLoad() {
oi = new objectInfo("logo");
if (oi.isValidIE())
{
  if (oi.object.style.filter.indexOf("glow") == -1)
    oi.object.style.filter += " glow(color="+colorAsRGBHex("65535")+",strength=2,enabled=0)";
}
logo_Info = new objectInfo("logo");
dbBrowser = new browserInfo();

if (logo_Info.fullName.length > 0 && dbBrowser.width > 0)
{
	logo_Info.hide();

	logo_pos = logo_Info.getPosition();
	if (logo_pos)
	{
		logo_offscreenPos = new offScreenPos(logo_Info, dbBrowser, "Right");
		logo_Info.setLeft( logo_offscreenPos.left);
		logo_Info.setTop(  logo_offscreenPos.top);

		logo_Info.show();
		logoduration = DurationToSeconds["Slow"];
		setTimeout('slideTo(logo_Info,logo_pos.left,logo_pos.top,logoduration);', 1);
	}
}
Image10oInfo = new objectInfo("Image10");
Image10duration = DurationToSeconds["Slow"];
slideTo(Image10oInfo,"600","82",Image10duration);
 }
function logo_onMouseOver() {
oi = new objectInfo("logo");
if (oi.isValidIE())
  oi.object.filters.glow.enabled=true;
 }
function _logo_onMouseOver() { if (logo) return logo.onMouseOver(); }
function logo_onMouseOut() {
oi = new objectInfo("logo");
if (oi.isValidIE())
  oi.object.filters.glow.enabled=false;
 }
function _logo_onMouseOut() { if (logo) return logo.onMouseOut(); }


