function createHTTPHandler(){
    httphandler = false;

    try {
      httphandler = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
       httphandler = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (E) {
          httphandler = false;
      }
    }

    if (!httphandler && typeof XMLHttpRequest!='undefined') {
        httphandler = new XMLHttpRequest();
    }
    return httphandler;
}

function giveSpecials(aantalSpecials, user_id, plaats) {

   var specialsContainer = document.getElementById('specialsContainer');
   var PostForm = 'user='+user_id+'&plaats='+plaats+'&specials='+aantalSpecials;

   specialsContainer.innerHTML = 'Even wachten..';

   var xmlhttp = null;
   var xmlhttp = createHTTPHandler();

   if (xmlhttp) {
   xmlhttp.onreadystatechange=xmlhttpChange
   xmlhttp.open("POST","/ajax/givespecials.php",true)
   xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
   xmlhttp.setRequestHeader("Cache-Control", "no-cache");
   xmlhttp.setRequestHeader("X_USERAGENT", "Jm2_Ajax");
   xmlhttp.setRequestHeader('Connection', 'close');
   xmlhttp.send(PostForm)
   }


   function xmlhttpChange() {
      if (xmlhttp.readyState==4) {
      specialsContainer.innerHTML = xmlhttp.responseText;
      }
   }

}