function changedKleur(stam_id, kleur_id, voorraad_afbeelding) {
  toDay = new Date();
  datumtijd = toDay.getTime();
  var xmlHttp;
  try { xmlHttp = new XMLHttpRequest();
  } catch (e) { try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e) { return false; } } }
  xmlHttp.onreadystatechange = function() {
    if(xmlHttp.readyState == 4) {
      document.getElementById('voorraad_maat_div').innerHTML = xmlHttp.responseText;
      changedMaat('');
      document.getElementById('bestellenInfo').innerHTML = "";
      var kleurDiv = document.getElementById('kleuren');
      var kleurArr = document.getElementsByName('kleur_png');
      for(var i=0; i<kleurArr.length; i++) {
        kleurArr[i].src = '/images/detail/kleur.png';
      }
      var kleurObj = document.getElementById("kleur_" + voorraad_afbeelding + "-" + kleur_id);
      kleurObj.src = '/images/detail/kleur_active.png';
      if (voorraad_afbeelding != "") {
        document.getElementById('detailFoto').src  = '/viewdbimg.asp?id=' + voorraad_afbeelding + '&maxbreedte=280&maxhoogte=280';
        document.getElementById('detailLink').href = '/viewdbimg.asp?id=' + voorraad_afbeelding + '&amp;maxbreedte=800&amp;maxhoogte=500';
      }
    }
  }
  var xmlParams = "";
  xmlParams = xmlParams + "stam_id=" + stam_id + "&";
  xmlParams = xmlParams + "kleur_id=" + kleur_id + "&";
  xmlParams = xmlParams + "datumtijd=" + datumtijd + "&";      
  xmlHttp.open("GET", "/content/exec_voorraad_maten.asp?" + xmlParams, true);
  xmlHttp.send(null);
}
function changedMaat(voorraad_id) {
  toDay = new Date();
  datumtijd = toDay.getTime();
  var xmlHttp;
  try { xmlHttp = new XMLHttpRequest();
  } catch (e) { try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e) { return false; } } }
  xmlHttp.onreadystatechange = function() {
    if(xmlHttp.readyState == 4) {
      document.getElementById('voorraad_aantal_div').innerHTML = xmlHttp.responseText;
      document.getElementById('bestellenInfo').innerHTML = "";
    }
  }
  var xmlParams = "";
  xmlParams = xmlParams + "voorraad_id=" + voorraad_id + "&";
  xmlParams = xmlParams + "datumtijd=" + datumtijd + "&";      
  xmlHttp.open("GET", "/content/exec_voorraad_aantal.asp?" + xmlParams, true);
  xmlHttp.send(null);
}
function addToCart(stam_id, voorraad_id, voorraad_aantal) {
  toDay = new Date();
  datumtijd = toDay.getTime();
  var xmlHttp;
  try { xmlHttp = new XMLHttpRequest();
  } catch (e) { try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e) { return false; } } }
  xmlHttp.onreadystatechange = function() {
    if(xmlHttp.readyState == 4) {
      document.getElementById('bestellenInfo').innerHTML = xmlHttp.responseText;
    }
  }
  var xmlParams = "";
  xmlParams = xmlParams + "stam_id=" + stam_id + "&";
  xmlParams = xmlParams + "voorraad_id=" + voorraad_id + "&";
  xmlParams = xmlParams + "voorraad_aantal=" + voorraad_aantal + "&";
  xmlParams = xmlParams + "datumtijd=" + datumtijd + "&";      
  if (checkCookies() == false) {
    alert('Uw browser staat geen \'cookies\' toe,\ncontroleer uw instellingen in uw browser.');
  } else {
    xmlHttp.open("GET", "/content/exec_addtocart.asp?" + xmlParams, true);
    xmlHttp.send(null);
  }
}