/*  This code is the intellectual property of Mark Groseth (Silicon Solutions) and
    should not be used without permission.  mark@sisnet.biz, www.sisnet.biz 
	This requires detector.js */

//---------------------------Excerpts from findDOM2.js--------------------------
// onerror = null doesn't work
// The following works except while debugging
//onerror = errFunction;
function errFunction() {
	// supress error messages
	return true
}

var fdObject = 0;
var fdStyle = 1;
var fdElement = 2;

// call this function to return a object or object style reference
// set returnType to 0 if you want an object reference
// set returnType to 1 if you want a style reference
// set returnType to 2 if you want an element object by name
function findDOM(objectID, returnType, selector, frameName) {
	var prefix = "";
	var obj;
	if (frameName != "" && frameName != null) { 
		if (frameName == "parent") { prefix = "parent." }
		else { prefix = "top[frameName]." }
	}
	if (returnType == 1) {
		if (selector == "" || selector == null) {
			if (dom) {
				// this is done as two lines to fix an Opera bug with eval
				obj = eval(prefix+"document.getElementById(objectID)");
				return obj.style }
			else { 
				if (document.all) { return eval(prefix+"document.all[objectID].style") }
				else { return null }
			}
		}
		else { return getStyleBySelector(selector, frameName) }
	}
	else {
		if (returnType == 0) {
			if (dom) { return eval(prefix+"document.getElementById(objectID)") }
			else { 
				if (document.all) { return eval(prefix+"document.all[objectID]") }
				else { return null }
			}
		}
		// returnType == 2
		else { return eval(prefix+"document."+objectID) }
	}
}

// Returns a NON-inline style object.  selector is the rule's id or class or tag etc
// Note that the 'link' tag's title attribure could by used to identify a stylesheet rather
// than iterating through them all, however, setting the title in the style sheet link will 
// cause the stylesheet to be Preferred, rather than Persistent, meaning that only one 
// linked stylesheet with a title can be used, which defeats the purpose.
function getStyleBySelector(selector, frameName) {
	var ruleList, sheetList;
	var i, j;
	if (ie5mac) selector = "*" + selector;
	if (frameName == "Parent") { sheetList = parent.document.styleSheets }
	else {
		if (frameName == "" || frameName == null) {	sheetList = document.styleSheets }
		else { sheetList = top[frameName].document.styleSheets }
	}
	for (i=sheetList.length-1; i >= 0; i--) {
		if (win && ie) {
			ruleList = sheetList[i].rules;
		} else {
			ruleList = sheetList[i].cssRules;
		}
		for (j=0; j<ruleList.length; j++) { 
			// removed this bit for compatability
			// ruleList[j].type == CSSRule.STYLE_RULE &&
			if (ruleList[j].selectorText == selector) {
				return ruleList[j].style; 
			} 
		} 
	}
	return null; 
}

//---------------------------Excerpts from tools2.js----------------------------------
/*  This function will load a control into a container element, replacing whatever 
was there.  For example, a flash movie could be loaded into a layer, replacing an 
image placeholder.  All the HTML for the control must be loaded into a variable of 
the name "Load" + the element ID.  The HTML string for the control must be 
formated using single quotes e.g. variable="<someparam='this'>".  Don't use "\'" or
charactor codes (like %22) to embed double quotes.   
The function works around two problems...
   1) IE 6 now loads inline controls in an inactive state due to a law suit
   2) Some browsers don't support loading controls into layers, so this funcion
      adds the altSuffix to the end of the source file in the object and\or embed
	  Note that different controls use different parameter names for the source
	  file in an object tag, so the function requires you to pass that parameter
	  name to pathParam.  Passing "" or nothing for altSuffix loads the same 
	  control.  Passing 'blank' empties the container element and finally, you 
	  can pass 'none' to altSuffix to just leave the container as is. 
*/
function loadPlugin(divID, pathParam, altSuffix) {
	var obj = findDOM(divID, fdObject);
	var controlHTML = eval("Load" + divID);
	if (!flashWMode) {
		if (altSuffix == "" || typeof altSuffix == "undefined") {
			obj.innerHTML = controlHTML
		} else if (altSuffix == "blank") {
			obj.innerHTML = "";
		} else if (altSuffix != "none") {
			var newHTML;
			var x, y;
			x = controlHTML.indexOf("'" + pathParam + "'");
			x = controlHTML.indexOf(">", x);
			x = controlHTML.lastIndexOf(".", x);
			newHTML = controlHTML.substring(0, x) + altSuffix;
			y = controlHTML.indexOf("embed", x);
			if(y != -1) {
				y = controlHTML.indexOf("src", y);
				y = controlHTML.indexOf("'", y) + 1;
				y = controlHTML.indexOf("'", y);
				y = controlHTML.lastIndexOf(".", y);
				newHTML += controlHTML.substring(x, y) + altSuffix;
				x = y; }
			newHTML += controlHTML.substring(x, controlHTML.length - 1);
			obj.innerHTML = newHTML }
	} else {
		obj.innerHTML = controlHTML }
}

