//var sel = 'S1';  //hier kun je het open menu ID globaal meegeven (S0 tm S5)

function initSel() {//body onload goede menu uitklappen
	if(sel == '') {//als er geen var sel globaal wordt mee gegeven, uit de html halen
	 sel = document.getElementById('selected').parentNode.id;
	}
	if(sel != 'S0')document.getElementById(sel).style.display = 'block';
}



function ToggleSub(num) {
	//num=submenu number
	str = sel.replace(/S/, "");
	if(num!=str){//bij klik op uitgeklapte geselecteerde menu gebeurt er niets
	for (var i=1;i<6;i++) {//alles inklappen, behalve geselcteerde menu
	if(i!=str)document.getElementById('S'+i).style.display = 'none';
	}
	document.getElementById('S'+num).style.display = 'block';
	}
}

/* Wrapper that correctly adds a handler to the window.onload event */
function appendOnLoad(fFunction){
	if (typeof fFunction == 'function') {
		fNew = fFunction
	} else {
		//assume string
		
		fNew = new Function(fFunction)
	}

	window.attachEvent('onload',fNew)

}

/* Wrapper that correctly adds a handler to the window.onresize event */
function appendOnResize(fFunction){
	if (typeof fFunction == 'function') {
		fNew = fFunction
	} else {
		//assume string
		fNew = new Function(fFunction)
	}
	window.attachEvent('onresize',fNew)
}
