function http() {
  var http;
  if (window.XMLHttpRequest) { 
    http = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    http = new ActiveXObject("Microsoft.XMLHTTP");
  }
  return http;
}

var xhr;
var ware_id;
function process(wid){
	xhr=http();
	ware_id=wid;
	var send_post="wid="+wid+"&wk="+document.getElementById("wk"+wid).value;
	if (document.getElementById("wg"+wid)) send_post=send_post+"&wg="+document.getElementById("wg"+wid).value;
	xhr.open("POST", "warenkorb.php", true);
	xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xhr.onreadystatechange=datenAusgeben;
	xhr.send(send_post);
}