// Get the XML request object for any 5th gen browser
var xmlHttp;
function getXMLRequestObject() {
	// For Mozila, NS6+, Safari 1.2+ , Konqourer 3.3+, Opera 7.6+, iCab3.0b352
	if( window.XMLHttpRequest) {
		try { xmlHttp = new XMLHttpRequest() } 
		catch (e) {	xmlHttp=false }
	// For IE5+ win excluding IceBrowser
	} else if (!navigator.__ice_version && window.ActiveXObject ) {
		try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP") } 
		catch (e) {
			try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP") } 
			catch (E) { xmlHttp = false }
		}
	// For IceBrowser
	} else if (window.createRequest) {
		try { xmlHttp = window.createRequest() } 
		catch (e) {	xmlHttp = false }
	}
	return xmlHttp;
}

//  This uses the getXMLRequestObject function.  If that doesn't work it uses an iframe to
//  suck the data in.  The later requires that the content pages body tag have an id of
//  'MainBody'.  It also results in images and flash being loaded twice.  Not really a good
//  solution, but necessary for IE5 mac. 
//  This function uses the parseBody function.  
//  If someone figures out how to pass objects as arguments in an event function please let me know.
var htmlRequestStatus, statusInt;
var htmlObj, frameBody;
function getNewHTML(url, objID, selector, frame) {
	var xmlHttp = getXMLRequestObject();
	htmlObj = findDOM(objID, fdObject, selector, frame);
	// prevent caching of content
	url += ( ( url.indexOf('?') + 1 ) ? '&' : '?' ) + ( new Date() ).getTime();
	htmlRequestStatus = false;
	if (!xmlHttp){
		//  Try using an iframe to load the data.  This is risky and slow.
		alert("using an Iframe");
		if (document.createElement && document.childNodes ) {
			var divObj = findDOM("xmlHttpLoader", fdObject);
			if (divObj == null || typeof divObj == "undefined") {
				divObj = document.createElement("div");
				divObj.id = "xmlHttpLoader";
				divObj.style.visibility = "hidden";
				divObj.style.position = "absolute";
				divObj.style.top = "0px";
				divObj.style.left = "0px";
				divObj.innerHTML = "<iframe src='" + url + "' id='x' name='xmlHttpData' height='0' width='0'></iframe>";
				document.body.appendChild(divObj);
			} else divObj.innerHTML = "<iframe src='" + url + "' id='x' name='xmlHttpData' height='0' width='0'></iframe>";
			alert(divObj.innerHTML);
			statusInt = window.setInterval("insertHtml()", 200) }
		else {
			htmlObj.innerHTML = "XML HTTP requests are not supported by your web browser" }
	} else {
		xmlHttp.open("GET", url, true);
		xmlHttp.onreadystatechange = new Function("if (xmlHttp.readyState == 4) insertHtml(true)");
		xmlHttp.send(null);
	}
}
function insertHtml(xmlObj) {
	var htmlText = "";
	if (xmlObj) {
		if (xmlHttp.status == 200) htmlText = parseBody(xmlHttp.responseText);
		else htmlText = xmlHttp.status + " - " + xmlHttp.statusText;
		insertHtml2(htmlText) }
	else {
		frameBody = findDOM("MainBody", fdObject, "", "xmlHttpData");
		if (frameBody) {
			alert("frame body found");
			clearInterval(statusInt);
			// an arbitrary delay to ensure that entire iFrame contents loaded.
			x = setTimeout("insertHtml2()",500) }
	}
}
function insertHtml2(htmlText) {
	if (frameBody) htmlText = frameBody.innerHTML;
	if (htmlText != "") {
		htmlObj.innerHTML = htmlText;
		htmlRequestStatus = true }
}

