$(document).ready(
	function () {
		$('ul.groupitem').Sortable( // !!! L'ID de référence doit contenir soit article, rubrique ou breve selon le cas !!!
			{
				accept : 		'sortableitem',
				opacity: 		0.8,
				fx:					200,
				axis:				'vertically',
				opacity:		0.4,
				revert:			true,
				onchange : 	function (sorted) 
					{
						serialm = $.SortSerialize();
						sro = serial.hash.replace(/\[\]/g,"[0][]");
						srm = serialm.hash.replace(/\[\]/g,"[1][]");
//						$('#data').html(serial.hash);
//						alert(serial.hash);
						/*
				    Instead of the $.ajax-call below, you could use these shorter funcs. In 
						addition to the hash used by $.ajax, the SortSerialize method above also 
						returns an object that can directly be used in the $().load and $.post/get 
						functions:
						// $('#data').load("gestnum.php",serialm.o.sortme);
						or
						// $.post("gestnum.php",serialm.o.sortme, function(feedback){ $('#data').html(feedback); });
						*/

						$.ajax(
							{
								url: "?action=gestnum",
								type: "POST",
								data: sro+"&"+srm,
								complete: function(){serial = serialm;},
								success: function(feedback){ if (feedback) {$('#data').html(feedback);} window.location.reload();}
								// error: function(){}
							}
						)
					}
			}
		)
	serial = $.SortSerialize();
	}
);


