// JavaScript Document
function toggleUitleg(o){
	if (o.className == 'uitleg'){
		o.className = 'hide';	
	} else {
		o.className = 'uitleg';
		o.onclick = function(){
			toggleUitleg(o);	
		}
	}
}

function formInit(){
	var uitlegBox, openBox, openBoxText, openBoxExtraText;
	uitlegBox = document.getElementsByTagName('span');
	
	for (var i=0;i<uitlegBox.length;i++){
		if (uitlegBox[i].className == 'uitleg'){
			uitlegBox[i].className = 'hide';
			openBox = document.createElement('a');
			
			openBoxImg = document.createElement('img');
			openBoxImg.src = '/images/layout/uitleg_knop_icoon.gif';
			openBoxImg.setAttribute('height', '11');
			openBoxImg.setAttribute('width', '11');
			openBoxImg.setAttribute('border', '0');
			openBoxImg.setAttribute('class','uitlegIcoon');
			openBoxImg.setAttribute('alt', 'uitleg');
			
			openBox.appendChild(openBoxImg);			
			openBox.setAttribute('href', '#');
			openBox.setAttribute('class', 'uitlegLink');
			openBox.setAttribute('title', 'meer toelichting over deze vraag...');
			openBox.onclick = function(){
				toggleUitleg(this.nextSibling.nextSibling.nextSibling);
				return false;
			}
			uitlegBox[i].parentNode.insertBefore(openBox, uitlegBox[i].previousSibling.previousSibling);
		}
	}
}
window.onload = function(){
	formInit();
}
