Change Has Children to Has GrandChildren in jQuery
<p>Here is an except of javascript.</p>

<pre>
    function showContent(layer, animate) {

        $("#background").show();
        $("footer").hide();
        $("#announcement").hide();

        $("#content").html($("#" + layer + "_html").comments());

        $("nav").children().each(function() {
            if ($(this).attr("id").search(layer) == -1) {
                $(this).addClass("inactive");
            } else {
                $(this).removeClass("inactive");
            }
        });

        if (animate == true) {
            $('html,body').animate({scrollTop: $("nav").offset().top - 16 - 40}, 200, "swing");
        }

        // setUpHover();

        setupFullScreen();
        setupImageViewers();
        setupHovers();

        // Load analytics tracking
        setTimeout(function() {
            $("#tracker").attr("src", "/track/" + layer + "/")
        }, 500);

        window.location.hash = layer;
    }

    // Set up the on click functions for the different menus
    $("nav").children().click(function() {
        showContent($(this).attr("id").split("_")[1], true);
    });
</pre>

<p>Here is an excerpt of html:</p>

<p><a href="http://pastie.org/2929494" rel="nofollow">http://pastie.org/2929494</a></p>

<p>Now here's my question. With that js and html it does what it is suppose to. However when I add a needed div  inside the nav as such it breaks:</p>

<p><a href="http://pastie.org/2929497" rel="nofollow">http://pastie.org/2929497</a></p>

<p>I imagine the problem is in the original js above, there are two lines about ("nav").children and imagine with my new code they are actually now grandchildren or such. So most likely need to make minor adjustments to both of those lines, but not sure to what.</p>

<p>Thanks in advance!</p>
