$.fn.dashboardColumn = function() {
	var column = $(this);
	var module_list = $(this).find('.module-list');
	
	module_list.sortable(
		{
			handle: module_list.find('h3'),
			connectWith: '.module-list'
		}
	);
}

$.fn.saveDashboard = function() {
	$(this).bind('click',
		function(e) {
			i = 1;
			$('.dashboard-column').each(
				function() {
					col = $(this);
					l = 0;
					
					col.find('.module-list .dashboard-module').each(
						function() {
							$(this).find('input.module.column').val(i);
							$(this).find('input.module.order').val(l);
							l ++;
						}
					);
					
					i ++;
				}
			);
		}
	);
}
