﻿
jQuery(function($) {
    setTimeout(startCycle, 1000);

    function startCycle() {

        var cycleTimeOut = parseInt($('#Cycle').attr('timeOut'));

        $('#Cycle').cycle({
            prev: '#Next',
            next: '#Prev',
            pause: true,
            fx: 'fade',
            //fx: 'all',
            timeout: cycleTimeOut,
            speed: 2000,
            delay: 1000
        });

        $("#Pause").toggle(function(e) {
            $('#Cycle').cycle('pause');
            $(this).addClass('paused').text('Resume').attr('title', 'Resume');
            e.preventDefault();
        }, function(e) {
            $('#Cycle').cycle('resume');
            $(this).removeClass('paused').text('Pause').attr('title', 'Pause');
            e.preventDefault();
        });
    }
});

