jQuery(document).ready(function($)
{
    var photo = $('#slideshow div.slides ul');
    var thumb = $('#slideshow ul.slides-nav li');
    var currentNum = 0;

    $(photo).cycle({
        timeout            : 5000,
        speed              : 600,
        random             : 1,
        shuffle            : {top:0, left:900},
        fx                 : 'scrollLeft',
        pager              : $(thumb, false),
        pagerAnchorBuilder : function(i, slide){
            return $(thumb).eq(i);
        },
        pauseOnPagerHover  : true,
        pause              : true,
        before             : function(){
            currentNum = parseInt($(this).attr("id").substring(1));
            $(thumb).each(function(i){
                if(currentNum === i) {
                    $(this).addClass('on');
                }
                else {
                    $(this).removeClass();
                }
            });
        }
    });
});

