function createNavigation()
{
	if (typeof(naviColor) == "undefined") color = "white"; else color = naviColor;
	if (typeof(naviElement) == "undefined") ele = $('navigation'); else ele = naviElement;

	as = ele.getElementsByTagName("table")[0].getElementsByTagName("a");
	
	console.log(as);

	for (i = 0; i < as.length; i++)
	{
		
		href = as[i].pathname;
		
		if (as[i].target == "_blank") continue; // links out

//		console.log(href,document.location.pathname.replace("/","").replace("/",""),href.replace("/","").replace("/",""));
		
		if (document.location.pathname.replace("/","").replace("/","").indexOf(href.replace("/","").replace("/","")) == 0)
		{
			
		console.log("OK",href);	
			
			if (document.location.pathname.replace("/","").replace("/","") == href.replace("/","").replace("/",""))
			{
				el = document.createElement("span");
				isSpan = true;
			} else {
				el = as[i];
				isSpan = false;
			}
				
			el.className = "chosenone";
			el.style.backgroundColor = as[i].style.color;
			el.style.color = color;
				
			if (isSpan)
			{
				el.innerHTML = as[i].innerHTML;
				pn = as[i].parentNode;
				pn.appendChild(el);
				pn.removeChild(as[i]);
			}
		}
	}
}

createNavigation();
