addOnload ( function ( ) 
{
	// Move right margin height to match page height
	var ContentH = getElementHeight ( document.getElementById ( "Content" ) );
	var ContentB = getElementHeight ( document.getElementById ( "ContentBox" ) );
	if ( typeof ( ContentH ) == "undefined" || !ContentH )
	{
		document.getElementById ( "MarginRight" ).style.height = ( ContentB + 36 + 4 ) + "px";
	}
	else
	{
		document.getElementById ( "MarginRight" ).style.height = ( ContentH + 68 + 40 + 4 ) + "px";
	}
		
	// Preload and setup onmouseover effects on menu	
	var menuItems = getElementsByClassName ( "MenuImage" );
	document.mImages = new Array ( );
	if ( menuItems ) for ( var a = 0; a < menuItems.length; a++ )
	{
		document.mImages[ a ] = new Image ( );
		if ( menuItems[ a ].src.indexOf ( "gt_" ) <= 0 )
			document.mImages[ a ].src = menuItems[ a ].src.replace ( "meny_", "valgt_meny_" );
		else document.mImages[ a ].src = menuItems[ a ].src;
		document.mImages[ a ].other = new Image ( );
		document.mImages[ a ].other.src = menuItems[ a ].src;
		menuItems[ a ].i = document.mImages[ a ];
		menuItems[ a ].onmouseover = function ( )
		{
			this.src = this.i.src;
		}
		menuItems[ a ].onmouseout = function ( )
		{
 			this.src = this.i.other.src;
		}
	}
}
);

function setActiveMenuItem ( varkey )
{
	var menuItems = getElementsByClassName ( "MenuImage" );
	for ( var a = 0; a < menuItems.length; a++ )
	{
		menuItems[ a ].src = menuItems[ a ].src.replace ( "valgt_", "" );
		if ( menuItems[ a ].src.indexOf ( varkey ) > 0 )
			menuItems[ a ].src = menuItems[ a ].src.replace ( "meny_", "valgt_meny_" );
	}
}

function showflashBanner ( )
{
	document.getElementById ( "FlashBanner" ).innerHTML = "" +
		"<object style=\"float: left\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" width=\"868\" height=\"400\" title=\"lodden\"><param name=\"movie\" value=\"style/forsideheader.swf\" /><param name=\"quality\" value=\"high\" /><embed style=\"float: left\" src=\"style/forsideheader.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"868\" height=\"400\"></embed></object><br style=\"clear: both\" />";
}
