function initFaqList() {
	selector = 0;
	qbox = document.getElementById('vraag');
	abox = document.getElementById('antwoord');

	qlinks = qbox.getElementsByTagName('a');
	aboxes = abox.getElementsByTagName('div');


	// find the selected
	for (i=0;i<qlinks.length;i++) {
		qlinks[i].onclick = showAnswer;
		if (qlinks[i].className == 'selected') selector = i;
	}
	// open the selected
	aboxes[selector].style.display = 'block';
}

function showAnswer() {
	abox = document.getElementById('antwoord');
	aboxes = abox.getElementsByTagName('div');
	for (i=0;i<qlinks.length;i++) {
		qlinks[i].className = '';
		if (qlinks[i] == this) selector = i;
	}
	this.className = "selected";
	for (j=0;j<aboxes.length;j++) {
		aboxes[j].style.display = 'none';
	}
	aboxes[selector].style.display = 'block';
	
	if (document.styleSheets[1].href.indexOf('workpower')!=-1) {
		window.scrollTo(0,findPosY(aboxes[selector]));
		//alert(aboxes[selector].offsetTop);
	}
	return false;
}

function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		while (obj.offsetParent) {
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	} else if (obj.y) {
		curtop += obj.y;
	}
	
	return curtop;
	
}

if (window.addEventListener) window.addEventListener("load", initFaqList, false)
else if (window.attachEvent) window.attachEvent("onload", initFaqList)
else if (document.getElementById) window.onload=initFaqList