function parseBody(htmlText) {
	var x, y;
	x = htmlText.indexOf("<body");
	x = htmlText.indexOf(">", x + 1) + 1;
	y = htmlText.indexOf("</body") - 1;
	return htmlText.substring(x, y);
}

function setStylesheetStyle(selector, styleAttrib, settingValue) {
	var theStyle = getStyleBySelector(selector, "", false);
	// The following does not work because the DOM has no equivelent object for a style's
	// attribute.
	//theStyleAttrib = eval("theStyle."+styleAttrib)
	// the following two work equally well
	//eval("theStyle." + styleAttrib + " = settingValue");
	theStyle[styleAttrib] = settingValue;
}		

//  Populates an array of child elements as such...
//	var childrenObj = new childArrayObj();
//	findChildren(document.getElementById("Layer1"),childrenObj)
//  now childrenObj.items[] array holds all the child elements
//  NOTE: This requires DOM level 1 support
function childArrayObj() {
	this.items = new Array();
	this.dom1 = false;
	if (document.childNodes) this.dom1 = true;
}
function findChildren(obj, arrayObj) {
	if (arrayObj.dom1 && obj.childNodes) {
		var x = arrayObj.items.length - 1;
		for (var i=0; i < obj.childNodes.length; i++) {
			if (obj.childNodes[i].nodeType == 1) {
				arrayObj.items[++x] = obj.childNodes[i];
				// redundant test improves speed
				if (obj.childNodes) findChildren(obj.childNodes[i], arrayObj) }
		}
	}	
}

// This function can be used to parse the query string
function getIdFromQstring(theID) {
	var theURL = document.location+''; // Insures string 
	var URLParts = theURL.split('?');
	if (URLParts[1]) { 
		var pairs = URLParts[1].split('&'); 
		for (i = 0; i < pairs.length; i++) {
			var IDVal;
			var keyVal = pairs[i].split('=');
			if (keyVal[0] == theID) {
				return keyVal[1];
			} 
		} 
	} 
	return "not found";
} 


//-------------------Excerpts from effects2.js---------------------------------------

// Height of object in pixels
//  specifying image type causes this to look up the name rather than the ID
//  the function uses fdImage to get the image by name for backward compatibility,
//  It could also use fdObject with the image ID
//  This function does not address clipping
//  Also, offset measurements are not of much interest for width/height
function getObjHeight(objID, imageYN, selector, frame) {
	var obj;
	var styleType = fdStyle;
	if (imageYN) { styleType = fdImage }
	obj = findDOM(objID, styleType, selector, frame);
	return parseInt(obj.height);
}

// Width of object in pixels
//  specifying image type causes this to look up the name rather than the ID
//  the function uses fdImage to get the image by name for backward compatibility,
//  It could also use fdObject with the image ID
//  This function does not address image clipping
//  Also, offset measurements are not of much interest for width/height
function getObjWidth(objID, imageYN, selector, frame) {
	var obj;
	var styleType = fdStyle;
	if (imageYN) { styleType = fdImage }
	obj = findDOM(objID, styleType, selector, frame);
	return parseInt(obj.width);
}

// Left coordinate of a positionable object
// pos can be offset or style, offset always gives an absolute result
function getObjLeft(objID, pos, selector, frame)  {
	var obj;
	var styleType = fdStyle;
	if (pos == "offset") { styleType = fdObject }
	obj = findDOM(objID, styleType, selector, frame);
	if (pos == "offset") { return obj.offsetLeft }
	else { return parseInt(obj.left) }
}

