// --- (c) 2007, script code by www.doran.be

var currCatSelected = '';

function catcontent_init() {
	if (document.getElementById && document.createTextNode) {
		var arrMainCats = ['parlementairevoorbereiding','wetgeving','rechtspraak'];
		for(i = 0; i < arrMainCats.length; i++) {
			if (document.getElementById(arrMainCats[i] + '_content')) {
				currObj = document.getElementById(arrMainCats[i] + '_content');
				currObj.style.display = 'none';
				currObj.style.visibility = 'hidden';
				}
			document.getElementById(arrMainCats[i] + '_handler').onclick = function() { catcontent_show(this.getAttribute('id')); }
			document.getElementById(arrMainCats[i]).onmouseover = function() {
				if (this.className != 's') { this.className = 'on'; }
				this.onmouseout = function() {
					if (this.className != 's') { this.className = ''; }
					}
				}
			}
		}
	}
function catcontent_show(catname) {
	catname = catname.replace(/_handler/, '');
	if (currCatSelected) { catcontent_hide(currCatSelected); }
	if (currCatSelected != catname) {
		currCatSelected = catname;
		currObj = document.getElementById(catname);
		currObj.className = 's';
		currObj.style.height = 'auto';
		if (document.getElementById(catname + '_content')) {
			parentObjPos = getAbsPos(currObj);
			currObj = document.getElementById(catname + '_content');
			currObj.style.display = 'block';
			currObj.style.visibility = 'visible';
			currObj.style.position = 'absolute';
			currObj.style.left = parentObjPos[0] + 'px';
			currObj.style.top = (parentObjPos[1] + 100) + 'px';
			currObj.style.zIndex = 50;
			document.getElementById('info').style.display = 'none';
			document.getElementById('footer').style.display = 'none';
			}
	} else {
		document.getElementById(catname).className = 'on';
		currCatSelected = '';
		}
	}
function catcontent_hide(catname) {
	currObj = document.getElementById(catname);
	currObj.className = '';
	currObj.style.height = '100px';
	if (document.getElementById(catname + '_content')) {
		currObj = document.getElementById(catname + '_content');
		currObj.style.display = 'none';
		currObj.style.visibility = 'hidden';
		currObj.style.zIndex = 0;
		}
	document.getElementById('info').style.display = 'block';
	document.getElementById('footer').style.display = 'block';
	}