// version 0.1.1
addDOMLoadEvent(setupSortableSubcats);

function setupSortableSubcats () {
    if ($('dsSortSubcats'))
    {
       $('dsSortSubcats').addClassName('sortableActive');
       $('dsSortSubcats').insert({after: '<p>Reorder by dragging and dropping the list above <strong>(changes will be automatically saved)</strong></p>'});
       Sortable.create("dsSortSubcats", {
        onUpdate: function() {
                new Ajax.Request("ajax/dsReorderSubcats.php", {
                    method: "post",
                    parameters: { data: Sortable.serialize("dsSortSubcats") }
                });
            }
        });
    }
}