function objetoAjax(){
	var xmlhttp=false;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
  		}
	}

	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}



function TPVsend(){

        //alert("dins");
		
        ajax=objetoAjax(); 
        
        ajax.open("GET", "cistella3send.php", true); 
		
        ajax.onreadystatechange=function(){
                if(ajax.readyState==1){
                        //contenido.innerHTML = "Cargando...";
                        
                }else if(ajax.readyState==4){
				
                        if(ajax.status==200){	
							
                                //mostramos los datos dentro de la div
                               document.compra.submit();		
								
								
                        }else if(ajax.status==404){
                                //contenido.innerHTML = "La página no existe";
                        }
						else{
                                //mostramos el posible error
                                //contenido.innerHTML = "Error:".ajax.status; 
                        }
                }
        }
        ajax.send(null);
}
