function xmlhttpPost(strURL , id, quantity, quantity_basket) {
    var xmlHttpReq = false;
    var self = this;
		var quantity_new = Number(quantity) + Number(quantity_basket);
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText, id, quantity_new);            
        }
    }
    self.xmlHttpReq.send(getquerystring(id, quantity));
}

function getquerystring(id, quantity) {
    qstr = 'id=' + escape(id) + '&quantity=' + escape(quantity);  // NOTE: no '?' before querystring
    return qstr;
}

function updatepage(str, id, quantity_new){
		
    document.getElementById("result").innerHTML = str;
    document.getElementById("qb_"+id).innerHTML = quantity_new;
//    createIndicator(id);
}

function createIndicator(id)
{
  var indicator = document.getElementById('indicator_'+id);
    indicator.style.display = "block";
  document.getElementById("indicator_"+id).innerHTML = 'товар добавлен';
  setTimeout("deleteIndicator("+id+")",2000);
 }
function deleteIndicator(id)
{
  var indicator = document.getElementById('indicator_'+id);
    indicator.style.display = "none";
}