	/*
	.-----------------------------------------------------------------------. 
	| SPIRE needs an element to rollover and an image or block level        |
	| element (BLE) to display when the roll over occurs.  The roll over		|
	| elements are linked to their pop up image/block by their IDs.  				|
	|	The ID of the pop up image/block has SPIRE_ prepended to the ID of 		|
	|	the rollover element.  All SPIRE elements must have a class name must |
	| start with SPIRE.  For example: 																			|
	|																																				|
	|		<SPAN ID="Image1">Something to rollover</SPAN>											|
	|		<IMG ID="SPIRE_Image1" CLASS="SPIRE" SRC="SomeImage.jpg">						|
	| 																																			|
	|		<SPAN ID="Text2">Expand topic</SPAN>																|
	|		<DIV ID="SPIRE_Text2" CLASS="SPIRE_Text" WIDTH=230 HEIGHT=200>			|
	|			This is the expanded information that pops up when the text 	 		|
	|			SPAN element above is rolled over.																|
	| 	</DIV>																															|
	|																																				|
	| Although a text BLE will work without WIDTH and HEIGHT specifications,|
	| the positioning is less than desirable, in this version.              |
	| 																																			|
	| onLoad('initSPIRE();') must be included in the <BODY> element or some	|
	| other means must be employed to run initSPIRE() after the document is |
	| loaded.  initSPIRE() checks the browser's ability to handle the 			|
	| javascript and	assigns the mouseOverSPIRE() and mouseOutSPIRE() 			|
	| event handler functions to the roll over elements.  For example:			|
	| 																																			|
	|		<BODY onLoad('initSPIRE();')>																				|
	|																																				|
	| The SPIRE class must include, as a minimum:														|
	|																																				|
	|		.SPIRE {																														|
	|			visibility: hidden;																								|
	|			position: absolute;																								|
	|		}																																		|
	|																																				|
	|	----	The original versions of getWindowXY(), getScrollXY(), 		----	|
	| ----	getMouseXY(), findPosX(), findPosY(), and getObjByID() 		----	|
	| ----	were taken from Peter-Paul Koch's CSS and JavaScript 			----	|
	|	----	tips and tricks site -- http://www.quirksmode.org					----	|
	'-----------------------------------------------------------------------'
	2005-04-17 DRH	Took the display functions our of MouseOverSPIRE() 
									and put them into doSPIREPopUp() which is reached 
									via a timer started in MouseOverSPIRE() and killed, 
									if necessary, in MouseOutSPIRE().
	2005-04-26 DRH	Check for no SPIRE tags in initSPIRE(); if(x.length == 0) return;
	*/
	
	var DHTML;
	var SPIREPPU;		// pending pop up

	function initSPIRE() {
		DHTML = (document.getElementById || document.all || document.layers);
		if( !DHTML) return;

		var cID;
		var cName;
		var i;
		if (!document.getElementById) return;
		var x = document.getElementsByTagName("*");
		if(x.length == 0) return;
		for (i = 0; i < x.length; i++) {
			if (x[i].className.substring(0,5) == 'SPIRE') {
				cID = x[i].id
				cName = cID.substring(6, cID.length);
				var y = document.getElementById( cName);
				if (y) {
					y.onmouseover = mouseOverSPIRE;
					y.onmouseout  = mouseOutSPIRE;
				}
			}
		}
	}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

	function getWindowXY() {	// X = Width, Y = Height
	
		var winX = 0, winY = 0;

		if( typeof( window.innerWidth ) == 'number' ) { 		//Non-IE
		    winX = window.innerWidth;
		    winY = window.innerHeight;
		} else if( document.documentElement &&
			     ( document.documentElement.clientWidth || 
				   document.documentElement.clientHeight ) ) {	//IE 6+ in 'standards compliant mode'
			winX = document.documentElement.clientWidth;
			winY = document.documentElement.clientHeight;
		} else if( document.body && 
				 ( document.body.clientWidth || 
				   document.body.clientHeight ) ) {				//IE 4 compatible
			winX = document.body.clientWidth;
			winY = document.body.clientHeight;
		}
		return [ winX, winY ];
	}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
	
	function getScrollXY() {	// X = Scrolled right, Y = Scrolled down

		var scrollX = 0, scrollY = 0;

		if( typeof( window.pageYOffset ) == 'number' ) {		//Netscape compliant
			scrollX = window.pageXOffset;
			scrollY = window.pageYOffset;
		} else if( document.body && 
				 ( document.body.scrollLeft || 
				   document.body.scrollTop ) ) {				//DOM compliant
			scrollX = document.body.scrollLeft;
			scrollY = document.body.scrollTop;
		} else if( document.documentElement &&
				 ( document.documentElement.scrollLeft || 
				   document.documentElement.scrollTop ) ) {		//IE6 standards compliant mode
			scrollX = document.documentElement.scrollLeft;
			scrollY = document.documentElement.scrollTop;
		}
		return [ scrollX, scrollY ];
	}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

	function getMouseXY(e) {	// X and Y are document not screen relative.

		var posX = 0, posY = 0;

		if( !e ) { e = window.event; } 
		if( !e ) { return [ 0, 0 ]; }
		if( typeof( e.pageX ) == 'number' ) {
			posX = e.pageX; 
			posY = e.pageY;
		} else {
			if( typeof( e.clientX ) == 'number' ) {
				posX = e.clientX; 
				posY = e.clientY;
				if( document.body && 
					( document.body.scrollTop || document.body.scrollLeft ) && 
					!( window.opera || window.debug || navigator.vendor == 'KDE' ) ) {
					posX += document.body.scrollLeft; 
					posY += document.body.scrollTop;
				} else {
					if( document.documentElement && 
						(document.documentElement.scrollTop || document.documentElement.scrollLeft) && 
						!( window.opera || window.debug || navigator.vendor == 'KDE' ) ) {
						posX += document.documentElement.scrollLeft; 
						posY += document.documentElement.scrollTop;
					}
				}
			}
		}
		return [ posX, posY ];
	}
	
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

	function findPosX(obj) {
	
		var curleft = 0;
	
		if (obj.offsetParent) {
			while( obj.offsetParent) {
				curleft += obj.offsetLeft;
				obj = obj.offsetParent;
			}
		} else if( obj.x) {
			curleft += obj.x;
		}
		return curleft;
	}
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

	function findPosY(obj) {

		var curtop = 0;
	
		if( obj.offsetParent) {
			while (obj.offsetParent) {
				curtop += obj.offsetTop;
				obj = obj.offsetParent;
			}
		} else if( obj.y) {
			curtop += obj.y;
		}
		return curtop;
	}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

	function getObjByID(name) {

		if( document.getElementById) {
			this.obj = document.getElementById(name);
			this.style = document.getElementById(name).style;
		} else if( document.all) {
			this.obj = document.all[name];
			this.style = document.all[name].style;
		} else if( document.layers) {
			this.obj = document.layers[name];
			this.style = document.layers[name];
		}
	}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

	function mouseOverSPIRE(e) {

		if( !DHTML) return;
		if( !e) var e = window.event;

		var winWH = new getWindowXY();
		var winW = winWH[0]; var winH = winWH[1];

		var scrollXY = new getScrollXY()
		var scrollX = scrollXY[0]; var scrollY = scrollXY[1];

		var mouseXY = new getMouseXY(e);
		var mouseX = mouseXY[0]; var mouseY = mouseXY[1];
		var eID = 'SPIRE_' + this.id;
		var elY = findPosY( this);


var sfunc = 'doSPIREPopUp( ' + winW    		+ ', '	+ winH		+ ', '
																+ scrollX	+ ', '	+ scrollY	+ ', '
																+ mouseX  + ', '	+ mouseY 	+ ', ' 
																+ elY			+ ', ' 
																+ '\'' 		+ eID		+ '\''			
																+ ')'
SPIREPPU = setTimeout( sfunc, 600);

	}

