function createHTTPHandler(){
    httphandler = false;
    /*@cc_on @*/
    /*@if (@_jscript_version >= 5)
    // JScript gives us Conditional compilation, we can cope with old IE versions.
    // and security blocked creation of the objects.
    try {
      httphandler = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
       httphandler = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
          httphandler = false;
      }
    }
    @end @*/
    if (!httphandler && typeof XMLHttpRequest!='undefined') {
        httphandler = new XMLHttpRequest();
    }
    return httphandler;
}

function wait(millis)
{
	var date = new Date();
	var curDate = null;

	while(curDate-date < millis)
	{
		curDate = new Date();
	}
}

function Ontbijt(action, categorie_id, id, type, aantal)
{
	var GetFile = './assortiment.php?action=' + action + '&id=' + id + '&aantal=' + aantal + '&categorie_id=' + categorie_id + '&type=' + type;
	var XMLHTTPObject = createHTTPHandler();
	XMLHTTPObject.open('GET', GetFile, true);
	XMLHTTPObject.setRequestHeader("Cache-Control", "no-cache");
	XMLHTTPObject.setRequestHeader("X_USERAGENT", "NmpBROODJES");

	XMLHTTPObject.onreadystatechange=function()
	{
	    if (XMLHTTPObject.readyState==4)
	    {
			//alert(XMLHTTPObject.responseText);
	    }
	}
	XMLHTTPObject.send(null);
}

function Reload()
{
	wait(200);
	document.location = document.location;
}
