function buy(what,num,obj,qty) {
//	alert('what: '+what+' num: '+num+' obj: '+obj);
	if(!qty) qty=1;

	$.post("/cart.php",{action: 'add', num: num, what: what, quantity: qty});

	var o=$("#"+obj.id);
	var pos=o.offset();
	o.hide();

	var cartPos=$("#headercarticon").offset();

//	alert(pos.left+','+pos.top);

	$("#buy-animate").css(pos);
	$("#buy-animate").css({width: o.width()+'px', height: o.height()+'px', 'font-size': 1+'em', opacity: 1});

	$("#buy-animate").html(o.html());
	$("#buy-animate").show();
	$("#buy-animate").animate( {
		left: cartPos.left+25,
		top: cartPos.top+25,
		width: 60+'px',
		height: 60+'px',
		'font-size': 0.5+'em',
		opacity: .3
	}, 600, function() {
		$("#buy-animate").hide();
		$("#headercarticon").animate( {
			right: '-=20px',
			top: '-=20px',
			width: '+=40px',
			height: '+=40px'
		},300,function() {
			$("#headercarticon").animate( {
				right: '+=20px',
				top: '+=20px',
				width: '-=40px',
				height: '-=40px'
			},300,function() {
				$("#headercart").load("/cart.php?action=header");
			});


		});

		o.fadeIn();
	});


}

