function InitBlestshoppen ( )
{
	if ( typeof ( BlestBoxSet ) != 'undefined' )
	{
		// Vedtekter		
		var wm = document.getElementById ( 'WebshopOutput__' );
		if ( !wm ) wm = document.getElementById ( 'WebModule__' );
		
		var base = document.getElementsByTagName ( 'base' );
		base = base[ 0 ].href;
		
		// Set some blestbox options
		BlestBoxSet ( 'background-opacity', 0.7 );
		BlestBoxSet ( 'graphics-path', base + 'gfx' );
		BlestBoxSet ( 'background-color', '#fff' );
		BlestBoxSet ( 'shadowbackground-color', '#000' );
		BlestBoxSet ( 'framebackground-color', '#fff' );
		BlestBoxSet ( 'page-width', 520 );
		BlestBoxSet ( 'page-height', 440 );
	}
	else
	{
		setTimeout ( 'InitBlestshoppen ( )', 50 );
	}
}
InitBlestshoppen ( );

// Activate menu item
_initplinktimout = 100;
function initProductLink ( )
{
	if ( document.getElementById ( 'Flash' ) )
	{
		var lis = document.getElementById ( 'TopMenu__' ).getElementsByTagName ( 'li' );
		if ( lis.length )
		{
			for ( var a = 0; a < lis.length; a++ )
			{
				if ( lis[ a ].className == 'li_produkter' || lis[ a ].className == 'li_products' )
				{
					lis[ a ].firstChild.className = 'current';
					return;
				}
			}
		}
	}
	else
	{
		_initplinktimout--;
		if ( _initplinktimout < 0 ) return;
		setTimeout ( 'initProductLink()', 50 );
	}
}
initProductLink ( );

_removewsf = 100;
function removeWebshopFuncs ( )
{
	if ( document.getElementById ( 'Nettbutikk' ) )
	{
		addImageEnlargementLink = function ( ){};
		var divs = document.getElementsByTagName ( 'div' );
		for ( var a = 0; a < divs.length; a++ )
		{
			if ( divs[ a ].className == 'Gallery' )
			{
				divs[ a ].childNodes[ 1 ].onclick = function(){};
				divs[ a ].childNodes[ 1 ].className = 'DetailImage';
				divs[ a ].childNodes[ 1 ].style.cursor = 'default';
				divs[ a ].childNodes[ 1 ].href = 'javascript: void(0)';
				return;
			}
		}
	}
	else
	{
		_removewsf--;
		if ( _removewsf < 0 ) return;
		setTimeout ( 'removeWebshopFuncs ( )', 50 );
	}
}
removeWebshopFuncs ( );



function setGoogleMap ( url, urlbig )
{
	if ( !urlbig ) 
	{
		urlbig = url;
		urlbig = urlbig.split ( '&amp;output=embed' );
		urlbig = urlbig[ 0 ];
	}
	var frn = document.getElementById ( 'googlemap' );
	var frnp = frn.parentNode;
	var nfr = document.createElement ( 'p' );
	var srcen = '<iframe width="445" height="260" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="' + url + '"></iframe>';
	var loc = document.location + '';
	var tx = loc.indexOf ( 'en/' ) > 0 ? 'See larger map' : 'Se større kart';
	srcen += '<a href="' + urlbig + '">' + tx + '</a>';
	nfr.innerHTML = srcen;
	frnp.parentNode.replaceChild ( nfr, frnp );
}


