var ballon1 = "<div id='tekstvlak' style='overflow-y:scroll'><div style='padding:20px'><div id='fotoSluiten' style='float:right'><a href='javascript:void(0)' onClick='unload()'>Sluiten</a></div>";
//var ballon2 = "</div></div>";

function ahah(url, target) {
  document.getElementById(target).innerHTML = ballon1 + 'Inhoud aan het laden...' + "<br><br><a href='javascript:void(0)' onClick='unload()'>Terug</a></div></div>";
  resizeBallon();
  if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (req != undefined) {
    req.onreadystatechange = function() {ahahDone(url, target);};
    req.open("GET", url, true);
    req.send("");
  }
}
function ahahDone(url, target) {
  if (req.readyState == 4) { // only if req is "loaded"
    if (req.status == 200) { // only if "OK"
      document.getElementById(target).innerHTML = ballon1 + req.responseText + "<br><br><a href='javascript:void(0)' onClick='unload()'>Terug</a></div></div>";
	  resizeBallon();
    } else {
      document.getElementById(target).innerHTML = ballon1 + "Error:\n"+ req.status + "\n" +req.statusText + "<br><br><a href='javascript:void(0)' onClick='unload()'>Terug</a></div></div>";
	  resizeBallon();
    }
  }
}
function load(name, div) {
	document.getElementById('content').style.display = '';
	ahah(name,div);
	//return false;
}
function unload() {
	//ahah('pagina/leeg.htm','inhoud');
	document.getElementById('content').style.display = 'none';
}