$(function() {
		
	$("table#sort_galleri_kategories").sortable({ 
		opacity: 0.6, 
		cursor: 'move',
		handle: '.move',
		appendTo: 'table',
		items: 'tr',
		update: function() { 
			var order = $(this).sortable("serialize") + '&action=update';       
			$.post("includes/sortGalleriKategories.php", order, function(theResponse){ 
				$("#contentRight").html(theResponse); 
			});
		}
	});
	
	$("table#sort_galleri").sortable({ 
		opacity: 0.6, 
		cursor: 'move',
		handle: '.move',
		appendTo: 'table',
		items: 'tr',
		update: function() {
			var order = $(this).sortable("serialize") + '&action=update';       
			$.post("includes/sortGalleri.php", order, function(theResponse){ 
				$("#contentRight").html(theResponse); 
			});
		}
	});
	
	$("ul#page_sort").sortable({ 
		opacity: 0.6, 
		cursor: 'move',
		handle: '.move',
		appendTo: 'ul',
		items: 'li',
		update: function() { 
			var parent = $(this).parent().attr('id');
			var order = $(this).sortable("serialize") + '&action=update&parent=' + parent;       
			$.post("includes/sortPage.php", order, function(theResponse){ 
				$("#contentRight").html(theResponse); 
			});
		}
	});
	
	$("a.galleri_lightbox").lightbox();
});
