var sub=false;
var toelichting=false;

function getNextSibling(startBrother){
  endBrother=startBrother.nextSibling;
  while(endBrother.nodeType!=1){
    endBrother = endBrother.nextSibling;
  }
  return endBrother;
}

function toggleShow(obj) {
  var nextElement=getNextSibling(obj.parentNode);
  if (nextElement.className == 'noshow') {
    nextElement.className = 'show';
  }
  else {
    nextElement.className='noshow';
  }
}

function showtoelichting() {
  if (toelichting) {
    document.getElementById("toelichtingsdiv").lastChild.value=toelichting;
  }
  document.getElementById("toelichtingsdiv").className='show';
  toelichting=false;
}

function removetoelichting() {
  if (!toelichting) {
    toelichting=document.getElementById("toelichtingsdiv").lastChild.value;
  }
  document.getElementById("toelichtingsdiv").className='noshow';
  /* Dit verwijdert de inhoud van de div... niet handig? */
  /* document.getElementById("toelichtingsdiv").lastChild.value='';
  */
}

function toggleToelichting() {
	if (document.getElementById("toelichtingsdiv").className == 'show')
		document.getElementById("toelichtingsdiv").className = 'noshow';
	else
		document.getElementById("toelichtingsdiv").className = 'show';
}

function showsubopties() {
  if (sub) {
    document.getElementById("suboptiediv").innerHTML=sub;
  }
  document.getElementById("suboptiediv").className='show';
  sub=false;
}

function removesubopties() {
  if (!sub) {
    sub=document.getElementById("suboptiediv").innerHTML;
  }
  document.getElementById("suboptiediv").className='noshow';
  document.getElementById("suboptiediv").innerHTML='';
}
