function xmlhttpPost(strURL , old_id, limit) {
    var xmlHttpReq = false;
    var self = this; 
	var old_id = old_id;
	var limit = limit;
    $('#akcia').fadeOut(1500);
	// 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) {
            setTimeout("updatepage(self.xmlHttpReq.responseText, old_id)", 1500);            
        }
    }
    self.xmlHttpReq.send(getquerystring(old_id, limit));
}

function getquerystring(old_id, limit) {
	qstr = 'usl=' + escape(old_id) + '&limit=' + escape(limit);  // NOTE: no '?' before querystring
    return qstr;
}

function updatepage(str, old_id){
		
    document.getElementById("akcia").innerHTML = str;
	$('#akcia').fadeIn(1500);
    document.getElementById("old_id").innerHTML = old_id;
    //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";
}
