function DoCallback(data, url)
{
  // branch for native XMLHttpRequest object
  if (window.XMLHttpRequest)
  {
    req = new XMLHttpRequest();
    req.onreadystatechange = processReqChange;
    req.open('POST', url, true);
    req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    req.send(data);
  // branch for IE/Windows ActiveX version
  }
  else if (window.ActiveXObject)
  {
    req = new ActiveXObject('Microsoft.XMLHTTP')
    if (req)
    {
      req.onreadystatechange = processReqChange;
      req.open('POST', url, true);
      req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      req.send(data);
    }
  }
}

function processReqChange()
{
  // only if req shows 'loaded'
  if (req.readyState == 4)
  {
    // only if 'OK'
    if (req.status == 200)
    {
      eval(what);
    }
    else
    {
      alert('There was a problem retrieving the XML data: ' +
      req.responseText);
    }
  }
}

var what = "SetWinkelmand(req.responseText)";

function UpdateWinkelmand(product_id, aantal)
{
  DoCallback("product_id="+product_id+"&aantal="+aantal, "javascript/updatewinkelmand.php");
}

function SetWinkelmand(respons)
{
  parts = respons.split('|');
  document.getElementById('totaal').innerHTML = parts[0];
  document.getElementById('totaal_top').innerHTML = parts[0];
  document.getElementById('items_top').innerHTML = parts[1];

}