// Top coordinate of a positionable object
// pos can be offset or style, offset always gives an absolute result
function getObjTop(objID, pos, selector, frame)  {
	var obj;
	var styleType = fdStyle;
	if (pos == "offset") { styleType = fdObject }
	obj = findDOM(objID, styleType, selector, frame);
	if (pos == "offset") { return obj.offsetTop }
	else { return parseInt(obj.top) }
}

function getObjBottom(objID, pos, imageYN, selector, frame) {
	return getObjTop(objID, pos, selector, frame) + getObjHeight(objID, imageYN, selector, frame)
}

function getTotalOffsetTop(objID) {
	var totalTop;
	var obj = findDOM(objID, fdObject);
	totalTop = obj.offsetTop;
	for (var i = 0; i < 10; i++) {
		if (obj.offsetParent) {
			obj = obj.offsetParent
			totalTop += obj.offsetTop }
	}
	return totalTop;
}

// Width of browser window page space
// for IE only works after body is loaded
function getInsideWindowWidth(frame) {
	if(frame == "Parent") {
		if (parent.innerWidth != null) return parent.innerWidth;
		if (document.documentElement.clientWidth) {
			if (parent.document.documentElement.clientWidth != null) return parent.document.documentElement.clientWidth;
		} else {
			if (parent.document.body.clientWidth != null) return parent.document.body.clientWidth;
		}
	} else {
		if (frame == "" || frame == null) {
			if (window.innerWidth != null) return window.innerWidth;
			if (document.documentElement.clientWidth) {
				if (document.documentElement.clientWidth != null) return document.documentElement.clientWidth;
			} else {
				if (document.body.clientWidth != null) return document.body.clientWidth;
			}
		} else {
			if (top[frame].innerWidth != null) return top[frame].innerWidth;
			if (document.documentElement.clientWidth) {
				if (top[frame].document.documentElement.clientWidth != null) return top[frame].document.documentElement.clientWidth;
			} else {
				if (top[frame].document.body.clientWidth != null) return top[frame].document.body.clientWidth;
			}
		}
	}
	return (null);
}

// Height of browser window page space
// for IE only works after body is loaded
function getInsideWindowHeight(frame) {
	if(frame == "Parent") {
		if (parent.innerHeight != null) return parent.innerHeight;
		if (document.documentElement.clientHeight) {
			if (parent.document.documentElement.clientHeight != null) return parent.document.documentElement.clientHeight;
		} else {
			if (parent.document.body.clientHeight != null) return parent.document.body.clientHeight;
		}
	} else {
		if (frame == "" || frame == null) {
			if (window.innerHeight != null) return window.innerHeight;
			if (document.documentElement.clientHeight) {
				if (document.documentElement.clientHeight != null) return document.documentElement.clientHeight;
			} else {
				if (document.body.clientHeight != null) return document.body.clientHeight;
			}	
		} else {
			if (top[frame].innerHeight != null) return top[frame].innerHeight;
			if (document.documentElement.clientHeight) {
				if (top[frame].document.documentElement.clientHeight != null) return top[frame].document.documentElement.clientHeight;
			} else {
				if (top[frame].document.body.clientHeight != null) return top[frame].document.body.clientHeight;
			}
		}
	}
	return (null);
}

// Width of screen
function getScreenWidth() {
	if (screen.availWidth) return screen.availWidth;
	return screen.width;
}

// Height of screen
function getScreenHeight() {
	if (screen.availHeight) return screen.availHeight;
	return screen.height;
}

// Sets visibility to visible
function show(objID, selector, frame) {
	var obj;
	obj = findDOM(objID, fdStyle, selector, frame);
	obj.visibility = "visible";
}

// Sets visibility to hidden
function hide(objID, selector, frame) {
	var obj;
	obj = findDOM(objID, fdStyle, selector, frame);
	obj.visibility = "hidden";
}

// Sets the focus
//  This will work for form elements, divs, embeded objects
//  its usefulness is questionable, results are buggy
function setFocus(objID, selector, frame) {
	var obj;
	obj = findDOM(objID, fdObject, selector, frame);
	obj.focus();
}

