Help tidying up some jquery
<p>Ok so I have some javascript (jQuery) that i think is a little bloated and I was wondering whether or not there is a better way to code it, the code basically does the following the first class with the biography is shown, and the rest are hidden, a user then clicks and image, from that we get the index number and work out which <code>.biography</code> the image belongs to we then animate the old text out and the new in, below is what I believe to be quite messy code, and was wondering if there is a qiucker way to achieve what I am doing?</p>

<pre><code>    $('.biography:first').show().addClass('visible');
            $('.biography:not(.visible)').css("top", "300px");
            $('.the-team img').click(function(){
                var clickedImage = $(this);
                $('.visible').animate({"top" : $('.the-team').height()+10 }, 1000).removeClass('visible').fadeOut(5);
                var indexToShow = clickedImage.index() + 1;
                if(indexToShow == 1) {
                    indexToShow = 2;
                } else if(indexToShow == 5) {
                    indexToShow = 4;
                } else if(indexToShow == 7) {
                    indexToShow = 5;
                }
                $('.biography:nth-child('+indexToShow+')').addClass('visible').show();
                $('.biography:nth-child('+indexToShow+')').animate({"top" : "123px"}, 1000);
            });
</code></pre>

<p>I have just been doing some x-browser testing, and apparently website broswers work out the indexes differently to moz based browsers, could anyone help on this?</p>

<p>Below is my HTML markup, </p>

<pre><code>&lt;article class="the-team"&gt;
        &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;
            &lt;?php if($post-&gt;ID == 15) : ?&gt;
                &lt;h1&gt;your team&lt;/h1&gt;
            &lt;?php else: ?&gt;
                &lt;h1&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt;
            &lt;?php endif;?&gt;
            &lt;?php the_content(); ?&gt;
        &lt;?php endwhile; endif;?&gt;
        &lt;section&gt;
        &lt;?php query_posts('post_type=team&amp;order=ASC'); ?&gt;
        &lt;?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?&gt;
            &lt;?php the_post_thumbnail(); ?&gt;
            &lt;article class="biography"&gt;
                &lt;h3&gt;&lt;?php the_title(); ?&gt;&lt;/h3&gt;
                &lt;?php the_content(); ?&gt;
            &lt;/article&gt;
        &lt;?php endwhile;  endif; ?&gt;
        &lt;/section&gt;
    &lt;/article&gt;
</code></pre>
