
function navhighlight() 
{	
	var actualLocation = window.location.href;
	var myregexp = new RegExp("http://" + window.location.hostname, "i");
		
	actualLocation = actualLocation.replace(myregexp, '');

	var dirArray = actualLocation.split("/");
	
	if (!document.getElementsByTagName){ return; }
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];
		
		var actualHref = anchor.getAttribute('href');
		actualHref = actualHref.replace(myregexp, '');
		
		// Überprüfung des Direktlinks
		if (actualHref == actualLocation)
		{			
			anchor.className = "active";
		}

		var actualPath = "";
		
		// Überprüfung der Unververzeichnisse
		for(var u=1;u<dirArray.length;u++)
		{
			actualPath = actualPath + "/" + dirArray[u];
			
			var tempPath = actualPath + "/index.php";
			
			if (actualHref == tempPath)
			{
				anchor.className = "active";
				//alert(anchor.innerHTML);
			}
		}
		
	}
}


navhighlight();