// toggles the Display style for an element
// This fucntion toggles an element's display property between 'none' and 
// the supplied displayType variable.  It can be set to colapse all other
// element's in a supplied array an element IDs
// can be used in hyperlink like href="javascript:expandToggle('itemID','block')"
// display options are: 
//       block - line break before and after, like div
//       inline - no line breaks, like span
//       none - no visible and no place holder
function expandToggle(objID, displayStyle, colapseAll, IDarray, selector, frame) {
	var obj;
	obj = findDOM(objID, fdStyle, selector, frame)
	if (obj.display == displayStyle) {
		obj.display = "none";
		return false }
	else {
		if (colapseAll) { 
			for (var i = 0; i < IDarray.length; i++) { removeElement(IDarray[i], selector, frame) }
		}
		obj.display = displayStyle;
		return true }
}

// remove an element
function removeElement(objID, selector, frame) {
	var obj;
	obj = findDOM(objID, fdStyle, selector, frame);
	obj.display = 'none';
}

// set an element's display style
function setDisplay(objID, displayType, selector, frame) {
	var obj;
	obj = findDOM(objID, fdStyle, selector, frame);
	obj.display = displayType;
}
	
// Position an object at a specific x,y location
//     some browsers won't allow negative values      
//   This function only uses the style elements because offset is read only
function shiftYTo(objID, y, selector, frame) {
	var obj;
	obj = findDOM(objID, fdStyle, selector, frame);
	obj.top = Math.round(y) + "px"; 
}

// Move an object by x and/or y pixels
//   Note that for Netscape4, if the block element's possition is relative
//   than it becomes relative to itself in the vertical direction
//   so that it's original offsetTop must be subtracted each time to 
//   it at the same vertical possition.
//   This function only uses the style elements because offset is read only
function shiftYBy(objID, deltaY, selector, frame) {
	var obj;
	obj = findDOM(objID, fdStyle, selector, frame);
	if (selector == "" || selector == null) obj.top = Math.round(parseInt(obj.top) + deltaY) + "px"
	else obj.top = Math.round(parseInt(obj.top) + deltaY) + "px"
}

// Center an object on the page
// this will center both vertical and horizontal.  For vertical to work
// you must use the "height=100%" style tag for the body element
//   not designed to center images with no container.
function center(objID, horizontal, verticle, selector, frame) {
	var obj;
	var x, y;
	obj = findDOM(objID, fdStyle, selector, frame);
	if (horizontal) {
		x = (getInsideWindowWidth(frame) - parseInt(obj.width))/2;
		if (x < 0) { x = 0 }
		obj.left = x + "px"	}
	if (verticle) {
		y = (getInsideWindowHeight(frame) - parseInt(obj.height))/2;
		if (y < 0) { y = 0 }
		obj.top = y + "px" }
}

//  Drag And Drop - these functions allow for draging an element, 
//  place a function in the mouseMove function to controll movement.
//  It is best to ensure all elements are loaded before attempting to
//  move them.  I recommend preloading or caching images to be dragged
//  These global variable are required for dragging
var lastX, lastY, mousePos, skipNext, dragObj;
//  Call this to initiallize dragging in the onLoad event, 
function initDragging() {
	dragObj = null;
	skipNext = false;
	document.onmouseup = mouseUp;
	document.onmousemove = mouseMove;
}
//  Call this to initialize each dragable element,  If the element 
//  contains another elements, such as an image, all mouse events 
//  will be disabled for those elements
function makeDragable(objID) {
	var obj = findDOM(objID, fdObject);
	obj.onmousedown = function() {
		dragObj = this;
		lastX = mousePos.x;
		lastY = mousePos.y; }
	obj.onmouseup = mouseUp;
	// kill mouse events for all child elements
	var childrenObj = new childArrayObj();
	findChildren(obj, childrenObj);
	for (var i = 0; i < childrenObj.items.length; i++) {
		childrenObj.items[i].onclick = function() { return false }
		childrenObj.items[i].onmousedown = function() { return false }
		childrenObj.items[i].onmouseup = function() { return false }
		 // this one is for ie
		childrenObj.items[i].onmousemove = function() { return false }
	}
}
function mouseUp(e) {
	dragObj = null;
}
function mouseMove(e) {  // e is automatically provided by non-IE browsers
	// skipping every other mouse movement event hughly improves performance
	mousePos = mouseXY(e);
	if (skipNext) skipNext = false;
	else {
		skipNext = true;
		if (ie) e = window.event;   // window.event object is supplied by MSIE
		if (dragObj) {
			// the next line is the function that controls the movement
			// for example
			verticleScrollBar(arg1, arg2);
			lastX = mousePos.x;
			lastY = mousePos.y }
	}
}
function mouseXY(e) {
	if (ie) {
		e = window.event;
		return { x:e.clientX + document.body.scrollLeft + document.body.clientLeft,
			y:e.clientY + document.body.scrollTop + document.body.clientTop }
	} else {		
		return { x:e.pageX, y:e.pageY }
	}
}

