function addToCart(product, sid) {

	//pop up
	$.post("/store/ajax/store.php", { action: 'addproduct', product: product, sid: sid },
	function(data) {
		tb_show('', '/store/ajax/display.php?product='+product+'&height=200&width=475', '');
		updateCount(sid);
	});
	
}

function updateCount(sid) {
	
	$.post("/store/ajax/store.php", { action: 'updatecount', sid: sid },
	function(data){
		$('#cartnotice').html(data);
		//alert(data);
	});	
	
}

function updateQty(product, qty, sid) {
	
	//update session
	$.post("/store/ajax/store.php", { action: 'updateqty', product: product, qty: qty, sid: sid },
	function(data) {
		$('#carttable tr#prod_'+product+' .total').html(data);
	});	
	
	//update subtotal
	$.post("/store/ajax/store.php", { action: 'grabsubtotal', sid: sid },
	function(data) {
		$('#carttable #subtotal').html(data);
	});	
	
}

function shipOptions() {
	
	tb_show('', '/store/ajax/shipping.php?height=220&width=475', '');
	
}

function pickShip(product) {
	
	//ajax routine
	$.post("/store/ajax/setshipping.php", { key: product },
	function(data) {
		//close dindow
		tb_remove();
		window.location.href = '/store/checkout/payment';
	});
	
}