function setDivHeight() {    var wrapper_div = document.getElementById('wrapper');    var headerFooterHeight = 200; //gedeelte wat niet hoeft te worden opgevuld      var bodyH = getCurPageSize();    var contentDiv = document.getElementById('mainContent');
    var contentH = contentDiv.offsetHeight;
    var totalContentH = contentH + headerFooterHeight;
    windowHeight=bodyH[3];
    pageHeight=bodyH[1];
    //resthoogte    if(totalContentH<windowHeight) {
        var divHeight = windowHeight - 4;
    } else {
        var divHeight = totalContentH - 4;
    }
    //alert(contentH);
    wrapper_div.style.height = divHeight+'px';    wrapper_div.style.display = 'block';}
function getCurPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
// WEBSHOP IMG ROLLOVER 
function set_webshop_rollover() {
    var web_img_2 = new Image();    web_img_2.src = "_img/webshop_img_link_2.png";    

    var web_link = document.getElementById('webshop_li_a');
    var web_link_img = document.getElementById('webshop_link_img');
    web_link.onmouseover=function() {
        web_link_img.src="_img/webshop_img_link_2.gif";
    }
    web_link.onmouseout=function() {
        web_link_img.src="_img/webshop_img_link.gif";
    }
}  
// addLoadEvent()
// Adds event to window.onload without overwriting currently assigned onload functions.
// Function found at Simon Willison's weblog - http://simon.incutio.com/
//
function addLoadEvent(func) {	
	var oldonload = window.onload;
	if (typeof window.onload != 'function'){
    	window.onload = func;
	} else {
		window.onload = function(){
		oldonload();
		func();
		}
	}
}
addLoadEvent(setDivHeight);
// addLoadEvent(set_webshop_rollover);
window.onresize= setDivHeight;
