var objTemp    = "";
var strId      = "";
var strUrl     = top.document.location.href;
var intStart   = strUrl.lastIndexOf("id=");
var strSubject = "null";
var strLiClassName = "";

if ( intStart > 0 )
	strSubject = strUrl.substr(intStart + 3)

if (strSubject != "null") {
	for (i=0; i<document.getElementById("referenzen").childNodes.length; i++)
	{
		strLiClassName = document.getElementById("referenzen").childNodes[i].className;
		if ( strLiClassName .lastIndexOf(strSubject) == "-1" )
			document.getElementById("referenzen").childNodes[i].className = "inactive";
	}
}

walkTheTreeRec ( document.getElementById("sub-navigation"), "sub-navigation");


function walkTheTreeRec( objNode, strEntryId )
{
	if ( objNode.nodeName == "A" )
	{
		// LINK GEFUNDEN !!!
		strId = objNode.getAttribute("rel");
		objNode.setAttribute("href","?id=" + strId);
		
		if ( strId == strSubject ) {
			// DAS IST DER AKTIVE LINK
			objNode.setAttribute("class","aktiv");
		}
	}

	if ( objNode.hasChildNodes() )
		// KINDERKNOTEN VORHANDEN, SELBSTAUFRUF
		walkTheTreeRec( objNode.childNodes[0], strEntryId )

	else if ( objNode.nextSibling != null )
		// KEINE KINDERKNOTEN GEFUNDEN, ABER EINEN NACHFOLGENDEN, SELBSTAUFRUF
		walkTheTreeRec( objNode.nextSibling, strEntryId );

	// KEINE KINDERKNOTEN UND LETZTER KNOTEN DIESER EBENE: NACHFOLGENDEN KNOTEN DES ELTERNKNOTENS AUFRUFEN		
	else 
	{
		while ( objNode.parentNode.getAttribute("id") != strEntryId )
		{
			objNode = objNode.parentNode;
		
			if ( objNode.nextSibling != null )					
				walkTheTreeRec( objNode.nextSibling, strEntryId );				
		}
		
	}
}
