﻿// JScript File
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 GetStyle(name)
{
	if (document.getElementById) {
		return document.getElementById(name).style;
	} else if (document.all) {
		return document.all[name].style;
	} else {
		var el =  document.layers[name];
		if (el != null) return el;
		for (var i = 0; i < document.layers.length; i++) {
			el =  document.layers[i].document.layers[name];
			if (el != null) return el;
		}
	}
}

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 FindElement(elementName)			// uses partial name
//{
//	if (document.getElementById) {
//		var e1 = document.getElementById(elementName);
//		if (e1 != null) return e1;
//	}
//	
//	var frm = document.forms[0];
//	var el = frm.elementName;
//	if (el != null) return el;
//	for (var i = 0; i < frm.elements.length; i++)   {
//		if (frm.elements[i].name.indexOf(elementName) != -1) {
//			return frm.elements[i];
//		}
//	}
//	return null;
//}
//function getOurLabel(el)
//{
//    alert("inside getourlabel");
//	var ip = el.id.lastIndexOf('_');
//	var name = el.id.substr(0, ip);
//	name += "_labCenterNav";
//	alert("after name");
//      
//	if (eval(el) == "")
//		return null;
//	var el = FindElement(name);
//	return el;
//}
//function setCenterStyle(elIn, isOn)
//{
//	var useColor = isOn ? "red" : "black";
////	alert("be4 el");
////	var el = getOurLabel(elIn);
////	alert(el);
////	if (el == null) return;

////	el.style.color = useColor;

//	var iName = "nav_news_desccc";
//////	if ((iName != null) && (document.images))
//////	{
//////		var ourImage = document.images[iName];
//////		if (isOn) {
//////			if (!ourImage.other)
//////				ourImage.other = ourImage.src;
//////		}
//////		
//		var swapper;
//		if (isOn)
//			swapper = "imagess/red_arrow_lid.GIF";
//////		else
//////			swapper = ourImage.other;
//		imageSwap2(iName, swapper);
//////	}
//}

//function centerOn(elIn){
//alert("onmouseoverdrid");
//	setCenterStyle(elIn, true);
//}	
//function centerOff(elIn){
//	setCenterStyle(elIn, false);
//}
