jquery to change html order of sibling div elements?
<p>My markup looks like this:</p>

<pre><code>&lt;ul class="menu collapsible"&gt;
    &lt;li class='expand sectionTitle home'&gt;
        &lt;a class='clicker' href='#'&gt;Home&lt;/a&gt;
        &lt;ul class='acitem'&gt;
            &lt;li class="section"&gt;stuff goes here
        &lt;/ul&gt;
    &lt;/li&gt;

    &lt;li class='expand sectionTitle section1'&gt;
        &lt;a class='clicker' href='#'&gt;Section 1&lt;/a&gt;
        &lt;ul class='acitem'&gt;
            &lt;li class="section"&gt;stuff goes here
        &lt;/ul&gt;
    &lt;/li&gt;

    &lt;li class='expand sectionTitle section2'&gt;
        &lt;a class='clicker' href='#'&gt;Section 2&lt;/a&gt;
        &lt;ul class='acitem'&gt;
            &lt;li class="section"&gt;stuff goes here
        &lt;/ul&gt;
    &lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>I'd like to add to the jQuery script (see below) that handles the accordian behavior so that when a "clicker" element is clicked, its parent div slides up to the 2nd position. I always want the "Home" div at the top, but I want whichever div is "active" to be expanded in 2nd position.</p>

<p>Here is the jQuery that controls the menu's accordian behavior:</p>

<pre><code>jQuery.fn.initMenu = function() {  
    return this.each(function(){
        var theMenu = $(this).get(0);
        $('.acitem', this).hide();
        $('li.expand &gt; .acitem', this).show();
        $('li.expand &gt; .acitem', this).prev().addClass('active');
        $('li a', this).click(
            function() {
                var theElement = $(this).next();
                var parent = this.parentNode.parentNode;
                if($(parent).hasClass('noaccordion')) {
                    $(theElement).slideToggle('normal', function() {
                        if ($(this).is(':visible')) {
                            $(this).prev().addClass('active');
                        }
                        else {
                            $(this).prev().removeClass('active');
                        }    
                    });
                    return false;
                }
                else {
                    if(theElement.hasClass('acitem') &amp;&amp; theElement.is(':visible')) {
                        if($(parent).hasClass('collapsible')) {
                            $('.acitem:visible', parent).first().slideUp('normal', 
                            function() {
                                $('.acitem:visible', parent).first().prev().removeClass('active');
                            }
                        );
                    }
                    return false;
                }
                if(theElement.hasClass('acitem') &amp;&amp; !theElement.is(':visible')) {                        
                    $('.acitem:visible', parent).first().slideUp('normal', function() {
                        $(this).prev().removeClass('active');
                    });
                    theElement.slideDown('normal', function() {
                        $(this).prev().addClass('active');
                    });
                    return false;
                }
            }
        }
    );
});
};

$(document).ready(function() {$('.menu').initMenu();});
</code></pre>
