
// function to open the anchored link (if there is one)
function openTargetLink()
{
	if (window.location.hash)
	{
		hideAll();
		document.getElementById(window.location.hash.substring(1)).style.display='block'
	}
}
// function to open one, close the rest
function showHide(a)
{
	var i;
	var href = a.href.split('#')[1];
	var divId = document.getElementById(href);
	hideAll();
	divId.style.display = 'block';
	divId.className = 'attentionBlock';
}
// clicking on the sidebar has to activate this
function checkUrl(a)
{
//	alert (window.location.pathname == '/new/tjenester.php');
//  stupid IE doesn't like a.pathname (below), so we have to spell out the path instead (two lines down)
//	if (window.location.pathname == a.pathname) showHide(a)
	if (window.location.pathname == '/tjenester.php') showHide(a)
	else return;
}
// function for hiding all blocks
function hideAll() {
	var blocks = new Array (
	'strat',
	'mediahand',
	'mediatrain',
	'krisekomm',
	'pr',
	'myndig',
	'corp',
	'omd'
	)
	for (i in blocks)
	{
		var blockId = document.getElementById(blocks[i]);
		blockId.style.display = 'none';
	}
}