function styleRoll(span, vis)
{
	var el = GetStyle(span);
	var state = vis? 'visible':'hidden';
	el.visibility = state;
}
function imageSwap3On(theImage,theSrc,span,hasMenuItems)
{
	if (hasMenuItems == "True")
	{
		styleRoll(span, true);
	}
	imageSwap2(theImage, theSrc);
}
function imageSwap3Off(theImage,theSrc,span,hasMenuItems)
{
	if (hasMenuItems == "True")
	{
		styleRoll(span, false);
	}
	imageSwap2(theImage, theSrc);
}

function imageSwap2On(theImage,theSrc)
{
	imageSwap2(theImage, theSrc);
}
function imageSwap2Off(theImage,theSrc)
{
	imageSwap2(theImage, theSrc);
}

function imageSwap2(theImage,theSrc){
	if(document.images){
		var img = document.images[theImage];
		if (img) {
			img.src = theSrc;
		} else
		{
			for (var i = 0; i < document.images.length; i++) {
				if (document.images[i].name == theSrc) {
					document.images[i].src = theSrc;
					return;
				}
			}
		}
	}
	
}
function getImageName(el)
{
	var ip = el.id.lastIndexOf('_');
	var name = el.id.substr(0, ip);
	
	var testName = name + "_imgArrow1";
	if (document.images[testName])
		return testName;

	testName = name + "_imgArrow2";
	if (document.images[testName])
		return testName;
		
	return null;
}
function getOurLabel(el)
{
	var ip = el.id.lastIndexOf('_');
	var name = el.id.substr(0, ip);
	name += "_labCenterNav";
	if (eval(el) == "")
		return null;
	var el = FindElement(name);
	return el;
}
function setCenterStyle(elIn, isOn)
{
	var useColor = isOn ? "red" : "black";
	
	var el = getOurLabel(elIn);
	if (el == null) return;

	el.style.color = useColor;

	var iName = getImageName(elIn);
	if ((iName != null) && (document.images))
	{
		var ourImage = document.images[iName];
		if (isOn) {
			if (!ourImage.other)
				ourImage.other = ourImage.src;
		}
		
		var swapper;
		if (isOn)
			swapper = "/source/images/red_arrow_lid.gif";
		else
			swapper = ourImage.other;
		imageSwap2(iName, swapper);
	}
}

function centerOn(elIn){
	setCenterStyle(elIn, true);
}	
function centerOff(elIn){
	setCenterStyle(elIn, false);
}