//  These functions allow scroll bar movement when used with the dragging
//  functions.  Adjust the element IDs as necessary.
//  It is best to ensure all elements are loaded before attempting to
//  drag them.  I recommend preloading or caching images to be dragged
var arg1, arg2;  // add more as needed
//  This one initializes the scroll bar, place a call in the onLoad event like
//  initVertScrollBar(true, 1), true causes the scroll bar element's height to 
//  be adjusted proportion to the scrolling content currently visible.  The 
//  integer "1" is the padding used in the scroll bar box.
function initVertScrollBar(scrollBarScaling, scrollPadding) {
	arg1 = scrollPadding;  // scroll bar box padding
	if (scrollBarScaling) {
		var objScrollBar = findDOM("ScrollBar", fdStyle);
		objScrollBar.height = Math.round((getObjHeight("ScrollBarBox") - scrollPadding) * ( getObjHeight("BoundingBox") / getObjHeight("ScrollingBox"))) + "px" }
	arg2 = (getObjHeight("ScrollingBox")-getObjHeight("BoundingBox")) / (getObjHeight("ScrollBarBox") - (scrollPadding * 2) - getObjHeight("ScrollBar"));
	var objScrollBarBox = findDOM("ScrollBarBox", fdObject);
	objScrollBarBox.onclick = scrollBarBoxClick;
}
//  This funciton is called from the mouseMove function of the drag and drop functions
function verticleScrollBar(scrollPadding, scrollRatio) {
	if (mousePos.y < lastY) { // move up
		if (getObjTop("ScrollBar") > scrollPadding) {
			shiftYBy("ScrollBar", mousePos.y - lastY);
			shiftYBy("ScrollingBox", (lastY - mousePos.y) * scrollRatio) }
		else {  // back to top
			shiftYTo("ScrollBar", scrollPadding);
			shiftYTo("ScrollingBox", 0) }
	} else if (mousePos.y > lastY) {  // move down
		if (getObjBottom("ScrollBar") < getObjHeight("ScrollBarBox") - scrollPadding - 1) {
			shiftYBy("ScrollBar", mousePos.y - lastY);
			shiftYBy("ScrollingBox", (lastY - mousePos.y) * scrollRatio) }
		else {  // go to bottom
			shiftYTo("ScrollBar", getObjHeight("ScrollBarBox")-getObjHeight("ScrollBar")- scrollPadding - 1);
			shiftYTo("ScrollingBox", getObjHeight("BoundingBox")-getObjHeight("ScrollingBox")) }
	}
}

//   This function moves the scrollbar if the user clicks above or below it
function scrollBarBoxClick(e) {
		if (ie) e = window.event;   // window.event object is supplied by MSIE
		mousePos = mouseXY(e);
		var scrollPadding = arg1;
		var scrollRatio = arg2;
		//console.debug(mousePos.y+" "+getTotalOffsetTop("ScrollBar"));
		if (mousePos.y < getTotalOffsetTop("ScrollBar")) {  // go up
			if (getObjTop("ScrollBar") - scrollPadding > getObjHeight("ScrollBar")) {  // go up part way
				shiftYTo("ScrollBar", getObjTop("ScrollBar") - getObjHeight("ScrollBar"));
				shiftYBy("ScrollingBox", getObjHeight("ScrollBar") * scrollRatio) }
			else {  //  go up all the way
				shiftYTo("ScrollBar", scrollPadding);
				shiftYTo("ScrollingBox", 0) }
		} else if (mousePos.y > getTotalOffsetTop("ScrollBar") + getObjHeight("ScrollBar")) {  // go down
			if (getObjHeight("ScrollBarBox") - getObjBottom("ScrollBar") > getObjHeight("ScrollBar")) {  // go down part way
				shiftYTo("ScrollBar", getObjTop("ScrollBar") + getObjHeight("ScrollBar"));
				shiftYBy("ScrollingBox", -1 * getObjHeight("ScrollBar") * scrollRatio) }
			else { // go down all the way
				shiftYTo("ScrollBar",getObjHeight("ScrollBarBox") - getObjHeight("ScrollBar") - scrollPadding - 1);
				shiftYTo("ScrollingBox", getObjHeight("BoundingBox")-getObjHeight("ScrollingBox")) }
		}
}

