function extractPageName(hrefString)

{

	var arr = hrefString.split('/');

	return  (arr.length<2) ? hrefString : arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase();               

}



function setActiveMenu(arr, crtPage)

{

	for (var i=0; i<arr.length; i++)

	{

		if(extractPageName(arr[i].href) == crtPage)

		{

			if (arr[i].parentNode.tagName != "DIV")

			{

				arr[i].className = "current";

				arr[i].parentNode.className = "current";

			}

		}

	}

}



function setPage()

{

	hrefString = document.location.href ? document.location.href : document.location;



	if (document.getElementById("main_menu")!=null)

		setActiveMenu(document.getElementById("main_menu").getElementsByTagName("a"), extractPageName(hrefString));

}



function getDanishUrl()

{

    	var currentUrl = document.location.href

	document.getElementById('otherLanguage').href=currentUrl.replace("/en/", "/da/")

}



function getEnglishUrl()

{

    	var currentUrl = document.location.href

	document.getElementById('otherLanguage').href=currentUrl.replace("/da/", "/en/")

}
