I am using the jquery cycle plugin to do a slideshow. I have 5 photos sliding but only showing 3 thumbnail pagers at a time. I wanted that when it slides to the 4th photo, the thumbnails on a bottom changes so it shows the 4th and 5th thumbnails.

I have a "Next" and "Prev" button on the page, when click on "Next" it'll display the 4th and 5th thumbnails, click "Prev" to go back to the 1st-3rd thumbnail. So basically, i want the div that contains the thumbnail to animate left automatically when it slides to the 4th photo as if you clicked on the "Next" button. But i have no idea why it isnt working....

Here's the scrip that start the slide and return the number of the current slide: 

```
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.cycle.all.js"></script>
<script type="text/javascript">
$(function() {
    $('#slideshow').cycle({           
        fx:     'turnDown',
        speed:  'fast',
        pager:  '#nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#nav li:eq(' + (idx) + ') a';
        } ,
    after: function (curr, next, opts) {
   var number = (opts.currSlide + 1);
$('#caption1').html(number);
},  
    });
});
</script>

```

Here's the code that controls the "Next" and "Prev" button

```
<script type="text/javascript">
$(document).ready(function() {
    $('#next_control').click(function() {
        var c = $('#nav_content');
        var pos = c.position();
        var w = c.width();
        var status = w + pos.left;
        var dif = w - 190;
        var x = w + dif;
        if (status > 190) {
            c.stop().animate({
                left: pos.left - 180
            }, 500);
        };
    });
});
$(document).ready(function() {
    $('#prev_control').click(function() {
        var c = $('#nav_content');
        var pos = c.position();
        if (pos.left < 0) {
            c.stop().animate({
                left: pos.left + 180
            }, 500)
        };
    });
});

```

**Finally**, here's the code that I thought would run the same effect as clicking on the "Next" button when the slideshow slides to the 4th photo. But it's not working for some reason....

```
$(document).ready(function(){
        if(number = 4){
            $('#nav_content').stop().animate({left: pos.left - 180},500);
            }              
                           });
</script>

```

Any idea..? Thanks!!!