// JavaScript Document
function Paginar(NumPag, datex){
   var campo=datex+"pageNum_list:" + NumPag;
   $("#listadoProductos").load("inc_resultado_materiales.php",{dat:campo},function(){});
}
function MuestraListado(){
	
	var campo=""; 
	$("#BuscadorProductos > div > input").each(function(){
	  campo +=$(this).attr("id") + ":" + $(this).attr("value") + ";";											  
	});
	$("#BuscadorProductos > div > select").each(function(){
	  campo +=$(this).attr("id") + ":" + $(this).attr("value") +  ";";											  
	}); //alert(campo);
	  campo +="pageNum_list:0";
	$("#listadoProductos").load("inc_resultado_materiales.php",{dat:campo},function(){});
}
function AgregarCarrito(ID_agregar, accion){
  var ID; var variablesPost=""; var id="";  var cantInput; 
  ID=ID_agregar.split("_");
  if(ID[1]!=""){
	  id=ID[1];
  }
  cantInput = "#cant_"+id;	 
  variablesPost += "cant_"+id+ "="+ $(cantInput).attr("value") + "&";
  variablesPost += "id="+id+"&accion="+ accion; 
  $.ajax({
	 type: "POST",
	 url: "agregar_carro.php",
	 data:  variablesPost,
	 success: function(msg){
	  // alert(msg);
	   $("#Carro").load("carrito.php");
	 }
   });	
  
}



