var col1, col2, col3;
function initcol1 ( )
{
  if ( document.getElementById ( 'Col1' ) )
  {
	// 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 );

  	var ch = getElementHeight (document.getElementById (  'Col1' ) );
  	var dh = getDocumentHeight ( );
    if ( ch > dh )
    {
      var ar = Array ( 'Col1', 'TopMenu__', 'Col2', 'UnderCol1' );
      if ( !document.getElementById ( 'Col2Broad' ) )
      	ar.push ( 'Footer' );
      for ( var a = 0; a < ar.length; a++ )
      {
         var ele = document.getElementById ( ar[a] );
         if ( !ele ) continue;
         if ( ele.style.position == 'absolute' )
         	continue;
         ele.style.position = 'absolute';
         ele.style.top = ( getElementTop ( ele ) - 32 ) + 'px';
      }
    }
  }
  else setTimeout ( 'initcol1()', 50 );
}
function columnorder ( ){  }
initcol1 ( );
window.onresize = function ()
{
	initcol1 ( );
}

window.onscroll = function ( )
{
	var y;
	if ( window.scrollTop )
		y = window.scrollTop;
	else y = window.pageYOffset;
	var l = document.location + '';
	if ( l.match ( /online_bestilling/ ) )
	{
		setCookie ( 'webshopPageTop', y );
	}
}
function initScrolling ()
{
	if ( document.getElementById ( 'Footer__' ) )
	{
		var l = document.location + '';
		if ( l.match ( /online_bestilling/ ) )
		{
			if ( getCookie ( 'webshopPageTop' ) )
			{
				window.scrollTo ( 0, getCookie ( 'webshopPageTop' ) );
				setCookie ( 'webshopPageTop', getCookie ( 'webshopPageTop' ) );
			}
		}
		else setCookie ( 'webshopPageTop', '' );
	}
	else setTimeout ( 'initScrolling()', 50 );
}
initScrolling();