        function sendRequest(idform) {
            var oForm = document.getElementById(idform);
            var sBody = getRequestBody(oForm);
        
            var oXmlHttp = zXmlHttp.createRequest();
            oXmlHttp.open("post", oForm.action, true);
            oXmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            
            oXmlHttp.onreadystatechange = function () {
                if (oXmlHttp.readyState == 4) {
                    if (oXmlHttp.status == 200) {
                        saveResult(oXmlHttp.responseText);
                    } else {
                        saveResult("An error occurred: " + oXmlHttp.statusText);
                    }
                }            
            };
            oXmlHttp.send(sBody);        
        }
        
        function getRequestBody(oForm) {
            var aParams = new Array();
            
            for (var i=0 ; i < oForm.elements.length; i++) {
                var sParam = encodeURIComponent(oForm.elements[i].name);
                sParam += "=";
                sParam += encodeURIComponent(oForm.elements[i].value);
                aParams.push(sParam);
            } 
            
            return aParams.join("&");        
        }
        
        function saveResult(sMessage) {
            var totale = document.getElementById("totale");
            totale.innerHTML = sMessage;
			alert("Prodotto aggiunto nel carrello");
        }