if (IS_MANAGE_MODE)
{
	$(document).ready(function () 
	{
		$('div.groupWrapper').Sortable(
		{
			accept: 'box',
			helperclass: 'sortHelper',
			activeclass : 'dropActive',
			hoverclass : 'dropHover',
			tolerance: 'intersect',
			onChange : function(currentGroup)
			{
				serial = $.SortSerialize('leftBlocks').hash+"&"+$.SortSerialize('centerBlocks').hash+"&"+$.SortSerialize('rightBlocks').hash+"&"+$.SortSerialize('user1Blocks').hash+"&"+$.SortSerialize('user2Blocks').hash;
				$.get("order-change.php?type=blocks&"+serial, function(data) 
				{
					$('#leftBlocks, #centerBlocks, #rightBlocks, #user1Blocks, #user2Blocks').Highlight(1000, '#FFFF99');
				})
			},
			onStart : function()
			{
			},
			onStop : function()
			{
			}
		}).each(function()
			{
				var id = $(this).attr("id").split("Blocks");
				$(this).prepend("<div style=\"text-align:center;font-size:16px;\">&quot;" + id[0] + "&quot; blocks" + "</div>");
			});
	});
}
