function mete_producto(query_string){
	setTimeout("show_hidden_messenger(1,1);",100);
	//document.getElementById('div_carrito_compras').innerHTML="loading..";
	$("#div_carrito_compras").load("carrito_ajax.php?action=mete_producto&" + query_string );
	setTimeout("show_hidden_messenger(1,2);",1000);
}

function mete_pedido(query_string){
   var objetoAjax=objetus();
	setTimeout("show_hidden_messenger(1,1);",100);
	objetoAjax.open("GET","carrito_ajax.php?action=mete_pedido&" + query_string ,true);
	   objetoAjax.onreadystatechange=function() {
		if (objetoAjax.readyState==4) { 
			document.getElementById('div_carrito_pedido').innerHTML = objetoAjax.responseText;
			setTimeout("show_hidden_messenger(1,2);",1000);
		}
   }
   objetoAjax.send(null);
}

function elimina_producto(linea,id_prod){
	//document.getElementById('div_carrito_compras').innerHTML="loading..";
	$("#div_carrito_compras").load("carrito_ajax.php?action=elimina_producto&linea=" + linea + "&id_prod=" + id_prod);
}

function elimina_pedido(linea,id_prod){
	//document.getElementById('div_carrito_compras').innerHTML="loading..";
   var objetoAjax=objetus();
	objetoAjax.open("GET","carrito_ajax.php?action=elimina_pedido&linea=" + linea + "&id_prod=" + id_prod,true);
	   objetoAjax.onreadystatechange=function() {
		if (objetoAjax.readyState==4) { 
			document.getElementById('div_carrito_pedido').innerHTML = objetoAjax.responseText;
		}
   }
   objetoAjax.send(null);
}


function show_hidden_messenger(cart,text) {
	if(cart == 2) sh = 'hidden'; else { 
		sh = 'visible'; 	
		setTimeout("show_hidden_messenger(2,2);",5000); 
	}
	var texto = Array();
	texto[1] = "EL PRODUCTO FUE AGREGADO";
	texto[2] = "MIRAR EL MENU -> VER PEDIDO";

	border = document.getElementById('messenger_hidden_border');
	conten = document.getElementById('messenger_hidden_cart');

		border.style.visibility="visible";
		border.style.left=document.body.scrollLeft+(document.body.clientWidth/2)-190;
		border.style.top=document.body.scrollTop+(document.body.clientHeight/2)-160-10;
		conten.innerHTML = texto[text];
		conten.style.visibility = sh;

}

