﻿$(document).ready(function() {

    $('#slideshow_right').cycle({
        fx: 'fade',
        timeout: 6000,
        speedIn: 1000,
        speedOut: 1000,
        prev: '#prev',
        next: '#next',
        before: function() {
            $('#caption_right').html(this.alt);
        },
        pagerAnchorBuilder: pagerFactory
    });

    function pagerFactory(idx, slide) {
        var s = idx > 2 ? ' style="display:none"' : '';
        return '<li' + s + '><a href="#">' + (idx + 1) + '</a></li>';
    };

    $('#slideshow_left').cycle({
        fx: 'fade',
        timeout: 6000,
        speedIn: 1000,
        speedOut: 1000,
        prev: '#prev',
        next: '#next',
        before: function() {
            $('#caption_left').html(this.alt);
        },
        pagerAnchorBuilder: pagerFactory
    });

    function pagerFactory(idx, slide) {
        var s = idx > 2 ? ' style="display:none"' : '';
        return '<li' + s + '><a href="#">' + (idx + 1) + '</a></li>';
    };
});
