// ved sideload
window.onload = function() {
resize_divscroll();
forsidecheck();
 getPageSizeWithScroll();
}

// ved sideresize
window.onresize = function() {
 resize_divscroll();
 forsidecheck();
 getPageSizeWithScroll();
}


function resize_divscroll() {

		
  var myWidth = 0, myHeight = 0;
  
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  /*window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );*/  
 
  
  myHeight = myHeight - 25;
    
  document.getElementById("indhold_holder").style.height= myHeight+"px";
 
}

function getPageSizeWithScroll()
	{     
		if (window.innerHeight && window.scrollMaxY) {// Firefox
			yWithScroll = window.innerHeight + window.scrollMaxY;         
			xWithScroll = window.innerWidth + window.scrollMaxX;     } 
		
		else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac 
			yWithScroll = document.body.scrollHeight;        
			xWithScroll = document.body.scrollWidth;     } 
		
		else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari         
			yWithScroll = document.body.offsetHeight;         
			xWithScroll = document.body.offsetWidth;       
			
			}     
			arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);     
			
			//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );    

		
			
			if(yWithScroll > 629 )
			{
			   
			   newheight = yWithScroll - 253;
			   document.getElementById("indhold").style.minHeight= newheight+"px";
			}
					
			
			return newheight;
  
}


// udskriver css på baggrund af browserdata
function forsidecheck() {
	if (browser_type == "Explorer" && browser_version < 7) {
		if(document.getElementById("forsidefoo")) {
	  document.getElementById("midt").style.width = 288 + 'px';
	  
	  newheightie6 = getPageSizeWithScroll();
	  document.getElementById("indhold").style.height= newheightie6+"px";
	  
	 }
	}
}
