Script not executing on homepage
<p>I'm using the following code to evaluate two sets of conditions in a CMS generated navigation list on a site I'm building:</p>

<p>Condition one: if there's an ampersand in the navigation, surround it with em tags.</p>

<pre><code>//pretty ampersands for all! Well, just the H1 tags and the navigation.
           $("nav a:contains('&amp;'), h1:contains('&amp;'), nav li:contains('&amp;')", document.body)
                .contents()
                .each(
                    function() {
                        if( this.nodeType == 3 ) {
                            $(this)
                                .replaceWith( this
                                    .nodeValue
                                    .replace( /&amp;/g, "&lt;em&gt;&amp;&lt;/em&gt;" )
                                );
                        }
                    }
            );
</code></pre>

<p>Condition two: if the number of characters in a li or a element exceed 20 characters, wrap the text so that the image set to display on hover and after won't jump to the next line.</p>

<pre><code>                //if a submenu link is more than 20 characters long, resize that baby so the hover leaf won't jump.                                 
            $('nav li ul li a, .active').each(function() {
                var curr = $(this).text().length;
                if(curr &gt;= 20){
                    $(this).css({'width':'90px','text-indent':'-1em','margin-left':'1em'});
                }
            });
</code></pre>

<p>For no apparent reason, neither of these conditions are being tested for or executed on the homepage. The script work fine on all interior pages. (though not in IE7, for reasons I have yet to figure out) I can't see any difference between the code on the separate pages that would account for this disparity. Help?</p>

<p><a href="http://www.qualprnt.com/clients/smca/" rel="nofollow">The live site can be viewed here.</a></p>
