Function is not defined, failed to load sources jQuery
<p>I have this jquery code:</p>

<pre><code>$(document).ready(function() {
            function slideSwitch() {
                var $active = $('#slideShow IMG.active');

                if ( $active.length == 0 ) $active = $('#slideShow IMG:last');

                var $next =  $active.next().length ? $active.next()
                    : $('#slideShow IMG:first');

                $active.addClass('last-active');

                $next.css({opacity: 0.0})
                    .addClass('active')
                    .animate({opacity: 1.0}, 1000, function() {
                        $active.removeClass('active last-active');
                    });
            }


                setInterval( "slideSwitch()", 5000 );

        });
</code></pre>

<p>And it errors with slideSwitch() is not defined?? any ideas?</p>
