﻿jQuery(document).ready(function () {

    $('#featuredContentRolling .thirdGalleryItem').cycle({
        fx: 'scrollRight',
        speedIn: 500,
        speedOut: 5,
        timeout: 10000,
        delay: -5000,
        pager: '#nav'
    });

    function slideShowSetup(interval) {

        var firstImg = $('#slideshow .slideshowItem:first');
        firstImg.addClass('slideactive');
        firstImg.css({ 'opacity': '1.0' });

        function changeImg() {

            var $curr = $('#slideshow .slideactive:first');
            var $next = $curr.next(".slideshowItem").length ? $curr.next() : $('#slideshow .slideshowItem:first');

            $curr.removeClass('slideactive');
            $next.addClass('slideactive');

            $curr.animate({ opacity: '0.0' }, 'slow');
            $next.animate({ opacity: '1.0' }, 'slow');

        }

        setInterval(function () { changeImg() }, (interval * 1000));

    }

    slideShowSetup(5);

});



