PageSourceSearch

https://www.btl.gov.il/_layouts/15/1037/BTL-JScripts/JQuery/new/camera.js

js btl.gov.il collected 2026-10-02 02:53:27 UTC 107,994 bytes, 2,281 lines download raw bytes

1// Camera slideshow v1.4.0 - a jQuery slideshow with many effects, transitions, easy to customize, using canvas and mobile ready, based on jQuery 1.9.1+
2// Copyright (c) 2012 by Manuel Masia - www.pixedelic.com
3// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
4; (function ($) {
5    $.fn.camera = function (opts, callback) {
6
7        var defaults = {
8            alignment: 'center', //topLeft, topCenter, topRight, centerLeft, center, centerRight, bottomLeft, bottomCenter, bottomRight
9
10            autoAdvance: true, //true, false
11
12            mobileAutoAdvance: true, //true, false. Auto-advancing for mobile devices
13
14            barDirection: 'leftToRight',       //'leftToRight', 'rightToLeft', 'topToBottom', 'bottomToTop'
15
16            barPosition: 'bottom',    //'bottom', 'left', 'top', 'right'
17
18            cols: 6,
19
20            easing: 'easeInOutExpo',     //for the complete list http://jqueryui.com/demos/effect/easing.html
21
22            mobileEasing: '',   //leave empty if you want to display the same easing on mobile devices and on desktop etc.
23
24            fx: 'random',        //'random','simpleFade', 'curtainTopLeft', 'curtainTopRight', 'curtainBottomLeft', 'curtainBottomRight', 'curtainSliceLeft', 'curtainSliceRight', 'blindCurtainTopLeft', 'blindCurtainTopRight', 'blindCurtainBottomLeft', 'blindCurtainBottomRight', 'blindCurtainSliceBottom', 'blindCurtainSliceTop', 'stampede', 'mosaic', 'mosaicReverse', 'mosaicRandom', 'mosaicSpiral', 'mosaicSpiralReverse', 'topLeftBottomRight', 'bottomRightTopLeft', 'bottomLeftTopRight', 'bottomLeftTopRight'
25            //you can also use more than one effect, just separate them with commas: 'simpleFade, scrollRight, scrollBottom'
26
27            mobileFx: '',   //leave empty if you want to display the same effect on mobile devices and on desktop etc.
28
29            gridDifference: 250,  //to make the grid blocks slower than the slices, this value must be smaller than transPeriod
30
31            height: '50%',       //here you can type pixels (for instance '300px'), a percentage (relative to the width of the slideshow, for instance '50%') or 'auto'
32
33            imagePath: 'images/',   //he path to the image folder (it serves for the blank.gif, when you want to display videos)
34
35            hover: true, //true, false. Puase on state hover. Not available for mobile devices
36
37            loader: 'pie',       //pie, bar, none (even if you choose "pie", old browsers like IE8- can't display it... they will display always a loading bar)
38
39            loaderColor: '#eeeeee',
40
41            loaderBgColor: '#222222',
42
43            loaderOpacity: .8,   //0, .1, .2, .3, .4, .5, .6, .7, .8, .9, 1
44
45            loaderPadding: 2,    //how many empty pixels you want to display between the loader and its background
46
47            loaderStroke: 7,    //the thickness both of the pie loader and of the bar loader. Remember: for the pie, the loader thickness must be less than a half of the pie diameter
48
49            minHeight: '200px',     //you can also leave it blank
50
51            navigation: true, //true or false, to display or not the navigation buttons
52
53            navigationHover: true, //if true the navigation button (prev, next and play/stop buttons) will be visible on hover state only, if false they will be visible always
54
55            mobileNavHover: true, //same as above, but only for mobile devices
56
57            opacityOnGrid: false,       //true, false. Decide to apply a fade effect to blocks and slices: if your slideshow is fullscreen or simply big, I recommend to set it false to have a smoother effect 
58
59            overlayer: true, //a layer on the images to prevent the users grab them simply by clicking the right button of their mouse (.camera_overlayer)
60
61            pagination: true,
62
63            playPause: true, //true or false, to display or not the play/pause buttons
64
65            pauseOnClick: true, //true, false. It stops the slideshow when you click the sliders.
66
67            pieDiameter: 38,
68
69            piePosition: 'rightTop',  //'rightTop', 'leftTop', 'leftBottom', 'rightBottom'
70
71            portrait: false, //true, false. Select true if you don't want that your images are cropped
72
73            rows: 4,
74
75            slicedCols: 12,   //if 0 the same value of cols
76
77            slicedRows: 8,    //if 0 the same value of rows
78
79            slideOn: 'random',    //next, prev, random: decide if the transition effect will be applied to the current (prev) or the next slide
80
81            thumbnails: false,
82
83            time: 7000, //milliseconds between the end of the sliding effect and the start of the nex one
84
85            transPeriod: 1500, //lenght of the sliding effect in milliseconds
86
87            ////////callbacks
88
89            onEndTransition: function () { },     //this callback is invoked when the transition effect ends
90
91            onLoaded: function () { },     //this callback is invoked when the image on a slide has completely loaded
92
93            onStartLoading: function () { },     //this callback is invoked when the image on a slide start loading
94
95            onStartTransition: function () { }      //this callback is invoked when the transition effect starts
96
97        };
98
99
100        function isMobile() {
101            if (navigator.userAgent.match(/Android/i) ||
102                    navigator.userAgent.match(/webOS/i) ||
103                    navigator.userAgent.match(/iPad/i) ||
104                    navigator.userAgent.match(/iPhone/i) ||
105                    navigator.userAgent.match(/iPod/i)
106                    ) {
107                return true;
108            }
109        }
110
111        $.support.borderRadius = false;
112        $.each(['borderRadius', 'BorderRadius', 'MozBorderRadius', 'WebkitBorderRadius', 'OBorderRadius', 'KhtmlBorderRadius'], function () {
113            if (document.body.style[this] !== undefined) $.support.borderRadius = true;
114        });
115
116        var opts = $.extend({}, defaults, opts);
117
118        var wrap = $(this).addClass('camera_wrap');
119
120        wrap.wrapInner(
121        '<div class="camera_src" />'
122               ).wrapInner(
123            '<div class="camera_fakehover" />'
124               );
125
126        var fakeHover = $('.camera_fakehover', wrap);
127        var fakeHoverSelector = ('.camera_fakehover', wrap);
128
129        fakeHover.append(
130               '<div class="camera_target"></div>'
131               );
132        if (opts.overlayer == true) {
133            fakeHover.append(
134                    '<div class="camera_overlayer"></div>'
135                    )
136        }
137        fakeHover.append(
138 '<div class="camera_target_content"></div>'
139        );
140
141        var loader;
142
143        if (opts.loader == 'pie' && !$.support.borderRadius) {
144            loader = 'bar';
145        } else {
146            loader = opts.loader;
147        }
148
149        if (loader == 'pie') {
150            fakeHover.append(
151                    '<div class="camera_pie"></div>'
152                    )
153        } else if (loader == 'bar') {
154            fakeHover.append(
155                    '<div class="camera_bar"></div>'
156                    )
157        } else {
158            fakeHover.append(
159                    '<div class="camera_bar" style="display:none"></div>'
160                    )
161        }
162
163        if (opts.playPause == true) {
164            fakeHover.append(
165     '<div class="camera_commands"></div>'
166            )
167        }
168
169        if (opts.navigation == true) {
170            fakeHover.append(
171                    '<div class="camera_prev"><span></span></div>'
172                    ).append(
173                    '<div class="camera_next"><span></span></div>'
174                    );
175        }
176
177        if (opts.thumbnails == true) {
178            wrap.append(
179                    '<div class="camera_thumbs_cont" />'
180                    );
181        }
182
183        if (opts.thumbnails == true && opts.pagination != true) {
184            $('.camera_thumbs_cont', wrap).wrap(
185                    '<div />'
186                    ).wrap(
187                            '<div class="camera_thumbs" />'
188                    ).wrap(
189                            '<div />'
190                    ).wrap(
191                            '<div class="camera_command_wrap" />'
192                    );
193        }
194
195        if (opts.pagination == true) {
196            wrap.append(
197                    '<div class="camera_pag"></div>'
198                    );
199        }
200
201        wrap.append(
202               '<div class="camera_loader"></div>'
203               );
204
205        $('.camera_caption', wrap).each(function () {
206            $(this).wrapInner('<div />');
207        });
208
209
210        var pieID = 'pie_' + wrap.index(),
211               elem = $('.camera_src', wrap),
212               target = $('.camera_target', wrap),
213               content = $('.camera_target_content', wrap),
214               pieContainer = $('.camera_pie', wrap),
215               barContainer = $('.camera_bar', wrap),
216               prevNav = $('.camera_prev', wrap),
217               nextNav = $('.camera_next', wrap),
218               commands = $('.camera_commands', wrap),
219               pagination = $('.camera_pag', wrap),
220               thumbs = $('.camera_thumbs_cont', wrap);
221
222
223        var w,
224               h;
225
226
227        var allImg = new Array();
228        $('> div', elem).each(function () {
229            allImg.push($(this).attr('data-src'));
230        });
231
232        var allLinks = new Array();
233        $('> div', elem).each(function () {
234            if ($(this).attr('data-link')) {
235                allLinks.push($(this).attr('data-link'));
236            } else {
237                allLinks.push('');
238            }
239        });
240
241        var allTargets = new Array();
242        $('> div', elem).each(function () {
243            if ($(this).attr('data-target')) {
244                allTargets.push($(this).attr('data-target'));
245            } else {
246                allTargets.push('');
247            }
248        });
249
250        var allPor = new Array();
251        $('> div', elem).each(function () {
252            if ($(this).attr('data-portrait')) {
253                allPor.push($(this).attr('data-portrait'));
254            } else {
255                allPor.push('');
256            }
257        });
258
259        var allAlign = new Array();
260        $('> div', elem).each(function () {
261            if ($(this).attr('data-alignment')) {
262                allAlign.push($(this).attr('data-alignment'));
263            } else {
264                allAlign.push('');
265            }
266        });
267
268
269        var allThumbs = new Array();
270        $('> div', elem).each(function () {
271            if ($(this).attr('data-thumb')) {
272                allThumbs.push($(this).attr('data-thumb'));
273            } else {
274                allThumbs.push('');
275            }
276        });
277
278        var amountSlide = allImg.length;
279
280        $(content).append('<div class="cameraContents" />');
281        var loopMove;
282        for (loopMove = 0; loopMove < amountSlide; loopMove++) {
283            $('.cameraContents', content).append('<div class="cameraContent" />');
284            if (allLinks[loopMove] != '') {
285                //only for Wordpress plugin
286                var dataBox = $('> div ', elem).eq(loopMove).attr('data-box');
287                if (typeof dataBox !== 'undefined' && dataBox !== false && dataBox != '') {
288                    dataBox = 'data-box="' + $('> div ', elem).eq(loopMove).attr('data-box') + '"';
289                } else {
290                    dataBox = '';
291                }
292                //
293                $('.camera_target_content .cameraContent:eq(' + loopMove + ')', wrap).append('<a class="camera_link" href="' + allLinks[loopMove] + '" ' + dataBox + ' target="' + allTargets[loopMove] + '"></a>');
294            }
295
296        }
297        $('.camera_caption', wrap).each(function () {
298            var ind = $(this).parent().index(),
299                    cont = wrap.find('.cameraContent').eq(ind);
300            $(this).appendTo(cont);
301        });
302
303        target.append('<div class="cameraCont" />');
304        var cameraCont = $('.cameraCont', wrap);
305
306
307
308        var loop;
309        for (loop = 0; loop < amountSlide; loop++) {
310            cameraCont.append('<div class="cameraSlide cameraSlide_' + loop + '" />');
311            var div = $('> div:eq(' + loop + ')', elem);
312            target.find('.cameraSlide_' + loop).clone(div);
313        }
314
315
316        function thumbnailVisible() {
317            var wTh = $(thumbs).width();
318            $('li', thumbs).removeClass('camera_visThumb');
319            $('li', thumbs).each(function () {
320                var pos = $(this).position(),
321                        ulW = $('ul', thumbs).outerWidth(),
322                        offUl = $('ul', thumbs).offset().left,
323                        offDiv = $('> div', thumbs).offset().left,
324                        ulLeft = offDiv - offUl;
325                if (ulLeft > 0) {
326                    $('.camera_prevThumbs', camera_thumbs_wrap).removeClass('hideNav');
327                } else {
328                    $('.camera_prevThumbs', camera_thumbs_wrap).addClass('hideNav');
329                }
330                if ((ulW - ulLeft) > wTh) {
331                    $('.camera_nextThumbs', camera_thumbs_wrap).removeClass('hideNav');
332                } else {
333                    $('.camera_nextThumbs', camera_thumbs_wrap).addClass('hideNav');
334                }
335                var left = pos.left,
336                       right = pos.left + ($(this).width());
337                if (right - ulLeft <= wTh && left - ulLeft >= 0) {
338                    $(this).addClass('camera_visThumb');
339                }
340            });
341        }
342
343        $(window).bind('load resize pageshow', function () {
344            thumbnailPos();
345            thumbnailVisible();
346        });
347
348
349        cameraCont.append('<div class="cameraSlide cameraSlide_' + loop + '" />');
350
351
352        var started;
353
354        wrap.show();
355        var w = target.width();
356        var h = target.height();
357
358        var setPause;
359
360        $(window).bind('resize pageshow', function () {
361            if (started == true) {
362                resizeImage();
363            }
364            $('ul', thumbs).animate({ 'margin-top': 0 }, 0, thumbnailPos);
365            if (!elem.hasClass('paused')) {
366                elem.addClass('paused');
367                if ($('.camera_stop', camera_thumbs_wrap).length) {
368                    $('.camera_stop', camera_thumbs_wrap).hide()
369                    $('.camera_play', camera_thumbs_wrap).show();
370                    if (loader != 'none') {
371                        $('#' + pieID).hide();
372                    }
373                } else {
374                    if (loader != 'none') {
375                        $('#' + pieID).hide();
376                    }
377                }
378                clearTimeout(setPause);
379                setPause = setTimeout(function () {
380                    elem.removeClass('paused');
381                    if ($('.camera_play', camera_thumbs_wrap).length) {
382                        $('.camera_play', camera_thumbs_wrap).hide();
383                        $('.camera_stop', camera_thumbs_wrap).show();
384                        if (loader != 'none') {
385                            $('#' + pieID).fadeIn();
386                        }
387                    } else {
388                        if (loader != 'none') {
389                            $('#' + pieID).fadeIn();
390                        }
391                    }
392                }, 1500);
393            }
394        });
395
396        function resizeImage() {
397            var res;
398            function resizeImageWork() {
399                w = wrap.width();
400                if (opts.height.indexOf('%') != -1) {
401                    var startH = Math.round(w / (100 / parseFloat(opts.height)));
402                    if (opts.minHeight != '' && startH < parseFloat(opts.minHeight)) {
403                        h = parseFloat(opts.minHeight);
404                    } else {
405                        h = startH;
406                    }
407                    wrap.css({ height: h });
408                } else if (opts.height == 'auto') {
409                    h = wrap.height();
410                } else {
411                    h = parseFloat(opts.height);
412                    wrap.css({ height: h });
413                }
414                $('.camerarelative', target).css({ 'width': w, 'height': h });
415                $('.imgLoaded', target).each(function () {
416                    var t = $(this),
417                           wT = t.attr('width'),
418                           hT = t.attr('height'),
419                           imgLoadIn = t.index(),
420                           mTop,
421                           mLeft,
422                           alignment = t.attr('data-alignment'),
423                           portrait = t.attr('data-portrait');
424
425                    if (typeof alignment === 'undefined' || alignment === false || alignment === '') {
426                        alignment = opts.alignment;
427                    }
428
429                    if (typeof portrait === 'undefined' || portrait === false || portrait === '') {
430                        portrait = opts.portrait;
431                    }
432
433                    if (portrait == false || portrait == 'false') {
434                        if ((wT / hT) < (w / h)) {
435                            var r = w / wT;
436                            var d = (Math.abs(h - (hT * r))) * 0.5;
437                            switch (alignment) {
438                                case 'topLeft':
439                                    mTop = 0;
440                                    break;
441                                case 'topCenter':
442                                    mTop = 0;
443                                    break;
444                                case 'topRight':
445                                    mTop = 0;
446                                    break;
447                                case 'centerLeft':
448                                    mTop = '-' + d + 'px';
449                                    break;
450                                case 'center':
451                                    mTop = '-' + d + 'px';
452                                    break;
453                                case 'centerRight':
454                                    mTop = '-' + d + 'px';
455                                    break;
456                                case 'bottomLeft':
457                                    mTop = '-' + d * 2 + 'px';
458                                    break;
459                                case 'bottomCenter':
460                                    mTop = '-' + d * 2 + 'px';
461                                    break;
462                                case 'bottomRight':
463                                    mTop = '-' + d * 2 + 'px';
464                                    break;
465                            }
466                            t.css({
467                                'height': hT * r,
468                                'margin-left': 0,
469                                'margin-right': 0,
470                                'margin-top': mTop,
471                                'position': 'absolute',
472                                'visibility': 'visible',
473                                'width': w
474                            });
475                        }
476                        else {
477                            var r = h / hT;
478                            var d = (Math.abs(w - (wT * r))) * 0.5;
479                            switch (alignment) {
480                                case 'topLeft':
481                                    mLeft = 0;
482                                    break;
483                                case 'topCenter':
484                                    mLeft = '-' + d + 'px';
485                                    break;
486                                case 'topRight':
487                                    mLeft = '-' + d * 2 + 'px';
488                                    break;
489                                case 'centerLeft':
490                                    mLeft = 0;
491                                    break;
492                                case 'center':
493                                    mLeft = '-' + d + 'px';
494                                    break;
495                                case 'centerRight':
496                                    mLeft = '-' + d * 2 + 'px';
497                                    break;
498                                case 'bottomLeft':
499                                    mLeft = 0;
500                                    break;
501                                case 'bottomCenter':
502                                    mLeft = '-' + d + 'px';
503                                    break;
504                                case 'bottomRight':
505                                    mLeft = '-' + d * 2 + 'px';
506                                    break;
507                            }
508                            t.css({
509                                'height': h,
510                                'margin-left': mLeft,
511                                'margin-right': mLeft,
512                                'margin-top': 0,
513                                'position': 'absolute',
514                                'visibility': 'visible',
515                                'width': wT * r
516                            });
517                        }
518                    } else {
519                        if ((wT / hT) < (w / h)) {
520                            var r = h / hT;
521                            var d = (Math.abs(w - (wT * r))) * 0.5;
522                            switch (alignment) {
523                                case 'topLeft':
524                                    mLeft = 0;
525                                    break;
526                                case 'topCenter':
527                                    mLeft = d + 'px';
528                                    break;
529                                case 'topRight':
530                                    mLeft = d * 2 + 'px';
531                                    break;
532                                case 'centerLeft':
533                                    mLeft = 0;
534                                    break;
535                                case 'center':
536                                    mLeft = d + 'px';
537                                    break;
538                                case 'centerRight':
539                                    mLeft = d * 2 + 'px';
540                                    break;
541                                case 'bottomLeft':
542                                    mLeft = 0;
543                                    break;
544                                case 'bottomCenter':
545                                    mLeft = d + 'px';
546                                    break;
547                                case 'bottomRight':
548                                    mLeft = d * 2 + 'px';
549                                    break;
550                            }
551                            t.css({
552                                'height': h,
553                                'margin-left': mLeft,
554                                'margin-right': mLeft,
555                                'margin-top': 0,
556                                'position': 'absolute',
557                                'visibility': 'visible',
558                                'width': wT * r
559                            });
560                        }
561                        else {
562                            var r = w / wT;
563                            var d = (Math.abs(h - (hT * r))) * 0.5;
564                            switch (alignment) {
565                                case 'topLeft':
566                                    mTop = 0;
567                                    break;
568                                case 'topCenter':
569                                    mTop = 0;
570                                    break;
571                                case 'topRight':
572                                    mTop = 0;
573                                    break;
574                                case 'centerLeft':
575                                    mTop = d + 'px';
576                                    break;
577                                case 'center':
578                                    mTop = d + 'px';
579                                    break;
580                                case 'centerRight':
581                                    mTop = d + 'px';
582                                    break;
583                                case 'bottomLeft':
584                                    mTop = d * 2 + 'px';
585                                    break;
586                                case 'bottomCenter':
587                                    mTop = d * 2 + 'px';
588                                    break;
589                                case 'bottomRight':
590                                    mTop = d * 2 + 'px';
591                                    break;
592                            }
593                            t.css({
594                                'height': hT * r,
595                                'margin-left': 0,
596                                'margin-right': 0,
597                                'margin-top': mTop,
598                                'position': 'absolute',
599                                'visibility': 'visible',
600                                'width': w
601                            });
602                        }
603                    }
604                });
605            }
606            if (started == true) {
607                clearTimeout(res);
608                res = setTimeout(resizeImageWork, 200);
609            } else {
610                resizeImageWork();
611            }
612
613            started = true;
614        }
615
616
617        var u,
618               setT;
619
620        var clickEv,
621               autoAdv,
622               navHover,
623               commands,
624               pagination;
625
626        var videoHover,
627               videoPresent;
628
629        if (isMobile() && opts.mobileAutoAdvance != '') {
630            autoAdv = opts.mobileAutoAdvance;
631        } else {
632            autoAdv = opts.autoAdvance;
633        }
634
635        if (autoAdv == false) {
636            elem.addClass('paused');
637        }
638
639        if (isMobile() && opts.mobileNavHover != '') {
640            navHover = opts.mobileNavHover;
641        } else {
642            navHover = opts.navigationHover;
643        }
644
645        if (elem.length != 0) {
646
647            var selector = $('.cameraSlide', target);
648            selector.wrapInner('<div class="camerarelative" />');
649
650            var navSlide;
651
652            var barDirection = opts.barDirection;
653
654            var camera_thumbs_wrap = wrap;
655
656
657            $('iframe', fakeHover).each(function () {
658                var t = $(this);
659                var src = t.attr('src');
660                t.attr('data-src', src);
661                var divInd = t.parent().index('.camera_src > div');
662                $('.camera_target_content .cameraContent:eq(' + divInd + ')', wrap).append(t);
663            });
664            function imgFake() {
665                $('iframe', fakeHover).each(function () {
666                    $('.camera_caption', fakeHover).show();
667                    var t = $(this);
668                    var cloneSrc = t.attr('data-src');
669                    t.attr('src', cloneSrc);
670                    var imgFakeUrl = opts.imagePath + 'blank.gif';
671                    var imgFake = new Image();
672                    imgFake.src = imgFakeUrl;
673                    if (opts.height.indexOf('%') != -1) {
674                        var startH = Math.round(w / (100 / parseFloat(opts.height)));
675                        if (opts.minHeight != '' && startH < parseFloat(opts.minHeight)) {
676                            h = parseFloat(opts.minHeight);
677                        } else {
678                            h = startH;
679                        }
680                    } else if (opts.height == 'auto') {
681                        h = wrap.height();
682                    } else {
683                        h = parseFloat(opts.height);
684                    }
685                    t.after($(imgFake).attr({ 'class': 'imgFake', 'width': w, 'height': h }));
686                    var clone = t.clone();
687                    t.remove();
688                    $(imgFake).bind('click', function () {
689                        if ($(this).css('position') == 'absolute') {
690                            $(this).remove();
691                            if (cloneSrc.indexOf('vimeo') != -1 || cloneSrc.indexOf('youtube') != -1) {
692                                if (cloneSrc.indexOf('?') != -1) {
693                                    autoplay = '&autoplay=1';
694                                } else {
695                                    autoplay = '?autoplay=1';
696                                }
697                            } else if (cloneSrc.indexOf('dailymotion') != -1) {
698                                if (cloneSrc.indexOf('?') != -1) {
699                                    autoplay = '&autoPlay=1';
700                                } else {
701                                    autoplay = '?autoPlay=1';
702                                }
703                            }
704                            clone.attr('src', cloneSrc + autoplay);
705                            videoPresent = true;
706                        } else {
707                            $(this).css({ position: 'absolute', top: 0, left: 0, zIndex: 10 }).after(clone);
708                            clone.css({ position: 'absolute', top: 0, left: 0, zIndex: 9 });
709                        }
710                    });
711                });
712            }
713
714            imgFake();
715
716
717            if (opts.hover == true) {
718                if (!isMobile()) {
719                    fakeHover.hover(function () {
720                        elem.addClass('hovered');
721                    }, function () {
722                        elem.removeClass('hovered');
723                    });
724                }
725            }
726
727            if (navHover == true) {
728                $(prevNav, wrap).animate({ opacity: 0 }, 0);
729                $(nextNav, wrap).animate({ opacity: 0 }, 0);
730                $(commands, wrap).animate({ opacity: 0 }, 0);
731                if (isMobile()) {
732                    $(document).on('vmouseover', fakeHoverSelector, function () {
733                        $(prevNav, wrap).animate({ opacity: 1 }, 200);
734                        $(nextNav, wrap).animate({ opacity: 1 }, 200);
735                        $(commands, wrap).animate({ opacity: 1 }, 200);
736                    });
737                    $(document).on('vmouseout', fakeHoverSelector, function () {
738                        $(prevNav, wrap).delay(500).animate({ opacity: 0 }, 200);
739                        $(nextNav, wrap).delay(500).animate({ opacity: 0 }, 200);
740                        $(commands, wrap).delay(500).animate({ opacity: 0 }, 200);
741                    });
742                } else {
743                    fakeHover.hover(function () {
744                        $(prevNav, wrap).animate({ opacity: 1 }, 200);
745                        $(nextNav, wrap).animate({ opacity: 1 }, 200);
746                        $(commands, wrap).animate({ opacity: 1 }, 200);
747                    }, function () {
748                        $(prevNav, wrap).animate({ opacity: 0 }, 200);
749                        $(nextNav, wrap).animate({ opacity: 0 }, 200);
750                        $(commands, wrap).animate({ opacity: 0 }, 200);
751                    });
752                }
753            }
754
755
756            camera_thumbs_wrap.on('click', '.camera_stop', function () {
757                autoAdv = false;
758                elem.addClass('paused');
759                if ($('.camera_stop', camera_thumbs_wrap).length) {
760                    $('.camera_stop', camera_thumbs_wrap).hide()
761                    $('.camera_play', camera_thumbs_wrap).show();
762                    if (loader != 'none') {
763                        $('#' + pieID).hide();
764                    }
765                } else {
766                    if (loader != 'none') {
767                        $('#' + pieID).hide();
768                    }
769                }
770            });
771
772            camera_thumbs_wrap.on('click', '.camera_play', function () {
773                autoAdv = true;
774                elem.removeClass('paused');
775                if ($('.camera_play', camera_thumbs_wrap).length) {
776                    $('.camera_play', camera_thumbs_wrap).hide();
777                    $('.camera_stop', camera_thumbs_wrap).show();
778                    if (loader != 'none') {
779                        $('#' + pieID).show();
780                    }
781                } else {
782                    if (loader != 'none') {
783                        $('#' + pieID).show();
784                    }
785                }
786            });
787
788            if (opts.pauseOnClick == true) {
789                $('.camera_target_content', fakeHover).mouseup(function () {
790                    autoAdv = false;
791                    elem.addClass('paused');
792                    $('.camera_stop', camera_thumbs_wrap).hide()
793                    $('.camera_play', camera_thumbs_wrap).show();
794                    $('#' + pieID).hide();
795                });
796            }
797            $('.cameraContent, .imgFake', fakeHover).hover(function () {
798                videoHover = true;
799            }, function () {
800                videoHover = false;
801            });
802
803            $('.cameraContent, .imgFake', fakeHover).bind('click', function () {
804                if (videoPresent == true && videoHover == true) {
805                    autoAdv = false;
806                    $('.camera_caption', fakeHover).hide();
807                    elem.addClass('paused');
808                    $('.camera_stop', camera_thumbs_wrap).hide()
809                    $('.camera_play', camera_thumbs_wrap).show();
810                    $('#' + pieID).hide();
811                }
812            });
813
814
815        }
816
817
818        function shuffle(arr) {
819            for (
820              var j, x, i = arr.length; i;
821              j = parseInt(Math.random() * i),
822              x = arr[--i], arr[i] = arr[j], arr[j] = x
823            );
824            return arr;
825        }
826
827        function isInteger(s) {
828            return Math.ceil(s) == Math.floor(s);
829        }
830
831        if (loader != 'pie') {
832            barContainer.append('<span class="camera_bar_cont" />');
833            $('.camera_bar_cont', barContainer)
834                    .animate({ opacity: opts.loaderOpacity }, 0)
835                    .css({ 'position': 'absolute', 'left': 0, 'right': 0, 'top': 0, 'bottom': 0, 'background-color': opts.loaderBgColor })
836                    .append('<span id="' + pieID + '" />');
837            $('#' + pieID).animate({ opacity: 0 }, 0);
838            var canvas = $('#' + pieID);
839            canvas.css({ 'position': 'absolute', 'background-color': opts.loaderColor });
840            switch (opts.barPosition) {
841                case 'left':
842                    barContainer.css({ right: 'auto', width: opts.loaderStroke });
843                    break;
844                case 'right':
845                    barContainer.css({ left: 'auto', width: opts.loaderStroke });
846                    break;
847                case 'top':
848                    barContainer.css({ bottom: 'auto', height: opts.loaderStroke });
849                    break;
850                case 'bottom':
851                    barContainer.css({ top: 'auto', height: opts.loaderStroke });
852                    break;
853            }
854            switch (barDirection) {
855                case 'leftToRight':
856                    canvas.css({ 'left': 0, 'right': 0, 'top': opts.loaderPadding, 'bottom': opts.loaderPadding });
857                    break;
858                case 'rightToLeft':
859                    canvas.css({ 'left': 0, 'right': 0, 'top': opts.loaderPadding, 'bottom': opts.loaderPadding });
860                    break;
861                case 'topToBottom':
862                    canvas.css({ 'left': opts.loaderPadding, 'right': opts.loaderPadding, 'top': 0, 'bottom': 0 });
863                    break;
864                case 'bottomToTop':
865                    canvas.css({ 'left': opts.loaderPadding, 'right': opts.loaderPadding, 'top': 0, 'bottom': 0 });
866                    break;
867            }
868        } else {
869            pieContainer.append('<canvas id="' + pieID + '"></canvas>');
870            var G_vmlCanvasManager;
871            var canvas = document.getElementById(pieID);
872            canvas.setAttribute("width", opts.pieDiameter);
873            canvas.setAttribute("height", opts.pieDiameter);
874            var piePosition;
875            switch (opts.piePosition) {
876                case 'leftTop':
877                    piePosition = 'left:0; top:0;';
878                    break;
879                case 'rightTop':
880                    piePosition = 'right:0; top:0;';
881                    break;
882                case 'leftBottom':
883                    piePosition = 'left:0; bottom:0;';
884                    break;
885                case 'rightBottom':
886                    piePosition = 'right:0; bottom:0;';
887                    break;
888            }
889            canvas.setAttribute("style", "position:absolute; z-index:1002; " + piePosition);
890            var rad;
891            var radNew;
892
893            if (canvas && canvas.getContext) {
894                var ctx = canvas.getContext("2d");
895                ctx.rotate(Math.PI * (3 / 2));
896                ctx.translate(-opts.pieDiameter, 0);
897            }
898
899        }
900        if (loader == 'none' || autoAdv == false) {
901            $('#' + pieID).hide();
902            $('.camera_canvas_wrap', camera_thumbs_wrap).hide();
903        }
904
905        if ($(pagination).length) {
906            $(pagination).append('<ul class="camera_pag_ul" />');
907            var li;
908            for (li = 0; li < amountSlide; li++) {
909                $('.camera_pag_ul', wrap).append('<li class="pag_nav_' + li + '" style="position:relative; z-index:1002"><span><span>' + li + '</span></span></li>');
910            }
911            $('.camera_pag_ul li', wrap).hover(function () {
912                $(this).addClass('camera_hover');
913                if ($('.camera_thumb', this).length) {
914                    var wTh = $('.camera_thumb', this).outerWidth(),
915                    hTh = $('.camera_thumb', this).outerHeight(),
916                    wTt = $(this).outerWidth();
917                    $('.camera_thumb', this).show().css({ 'top': '-' + hTh + 'px', 'left': '-' + (wTh - wTt) / 2 + 'px' }).animate({ 'opacity': 1, 'margin-top': '-3px' }, 200);
918                    $('.thumb_arrow', this).show().animate({ 'opacity': 1, 'margin-top': '-3px' }, 200);
919                }
920            }, function () {
921                $(this).removeClass('camera_hover');
922                $('.camera_thumb', this).animate({ 'margin-top': '-20px', 'opacity': 0 }, 200, function () {
923                    $(this).css({ marginTop: '5px' }).hide();
924                });
925                $('.thumb_arrow', this).animate({ 'margin-top': '-20px', 'opacity': 0 }, 200, function () {
926                    $(this).css({ marginTop: '5px' }).hide();
927                });
928            });
929        }
930
931
932
933        if ($(thumbs).length) {
934            var thumbUrl;
935            if (!$(pagination).length) {
936                $(thumbs).append('<div />');
937                $(thumbs).before('<div class="camera_prevThumbs hideNav"><div></div></div>').before('<div class="camera_nextThumbs hideNav"><div></div></div>');
938                $('> div', thumbs).append('<ul />');
939                $.each(allThumbs, function (i, val) {
940                    if ($('> div', elem).eq(i).attr('data-thumb') != '') {
941                        var thumbUrl = $('> div', elem).eq(i).attr('data-thumb'),
942                               newImg = new Image();
943                        newImg.src = thumbUrl;
944                        $('ul', thumbs).append('<li class="pix_thumb pix_thumb_' + i + '" />');
945                        $('li.pix_thumb_' + i, thumbs).append($(newImg).attr('class', 'camera_thumb'));
946                    }
947                });
948            } else {
949                $.each(allThumbs, function (i, val) {
950                    if ($('> div', elem).eq(i).attr('data-thumb') != '') {
951                        var thumbUrl = $('> div', elem).eq(i).attr('data-thumb'),
952                               newImg = new Image();
953                        newImg.src = thumbUrl;
954                        $('li.pag_nav_' + i, pagination).append($(newImg).attr('class', 'camera_thumb').css({ 'position': 'absolute' }).animate({ opacity: 0 }, 0));
955                        $('li.pag_nav_' + i + ' > img', pagination).after('<div class="thumb_arrow" />');
956                        $('li.pag_nav_' + i + ' > .thumb_arrow', pagination).animate({ opacity: 0 }, 0);
957                    }
958                });
959                wrap.css({ marginBottom: $(pagination).outerHeight() });
960            }
961        } else if (!$(thumbs).length && $(pagination).length) {
962            wrap.css({ marginBottom: $(pagination).outerHeight() });
963        }
964
965
966        var firstPos = true;
967
968        function thumbnailPos() {
969            if ($(thumbs).length && !$(pagination).length) {
970                var wTh = $(thumbs).outerWidth(),
971                       owTh = $('ul > li', thumbs).outerWidth(),
972                       pos = $('li.cameracurrent', thumbs).length ? $('li.cameracurrent', thumbs).position() : '',
973                       ulW = ($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth()),
974                       offUl = $('ul', thumbs).offset().left,
975                       offDiv = $('> div', thumbs).offset().left,
976                       ulLeft;
977
978                if (offUl < 0) {
979                    ulLeft = '-' + (offDiv - offUl);
980                } else {
981                    ulLeft = offDiv - offUl;
982                }
983
984
985
986                if (firstPos == true) {
987                    $('ul', thumbs).width($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth());
988                    if ($(thumbs).length && !$(pagination).lenght) {
989                        wrap.css({ marginBottom: $(thumbs).outerHeight() });
990                    }
991                    thumbnailVisible();
992                    /*I repeat this two lines because of a problem with iPhones*/
993                    $('ul', thumbs).width($('ul > li', thumbs).length * $('ul > li', thumbs).outerWidth());
994                    if ($(thumbs).length && !$(pagination).lenght) {
995                        wrap.css({ marginBottom: $(thumbs).outerHeight() });
996                    }
997                    /*...*/
998                }
999                firstPos = false;
1000
1001                var left = $('li.cameracurrent', thumbs).length ? pos.left : '',
1002                        right = $('li.cameracurrent', thumbs).length ? pos.left + ($('li.cameracurrent', thumbs).outerWidth()) : '';
1003                if (left < $('li.cameracurrent', thumbs).outerWidth()) {
1004                    left = 0;
1005                }
1006                if (right - ulLeft > wTh) {
1007                    if ((left + wTh) < ulW) {
1008                        $('ul', thumbs).animate({ 'margin-left': '-' + (left) + 'px' }, 500, thumbnailVisible);
1009                    } else {
1010                        $('ul', thumbs).animate({ 'margin-left': '-' + ($('ul', thumbs).outerWidth() - wTh) + 'px' }, 500, thumbnailVisible);
1011                    }
1012                } else if (left - ulLeft < 0) {
1013                    $('ul', thumbs).animate({ 'margin-left': '-' + (left) + 'px' }, 500, thumbnailVisible);
1014                } else {
1015                    $('ul', thumbs).css({ 'margin-left': 'auto', 'margin-right': 'auto' });
1016                    setTimeout(thumbnailVisible, 100);
1017                }
1018
1019            }
1020        }
1021
1022        if ($(commands).length) {
1023            $(commands).append('<div class="camera_play"></div>').append('<div class="camera_stop"></div>');
1024            if (autoAdv == true) {
1025                $('.camera_play', camera_thumbs_wrap).hide();
1026                $('.camera_stop', camera_thumbs_wrap).show();
1027            } else {
1028                $('.camera_stop', camera_thumbs_wrap).hide();
1029                $('.camera_play', camera_thumbs_wrap).show();
1030            }
1031
1032        }
1033
1034
1035        function canvasLoader() {
1036            rad = 0;
1037            var barWidth = $('.camera_bar_cont', camera_thumbs_wrap).width(),
1038                    barHeight = $('.camera_bar_cont', camera_thumbs_wrap).height();
1039
1040            if (loader != 'pie') {
1041                switch (barDirection) {
1042                    case 'leftToRight':
1043                        $('#' + pieID).css({ 'right': barWidth });
1044                        break;
1045                    case 'rightToLeft':
1046                        $('#' + pieID).css({ 'left': barWidth });
1047                        break;
1048                    case 'topToBottom':
1049                        $('#' + pieID).css({ 'bottom': barHeight });
1050                        break;
1051                    case 'bottomToTop':
1052                        $('#' + pieID).css({ 'top': barHeight });
1053                        break;
1054                }
1055            } else {
1056                ctx.clearRect(0, 0, opts.pieDiameter, opts.pieDiameter);
1057            }
1058        }
1059
1060
1061        canvasLoader();
1062
1063
1064        $('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom', fakeHover).each(function () {
1065            $(this).css('visibility', 'hidden');
1066        });
1067
1068        opts.onStartLoading.call(this);
1069
1070        nextSlide();
1071
1072
1073        /*************************** FUNCTION nextSlide() ***************************/
1074
1075        function nextSlide(navSlide) {
1076            elem.addClass('camerasliding');
1077
1078            videoPresent = false;
1079            var vis = parseFloat($('div.cameraSlide.cameracurrent', target).index());
1080
1081            if (navSlide > 0) {
1082                var slideI = navSlide - 1;
1083            } else if (vis == amountSlide - 1) {
1084                var slideI = 0;
1085            } else {
1086                var slideI = vis + 1;
1087            }
1088
1089
1090            var slide = $('.cameraSlide:eq(' + slideI + ')', target);
1091            var slideNext = $('.cameraSlide:eq(' + (slideI + 1) + ')', target).addClass('cameranext');
1092            if (vis != slideI + 1) {
1093                slideNext.hide();
1094            }
1095            $('.cameraContent', fakeHover).fadeOut(600);
1096            $('.camera_caption', fakeHover).show();
1097
1098            $('.camerarelative', slide).append($('> div ', elem).eq(slideI).find('> div.camera_effected'));
1099
1100            $('.camera_target_content .cameraContent:eq(' + slideI + ')', wrap).append($('> div ', elem).eq(slideI).find('> div'));
1101
1102            if (!$('.imgLoaded', slide).length) {
1103                var imgUrl = allImg[slideI];
1104                var imgLoaded = new Image();
1105                imgLoaded.src = imgUrl + "?" + new Date().getTime();
1106                slide.css('visibility', 'hidden');
1107                slide.prepend($(imgLoaded).attr('class', 'imgLoaded').css('visibility', 'hidden'));
1108                var wT, hT;
1109                if (!$(imgLoaded).get(0).complete || wT == '0' || hT == '0' || typeof wT === 'undefined' || wT === false || typeof hT === 'undefined' || hT === false) {
1110                    $('.camera_loader', wrap).delay(500).fadeIn(400);
1111                    imgLoaded.onload = function () {
1112                        wT = imgLoaded.naturalWidth;
1113                        hT = imgLoaded.naturalHeight;
1114                        $(imgLoaded).attr('data-alignment', allAlign[slideI]).attr('data-portrait', allPor[slideI]);
1115                        $(imgLoaded).attr('width', wT);
1116                        $(imgLoaded).attr('height', hT);
1117                        target.find('.cameraSlide_' + slideI).hide().css('visibility', 'visible');
1118                        resizeImage();
1119                        nextSlide(slideI + 1);
1120                    };
1121                }
1122            } else {
1123                if (allImg.length > (slideI + 1) && !$('.imgLoaded', slideNext).length) {
1124                    var imgUrl2 = allImg[(slideI + 1)];
1125                    var imgLoaded2 = new Image();
1126                    imgLoaded2.src = imgUrl2 + "?" + new Date().getTime();
1127                    slideNext.prepend($(imgLoaded2).attr('class', 'imgLoaded').css('visibility', 'hidden'));
1128                    imgLoaded2.onload = function () {
1129                        wT = imgLoaded2.naturalWidth;
1130                        hT = imgLoaded2.naturalHeight;
1131                        $(imgLoaded2).attr('data-alignment', allAlign[slideI + 1]).attr('data-portrait', allPor[slideI + 1]);
1132                        $(imgLoaded2).attr('width', wT);
1133                        $(imgLoaded2).attr('height', hT);
1134                        resizeImage();
1135                    };
1136                }
1137                opts.onLoaded.call(this);
1138                if ($('.camera_loader', wrap).is(':visible')) {
1139                    $('.camera_loader', wrap).fadeOut(400);
1140                } else {
1141                    $('.camera_loader', wrap).css({ 'visibility': 'hidden' });
1142                    $('.camera_loader', wrap).fadeOut(400, function () {
1143                        $('.camera_loader', wrap).css({ 'visibility': 'visible' });
1144                    });
1145                }
1146                var rows = opts.rows,
1147                        cols = opts.cols,
1148                        couples = 1,
1149                        difference = 0,
1150                        dataSlideOn,
1151                        time,
1152                        transPeriod,
1153                        fx,
1154                        easing,
1155                        randomFx = new Array('simpleFade', 'curtainTopLeft', 'curtainTopRight', 'curtainBottomLeft', 'curtainBottomRight', 'curtainSliceLeft', 'curtainSliceRight', 'blindCurtainTopLeft', 'blindCurtainTopRight', 'blindCurtainBottomLeft', 'blindCurtainBottomRight', 'blindCurtainSliceBottom', 'blindCurtainSliceTop', 'stampede', 'mosaic', 'mosaicReverse', 'mosaicRandom', 'mosaicSpiral', 'mosaicSpiralReverse', 'topLeftBottomRight', 'bottomRightTopLeft', 'bottomLeftTopRight', 'topRightBottomLeft', 'scrollLeft', 'scrollRight', 'scrollTop', 'scrollBottom', 'scrollHorz');
1156                marginLeft = 0,
1157                marginTop = 0,
1158                opacityOnGrid = 0;
1159
1160                if (opts.opacityOnGrid == true) {
1161                    opacityOnGrid = 0;
1162                } else {
1163                    opacityOnGrid = 1;
1164                }
1165
1166
1167
1168                var dataFx = $(' > div', elem).eq(slideI).attr('data-fx');
1169
1170                if (isMobile() && opts.mobileFx != '' && opts.mobileFx != 'default') {
1171                    fx = opts.mobileFx;
1172                } else {
1173                    if (typeof dataFx !== 'undefined' && dataFx !== false && dataFx !== 'default') {
1174                        fx = dataFx;
1175                    } else {
1176                        fx = opts.fx;
1177                    }
1178                }
1179
1180                if (fx == 'random') {
1181                    fx = shuffle(randomFx);
1182                    fx = fx[0];
1183                } else {
1184                    fx = fx;
1185                    if (fx.indexOf(',') > 0) {
1186                        fx = fx.replace(/ /g, '');
1187                        fx = fx.split(',');
1188                        fx = shuffle(fx);
1189                        fx = fx[0];
1190                    }
1191                }
1192
1193                dataEasing = $(' > div', elem).eq(slideI).attr('data-easing');
1194                mobileEasing = $(' > div', elem).eq(slideI).attr('data-mobileEasing');
1195
1196                if (isMobile() && opts.mobileEasing != '' && opts.mobileEasing != 'default') {
1197                    if (typeof mobileEasing !== 'undefined' && mobileEasing !== false && mobileEasing !== 'default') {
1198                        easing = mobileEasing;
1199                    } else {
1200                        easing = opts.mobileEasing;
1201                    }
1202                } else {
1203                    if (typeof dataEasing !== 'undefined' && dataEasing !== false && dataEasing !== 'default') {
1204                        easing = dataEasing;
1205                    } else {
1206                        easing = opts.easing;
1207                    }
1208                }
1209
1210                dataSlideOn = $(' >
1210 div', elem).eq(slideI).attr('data-slideOn');
1211                if (typeof dataSlideOn !== 'undefined' && dataSlideOn !== false) {
1212                    slideOn = dataSlideOn;
1213                } else {
1214                    if (opts.slideOn == 'random') {
1215                        var slideOn = new Array('next', 'prev');
1216                        slideOn = shuffle(slideOn);
1217                        slideOn = slideOn[0];
1218                    } else {
1219                        slideOn = opts.slideOn;
1220                    }
1221                }
1222
1223                var dataTime = $(' > div', elem).eq(slideI).attr('data-time');
1224                if (typeof dataTime !== 'undefined' && dataTime !== false && dataTime !== '') {
1225                    time = parseFloat(dataTime);
1226                } else {
1227                    time = opts.time;
1228                }
1229
1230                var dataTransPeriod = $(' > div', elem).eq(slideI).attr('data-transPeriod');
1231                if (typeof dataTransPeriod !== 'undefined' && dataTransPeriod !== false && dataTransPeriod !== '') {
1232                    transPeriod = parseFloat(dataTransPeriod);
1233                } else {
1234                    transPeriod = opts.transPeriod;
1235                }
1236
1237                if (!$(elem).hasClass('camerastarted')) {
1238                    fx = 'simpleFade';
1239                    slideOn = 'next';
1240                    easing = '';
1241                    transPeriod = 400;
1242                    $(elem).addClass('camerastarted')
1243                }
1244
1245                switch (fx) {
1246                    case 'simpleFade':
1247                        cols = 1;
1248                        rows = 1;
1249                        break;
1250                    case 'curtainTopLeft':
1251                        if (opts.slicedCols == 0) {
1252                            cols = opts.cols;
1253                        } else {
1254                            cols = opts.slicedCols;
1255                        }
1256                        rows = 1;
1257                        break;
1258                    case 'curtainTopRight':
1259                        if (opts.slicedCols == 0) {
1260                            cols = opts.cols;
1261                        } else {
1262                            cols = opts.slicedCols;
1263                        }
1264                        rows = 1;
1265                        break;
1266                    case 'curtainBottomLeft':
1267                        if (opts.slicedCols == 0) {
1268                            cols = opts.cols;
1269                        } else {
1270                            cols = opts.slicedCols;
1271                        }
1272                        rows = 1;
1273                        break;
1274                    case 'curtainBottomRight':
1275                        if (opts.slicedCols == 0) {
1276                            cols = opts.cols;
1277                        } else {
1278                            cols = opts.slicedCols;
1279                        }
1280                        rows = 1;
1281                        break;
1282                    case 'curtainSliceLeft':
1283                        if (opts.slicedCols == 0) {
1284                            cols = opts.cols;
1285                        } else {
1286                            cols = opts.slicedCols;
1287                        }
1288                        rows = 1;
1289                        break;
1290                    case 'curtainSliceRight':
1291                        if (opts.slicedCols == 0) {
1292                            cols = opts.cols;
1293                        } else {
1294                            cols = opts.slicedCols;
1295                        }
1296                        rows = 1;
1297                        break;
1298                    case 'blindCurtainTopLeft':
1299                        if (opts.slicedRows == 0) {
1300                            rows = opts.rows;
1301                        } else {
1302                            rows = opts.slicedRows;
1303                        }
1304                        cols = 1;
1305                        break;
1306                    case 'blindCurtainTopRight':
1307                        if (opts.slicedRows == 0) {
1308                            rows = opts.rows;
1309                        } else {
1310                            rows = opts.slicedRows;
1311                        }
1312                        cols = 1;
1313                        break;
1314                    case 'blindCurtainBottomLeft':
1315                        if (opts.slicedRows == 0) {
1316                            rows = opts.rows;
1317                        } else {
1318                            rows = opts.slicedRows;
1319                        }
1320                        cols = 1;
1321                        break;
1322                    case 'blindCurtainBottomRight':
1323                        if (opts.slicedRows == 0) {
1324                            rows = opts.rows;
1325                        } else {
1326                            rows = opts.slicedRows;
1327                        }
1328                        cols = 1;
1329                        break;
1330                    case 'blindCurtainSliceTop':
1331                        if (opts.slicedRows == 0) {
1332                            rows = opts.rows;
1333                        } else {
1334                            rows = opts.slicedRows;
1335                        }
1336                        cols = 1;
1337                        break;
1338                    case 'blindCurtainSliceBottom':
1339                        if (opts.slicedRows == 0) {
1340                            rows = opts.rows;
1341                        } else {
1342                            rows = opts.slicedRows;
1343                        }
1344                        cols = 1;
1345                        break;
1346                    case 'stampede':
1347                        difference = '-' + transPeriod;
1348                        break;
1349                    case 'mosaic':
1350                        difference = opts.gridDifference;
1351                        break;
1352                    case 'mosaicReverse':
1353                        difference = opts.gridDifference;
1354                        break;
1355                    case 'mosaicRandom':
1356                        break;
1357                    case 'mosaicSpiral':
1358                        difference = opts.gridDifference;
1359                        couples = 1.7;
1360                        break;
1361                    case 'mosaicSpiralReverse':
1362                        difference = opts.gridDifference;
1363                        couples = 1.7;
1364                        break;
1365                    case 'topLeftBottomRight':
1366                        difference = opts.gridDifference;
1367                        couples = 6;
1368                        break;
1369                    case 'bottomRightTopLeft':
1370                        difference = opts.gridDifference;
1371                        couples = 6;
1372                        break;
1373                    case 'bottomLeftTopRight':
1374                        difference = opts.gridDifference;
1375                        couples = 6;
1376                        break;
1377                    case 'topRightBottomLeft':
1378                        difference = opts.gridDifference;
1379                        couples = 6;
1380                        break;
1381                    case 'scrollLeft':
1382                        cols = 1;
1383                        rows = 1;
1384                        break;
1385                    case 'scrollRight':
1386                        cols = 1;
1387                        rows = 1;
1388                        break;
1389                    case 'scrollTop':
1390                        cols = 1;
1391                        rows = 1;
1392                        break;
1393                    case 'scrollBottom':
1394                        cols = 1;
1395                        rows = 1;
1396                        break;
1397                    case 'scrollHorz':
1398                        cols = 1;
1399                        rows = 1;
1400                        break;
1401                }
1402
1403                var cycle = 0;
1404                var blocks = rows * cols;
1405                var leftScrap = w - (Math.floor(w / cols) * cols);
1406                var topScrap = h - (Math.floor(h / rows) * rows);
1407                var addLeft;
1408                var addTop;
1409                var tAppW = 0;
1410                var tAppH = 0;
1411                var arr = new Array();
1412                var delay = new Array();
1413                var order = new Array();
1414                while (cycle < blocks) {
1415                    arr.push(cycle);
1416                    delay.push(cycle);
1417                    cameraCont.append('<div class="cameraappended" style="display:none; overflow:hidden; position:absolute; z-index:1000" />');
1418                    var tApp = $('.cameraappended:eq(' + cycle + ')', target);
1419                    if (fx == 'scrollLeft' || fx == 'scrollRight' || fx == 'scrollTop' || fx == 'scrollBottom' || fx == 'scrollHorz') {
1420                        selector.eq(slideI).clone().show().appendTo(tApp);
1421                    } else {
1422                        if (slideOn == 'next') {
1423                            selector.eq(slideI).clone().show().appendTo(tApp);
1424                        } else {
1425                            selector.eq(vis).clone().show().appendTo(tApp);
1426                        }
1427                    }
1428
1429                    if (cycle % cols < leftScrap) {
1430                        addLeft = 1;
1431                    } else {
1432                        addLeft = 0;
1433                    }
1434                    if (cycle % cols == 0) {
1435                        tAppW = 0;
1436                    }
1437                    if (Math.floor(cycle / cols) < topScrap) {
1438                        addTop = 1;
1439                    } else {
1440                        addTop = 0;
1441                    }
1442                    tApp.css({
1443                        'height': Math.floor((h / rows) + addTop + 1),
1444                        'left': tAppW,
1445                        'top': tAppH,
1446                        'width': Math.floor((w / cols) + addLeft + 1)
1447                    });
1448                    $('> .cameraSlide', tApp).css({
1449                        'height': h,
1450                        'margin-left': '-' + tAppW + 'px',
1451                        'margin-top': '-' + tAppH + 'px',
1452                        'width': w
1453                    });
1454                    tAppW = tAppW + tApp.width() - 1;
1455                    if (cycle % cols == cols - 1) {
1456                        tAppH = tAppH + tApp.height() - 1;
1457                    }
1458                    cycle++;
1459                }
1460
1461
1462
1463                switch (fx) {
1464                    case 'curtainTopLeft':
1465                        break;
1466                    case 'curtainBottomLeft':
1467                        break;
1468                    case 'curtainSliceLeft':
1469                        break;
1470                    case 'curtainTopRight':
1471                        arr = arr.reverse();
1472                        break;
1473                    case 'curtainBottomRight':
1474                        arr = arr.reverse();
1475                        break;
1476                    case 'curtainSliceRight':
1477                        arr = arr.reverse();
1478                        break;
1479                    case 'blindCurtainTopLeft':
1480                        break;
1481                    case 'blindCurtainBottomLeft':
1482                        arr = arr.reverse();
1483                        break;
1484                    case 'blindCurtainSliceTop':
1485                        break;
1486                    case 'blindCurtainTopRight':
1487                        break;
1488                    case 'blindCurtainBottomRight':
1489                        arr = arr.reverse();
1490                        break;
1491                    case 'blindCurtainSliceBottom':
1492                        arr = arr.reverse();
1493                        break;
1494                    case 'stampede':
1495                        arr = shuffle(arr);
1496                        break;
1497                    case 'mosaic':
1498                        break;
1499                    case 'mosaicReverse':
1500                        arr = arr.reverse();
1501                        break;
1502                    case 'mosaicRandom':
1503                        arr = shuffle(arr);
1504                        break;
1505                    case 'mosaicSpiral':
1506                        var rows2 = rows / 2, x, y, z, n = 0;
1507                        for (z = 0; z < rows2; z++) {
1508                            y = z;
1509                            for (x = z; x < cols - z - 1; x++) {
1510                                order[n++] = y * cols + x;
1511                            }
1512                            x = cols - z - 1;
1513                            for (y = z; y < rows - z - 1; y++) {
1514                                order[n++] = y * cols + x;
1515                            }
1516                            y = rows - z - 1;
1517                            for (x = cols - z - 1; x > z; x--) {
1518                                order[n++] = y * cols + x;
1519                            }
1520                            x = z;
1521                            for (y = rows - z - 1; y > z; y--) {
1522                                order[n++] = y * cols + x;
1523                            }
1524                        }
1525
1526                        arr = order;
1527
1528                        break;
1529                    case 'mosaicSpiralReverse':
1530                        var rows2 = rows / 2, x, y, z, n = blocks - 1;
1531                        for (z = 0; z < rows2; z++) {
1532                            y = z;
1533                            for (x = z; x < cols - z - 1; x++) {
1534                                order[n--] = y * cols + x;
1535                            }
1536                            x = cols - z - 1;
1537                            for (y = z; y < rows - z - 1; y++) {
1538                                order[n--] = y * cols + x;
1539                            }
1540                            y = rows - z - 1;
1541                            for (x = cols - z - 1; x > z; x--) {
1542                                order[n--] = y * cols + x;
1543                            }
1544                            x = z;
1545                            for (y = rows - z - 1; y > z; y--) {
1546                                order[n--] = y * cols + x;
1547                            }
1548                        }
1549
1550                        arr = order;
1551
1552                        break;
1553                    case 'topLeftBottomRight':
1554                        for (var y = 0; y < rows; y++)
1555                            for (var x = 0; x < cols; x++) {
1556                                order.push(x + y);
1557                            }
1558                        delay = order;
1559                        break;
1560                    case 'bottomRightTopLeft':
1561                        for (var y = 0; y < rows; y++)
1562                            for (var x = 0; x < cols; x++) {
1563                                order.push(x + y);
1564                            }
1565                        delay = order.reverse();
1566                        break;
1567                    case 'bottomLeftTopRight':
1568                        for (var y = rows; y > 0; y--)
1569                            for (var x = 0; x < cols; x++) {
1570                                order.push(x + y);
1571                            }
1572                        delay = order;
1573                        break;
1574                    case 'topRightBottomLeft':
1575                        for (var y = 0; y < rows; y++)
1576                            for (var x = cols; x > 0; x--) {
1577                                order.push(x + y);
1578                            }
1579                        delay = order;
1580                        break;
1581                }
1582
1583
1584
1585                $.each(arr, function (index, value) {
1586
1587                    if (value % cols < leftScrap) {
1588                        addLeft = 1;
1589                    } else {
1590                        addLeft = 0;
1591                    }
1592                    if (value % cols == 0) {
1593                        tAppW = 0;
1594                    }
1595                    if (Math.floor(value / cols) < topScrap) {
1596                        addTop = 1;
1597                    } else {
1598                        addTop = 0;
1599                    }
1600
1601                    switch (fx) {
1602                        case 'simpleFade':
1603                            height = h;
1604                            width = w;
1605                            opacityOnGrid = 0;
1606                            break;
1607                        case 'curtainTopLeft':
1608                            height = 0,
1609                            width = Math.floor((w / cols) + addLeft + 1),
1610                            marginTop = '-' + Math.floor((h / rows) + addTop + 1) + 'px';
1611                            break;
1612                        case 'curtainTopRight':
1613                            height = 0,
1614                            width = Math.floor((w / cols) + addLeft + 1),
1615                            marginTop = '-' + Math.floor((h / rows) + addTop + 1) + 'px';
1616                            break;
1617                        case 'curtainBottomLeft':
1618                            height = 0,
1619                            width = Math.floor((w / cols) + addLeft + 1),
1620                            marginTop = Math.floor((h / rows) + addTop + 1) + 'px';
1621                            break;
1622                        case 'curtainBottomRight':
1623                            height = 0,
1624                            width = Math.floor((w / cols) + addLeft + 1),
1625                            marginTop = Math.floor((h / rows) + addTop + 1) + 'px';
1626                            break;
1627                        case 'curtainSliceLeft':
1628                            height = 0,
1629                            width = Math.floor((w / cols) + addLeft + 1);
1630                            if (value % 2 == 0) {
1631                                marginTop = Math.floor((h / rows) + addTop + 1) + 'px';
1632                            } else {
1633                                marginTop = '-' + Math.floor((h / rows) + addTop + 1) + 'px';
1634                            }
1635                            break;
1636                        case 'curtainSliceRight':
1637                            height = 0,
1638                            width = Math.floor((w / cols) + addLeft + 1);
1639                            if (value % 2 == 0) {
1640                                marginTop = Math.floor((h / rows) + addTop + 1) + 'px';
1641                            } else {
1642                                marginTop = '-' + Math.floor((h / rows) + addTop + 1) + 'px';
1643                            }
1644                            break;
1645                        case 'blindCurtainTopLeft':
1646                            height = Math.floor((h / rows) + addTop + 1),
1647                            width = 0,
1648                            marginLeft = '-' + Math.floor((w / cols
1648) + addLeft + 1) + 'px';
1649                            break;
1650                        case 'blindCurtainTopRight':
1651                            height = Math.floor((h / rows) + addTop + 1),
1652                            width = 0,
1653                            marginLeft = Math.floor((w / cols) + addLeft + 1) + 'px';
1654                            break;
1655                        case 'blindCurtainBottomLeft':
1656                            height = Math.floor((h / rows) + addTop + 1),
1657                            width = 0,
1658                            marginLeft = '-' + Math.floor((w / cols) + addLeft + 1) + 'px';
1659                            break;
1660                        case 'blindCurtainBottomRight':
1661                            height = Math.floor((h / rows) + addTop + 1),
1662                            width = 0,
1663                            marginLeft = Math.floor((w / cols) + addLeft + 1) + 'px';
1664                            break;
1665                        case 'blindCurtainSliceBottom':
1666                            height = Math.floor((h / rows) + addTop + 1),
1667                            width = 0;
1668                            if (value % 2 == 0) {
1669                                marginLeft = '-' + Math.floor((w / cols) + addLeft + 1) + 'px';
1670                            } else {
1671                                marginLeft = Math.floor((w / cols) + addLeft + 1) + 'px';
1672                            }
1673                            break;
1674                        case 'blindCurtainSliceTop':
1675                            height = Math.floor((h / rows) + addTop + 1),
1676                            width = 0;
1677                            if (value % 2 == 0) {
1678                                marginLeft = '-' + Math.floor((w / cols) + addLeft + 1) + 'px';
1679                            } else {
1680                                marginLeft = Math.floor((w / cols) + addLeft + 1) + 'px';
1681                            }
1682                            break;
1683                        case 'stampede':
1684                            height = 0;
1685                            width = 0;
1686                            marginLeft = (w * 0.2) * (((index) % cols) - (cols - (Math.floor(cols / 2)))) + 'px';
1687                            marginTop = (h * 0.2) * ((Math.floor(index / cols) + 1) - (rows - (Math.floor(rows / 2)))) + 'px';
1688                            break;
1689                        case 'mosaic':
1690                            height = 0;
1691                            width = 0;
1692                            break;
1693                        case 'mosaicReverse':
1694                            height = 0;
1695                            width = 0;
1696                            marginLeft = Math.floor((w / cols) + addLeft + 1) + 'px';
1697                            marginTop = Math.floor((h / rows) + addTop + 1) + 'px';
1698                            break;
1699                        case 'mosaicRandom':
1700                            height = 0;
1701                            width = 0;
1702                            marginLeft = Math.floor((w / cols) + addLeft + 1) * 0.5 + 'px';
1703                            marginTop = Math.floor((h / rows) + addTop + 1) * 0.5 + 'px';
1704                            break;
1705                        case 'mosaicSpiral':
1706                            height = 0;
1707                            width = 0;
1708                            marginLeft = Math.floor((w / cols) + addLeft + 1) * 0.5 + 'px';
1709                            marginTop = Math.floor((h / rows) + addTop + 1) * 0.5 + 'px';
1710                            break;
1711                        case 'mosaicSpiralReverse':
1712                            height = 0;
1713                            width = 0;
1714                            marginLeft = Math.floor((w / cols) + addLeft + 1) * 0.5 + 'px';
1715                            marginTop = Math.floor((h / rows) + addTop + 1) * 0.5 + 'px';
1716                            break;
1717                        case 'topLeftBottomRight':
1718                            height = 0;
1719                            width = 0;
1720                            break;
1721                        case 'bottomRightTopLeft':
1722                            height = 0;
1723                            width = 0;
1724                            marginLeft = Math.floor((w / cols) + addLeft + 1) + 'px';
1725                            marginTop = Math.floor((h / rows) + addTop + 1) + 'px';
1726                            break;
1727                        case 'bottomLeftTopRight':
1728                            height = 0;
1729                            width = 0;
1730                            marginLeft = 0;
1731                            marginTop = Math.floor((h / rows) + addTop + 1) + 'px';
1732                            break;
1733                        case 'topRightBottomLeft':
1734                            height = 0;
1735                            width = 0;
1736                            marginLeft = Math.floor((w / cols) + addLeft + 1) + 'px';
1737                            marginTop = 0;
1738                            break;
1739                        case 'scrollRight':
1740                            height = h;
1741                            width = w;
1742                            marginLeft = -w;
1743                            break;
1744                        case 'scrollLeft':
1745                            height = h;
1746                            width = w;
1747                            marginLeft = w;
1748                            break;
1749                        case 'scrollTop':
1750                            height = h;
1751                            width = w;
1752                            marginTop = h;
1753                            break;
1754                        case 'scrollBottom':
1755                            height = h;
1756                            width = w;
1757                            marginTop = -h;
1758                            break;
1759                        case 'scrollHorz':
1760                            height = h;
1761                            width = w;
1762                            if (vis == 0 && slideI == amountSlide - 1) {
1763                                marginLeft = -w;
1764                            } else if (vis < slideI || (vis == amountSlide - 1 && slideI == 0)) {
1765                                marginLeft = w;
1766                            } else {
1767                                marginLeft = -w;
1768                            }
1769                            break;
1770                    }
1771
1772
1773                    var tApp = $('.cameraappended:eq(' + value + ')', target);
1774
1775                    if (typeof u !== 'undefined') {
1776                        clearInterval(u);
1777                        clearTimeout(setT);
1778                        setT = setTimeout(canvasLoader, transPeriod + difference);
1779                    }
1780
1781
1782                    if ($(pagination).length) {
1783                        $('.camera_pag li', wrap).removeClass('cameracurrent');
1784                        $('.camera_pag li', wrap).eq(slideI).addClass('cameracurrent');
1785                    }
1786
1787                    if ($(thumbs).length) {
1788                        $('li', thumbs).removeClass('cameracurrent');
1789                        $('li', thumbs).eq(slideI).addClass('cameracurrent');
1790                        $('li', thumbs).not('.cameracurrent').find('img').animate({ opacity: .5 }, 0);
1791                        $('li.cameracurrent img', thumbs).animate({ opacity: 1 }, 0);
1792                        $('li', thumbs).hover(function () {
1793                            $('img', this).stop(true, false).animate({ opacity: 1 }, 150);
1794                        }, function () {
1795                            if (!$(this).hasClass('cameracurrent')) {
1796                                $('img', this).stop(true, false).animate({ opacity: .5 }, 150);
1797                            }
1798                        });
1799                    }
1800
1801
1802                    var easedTime = parseFloat(transPeriod) + parseFloat(difference);
1803
1804                    function cameraeased() {
1805
1806                        $(this).addClass('cameraeased');
1807                        if ($('.cameraeased', target).length >= 0) {
1808                            $(thumbs).css({ visibility: 'visible' });
1809                        }
1810                        if ($('.cameraeased', target).length == blocks) {
1811
1812                            thumbnailPos();
1813
1814                            $('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom', fakeHover).each(function () {
1815                                $(this).css('visibility', 'hidden');
1816                            });
1817
1818                            selector.eq(slideI).show().css('z-index', '999').removeClass('cameranext').addClass('cameracurrent');
1819                            selector.eq(vis).css('z-index', '1').removeClass('cameracurrent');
1820                            $('.cameraContent', fakeHover).eq(slideI).addClass('cameracurrent');
1821                            if (vis >= 0) {
1822                                $('.cameraContent', fakeHover).eq(vis).removeClass('cameracurrent');
1823                            }
1824
1825                            opts.onEndTransition.call(this);
1826
1827                            if ($('> div', elem).eq(slideI).attr('data-video') != 'hide' && $('.cameraContent.cameracurrent .imgFake', fakeHover).length) {
1828                                $('.cameraContent.cameracurrent .imgFake', fakeHover).click();
1829                            }
1830
1831
1832                            var lMoveIn = selector.eq(slideI).find('.fadeIn').length;
1833                            var lMoveInContent = $('.cameraContent', fakeHover).eq(slideI).find('.moveFromLeft, .moveFromRight, .moveFromTop, .moveFromBottom, .fadeIn, .fadeFromLeft, .fadeFromRight, .fadeFromTop, .fadeFromBottom').length;
1834
1835                            if (lMoveIn != 0) {
1836                                $('.cameraSlide.cameracurrent .fadeIn', fakeHover).each(function () {
1837                                    if ($(this).attr('data-easing') != '') {
1838                                        var easeMove = $(this).attr('data-easing');
1839                                    } else {
1840                                        var easeMove = easing;
1841                                    }
1842                                    var t = $(this);
1843                                    if (typeof t.attr('data-outerWidth') === 'undefined' || t.attr('data-outerWidth') === false || t.attr('data-outerWidth') === '') {
1844                                        var wMoveIn = t.outerWidth();
1845                                        t.attr('data-outerWidth', wMoveIn);
1846                                    } else {
1847                                        var wMoveIn = t.attr('data-outerWidth');
1848                                    }
1849                                    if (typeof t.attr('data-outerHeight') === 'undefined' || t.attr('data-outerHeight') === false || t.attr('data-outerHeight') === '') {
1850                                        var hMoveIn = t.outerHeight();
1851                                        t.attr('data-outerHeight', hMoveIn);
1852                                    } else {
1853                                        var hMoveIn = t.attr('data-outerHeight');
1854                                    }
1855                                    //t.css('width',wMoveIn);
1856                                    var pos = t.position();
1857                                    var left = pos.left;
1858                                    var top = pos.top;
1859                                    var tClass = t.attr('class');
1860                                    var ind = t.index();
1861                                    var hRel = t.parents('.camerarelative').outerHeight();
1862                                    var wRel = t.parents('.camerarelative').outerWidth();
1863                                    if (tClass.indexOf("fadeIn") != -1) {
1864                                        t.animate({ opacity: 0 }, 0).css('visibility', 'visible').delay((time / lMoveIn) * (0.1 * (ind - 1))).animate({ opacity: 1 }, (time / lMoveIn) * 0.15, easeMove);
1865                                    } else {
1866                                        t.css('visibility', 'visible');
1867                                    }
1868                                });
1869                            }
1870
1871                            $('.cameraContent.cameracurrent', fakeHover).show();
1872                            if (lMoveInContent != 0) {
1873
1874                                $('.cameraContent.cameracurrent .moveFromLeft, .cameraContent.cameracurrent .moveFromRight, .cameraContent.cameracurrent .moveFromTop, .cameraContent.cameracurrent .moveFromBottom, .cameraContent.cameracurrent .fadeIn, .cameraContent.cameracurrent .fadeFromLeft, .cameraContent.cameracurrent .fadeFromRight, .cameraContent.cameracurrent .fadeFromTop, .cameraContent.cameracurrent .fadeFromBottom', fakeHover).each(function () {
1875                                    if ($(this).attr('data-easing') != '') {
1876                                        var easeMove = $(this).attr('data-easing');
1877                                    } else {
1878                                        var easeMove = easing;
1879                                    }
1880                                    var t = $(this);
1881                                    var pos = t.position();
1882                                    var left = pos.left;
1883                                    var top = pos.top;
1884                                    var tClass = t.attr('class');
1885                                    var ind = t.index();
1886                                    var thisH = t.outerHeight();
1887                                    if (tClass.indexOf("moveFromLeft") != -1) {
1888                                        t.css({ 'left': '-' + (w) + 'px', 'right': 'auto' });
1889                                        t.css('visibility', 'visible').delay((time / lMoveInContent) * (0.1 * (ind - 1))).animate({ 'left': pos.left }, (time / lMoveInContent) * 0.15, easeMove);
1890                                    } else if (tClass.indexOf("moveFromRight") != -1) {
1891                                        t.css({ 'left': w + 'px', 'right': 'auto' });
1892                                        t.css('visibility', 'visible').delay((time / lMoveInContent) * (0.1 * (ind - 1))).animate({ 'left': pos.left }, (time / lMoveInContent) * 0.15, easeMove);
1893                                    } else if (tClass.indexOf("moveFromTop") != -1) {
1894                                        t.css({ 'top': '-' + h + 'px', 'bottom': 'auto' });
1895                                        t.css('visibility', 'visible').delay((time / lMoveInContent) * (0.1 * (ind - 1))).animate({ 'top': pos.top }, (time / lMoveInContent) * 0.15, easeMove, function () {
1896                                            t.css({ top: 'auto', bottom: 0 });
1897                                        });
1898                                    } else if (tClass.indexOf("moveFromBottom") != -1) {
1899                                        t.css({ 'top': h + 'px', 'bottom': 'auto' });
1900                                        t.css('visibility', 'visible').delay((time / lMoveInContent) * (0.1 * (ind - 1))).animate({ 'top': pos.top }, (time / lMoveInContent) * 0.15, easeMove);
1901                                    } else if (tClass.indexOf("fadeFromLeft") != -1) {
1902                                        t.animate({ opacity: 0 }, 0).css({ 'left': '-' + (w) + 'px', 'right': 'auto' });
1903                                        t.css('visibility', 'visible').delay((time / lMoveInContent) * (0.1 * (ind - 1))).animate({ 'left': pos.left, opacity: 1 }, (time / lMoveInContent) * 0.15, easeMove);
1904                                    } else if (tClass.indexOf("fadeFromRight") != -1) {
1905                                        t.animate({ opacity: 0 }, 0).css({ 'left': (w) + 'px', 'right': 'auto' });
1906                                        t.css('visibility', 'visible').delay((time / lMoveInContent) * (0.1 * (ind - 1))).animate({ 'left': pos.left, opacity: 1 }, (time / lMoveInContent) * 0.15, easeMove);
1907                                    } else if (tClass.indexOf("fadeFromTop") != -1) {
1908                                        t.animate({ opacity: 0 }, 0).css({ 'top': '-' + (h) + 'px', 'bottom': 'auto' });
1909                                        t.css('visibility', 'visible').delay((time / lMoveInContent) * (0.1 * (ind - 1))).animate({ 'top': pos.top, opacity: 1 }, (time / lMoveInContent) * 0.15, easeMove, function () {
1910                                            t.css({ top: 'auto', bottom: 0 });
1911                                        });
1912                                    } else if (tClass.indexOf("fadeFromBottom") != -1) {
1913                                        t.animate({ opacity: 0 }, 0).css({ 'bottom': '-' + thisH + 'px' });
1914                                        t.css('visibility', 'visible').delay((time / lMoveInContent) * (0.1 * (ind - 1))).animate({ 'bottom': '0', opacity: 1 }, (time / lMoveInContent) * 0.15, easeMove);
1915                                    } else if (tClass.indexOf("fadeIn") != -1) {
1916                                        t.animate({ opacity: 0 }, 0).css('visibility', 'visible').delay((time / lMoveInContent) * (0.1 * (ind - 1))).animate({ opacity: 1 }, (time / lMoveInContent) * 0.15, easeMove);
1917                                    } else {
1918                                        t.css('visibility', 'visible');
1919                                    }
1920                                });
1921                            }
1922
1923
1924                            $('.cameraappended', target).remove();
1925                            elem.removeClass('camerasliding');
1926                            selector.eq(vis).hide();
1927                            var barWidth = $('.camera_bar_cont', camera_thumbs_wrap).width(),
1928                                    barHeight = $('.camera_bar_cont', camera_thumbs_wrap).height(),
1929                                    radSum;
1930                            if (loader != 'pie') {
1931                                radSum = 0.05;
1932                            } else {
1933                                radSum = 0.005;
1934                            }
1935                            $('#' + pieID).animate({ opacity: opts.loaderOpacity }, 200);
1936                            u = setInterval(
1937                                    function () {
1938                                        if (elem.hasClass('stopped')) {
1939                                            clearInterval(u);
1940                                        }
1941                                        if (loader != 'pie') {
1942                                            if (rad <= 1.002 && !elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')) {
1943                                                rad = (rad + radSum);
1944                                            } else if (rad <= 1 && (elem.hasClass('stopped') || elem.hasClass('paused') || elem.hasClass('stopped') || elem.hasClass('hovered'))) {
1945                                                rad = rad;
1946                                            } else {
1947                                                if (!elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')) {
1948                                                    clearInterval(u);
1949                                                    imgFake();
1950                                                    $('#' + pieID).animate({ opacity: 0 }, 200, function () {
1951                                                        clearTimeout(setT);
1952                                                        setT = setTimeout(canvasLoader, easedTime);
1953                                                        nextSlide();
1954                                                        opts.onStartLoading.call(this);
1955                                                    });
1956                                                }
1957                                            }
1958                                            switch (barDirection) {
1959                                                case 'leftToRight':
1960                                                    $('#' + pieID).animate({ 'right': barWidth - (barWidth * rad) }, (time * radSum), 'linear');
1961                                                    break;
1962                                                case 'rightToLeft':
1963                                                    $('#' + pieID).animate({ 'left': barWidth - (barWidth * rad) }, (time * radSum), 'linear');
1964                                                    break;
1965                                                case 'topToBottom':
1966                                                    $('#' + pieID).animate({ 'bottom': barHeight - (barHeight * rad) }, (time * radSum), 'linear');
1967                                                    break;
1968                                                case 'bottomToTop':
1969                                                    $('#' + pieID).animate({ 'bottom': barHeight - (barHeight * rad) }, (time * radSum), 'linear');
1970                                                    break;
1971                                            }
1972
1973                                        } else {
1974                                            radNew = rad;
1975                                            ctx.clearRect(0, 0, opts.pieDiameter, opts.pieDiameter);
1976                                            ctx.globalCompositeOperation = 'destination-over';
1977                                            ctx.beginPath();
1978                                            ctx.arc((opts.pieDiameter) / 2, (opts.pieDiameter) / 2, (opts.pieDiameter) / 2 - opts.loaderStroke, 0, Math.PI * 2, false);
1979                                            ctx.lineWidth = opts.loaderStroke;
1980                                            ctx.strokeStyle = opts.loaderBgColor;
1981                                            ctx.stroke();
1982                                            ctx.closePath();
1983                                            ctx.globalCompositeOperation = 'source-over';
1984                                            ctx.beginPath();
1985                                            ctx.arc((opts.pieDiameter) / 2, (opts.pieDiameter) / 2, (opts.pieDiameter) / 2 - opts.loaderStroke, 0, Math.PI * 2 * radNew, false);
1986                                            ctx.lineWidth = opts.loaderStroke - (opts.loaderPadding * 2);
1987                                            ctx.strokeStyle = opts.loaderColor;
1988                                            ctx.stroke();
1989                                            ctx.closePath();
1990
1991                                            if (rad <= 1.002 && !elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')) {
1992                                                rad = (rad + radSum);
1993                                            } else if (rad <= 1 && (elem.hasClass('stopped') || elem.hasClass('paused') || elem.hasClass('hovered'))) {
1994                                                rad = rad;
1995                                            } else {
1996                                                if (!elem.hasClass('stopped') && !elem.hasClass('paused') && !elem.hasClass('hovered')) {
1997                                                    clearInterval(u);
1998                                                    imgFake();
1999                                                    $('#' + pieID + ', .camera_canvas_wrap', camera_thumbs_wrap).animate({ opacity: 0 }, 200, function () {
2000                                                        clearTimeout(setT);
2001                                                        setT = setTimeout(canvasLoader, easedTime);
2002                                                        nextSlide();
2003                                                        opts.onStartLoading.call(this);
2004                                                    });
2005                                                }
2006                                            }
2007                                        }
2008                                    }, time * radSum
2009                            );
2010                        }
2011
2012                    }
2013
2014
2015
2016                    if (fx == 'scrollLeft' || fx == 'scrollRight' || fx == 'scrollTop' || fx == 'scrollBottom' || fx == 'scrollHorz') {
2017                        opts.onStartTransition.call(this);
2018                        easedTime = 0;
2019                        tApp.delay((((transPeriod + difference) / blocks) * delay[index] * couples) * 0.5).css({
2020                            'display': 'block',
2021                            'height': height,
2022                            'margin-left': marginLeft,
2023                            'margin-top': marginTop,
2024                            'width': width
2025                        }).animate({
2026                            'height': Math.floor((h / rows) + addTop + 1),
2027                            'margin-top': 0,
2028                            'margin-left': 0,
2029                            'width': Math.floor((w / cols) + addLeft + 1)
2030                        }, (transPeriod - difference), easing, cameraeased);
2031                        selector.eq(vis).delay((((transPeriod + difference) / blocks) * delay[index] * couples) * 0.5).animate({
2032                            'margin-left': marginLeft * (-1),
2033                            'margin-top': marginTop * (-1)
2034                        }, (transPeriod - difference), easing, function () {
2035                            $(this).css({ 'margin-top': 0, 'margin-left': 0 });
2036                        });
2037                    } else {
2038                        opts.onStartTransition.call(this);
2039                        easedTime = parseFloat(transPeriod) + parseFloat(difference);
2040                        if (slideOn == 'next') {
2041                            tApp.delay((((transPeriod + difference) / blocks) * delay[index] * couples) * 0.5).css({
2042                                'display': 'block',
2043                                'height': height,
2044                                'margin-left': marginLeft,
2045                                'margin-top': marginTop,
2046                                'width': width,
2047                                'opacity': opacityOnGrid
2048                            }).animate({
2049                                'height': Math.floor((h / rows) + addTop + 1),
2050                                'margin-top': 0,
2051                                'margin-left': 0,
2052                                'opacity': 1,
2053                                'width': Math.floor((w / cols) + addLeft + 1)
2054                            }, (transPeriod - difference), easing, cameraeased);
2055                        } else {
2056                            selector.eq(slideI).show().css('z-index', '999').addClass('cameracurrent');
2057                            selector.eq(vis).css('z-index', '1').removeClass('cameracurrent');
2058                            $('.cameraContent', fakeHover).eq(slideI).addClass('cameracurrent');
2059                            $('.cameraContent', fakeHover).eq(vis).removeClass('cameracurrent');
2060                            tApp.delay((((transPeriod + difference) / blocks) * delay[index] * couples) * 0.5).css({
2061                                'display': 'block',
2062                                'height': Math.floor((h / rows) + addTop + 1),
2063                                'margin-top': 0,
2064                                'margin-left': 0,
2065                                'opacity': 1,
2066                                'width': Math.floor((w / cols) + addLeft + 1)
2067                            }).animate({
2068                                'height': height,
2069                                'margin-left': marginLeft,
2070                                'margin-top': marginTop,
2071                                'width': width,
2072                                'opacity': opacityOnGrid
2073                            }, (transPeriod - difference), easing, cameraeased);
2074                        }
2075                    }
2076
2077
2078
2079
2080
2081                });
2082
2083
2084
2085
2086            }
2087        }
2088
2089
2090        if ($(prevNav).length) {
2091            $(prevNav).click(function () {
2092                if (!elem.hasClass('camerasliding')) {
2093                    var idNum = parseFloat($('.cameraSlide.cameracurrent', target).index());
2094                    clearInterval(u);
2095                    imgFake();
2096                    $('#' + pieID + ', .camera_canvas_wrap', wrap).animate({ opacity: 0 }, 0);
2097                    canvasLoader();
2098                    if (idNum != 0) {
2099                        nextSlide(idNum);
2100                    } else {
2101                        nextSlide(amountSlide);
2102                    }
2103                    opts.onStartLoading.call(this);
2104                }
2105            });
2106        }
2107
2108        if ($(nextNav).length) {
2109            $(nextNav).click(function () {
2110                if (!elem.hasClass('camerasliding')) {
2111                    var idNum = parseFloat($('.cameraSlide.cameracurrent', target).index());
2112                    clearInterval(u);
2113                    imgFake();
2114                    $('#' + pieID + ', .camera_canvas_wrap', camera_thumbs_wrap).animate({ opacity: 0 }, 0);
2115                    canvasLoader();
2116                    if (idNum == amountSlide - 1) {
2117                        nextSlide(1);
2118                    } else {
2119                        nextSlide(idNum + 2);
2120                    }
2121                    opts.onStartLoading.call(this);
2122                }
2123            });
2124        }
2125
2126
2127        if (isMobile()) {
2128            fakeHover.bind('swipeleft', function (event) {
2129                if (!elem.hasClass('camerasliding')) {
2130                    var idNum = parseFloat($('.cameraSlide.cameracurrent', target).index());
2131                    clearInterval(u);
2132                    imgFake();
2133                    $('#' + pieID + ', .camera_canvas_wrap', camera_thumbs_wrap).animate({ opacity: 0 }, 0);
2134                    canvasLoader();
2135                    if (idNum == amountSlide - 1) {
2136                        nextSlide(1);
2137                    } else {
2138                        nextSlide(idNum + 2);
2139                    }
2140                    opts.onStartLoading.call(this);
2141                }
2142            });
2143            fakeHover.bind('swiperight', function (event) {
2144                if (!elem.hasClass('camerasliding')) {
2145                    var idNum = parseFloat($('.cameraSlide.cameracurrent', target).index());
2146                    clearInterval(u);
2147                    imgFake();
2148                    $('#' + pieID + ', .camera_canvas_wrap', camera_thumbs_wrap).animate({ opacity: 0 }, 0);
2149                    canvasLoader();
2150                    if (idNum != 0) {
2151                        nextSlide(idNum);
2152                    } else {
2153                        nextSlide(amountSlide);
2154                    }
2155                    opts.onStartLoading.call(this);
2156                }
2157            });
2158        }
2159
2160        if ($(pagination).length) {
2161            $('.camera_pag li', wrap).click(function () {
2162                if (!elem.hasClass('camerasliding')) {
2163                    var idNum = parseFloat($(this).index());
2164                    var curNum = parseFloat($('.cameraSlide.cameracurrent', target).index());
2165                    if (idNum != curNum) {
2166                        clearInterval(u);
2167                        imgFake();
2168                        $('#' + pieID + ', .camera_canvas_wrap', camera_thumbs_wrap).animate({ opacity: 0 }, 0);
2169                        canvasLoader();
2170                        nextSlide(idNum + 1);
2171                        opts.onStartLoading.call(this);
2172                    }
2173                }
2174            });
2175        }
2176
2177        if ($(thumbs).length) {
2178
2179            $('.pix_thumb img', thumbs).click(function () {
2180                if (!elem.hasClass('camerasliding')) {
2181                    var idNum = parseFloat($(this).parents('li').index());
2182                    var curNum = parseFloat($('.cameracurrent', target).index());
2183                    if (idNum != curNum) {
2184                        clearInterval(u);
2185                        imgFake();
2186                        $('#' + pieID + ', .camera_canvas_wrap', camera_thumbs_wrap).animate({ opacity: 0 }, 0);
2187                        $('.pix_thumb', thumbs).removeClass('cameracurrent');
2188                        $(this).parents('li').addClass('cameracurrent');
2189                        canvasLoader();
2190                        nextSlide(idNum + 1);
2191                        thumbnailPos();
2192                        opts.onStartLoading.call(this);
2193                    }
2194                }
2195            });
2196
2197            $('.camera_thumbs_cont .camera_prevThumbs', camera_thumbs_wrap).hover(function () {
2198                $(this).stop(true, false).animate({ opacity: 1 }, 250);
2199            }, function () {
2200                $(this).stop(true, false).animate({ opacity: .7 }, 250);
2201            });
2202            $('.camera_prevThumbs', camera_thumbs_wrap).click(function () {
2203                var sum = 0,
2204                       wTh = $(thumbs).outerWidth(),
2205                       offUl = $('ul', thumbs).offset().left,
2206                       offDiv = $('> div', thumbs).offset().left,
2207                       ulLeft = offDiv - offUl;
2208                $('.camera_visThumb', thumbs).each(function () {
2209                    var tW = $(this).outerWidth();
2210                    sum = sum + tW;
2211                });
2212                if (ulLeft - sum > 0) {
2213                    $('ul', thumbs).animate({ 'margin-left': '-' + (ulLeft - sum) + 'px' }, 500, thumbnailVisible);
2214                } else {
2215                    $('ul', thumbs).animate({ 'margin-left': 0 }, 500, thumbnailVisible);
2216                }
2217            });
2218
2219            $('.camera_thumbs_cont .camera_nextThumbs', camera_thumbs_wrap).hover(function () {
2220                $(this).stop(true, false).animate({ opacity: 1 }, 250);
2221            }, function () {
2222                $(this).stop(true, false).animate({ opacity: .7 }, 250);
2223            });
2224            $('.camera_nextThumbs', camera_thumbs_wrap).click(function () {
2225                var sum = 0,
2226                       wTh = $(thumbs).outerWidth(),
2227                       ulW = $('ul', thumbs).outerWidth(),
2228                       offUl = $('ul', thumbs).offset().left,
2229                       offDiv = $('> div', thumbs).offset().left,
2230                       ulLeft = offDiv - offUl;
2231                $('.camera_visThumb', thumbs).each(function () {
2232                    var tW = $(this).outerWidth();
2233                    sum = sum + tW;
2234                });
2235                if (ulLeft + sum + sum < ulW) {
2236                    $('ul', thumbs).animate({ 'margin-left': '-' + (ulLeft + sum) + 'px' }, 500, thumbnailVisible);
2237                } else {
2238                    $('ul', thumbs).animate({ 'margin-left': '-' + (ulW - wTh) + 'px' }, 500, thumbnailVisible);
2239                }
2240            });
2241
2242        }
2243
2244
2245
2246    }
2247
2248})(jQuery);
2249
2250; (function ($) {
2251    $.fn.cameraStop = function () {
2252        var wrap = $(this),
2253               elem = $('.camera_src', wrap),
2254               pieID = 'pie_' + wrap.index();
2255        elem.addClass('stopped');
2256        if ($('.camera_showcommands').length) {
2257            var camera_thumbs_wrap = $('.camera_thumbs_wrap', wrap);
2258        } else {
2259            var camera_thumbs_wrap = wrap;
2260        }
2261    }
2262})(jQuery);
2263
2264; (function ($) {
2265    $.fn.cameraPause = function () {
2266        var wrap = $(this);
2267        var elem = $('.camera_src', wrap);
2268        elem.addClass('paused');
2269    }
2270})(jQuery);
2271
2272; (function ($) {
2273    $.fn.cameraResume = function () {
2274        var wrap = $(this);
2275        var elem = $('.camera_src', wrap);
2276        if (typeof autoAdv === 'undefined' || autoAdv !== true) {
2277            elem.removeClass('paused');
2278        }
2279    }
2280})(jQuery);
2281

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.