function shopping_cart(strURL, loading) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
	self.xmlHttpReq = new XMLHttpRequest();
    }
    else if (window.ActiveXObject) {
      self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('GET', strURL, true);
	self.xmlHttpReq.onreadystatechange = function() {
          if (self.xmlHttpReq.readyState == 4) {
            updateshop(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(null);
}

function updateshop(str){

	if (str=="#REDIRECT#") {
	alert("text")
	}
	else{
    document.getElementById("containerShoppingCart").innerHTML = str;
}
}

function updatecart(strURL, nf) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) {
	self.xmlHttpReq = new XMLHttpRequest();
    }
    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) {
            updateqta(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(u(nf));
  }
function u(nf) {
	var nomeform   = (""+nf+"")
    var form  = document.forms["f"+nomeform+""];

    var idp = form.idp.value;
    var qta = form.qta.value;
	qstr = 'idp=' + unescape(idp) + '&qta=' + unescape(qta);

    return qstr;
}
function updateqta(str){
    document.getElementById("containerShoppingCart").innerHTML = str;
	//Richiesta('', 0, 0)
}


