problem with jquery dropdown menu
<p>I'm trying to build a jquery dropdown menu, basically I have the left navigation which is drop down and I have a right section as well, I'm trying to make the height of the left navigation always equal to the height of the right part, 
it works fine on page load, but when I click on link on the left navigation the products under it will show and the products that were open before will hide, but I get the height of the left navigation as soon as I click on it before the second part is hidden, therefore it's giving me the wrong height, I figured that I have to wait for the click event to finish completely and then calculate height, but I dont know how to do that,</p>

<p><a href="http://www.electrocart247.co.uk/test/index.php/customer/account/login/" rel="nofollow">test site to show what I mean</a></p>

<p>if you click on ladies clothing and then men clothing the height of left navigation wont increase, if you click on men clothing and then ladies clothing the height of the right container gets too big,</p>

<pre><code>jQuery.noConflict();

jQuery(document).ready(function() {
var level2 = jQuery('.nav-container ul#nav li.level0 ul.level0 li.level1 ul.level1 li.level2 &gt; a');

    level2.click(function(e) {
        e.preventDefault();
        var navId = jQuery(this).parent().attr('class').substr(7,9);
        jQuery('.nav-container ul#nav li.level0 ul.level0 li.level1 ul.level1 li.level2 ul.level2 li.level3 &gt; a').slideUp();
        jQuery('.nav-container ul#nav li.level0 ul.level0 li.level1 ul.level1 li.'+navId+' ul.level2 li.level3 &gt; a').slideDown();

        var navHeight = jQuery('div.page div.nav-container').height();
        var mainContainerHeight = jQuery('div.main-container').height();

        if (navHeight &gt; mainContainerHeight) {
            jQuery('div.main-container').height(navHeight); 
        }else {
            jQuery('div.page div.nav-container').height(mainContainerHeight);
        }
});
});
</code></pre>

<p>any help would be appreciated.</p>
