Here is a better example using new OO libraries that I've recently developed.
This script allows you to assign a function called "reorderingGrab(this, y)" as an onmousedown event on any element on your page. By doing so, grabbing and dragging the object referenced (the first argument, 'this') will result in reordering it among its sibling elements. An outlined placeholder will appear wherever the drop position is currently assumed to be. Upon releasing the mouse button, the script will set a master variable called "droppedPosition" to indicate the position index (starting with 0) to which it was moved, allowing you to reference this variable in any functions you may call after dropping. You can call a function after dropping by passing that function as the second argument (y), as demonstrated in this example, which pops up the text at the top of the page telling you which element was moved where.
Generally speaking, you shouldn't have to mess with 'ordering.js', but instead can include JavaScript in your page or (better) as a separate external script that contains any specialized functions that you want to carry out after dropping an element.
It is assumed that the 'droppedPosition' value will be used by the 'doAfter' function that is passed (or whatever you choose to call yours) to do some Ajax to save the reordering in your database. This could be useful for ordering photos, to-do lists, items in a content management system, etc. You can use it for pretty much whatever you want, as long as the task involves grabbing an element and moving it to a different position among a group of related sibling elements.
TRY IT: Grab any of the boxes to the left and reorder them. Their numbers won't change, but their position will, so you can see the result in the text that appears above after each drop. While dragging, you'll see the distance of the dragged element from the top of the page (in pixels). Both of these functions (during drag and after dropping) can be customized to suit your needs - most of the time this will probably involve making an Ajax call of some sort, or interacting with other information on your page after reordering. You might not necessarily need to use a 'doDuring' function, but are quite likely to need to pass a 'doAfter' equivalent to do something useful on the page and/or in the database after the drop. If not passing a certain function, replace it with 'null' in your 'onmousedown' event handler. Also note that dragging close to the bottom or top of the screen will result in some scrolling to accomode movement to positions that are currently out of view within the browser frame.