function intPageHeight() {
	// http://www.quirksmode.org/viewport/compatibility.html
	var x,y;
	var test1 = document.body.scrollHeight;
	var test2 = document.body.offsetHeight
	if (test1 > test2) // all but Explorer Mac
	{
		//x = document.body.scrollWidth;
		y = document.body.scrollHeight;
	}
	else // Explorer Mac;
	//would also work in Explorer 6 Strict, Mozilla and Safari
	{
		//x = document.body.offsetWidth;
		y = document.body.offsetHeight;
	}
	return y;
}

function intScreenHeight() {
	// http://www.quirksmode.org/viewport/compatibility.html
	var x,y;
	if (self.innerHeight) // all except Explorer
	{
		// x = self.innerWidth;
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
	{
		// x = document.documentElement.clientWidth;
		y = document.documentElement.clientHeight;
	}
	else if (document.body) // other Explorers
	{
		// x = document.body.clientWidth;
		y = document.body.clientHeight;
	}
	
	return y;
}


function setMargeKolomHeight(){	

	if ((pageType=="index") || (pageType=="content") || (pageType=="popup")) {	
		headerHeight=getElt('header').offsetHeight;
		intFtHeight=getElt('theFooter').offsetHeight;		
		margeKolomHeight=getElt('margeKolom').offsetHeight;
		// bekijk welk element hoger is: contentveld of menu
		if (getElt('allecontent').offsetHeight > getElt('margeKolom').offsetHeight) {			
			intContentHeight=getElt('allecontent').offsetHeight;			
		} else {
			intContentHeight=getElt('margeKolom').offsetHeight;			
		}
		if (pageType=="popup"){
	
			intContentHeight=getElt('allecontent').offsetHeight;
			getElt("margeKolom").style.height=intContentHeight - 104;
			getElt("margeKolom").style.visibility='visible';
			margeblokUpdate()
		}
				
		
		if (pageType=="content") {
			/* content pagina, opbouw als volgt:
			[header]
			[navsmall]
			[allecontent]
			[footer]
			
			Bijzonderheid is dat de derde kolom in de allecontent div, soms, grijs moet zijn... deze kolom heeft als div id "margeKolom" en reageert op de variable fillUpThirdKol.
			*/
			//navHeight=getElt('navSmall').offsetHeight;
			// content pagina laat volledig menu zien
			
			navHeight=getElt('navSmall').offsetHeight;
			getElt('allecontent').style.top=headerHeight + navHeight;			
			
			if (fillUpThirdKol) {	
				
				getElt("margeKolom").style.top=headerHeight + navHeight;
				getElt("margeKolom").style.height=intContentHeight;
				try {
					getElt("margeKolomInhoudLinks").style.height=intContentHeight;
					getElt("margeKolomInhoudRechts").style.height=intContentHeight;
				} catch (e) {
				}
				getElt("margeKolom").style.visibility='visible';
			}
		}
		
		if  (pageType=="index") {
			/* index pagina, opbouw als volgt:
			[header]			
			[topnav]
			[allecontent]
			[footer]
			*/			
			getElt('topnav').style.top=headerHeight;
			navHeight=getElt('topnav').offsetHeight;			
			getElt('allecontent').style.top=headerHeight + navHeight;
			
		}
		
		getElt("theFooter").style.top=headerHeight + navHeight + intContentHeight;
		
		if (intContentHeight-margeKolomHeight<100) {
			// Geen ruimte voor margeblok. Bij gebrek aan een betere optie: verberg het.
			getElt('margeBlok').style.visibility='hidden';
		}
		
		// voor navigatie.js moet margeBlokMaxBottom gezet worden		
		margeBlokMaxBottom = parseInt(getElt('theFooter').style.top) - 70;
	} else {
		// sorry? onbekend paginatype? 
	}
}