function TransferCustomerCart(o){
	
	var defaults = {};
	
	init();
	
	function init(){
		defaults = $.extend(defaults,o);
		$('.select-on-check-all').click(recalculate);
		$('.cart-item').click(recalculate);
		$('.select-all').click(selectAll);
		$('.deselect-all').click(deselectAll);
	}
	
	function selectAll(){
		var table;
		table = $('.grid-view').find('table');
		
		table.find('input').prop('checked',true);
		recalculate();
	}
	function deselectAll(){
		var table;
		table = $('.grid-view').find('table');
		
		table.find('input').prop('checked',false);
		recalculate();
	}
	
	function recalculate(){
		var items = $('.cart-item');
		var money = 0;
		items.each(function(i,e){
			if ( $(e).is(':checked')){
				money += $(e).data('money');
			}
		});
		$('#customercartform-money').val(money);
		$('.selected-money').html(money);
		selectRows();
	}
	
	function selectRows(){
		
		var table;
		var rows;
		table = $('.grid-view').find('table');
		
		rows = table.find('tbody').find('tr');
		rows.removeClass('info');
		rows.each(function(i,e){
			var cb;
			var selected;
			var row;
			row = $(e);
			cb = row.find('td').eq(0).find('input');
			selected = cb.is(':checked');
			if ( selected){
				 row.addClass('info');
			}
		});
	}
}