var _isInitialized= false;

function initPage()
{	_isInitialized= true;
}

function destroyPage()
{	_isInitialized= false;
}

var _preloadImg= new Array();

function getRef(id)
{	var theRef= null;
	if (document.all)
	{	theRef= document.all[id];
	}
	else if (document.getElementById)
	{	theRef= document.getElementById(id);
	}
	return theRef;
}

function createRolloverName(id)
{	return _pathPrefix + "img/ro-" + id + ".jpg";
}

function preloadRolloverImg(id)
{	_preloadImg[id]= new Image();
	_preloadImg[id].src= createRolloverName(id);
}

function preloadMenu1Rollovers(root)
{	var childCnt= root.children.length;
	for (var childNdx= 0; childNdx < childCnt; childNdx++)
	{	preloadRolloverImg(root.children[childNdx].id);
	}
}

function mouseOver(id)
{	if (_isInitialized)
	{	var bgimgRef= getRef("bgrdMenu1");
		if (bgimgRef != null)
		{	bgimgRef.style.backgroundImage= 
				"url(" + createRolloverName(id) + ")";
		}
		var destNode= theSite.getById(id);
		if (destNode != null)
		{	var roText= destNode.subTitle;
			if ((roText != null) && (roText.length > 0))
			{	roText= "&nbsp;-&nbsp;" + roText;
				var spanId= "ro_" + id;
				var spanRef= getRef(spanId);
				if (spanRef != null)
				{	spanRef.innerHTML= roText;
				}
			}
		}
	}
}

function mouseOut(id)
{	if (_isInitialized)
	{	var bgimgRef= getRef("bgrdMenu1");
		if (bgimgRef != null)
		{	bgimgRef.style.backgroundImage=
				"url(" + _pathPrefix + "img/menu-bgrd.jpg" + ")";
		}
		var spanId= "ro_" + id;
		var spanRef= getRef(spanId);
		if (spanRef != null)
		{	spanRef.innerHTML= "&nbsp;";
		}
	}
}