function doSPIREPopUp( winW, winH, scrollX, scrollY, mouseX, mouseY, elY, eID) {

	
		var obj = new getObjByID( eID);

		if (obj.obj.width) {
			if (obj.style.width) {
				eWidth = (obj.obj.width = 0) ? obj.style.width : obj.obj.width;
			} else {
				eWidth = obj.obj.width;
			}
		} else {
			if (obj.style.width) {
				eWidth = obj.style.width;
			} else {
				eWidth = 0;
			}
		}
		eWidth = parseInt(eWidth);

		if (obj.obj.height) {
			if (obj.style.height) {
				eHight = (obj.obj.height = 0) ? obj.style.height : obj.obj.height;
			} else {
				eHight = obj.obj.height;
			}
		} else {
			if (obj.style.height) {
				eHight = obj.style.height;
			} else {
				eHight = 0
			}
		}
		eHight = parseInt(eHight);

		// Preferred X - centered on the mouseX.
		var offX = (mouseX - scrollX) - (eWidth / 2);
		offX = (offX < scrollX) ? scrollX : offX;
		while( (offX > scrollX) && ((offX + eWidth) > (scrollX + winW - 50))) {
			offX -= 1;
		}
		obj.style.left = offX;

		// Preferred Y - somewhere above the top of the element moused over.
		var offY = elY - (eHight + 35);
		obj.style.top = (offY < (scrollY + 150)) ? elY + 35 : offY;
		obj.style.visibility = 'visible';
	}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

	function mouseOutSPIRE(e) {

		if( !DHTML) return;

if (SPIREPPU) {
	clearTimeout(SPIREPPU);
}

		var obj = new getObjByID('SPIRE_' + this.id);
		obj.style.visibility = 'hidden';
	}

	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

