var windowHeight = null;
var hNavigation = null;
var divNavigation = null;
var divContainer = null;
function autoheight () {
	divContainer = document.getElementById('container');
	divContent = document.getElementById('content');
	divNavigation = document.getElementById('navigation');
	divMoodimage = document.getElementById('moodimage_1');
	divHeader = document.getElementById('header');
	divAction = document.getElementById('actioncontent');
	divAction.style.height = '';
	divPartnerlogos = document.getElementById('partnerlogos');

	offset = 0;
	hWindow = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0);
	hContent = divContent.offsetHeight;
	hHeader = divHeader.offsetHeight;
	hMoodimage = divMoodimage.offsetHeight;
	hNavigation = divNavigation.offsetHeight + offset;
	hAction = divAction.offsetHeight;
	hActionbanner = 60 // zwarte banner boven actiefoto
	hPartnerlogos = divPartnerlogos.offsetHeight;
 	if (template != 'home') {
 		hNavigation = 0;
 	} else {
 	}
	if (hContent < hAction) hContent = hAction;
	hContainer = hContent + hMoodimage + hHeader+hNavigation;
	divAction.style.height = '100%';
	divAction.style.top = hHeader+hMoodimage+2+'px';
	if (hContainer < hWindow) {
		divContainer.style.height = hWindow-1+'px';
	} else {
		hContainer =  hContainer-1+hActionbanner;
		divContainer.style.height = hContainer+'px';
	}



 	if (template == 'home') {
		divNavigation.style.position='absolute';
		windowHeight = hWindow;
		hNavigation = hNavigation;
		topNavigation = windowHeight - hNavigation;
		divNavigation.style.top = topNavigation + 'px';
		setInterval('posNavigation()',500);
 	}
}

function posNavigation() {
	myScrollOffsets = document.viewport.getScrollOffsets();
	windowHeight = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0);
	divNavigation = document.getElementById('navigation');
	hNavigation = divNavigation.offsetHeight + offset;
	topNavigation = windowHeight - hNavigation;
	divNavigation.style.top = (topNavigation + myScrollOffsets.top) + 'px';
}


