function imgSwap(strObj, strImage, blnSwitch){
	if (blnSwitch == 1){
		strImage = "/images/navigation/" + strImage + "-on.gif";
		document.images[strObj].src = strImage;
	}
	
	if (blnSwitch == 0){
		strImage = "/images/navigation/" + strImage + "-off.gif";
		document.images[strObj].src = strImage;
	}
	
	return;
} // end of imgSwap

function sideSwap(strObj, strImage, blnSwitch){
	if (blnSwitch == 1){
		strImage = "/images/sidelinks/" + strImage + "_on1.jpg";
		document.images[strObj].src = strImage;
	}
	
	if (blnSwitch == 0){
		strImage = "/images/sidelinks/" + strImage + "_off.jpg";
		document.images[strObj].src = strImage;
	}
	
	return;
} // end of imgSwap




function openDiv(objID, topX) {
	document.getElementById(objID).style.display = 'block';
	var yScroll;
	if (self.pageYOffset) {				// all except Explorer
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop) {		// Explorer 6 Strict Mode
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {			// other Explorers
		yScroll = document.body.scrollTop;
	}
	
	//	Check to see how far the page has scrolled
	if (yScroll > topX) {
		var tempTop = (yScroll + 10);	//	"10" being the buffer from the top of the inwo
		document.getElementById(objID).style.top = tempTop;
	}
}




/*	FIND RELATIVE POSITION OF SOMETHING	*/

var xTotal, yTotal, findObj, moveObj, offsetAmount;

function findPositionandMove(findObj, moveObj, offsetAmount) {
	xTotal = 0;
	yTotal = 0;
	theObject = document.getElementById(findObj);
	
	var arrowXPos;
	
	while (theObject.offsetParent != null) {
		 
		xTotal += theObject.offsetLeft;

		//	Sometimes a parent and its child node have the same
		//	offsetHeight
		if(theObject.offsetTop != theObject.parentNode.offsetTop) {
			yTotal += theObject.offsetTop;
		}
		theObject = theObject.parentNode
	}
	
	//	Somehow, the <p> tag's margin is being consider
	//	25x to the left, so get rid of it.
	xTotal -= 25;
	
	if (xTotal > offsetAmount) {
			xTotal = offsetAmount - xTotal;
			arrowXPos = 10 - xTotal;
	} else {
			xTotal = 0;
			arrowXPos = 10;
	}
	

	
//	document.getElementById(moveObj).style.top = yTotal;
	document.getElementById(moveObj).style.left = xTotal;
	
	//	Find the up-image, which is a child node of the findObj object
	
	var upArrowObj = cycleChildNodes(document.getElementById(moveObj), "up-arrow");
	
	upArrowObj.style.left = arrowXPos;

}

function cycleChildNodes(thisObj, lookFor) {
	for (var a = 0; a < thisObj.childNodes.length; a++) {

		//	First, look to see if this node is what you want.
		
		//	alert(thisObj.childNodes[a].tagName + " " + thisObj.childNodes[a].checkProp);
		
		if (thisObj.childNodes[a].className == lookFor) {
			upArrowObj = thisObj.childNodes[a];
		} else {	
			if (thisObj.childNodes[a].childNodes.length > 0) {
				cycleChildNodes(thisObj.childNodes[a], lookFor);
			}
		}
	}
	return upArrowObj;
}

