var framesTop = parent.parent;

function GetNextUL(eSrc){
	eRefChildren = eSrc.children;
	eRefChildrenLen = eRefChildren.length;
	for(var i = 0; i < eRefChildrenLen; i++) if("UL" == eRefChildren[i].tagName) return eRefChildren[i];
	return false;
}

function Toc_click()
{
	var eSrc = window.event.srcElement;
	if("A" == eSrc.tagName && "LI" == eSrc.parentElement.tagName)
	{
	}
	else if("SPAN" == eSrc.tagName && "LI" == eSrc.parentElement.tagName)
	{
		var eImg = eSrc.parentElement.children[0];
		if(eImg) eImg.click();
		window.event.returnValue = false;
	}
	else if("IMG" == eSrc.tagName)
	{
		var eLink = eSrc.parentElement.children[1];

		if("object" == typeof(framesTop.fraTopic) && eLink && "A" == eLink.tagName)
		{
			framesTop.fraTopic.location.href = eSrc.parentElement.children[1].href;
		}

		if("noHand" != eSrc.className)
		{
			eLI = eSrc.parentElement;
			var eUL = GetNextUL(eLI);
			if(eUL && "kidShown" == eLI.className)
			{
				// hide on-page kids
				eLI.className = "kid";
				eUL.className = "clsHidden";
				eSrc.src = "bs.gif"
			}
			else if(eUL && "kid" == eLI.className)
			{
				// show on-page kids
				eLI.className = "kidShown";
				eUL.className = "clsShown";
				eSrc.src = "bo.gif"
			}
			else if("kid" == eLI.className)
			{
				// load off-page kids
				eLI.className = "kidShown";
				eSrc.src = "bo.gif"
				window.eRootNode = eLI;
				eLI.insertAdjacentHTML("beforeEnd","<DIV CLASS='clsLoadMsg'>" + framesTop.L_Loading_Text + "<DIV>");
				var sChunkFileName = "chunks/chunk_" + eLI.id + ".htm";
				hiddenframe.location.replace(sChunkFileName);
			}
		}
	}
}


