function add(nr) {
if (nr != "") {
ajaxsend(nr);
}
}

function ajaxsend(nr) {
var str = "nr=" + nr;
var url = "http://www.pazoen.com/addbag.php";
// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp32=new XMLHttpRequest();
		xmlhttp32.onreadystatechange = resiChange;
		xmlhttp32.open("POST", url, true);
		xmlhttp32.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
		xmlhttp32.send(str);
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp32=new ActiveXObject("Microsoft.XMLHTTP");
		if (xmlhttp32)
		{
			xmlhttp32.onreadystatechange = resiChange;
			xmlhttp32.open("POST", url, true);
			xmlhttp32.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
			xmlhttp32.send(str);
		}
	}
      
    }

function resiChange()
{

if (xmlhttp32.readyState==4)
  {
  if (xmlhttp32.status==200)
    {
data = xmlhttp32.responseText;
var ar = data.split(":");
if (parseInt(ar[0]) == 1) {
	document.getElementById("bagnr").innerHTML = parseInt(document.getElementById("bagnr").innerHTML)+1;
	document.getElementById("stat_" + ar[1]).innerHTML = "<img src=\"http://www.pazoen.com/images/ok.gif\" alt=\"ok\" />";
}
if (parseInt(ar[0]) == 2) {
	alert('Your bag is full');
}
	}
  }
}