.insertBefore Jquery not working?
<p>I have put together a simple piece of Jquery that upon clicking an anchor tag (Advanced Search) toggles more content below it and moves the search button, everything works as expected except that when I toggle back to the elements original layout the search button does not move back.. bit stumped as to why</p>

<p>I have put it in a jsfiddle <a href="http://jsfiddle.net/richlewis14/fn9E8/1" rel="nofollow">http://jsfiddle.net/richlewis14/fn9E8/1</a></p>

<p>and here is my Jquery</p>

<pre><code>$(document).ready(function() {
    $('#hiddenSearch').hide();
    $('#aSearch').click(function(e) {
        e.preventDefault();
        $('#hiddenSearch').slideToggle();
        if ($('#hiddenSearch').is(':visible')) {
            $('#searchButton').insertAfter('#last')
        } else {
            $('#searchButton').insertBefore('#aSearch')
        }
    });
});
</code></pre>

<p>What am i missing?</p>

<p>Thanks</p>
