// JavaScript Document
$(function(){
	$("a.vin_mas").click(function(){
	
	$.blockUI({ message: "<h3>Agregando al carrito...</h3>" });  

	//the main ajax request
		$.ajax({
			type: "POST",
			data: "tipo=vin&id="+$(this).attr("id"),
			url: "ajax/accion.php",
			success: function(msg)
			{
				$("div#carrito").fadeOut();
				$("div#carrito").html(msg);
				$("div#carrito").fadeIn();
				$.blockUI({ message: $('#question'), css: { width: '295px' } });
			}
		});
		$('#yes').click(function() { 
            $.unblockUI(); 
            return false; 
        }); 
		$('#no').click(function() { 
			window.location.href="carrito/1";
            return false; 
        }); 
	});
});	


$(function(){
	$("a.vin_mas_caja").click(function(){
	
	$.blockUI({ message: "<h3>Agregando al carrito...</h3>" });  

	//the main ajax request
		$.ajax({
			type: "POST",
			data: "tipo=vin&caja=1&id="+$(this).attr("id"),
			url: "ajax/accion.php",
			success: function(msg)
			{
				$("div#carrito").fadeOut();
				$("div#carrito").html(msg);
				$("div#carrito").fadeIn();
				$.blockUI({ message: $('#question'), css: { width: '275px' } });
			}
		});
		$('#yes').click(function() { 
            $.unblockUI(); 
            return false; 
        }); 
		$('#no').click(function() { 
            window.location.href="carrito/1";
            return false; 
        }); 
	});
});


$(function(){
	$("a.pro_mas").click(function(){
	
	$.blockUI({ message: "<h3>Agregando al carrito...</h3>" });  

	//the main ajax request
		$.ajax({
			type: "POST",
			data: "tipo=pro&id="+$(this).attr("id"),
			url: "ajax/accion.php",
			success: function(msg)
			{
				$("div#carrito").fadeOut();
				$("div#carrito").html(msg);
				$("div#carrito").fadeIn();
				$.blockUI({ message: $('#question'), css: { width: '275px' } });
			}
		});
		$('#yes').click(function() { 
            $.unblockUI(); 
            return false; 
        }); 
		$('#no').click(function() { 
            window.location.href="carrito/1";
            return false; 
        }); 
	});
});

$(function(){
	$("a.pro_mas_caja").click(function(){
	
	$.blockUI({ message: "<h3>Agregando al carrito...</h3>" });  

	//the main ajax request
		$.ajax({
			type: "POST",
			data: "tipo=pro&caja=1&id="+$(this).attr("id"),
			url: "ajax/accion.php",
			success: function(msg)
			{
				$("div#carrito").fadeOut();
				$("div#carrito").html(msg);
				$("div#carrito").fadeIn();
				$.blockUI({ message: $('#question'), css: { width: '275px' } });
			}
		});
		$('#yes').click(function() { 
            $.unblockUI(); 
            return false; 
        }); 
		$('#no').click(function() { 
            window.location.href="carrito/1"; 
            return false; 
        }); 
	});
});