// Fade spanned text from one color to another, given RGB color values
//    Netscape <6 doesn't recognize the style.color DOM so you have to use the font tag color
//    Netscape prefers to get the color as a hex value when using the font tag
var fadeIntervalID = new Array();
var fadeI = new Array();
var fadeDone = new Array();
function fadeRGB(objID, startR, startG, startB, endR, endG, endB, wait, shifts, instance, selector, frame) {
	var incR, incG, incB, curR, curG, curB;
	var colorArray = new Array();
	var fadeObj = findDOM(objID, fdObject, selector, frame);
	fadeDone[instance] = false;
	// first build a color array
	// NOTE, the math here will actually produce shifts+1 color shifts
	incR = (endR - startR)/shifts;
	incG = (endG - startG)/shifts;
	incB = (endB - startB)/shifts;
	curR = startR;
	curG = startG;
	curB = startB;
	for (fadeI[instance] = 1; fadeI[instance] <= shifts; fadeI[instance]++) {
		curR = Math.round(curR + incR);
		curG = Math.round(curG + incG);
		curB = Math.round(curB + incB);
		//colorArray[fadeI[instance]] = "rgb(" + curR + ", " + curG + ", " + curB + ")" }
		colorArray[fadeI[instance]] = "#" + decToHex(curR) + decToHex(curG) + decToHex(curB) }
	fadeI[instance] = 1;
	fadeRGB2(fadeObj, colorArray, wait, instance);
}
function fadeRGB2(fadeObj, colorArray, wait, instance) {
	if (fadeI[instance] >= colorArray.length) {
		clearTimeout(fadeIntervalID[instance]); 
		fadeDone[instance] = true }
	else {
		fadeObj.color = colorArray[fadeI[instance]];
		fadeI[instance] += 1;
		fadeIntervalID[instance] = setTimeout(function() { fadeRGB2(fadeObj, colorArray, wait, instance) }, wait) }
}

//-----Flash error page--------------
var noFlash = "<blockquote><h3>&nbsp;</h3><h3><font color='#999999' face='Arial, Helvetica, sans-serif'>This web site needs version ";
noFlash += requiredMajorVersion + "." + requiredMinorVersion
noFlash += " or later of the Flash<sup><font size='-2'>TM</font></sup> Player.</font><font face='Arial, Helvetica, sans-serif'></font></h3><font face='Arial, Helvetica, sans-serif'><table width='82%'><tr><td height='78' colspan='2'><p />Check here for information about <a href='http://www.macromedia.com/software/flash/' target='_new'>Macromedia<sup><font size='-1'>&reg;</font></sup>Flash<sup><font size='-2'>TM</font></sup></a> software.<p />";
if(flashVersion > 0) {
	noFlash += "You are currently using version " + flashVersion + " and should consider upgrading.";
} else {
	noFlash += "You currently do not have the Flash Player.  Please consider intalling it now.";
}
noFlash += "</td></tr><tr><td><a href='http://www.macromedia.com/go/getflashplayer'><img src='flash/alternate.gif' border='0' width='88' height='31' /></a></td><td><p />It will only take a moment to download and install the latest version.</td></tr></table></font><p /><font face='Verdana, Arial, Helvetica, sans-serif' SIZE='-2'>Macromedia and Flash are trademarks of Macromedia, Inc.</font></blockquote>";
