var sendReq = GetXmlHttpObject();
var delReq = delGetXmlHttpObject();
function GetXmlHttpObject()
{
var sendReq=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 sendReq=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  sendReq=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  sendReq=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return sendReq;
}
function delGetXmlHttpObject()
{
var delReq=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 delReq=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  delReq=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  delReq=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return delReq;
}

			function inviodaticarrello(idart,qta,tipo) {	
				if (sendReq.readyState == 4 || sendReq.readyState == 0) {
					sendReq.open("POST", 'addcarrello.php?insert=1', true);
					sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
					sendReq.onreadystatechange = handleSendChat; 
					var param = 'idarticolo='+idart;//+ escape(document.getElementById('id').value);
					param += '&qta='+qta;
					param += '&tipo='+tipo;
					sendReq.send(param);
					//document.getElementById('txt_message').value = '';
				}							
			}
			//When our message has been sent, update our page.
			function handleSendChat() {
				//Clear out the existing timer so we don't have 
				//multiple timer instances running.
				//clearInterval(mTimer);
				//getChatText();
				show_stato_carrello(0);
				show_totale_carrello(0,1);
				show_elenco_carrello(0);
			}
				function inviodaticarrello1(idart,qta,tipo) {	
				if (sendReq.readyState == 4 || sendReq.readyState == 0) {
					sendReq.open("POST", 'addcarrello.php?insert=1', true);
					sendReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
					sendReq.onreadystatechange = handleSendChat1; 
					var param = 'idarticolo='+idart;//+ escape(document.getElementById('id').value);
					param += '&qta='+qta;
					param += '&tipo='+tipo;
					sendReq.send(param);					
				}							
			}
			//When our message has been sent, update our page.
			function handleSendChat1() {
				//Clear out the existing timer so we don't have 
				//multiple timer instances running.
				//clearInterval(mTimer);
				//getChatText();
				quantira=quantita+tmpqta;
				show_stato_carrello(0);
				show_elenco_carrello(0);				
			}
			function deletedaticarrello(idcarrello) {	
				if (delReq.readyState == 4 || delReq.readyState == 0) {
					delReq.open("POST", 'delcarrello.php?delete=1', true);
					delReq.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
					delReq.onreadystatechange = handle; 
					var param = 'idcarrello='+idcarrello;//+ escape(document.getElementById('id').value);					
					delReq.send(param);					
				}							
			}
			//When our message has been sent, update our page.
			function handle() {
				//Clear out the existing timer so we don't have 
				//multiple timer instances running.
				//clearInterval(mTimer);
				//getChatText();
				show_stato_carrello(0);
				show_elenco_carrello(0);				
			}