var xmlhttp

function loadXMLDoc(url)
{
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  xmlhttp.onreadystatechange=state_Change
  xmlhttp.open("GET",url,true)
  xmlhttp.send(null)
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
    if (xmlhttp)
    {
    xmlhttp.onreadystatechange=state_Change
    xmlhttp.open("GET",url,true)
    xmlhttp.send()
    }
  }
}

function state_Change()
{
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
	{
  // if "OK"
		  if (xmlhttp.status==200)
		{
			  document.getElementById('xmlhttp_response').innerHTML=xmlhttp.responseText
		}
			else
		{
			alert("Problem retrieving data:" + xmlhttp.statusText)
		}
	}
}


/* toon het block met het zoekresultaat wel of niet, afhankelijk van de zoekterm, of als er op 'sluit venster' wordt geklikt */

function toggle(zoek) {
	if (zoek.length < 2) {
		document.getElementById('xmlhttp_response').style.display = 'none';
	} else {
		document.getElementById('xmlhttp_response').style.display = 'block';
	}
}

function hide() {
	document.getElementById('xmlhttp_response').style.display = 'none';
}

