$(function() {

	function roundNumber(num, dec) {
		var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
		return result;
	}

	$('*:radio').click(function() {
		var shipping = parseFloat($(this).val());
		var raw_total = parseFloat($('#total_without_shipping').text());
		$('#ship').html('£'+shipping);
		$('#total').html('£'+roundNumber(shipping+raw_total, 2));
		$('#paypal_handling_cart').val(shipping);
	});

	$('input[name=remove]').click(function() {
		var index = $(this).val();
		location.href = baseDir+'/cart/remove/'+index;
	});

});
