
var isIE = false;

function fixmsie()
{
	if (!isIE) return;
	var s = getPageSize();
	var h = s[1] > s[3] ? s[1] : s[3];
	var els = ['scrollhide', 'menu', 'content', 'copyright'];
	var l = document.getElementById('leftbar');
	var height = 0;
	for (var i = 0; i < els.length; i++) {
		height += document.getElementById(els[i]).offsetHeight;
	}
	height += 50;
	l.style.height = (height > s[3] ? height : s[3]) + 'px';
}

function showbig(el)
{
	var pageScroll = getPageScroll();
	var pageSize = getPageSize();
	var c = document.createElement('DIV');
	c.id = 'modal';
	var dimw = pageSize[2];
	var dimh = pageSize[3];
	c.style.width = document.body.offsetWidth + 'px';
	c.style.height = pageSize[1] + 'px';
	var i = document.createElement('IMG');
	i.className = 'bigimg';
	i.onclick = function() { closebig(this); };
	var b = dimw > dimh ? dimh : dimw;
	i.src = (el.href + '&b=' + (b - 64));
	i.onload = function() {
		var pageScroll = getPageScroll();
		var pageSize = getPageSize();
	    var dimw = pageSize[2] + (document.body.scrollLeft ? document.body.scrollLeft : 0);
    	var dimh = pageSize[3] + (document.body.scrollTop ? document.body.scrollTop : 0);

		var mv = (pageSize[3] - this.offsetHeight) / 2 + pageScroll[1];
		var mh = (pageSize[2] - this.offsetWidth) / 2 + pageScroll[0];
		this.style.top = mv + 'px';
		this.style.left = mh + 'px';
		this.style.visibility = 'visible';
	};
	document.body.appendChild(c);
	document.body.appendChild(i);
}

function closebig(el)
{
	var p = el.parentNode;
	p.removeChild(el);
	var m = document.getElementById('modal');
	document.body.removeChild(m);
}

function getPageScroll()
{
	var scrOfX = 0, scrOfY = 0;
	if (typeof(window.pageYOffset) == 'number') {
	    //Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	} else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}
	return [scrOfX, scrOfY];
}

function getPageSize()
{
	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;
	}
	return [pageWidth, pageHeight, windowWidth, windowHeight];
}


function switchen()
{
	document.location.href = '?open=boekingen&mo=' + document.forms['datum'].elements['maand'].value + '&yr=' + document.forms['datum'].elements['jaar'].value;
}

