(function ($) {



    $.fn.shuffle = function () {
        return this.each(function () {
            var items = $(this).children();
            return (items.length) ? $(this).html($.shuffle(items)) : this;
        });
    }

    $.shuffle = function (arr) {
        for (
        var j, x, i = arr.length; i;
        j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x);
        return arr;
    }




    $(document).ready(function () {


        var images = [{
            src: 'images/slide/pic1.jpg',
            from: '100% 50% 1x',
            to: '100% 0% 2x',
            time: 10
        }, {
            src: 'images/slide/pic2.jpg',
            from: 'bottom left',
            to: 'top right 2x',
            time: 20
        }, {
            src: 'images/slide/pic3.jpg',
            from: '100% 80% 1.5x',
            to: '80% 0% 1.1x',
            time: 8
        }, {
            src: 'images/slide/pic4.jpg',
            from: '100% 50%',
            to: '30% 50% 1.5x',
            time: 8
        }];

        // shuffle the array
        $.shuffle(images);

        // call the slideshow

        $('#slideshow').crossSlide({
            fade: 1
        }, images );
    });

    })(jQuery);