/* ---------------------------
    jquery.reorder.js
--------------------------- */
(function($){
    $.fn.reorder = function() {
        // random array sort from
        // http://javascript.about.com/library/blsort2.htm
        function randOrd() { return(Math.round(Math.random())-0.5); }
        return($(this).each(function() {
            var $this = $(this),
                    $children = $this.children(),
                    childCount = $children.length;
            if (childCount > 1) {
                $children.remove();
                var indices = [];
                for (i=0;i<childCount;i++) { indices[indices.length] = i; }
                indices = indices.sort(randOrd);
                $.each(indices,function(j,k) { $this.append($children.eq(k)); });
            }
        }));
};
})(jQuery);
