function GetXmlHttpObject(handler)
{
   var objXMLHttp=null
   if (window.XMLHttpRequest)
   {
       objXMLHttp=new XMLHttpRequest()
   }
   else if (window.ActiveXObject)
   {
       objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
   }
   return objXMLHttp
}

function stateChanged()
{
   if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
   {
	   
           document.getElementById("txtResult").innerHTML= xmlHttp.responseText;
		
		   clear_wachten();
   }
   else {
           //alert(xmlHttp.status);
   }
}

// Will populate data based on input
function htmlData(url, qStr)
{
   if (url.length==0)
   {
       document.getElementById("txtResult").innerHTML="";
	   
       return;
   }
   xmlHttp=GetXmlHttpObject()
   if (xmlHttp==null)
   {
       alert ("Browser does not support HTTP Request");
       return;
   }

   url=url+"?"+qStr;
   url=url+"&sid="+Math.random();
   xmlHttp.onreadystatechange=stateChanged;
   xmlHttp.open("GET",url,true) ;
   xmlHttp.send(null);
}






function wachten () {
	
	document.getElementById('momentje').style.display = "block";
	if(navigator.appName == 'Microsoft Internet Explorer')
	{
		document.getElementById('momentje').innerHTML = 'Bestemmingen worden opgehaald. <img id="loading-image" src="/images/loader.gif" />';
	}	
}

function wachten_sort() {
	
	document.getElementById('momentje_sort').style.display = "block";
	if(navigator.appName == 'Microsoft Internet Explorer')
	{
		document.getElementById('momentje_sort').innerHTML = 'Accomodaties worden weggehaald. <img id="loading-image" src="/images/loader.gif" />';
	}	
}

function clear_wachten_sort() {
	document.getElementById('momentje_sort').style.display = "none";	
}

function clear_wachten() {
	document.getElementById('momentje').style.display = "none";
	
}