PageSourceSearch

https://www.merrillinn.com/wp-content/plugins/slider-image/assets/…ain_ver-40f8cc2fdd1ef3c3a91f0dcc7fe3a5b0.js

js merrillinn.com collected 2026-10-08 20:12:52 UTC 109,693 bytes, 2,860 lines download raw bytes

1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
2let window = _____WB$wombat$assign$function_____("window");
3let self = _____WB$wombat$assign$function_____("self");
4let document = _____WB$wombat$assign$function_____("document");
5let location = _____WB$wombat$assign$function_____("location");
6let top = _____WB$wombat$assign$function_____("top");
7let parent = _____WB$wombat$assign$function_____("parent");
8let frames = _____WB$wombat$assign$function_____("frames");
9let opens = _____WB$wombat$assign$function_____("opens");
10/*
11 * Special thanks to Sachin Choolur
12 * for original Slider script.
13 * https://github.com/sachinchoolur/lightslider
14 */
15
16(function ($) {
17
18    'use strict';
19
20    var defaults = {
21        item: 1,
22        view: 'thumb_view',
23        maxWidth: 900,
24        maxHeight: 700,
25        mode: 'slide',
26        speed: 400,
27        pauseOnHover: false,
28        pause: 2000,
29        controls: false,
30        fullscreen: false,
31        vertical: false,
32        sliderHeight: 500,
33        vThumbWidth: 100,
34        hThumbHeight: 80,
35        thumbItem: 10,
36        thumbMargin: 5,
37        thumbPosition: false,
38        thumbControls: false,
39        pager: false,
40        gallery: false,
41        dragdrop: false,
42        swipe: false,
43        thumbdragdrop: false,
44        thumbswipe: false,
45        title: false,
46        description: false,
47        titlesymbollimit: 20,
48        descsymbollimit: 30
49    };
50
51    $.fn.RSlider = function (options) {
52        if (this.length === 0) {
53            return this;
54        }
55
56        if (this.length > 1) {
57            this.each(function () {
58                $(this).RSlider(options);
59            });
60            return this;
61        }
62
63        var plugin = {},
64            settings = $.extend(true, {}, defaults, options),
65            $el = this;
66
67        plugin.$el = this;
68
69        if (settings.mode === 'fade') {
70            settings.vertical = false;
71        }
72        var $children = $el.children(),
73            length = 0,
74            w = 0,
75            on = false,
76            elSize = 0,
77            $slide = '',
78            scene = 0,
79            property = (settings.vertical === true) ? 'height' : 'width',
80            gutter = (settings.vertical === true) ? 'margin-bottom' : 'margin-right',
81            slideValue = 0,
82            pagerWidth = 0,
83            slideWidth = 0,
84            thumbWidth = 0,
85            interval = null,
86            isTouch = ('ontouchstart' in document.documentElement);
87
88        var refresh = {};
89
90        refresh.calSW = function () {
91            if(settings.vertical){
92                if(!$slide.hasClass('rwd-fullscreen-on')){
93                    elSize = settings.sliderHeight;
94                    slideWidth = elSize / settings.item;
95                    $('.rwd-SlideOuter.vertical .thumbAction > .thumbPrev').css('top', -settings.sliderHeight + 20 + 'px');
96                } else {
97                    slideWidth = ($(window).height() - 30) / settings.item;
98                    $('.rwd-SlideOuter.vertical .thumbAction > .thumbPrev').css('top', -($(window).height() - 40) + 'px');
99                    $(window).resize();
100                    setTimeout(function(){
101                        $(window).one('resize');
102                    }, 0)
103                }
104            } else {
105                slideWidth = elSize / settings.item;
106            }
107        };
108        refresh.calWidth = function (cln) {
109            var ln = cln === true ? $slide.find('.rwd-slide').length : $children.length;
110            w = ln * slideWidth;
111
112            return w;
113        };
114        plugin.doCss = function () {
115            function support() {
116                var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition'];
117                var root = document.documentElement;
118                for (var i = 0; i < transition.length; i++) {
119                    if (transition[i] in root.style) {
120                        return true;
121                    }
122                }
123            }
124
125            return support();
126        };
127        plugin.videoControl = function(){
128            $('.rslider_iframe_cover').on('click', function(){
129                $('.rslider_iframe_cover').hide();
130
131                var $iframe = $(this).parent().find('iframe');
132
133                if($iframe && $iframe.attr('src')){
134                    if($iframe.attr('src').indexOf('youtube') !== -1){
135                        $iframe.get(0).contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
136                    } else if($iframe.attr('src').indexOf('vimeo') !== -1){
137                        try {
138                            $f($iframe.get(0)).api('play');
139                        } catch (e) {
140                            console.error('Make sure you have included froogaloop2 js');
141                        }
142                    }
143                }
144
145                $('.rwd-SlideWrapper').addClass('videoIsPlay');
146
147                $el.pause();
148            });
149        };
150        plugin.keyPress = function () {
151            $(document).on('keyup', function (e) {
152                if (!$(':focus').is('input, textarea')) {
153                    if (e.preventDefault) {
154                        e.preventDefault();
155                    } else {
156                        e.returnValue = false;
157                    }
158                    if (e.keyCode === 37) {
159                        $el.goToPrevSlide();
160                    } else if (e.keyCode === 39) {
161                        $el.goToNextSlide();
162                    }
163                }
164            });
165        };
166        plugin.controls = function () {
167            if (settings.controls) {
168                $el.after('<div class="rwd-Action"><a class="rwd-Prev"></a><a class="rwd-Next"></a></div>');
169                if (length <= settings.item) {
170                    $slide.find('.rwd-Action').hide();
171                }
172
173                $slide.find('.rwd-Action a').on('click', function (e) {
174                    if (e.preventDefault) {
175                        e.preventDefault();
176                    } else {
177                        e.returnValue = false;
178                    }
179                    if ($(this).attr('class') === 'rwd-Prev') {
180                        $el.goToPrevSlide();
181                    } else {
182                        $el.goToNextSlide();
183                    }
184                    return false;
185                });
186            }
187        };
188        plugin.thumbControls = function () {
189            var $this = this;
190
191            if (settings.thumbControls) {
192                if (!settings.vertical && settings.thumbPosition) {
193                    setTimeout(function(){
194                        $el.parent().parent().prepend('<div class="thumbAction"><a class="thumbPrev"></a><a class="thumbNext"></a></div>');
195                    }, 0);
196                } else {
197                    $el.parent().after('<div class="thumbAction"><a class="thumbPrev"></a><a class="thumbNext"></a></div>');
198                }
199                if (length <= settings.item) {
200                    $slide.find('.thumbAction').hide();
201                }
202                $(document).on('click', '.thumbAction a', function (e) {
203                    if (e.preventDefault) {
204                        e.preventDefault();
205                    } else {
206                        e.returnValue = false;
207                    }
208                    if ($(this).hasClass('thumbPrev')) {
209                        $this.prevThumb();
210                    } else {
211                        $this.nextThumb();
212                    }
213                    return false;
214                });
215
216                if(settings.vertical){
217                    if(settings.thumbPosition){
218                        $('.rwd-SlideOuter.vertical .thumbAction > a').css('left', settings.vThumbWidth / 2 - 15 + 'px');
219                    } else {
220                        $('.rwd-SlideOuter.vertical .thumbAction > a').css('right', -settings.vThumbWidth / 2 - 15 + 'px');
221                    }
222                } else {
223                    setTimeout(function(){
224                        $('.thumbAction').css('top', (settings.hThumbHeight - 5) / 2 + 'px');
225                        $('.thumbPrev').css('left', '10px');
226                        $('.thumbNext').css('right', '10px');
227                    }, 0);
228                }
229            }
230        };
231        plugin.prevThumb = function(){
232            var thumbMove = 0, $pager;
233
234            $slide.addClass('thumb_move');
235
236            $pager = $slide.parent().find('.rwd-Pager');
237
238            thumbMove = (+$pager.attr('data-move') || 0) - thumbWidth - settings.thumbMargin;
239
240            if (thumbMove < 0) {
241                if(!$('.rwd-SlideWrapper').hasClass('rwd-fullscreen-on')){
242                    thumbMove = ($('.rwd-Pager.rwd-Gallery li').length - settings.thumbItem) * (thumbWidth + settings.thumbMargin);
243                } else {
244                    thumbMove = ($('.rwd-Pager.rwd-Gallery li').length - $('.rwd-SlideWrapper').height() / (thumbWidth + settings.thumbMargin)) * (thumbWidth + settings.thumbMargin);
245                }
246            }
247
248            $pager.attr('data-move', +thumbMove);
249
250            this.move($pager, thumbMove);
251        };
252        plugin.nextThumb = function(){
253            var thumbMove = 0, $pager;
254
255            $slide.addClass('thumb_move');
256
257            $pager = $slide.parent().find('.rwd-Pager');
258
259            thumbMove = thumbWidth + settings.thumbMargin + (+$pager.attr('data-move') || 0);
260
261            if(settings.vertical){
262                if (thumbMove + $('.rwd-SlideWrapper').height() > $('.rwd-Pager.rwd-Gallery').height()) {
263                    thumbMove = 0;
264                }
265            } else {
266                if (thumbMove + $('.rwd-SlideWrapper').width() > $('.rwd-Pager.rwd-Gallery').width()) {
267                    thumbMove = 0;
268                }
269            }
270
271            $pager.attr('data-move', +thumbMove);
272
273            this.move($pager, thumbMove);
274        };
275        plugin.fullscreen = function () {
276            var $this = this;
277
278            if (settings.fullscreen) {
279                var fullScreen = '<span class="rwd-fullscreen rwd-icon">' +
280                    '<svg id="rwd-fullscreen-on" width="20px" height="20px" version="1.1" x="0px" y="0px"' +
281                    'viewBox="0 0 35.9 35.9" style="enable-background:new 0 0 35.9 35.9;" xml:space="preserve">' +
282                    '<style type="text/css">.st0{stroke:#FFFFFF;stroke-width:2;stroke-miterlimit:10;}</style><g id="fullscreen">' +
283                    '<path class="st0" d="M6.5,22.4H1.8v11.7h11.7v-4.7h-7V22.4z M1.8,13h4.7v-7h7V1.3H1.8V13z M30,29.4h-7v4.7h11.7V22.4H30V29.4z' +
284                    'M22.9,1.3v4.7h7v7h4.7V1.3H22.9z M22.9,1.3"/></g></svg>
284' +
285                    '<svg id="rwd-fullscreen-off" width="20px" height="20px" x="0px" y="0px"' +
286                    'viewBox="0 0 35.9 35.9" style="enable-background:new 0 0 35.9 35.9;" xml:space="preserve">' +
287                    '<style type="text/css">.st0{stroke:#FFFFFF;stroke-width:2;stroke-miterlimit:10;}</style><g id="fullscreen-exit">' +
288                    '<path class="st0" d="M2.6,27h6.8v6.8h4.5V22.5H2.6V27z M9.4,8.9H2.6v4.5h11.3V2.1H9.4V8.9z M23,33.8h4.5V27h6.8v-4.5H23V33.8z' +
289                    'M27.5,8.9V2.1H23v11.3h11.3V8.9H27.5z M27.5,8.9"/></g></svg>' +
290                    '</span>';
291
292                $el.after('<div class="fullscreen">' + fullScreen + '</div>');
293
294                $(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', function() {
295                    $('.rwd-SlideWrapper').toggleClass('rwd-fullscreen-on');
296                    $('.rwd-Pager.rwd-Gallery').toggleClass('rwd-fullscreen-on');
297
298                    if(!$('.rwd-SlideWrapper').hasClass('rwd-fullscreen-on')){
299                        $('.rwd-fullscreen').toggleClass('active');
300                        $this.exitFullscreen();
301                    }
302                });
303
304                $('.rwd-fullscreen svg').on('click', function() {
305                    $('.rwd-fullscreen').toggleClass('active');
306                    if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {
307                        $this.requestFullscreen();
308                    } else {
309                        $this.exitFullscreen();
310                    }
311                });
312            }
313        };
314        plugin.requestFullscreen = function() {
315            var el = document.documentElement;
316
317            if (el.requestFullscreen) {
318                el.requestFullscreen();
319            } else if (el.msRequestFullscreen) {
320                el.msRequestFullscreen();
321            } else if (el.mozRequestFullScreen) {
322                el.mozRequestFullScreen();
323            } else if (el.webkitRequestFullscreen) {
324                el.webkitRequestFullscreen();
325            }
326
327            var $sl = $el.parent().parent().parent();
328
329            $('body').prepend($sl);
330
331            var $h = 0;
332
333            $h = settings.hThumbHeight;
334
335            if($h > 50 && $h <= 100){
336                $h *= 1.5;
337            } else if($h <= 50){
338                $h *= 2;
339            } else if($h > 100){
340                $h *= 1.25;
341            }
342
343            if(settings.title || settings.description) {
344                $h += 45;
345            }
346
347            setTimeout(function(){
348                $('html, body').css('overflow', 'hidden');
349
350                $sl.css({
351                    'max-width': 'none',
352                    'width': '100%',
353                    'height': $(window).height() + 'px',
354                    'position': 'fixed',
355                    'z-index': '999999999'
356                });
357
358                if(!settings.vertical){
359                    if(settings.thumbPosition){
360                        $('.rwd-SlideWrapper').css({
361                            'height': $(window).height() + 'px'
362                        });
363                    } else {
364                        $('.rwd-SlideWrapper').css({
365                            'height': $(window).height() - $h + 'px'
366                        });
367                    }
368                }
369
370                $('.rwd-SlideOuter').parent().css({
371                    'background': 'white'
372                });
373
374                if(!settings.vertical && settings.thumbPosition){
375                    setTimeout(function(){
376                        $('.rwd-SlideOuter').prepend($('.thumbAction'));
377                    }, 300)
378                }
379
380            }, 360);
381
382            $('.rwd-SlideOuter').css({
383                visibility: 'hidden',
384                opacity: '0'
385            });
386
387            for(var i = 0; i < 5; i++){
388                setTimeout(function(){
389                    refresh.init();
390                }, i * 400);
391            }
392
393            setTimeout(function(){
394                $('.rwd-SlideOuter').css({
395                    visibility: 'visible',
396                    opacity: '1'
397                });
398            }, 1600);
399
400            $('div[class*=share_buttons_]').hide();
401        };
402        plugin.exitFullscreen = function() {
403            if (document.exitFullscreen) {
404                document.exitFullscreen();
405            } else if (document.msExitFullscreen) {
406                document.msExitFullscreen();
407            } else if (document.mozCancelFullScreen) {
408                document.mozCancelFullScreen();
409            } else if (document.webkitExitFullscreen) {
410                document.webkitExitFullscreen();
411            }
412
413            var $sl = $el.parent().parent().parent(),
414                $p = $('.slider-parent');
415
416            $p.after($sl);
417
418            $('html, body').css('overflow', '');
419
420            $sl.css({
421                'max-width': '',
422                'width': '',
423                'height': '',
424                'position': '',
425                'z-index': ''
426            });
427
428            $('.rwd-SlideWrapper').css({
429                'height': ''
430            });
431
432            $('.rwd-SlideOuter').parent().css({
433                'background': ''
434            });
435
436            if(!settings.vertical && settings.thumbPosition){
437                setTimeout(function(){
438                    $('.rwd-SlideOuter').prepend($('.thumbAction'));
439                }, 320);
440            }
441
442            $('.rwd-SlideOuter').css({
443                visibility: 'hidden',
444                opacity: '0'
445            });
446
447            for(var i = 0; i < 5; i++){
448                setTimeout(function(){
449                    refresh.init();
450                }, i * 400);
451            }
452
453            setTimeout(function(){
454                $('.rwd-SlideOuter').css({
455                    visibility: 'visible',
456                    opacity: '1'
457                });
458            }, 1600);
459
460            $('div[class*=share_buttons_]').show();
461        };
462        plugin.initialStyle = function () {
463            var $this = this;
464
465            $el.addClass('huge_it_slider').wrap('<div class="rwd-Sli
465deOuter"><div class="rwd-SlideWrapper"></div></div>');
466            $slide = $el.parent('.rwd-SlideWrapper');
467            if (settings.vertical) {
468                $slide.parent().addClass('vertical');
469                elSize = settings.sliderHeight;
470                $slide.css('height', elSize + 'px');
471            } else {
472                elSize = $el.outerWidth();
473            }
474            $children.addClass('rwd-slide');
475            if (settings.mode === 'slide') {
476                refresh.calSW();
477                refresh.clone = function () {
478                    if (refresh.calWidth(true) > elSize) {
479                        var tWr = 0,
480                            tI = 0;
481                        for (var k = 0; k < $children.length; k++) {
482                            tWr += parseInt($el.find('.rwd-slide').eq(k).width());
483                            tI++;
484                            if (tWr >= elSize) {
485                                break;
486                            }
487                        }
488                        var tItem = settings.item;
489
490                        if (tItem < $el.find('.clone.left').length) {
491                            for (var i = 0; i < $el.find('.clone.left').length - tItem; i++) {
492                                $children.eq(i).remove();
493                            }
494                        }
495                        if (tItem < $el.find('.clone.right').length) {
496                            for (var j = $children.length - 1; j > ($children.length - 1 - $el.find('.clone.right').length); j--) {
497                                scene--;
498                                $children.eq(j).remove();
499                            }
500                        }
501
502                        for (var n = $el.find('.clone.right').length; n < tItem; n++) {
503                            $el.find('.rwd-slide').eq(n).clone().removeClass('rwd-slide').addClass('clone right').appendTo($el);
504                            scene++;
505                        }
506                        for (var m = $el.find('.rwd-slide').length - $el.find('.clone.left').length; m > ($el.find('.rwd-slide').length - tItem); m--) {
507                            $el.find('.rwd-slide').eq(m - 1).clone().removeClass('rwd-slide').addClass('clone left').prependTo($el);
508                        }
509                        $children = $el.children();
510                    } else {
511                        if ($children.hasClass('clone')) {
512                            $el.find('.clone').remove();
513                            $this.move($el, 0);
514                        }
515                    }
516                };
517                refresh.clone();
518            }
519            refresh.sSW = function () {
520                length = $children.length;
521                $children.css(property, slideWidth + 'px');
522                $children.css(gutter, '0px');
523                w = refresh.calWidth(false);
524                $el.css(property, w + 'px');
525                if (settings.mode === 'slide') {
526                    if (on === false) {
527                        scene = $el.find('.clone.left').length;
528                    }
529                }
530            };
531            refresh.calL = function () {
532                $children = $el.children();
533                length = $children.length;
534            };
535            if (this.doCss()) {
536                $slide.addClass('usingCss');
537            }
538            refresh.calL();
539            if (settings.mode === 'slide') {
540                refresh.calSW();
541                refresh.sSW();
542
543                slideValue = $this.slideValue();
544                this.move($el, slideValue);
545
546                if (settings.vertical === false) {
547                    this.setHeight($el, false);
548                }
549
550            } else {
551                this.setHeight($el, true);
552                $el.addClass('rwd-Fade');
553                if (!this.doCss()) {
554                    $children.fadeOut(0);
555                    $children.eq(scene).fadeIn(0);
556                }
557            }
558            if (settings.mode === 'slide') {
559                $children.eq(scene).addClass('active');
560            } else {
561                $children.first().addClass('active');
562            }
563
564            $('.rslider_iframe_cover').height($('.rslider_iframe_cover').parent().height());
565        };
566        plugin.pager = function () {
567            var $this = this;
568            refresh.createPager = function () {
569                var $size;
570
571                if (settings.vertical) {
572                    $size = settings.sliderHeight;
573                } else {
574                    $size = elSize;
575                }
576
577                thumbWidth = ($size - ((settings.thumbItem * (settings.thumbMargin)) - settings.thumbMargin)) / settings.thumbItem;
578
579                var $children = $slide.find('.rwd-slide');
580                var length = $slide.find('.rwd-slide').length;
581                var i = 0,
582                    pagers = '',
583                    v = 0;
584
585                for (i = 0; i < length; i++) {
586                    if (settings.mode === 'slide') {
587                        v = i * slideWidth;
588                    }
589                    var thumb = $children.eq(i).attr('data-thumb');
590                    var title = $children.eq(i).attr('data-title') || '';
591                    var description = $children.eq(i).attr('data-description') || '';
592
593                    if(settings.title && !settings.vertical){
594                        title = title.substring(0, settings.titlesymbollimit);
595                    }
596
597                    if(settings.description && !settings.vertical){
598                        description = description.substring(0, settings.descsymbollimit);
599                    }
600
601                    var $shift = '', $wT = '';
602
603                    if(settings.vertical && (settings.title || settings.description)){
604                        $shift = 'margin-left';
605                        $wT = settings.vThumbWidth + 5;
606                    }
607
608                    var $t = '', $d = '', $dH = '';
609
610                    if(settings.vertical){
611                        var $h = Math.floor(($('.rwd-Pager.rwd-Gallery li').height() - 21.5) / 16.5) * 16.5;
612                        $dH = 'height: ' + $h + 'px;';
613                    }
614
615                    if(settings.title){
616                        $t= '<p class="thumb_title" style="' + $shift + ':' + $wT + 'px">' + title + '</p>';
617                    }
618
619                    if(settings.description){
620                        $d = '<p class="thumb_description" style="'+ $dH + $shift + ':' + $wT + 'px">' + description + '</p>';
621                    }
622
623                    if (settings.gallery === true) {
624                        pagers += '<li style="width:100%;' + property + ':' + thumbWidth + 'px;' + gutter + ':' + settings.thumbMargin + 'px">' +
625                            '<a href="#"><img src="' + thumb + '"/>' +
626                            $t +
627                            $d +
628                            '</a></li>';
629                    } else {
630                        pagers += '<li><a href="#">' + (i + 1) + '</a></li>';
631                    }
632
633                    if (settings.mode === 'slide') {
634                        if ((v) >= w - elSize) {
635                            i = i + 1;
636                            var minPgr = 2;
637                            if (i < minPgr) {
638                                pagers = null;
639                                $slide.parent().addClass('noPager');
640                            } else {
641                                $slide.parent().removeClass('noPager');
642                            }
643                            break;
644                        }
645                    }
646                }
647                var $cSouter = $slide.parent();
648                $cSouter.find('.rwd-Pager').html(pagers);
649                if (settings.gallery === true) {
650                    if (settings.vertical === true) {
651                        if(settings.title || settings.description) {
652                            $cSouter.find('.rwd-Pager img').css({
653                                'width': settings.vThumbWidth + 'px',
654                                'float': 'left'
655                            });
656
657                            if($el.parent().parent().parent().parent().width() > 600) {
658                                $cSouter.find('.rwd-Pager').css('width', (settings.vThumbWidth + 150) + 'px');
659                            } else {
660                                $cSouter.find('.rwd-Pager').css('width', '100%');
661                                $cSouter.find('.rwd-Pager p').css('width', 'calc(100% - 105px)');
662                            }
663                        } else {
664                            $cSouter.find('.rwd-Pager').css('width', settings.vThumbWidth + 'px');
665                        }
666                    } else {
667                        $cSouter.find('.rwd-Pager img').css({
668                            'height': settings.hThumbHeight + 'px'
669                        });
670                    }
671
672                    pagerWidth = (i * (settings.thumbMargin + thumbWidth)) + 0.5;
673                    $cSouter.find('.rwd-Pager').css({
674                        property: pagerWidth + 'px',
675                        'transition-duration': settings.speed + 'ms'
676                    });
677
678                    if($el.parent().parent().parent().parent().width() > 600){
679                        if (settings.vertical === true && settings.thumbPosition === false) {
680                            if(settings.title || settings.description){
681                                $slide.parent().css('padding-right', (settings.vThumbWidth + 155) + 'px');
682                            } else {
683                                $slide.parent().css('padding-right', settings.vThumbWidth + 5 + 'px');
684                            }
685                        }
686
687                        if(!settings.vertical && !$('.rwd-Pager.rwd-Gallery').hasClass('rwd-fullscreen-on')){
688                            $('.thumb_description').show();
689                        }
690                    } else {
691                        if (settings.vertical === true && settings.thumbPosition === false) {
692                            $slide.parent().css('padding-right', '');
693                        }
694                        if(!settings.vertical){
695                            $('.thumb_description').hide();
696                        }
697                    }
698
699                    $cSouter.find('.rwd-Pager').css(property, pagerWidth + 'px');
700                }
701                var $pager = $cSouter.find('.rwd-Pager').find('li');
702                $pager.first().addClass('active');
703                $pager.on('click', function () {
704                    if(!$slide.hasClass('thumb_moving')){
705                        $slide.removeClass('thumb_move');
706                    }
707                    if (settings.mode === 'slide') {
708                        scene = scene + ($pager.index(this) - $cSouter.find('.rwd-Pager').find('li.active').index());
709                    } else {
710                        scene = $pager.index(this);
711                    }
712                    $el.mode(false);
713                    if (settings.gallery === true) {
714                        $this.slideThumb();
715                    }
716                    return false;
717                });
718
719                if(settings.view === 'carousel1') {
720                    var $h = (settings.maxHeight / settings.maxWidth) * jQuery('.rwd-SlideOuter').width();
721                    jQuery('.rwd-SlideOuter').height($h);
722                    if (settings.dotsPos === 'top') {
723                        jQuery('.rwd-Pager.rwd-pg').css({
724                            top: (jQuery('.rwd-SlideWrapper').height() - jQuery('.rwd-SlideOuter').height()) / 2 + 10 + 'px'
725                        });
726                    } else {
727                        jQuery('.rwd-Pager.rwd-pg').css({
728                            bottom: (jQuery('.rwd-SlideWrapper').height() - jQuery('.rwd-SlideOuter').height()) / 2 - jQuery('.rwd-SlideWrapper').height() + 15 + 'px'
729                        });
730                    }
731                }
732
733                if(settings.thumbdragdrop){
734                    plugin.enableThumbDrag();
735                }
736
737                if(settings.thumbswipe){
738                    plugin.enableThumbTouch();
739                }
740
741                if(settings.pager){
742                    var gMargin = '', $s = '', gM = 5;
743
744                    if(settings.vertical){
745                        if(settings.thumbPosition){
746                            gMargin = 'margin-left';
747                            gM = 0;
748                            $slide.parent().find('.rwd-Pager').css({'left': '0px', 'position': 'absolute'});
749                            if(settings.title || settings.description){
750                                $slide.parent().find('.rwd-SlideWrapper').css('margin-left', (settings.vThumbWidth + 155) + 'px');
751                            } else {
752                                $slide.parent().find('.rwd-SlideWrapper').css('margin-left', settings.vThumbWidth + 5 + 'px');
753                            }
754                            if($el.parent().parent().parent().parent().width() > 600) {
755                                if (settings.title || settings.description) {
756                                    $slide.parent().find('.rwd-SlideWrapper').css('margin-left', (settings.vThumbWidth + 155) + 'px');
757                                }
758
759                                $slide.parent().find('.rwd-Pager').css({'position': 'absolute'});
760
761                                $('.rwd-SlideOuter.vertical').prepend($('.rwd-SlideOuter.vertical .rwd-Gallery').parent());
762
763                                $('.rwd-SlideOuter.vertical .rwd-Gallery').parent().css({
764                                    'overflow': '',
765                                    'margin-top': ''
766                                });
767
768                                $('.thumbAction').show();
769                            } else {
770                                if (settings.title || settings.description) {
771                                    $slide.parent().find('.rwd-SlideWrapper').css('margin-left', '');
772                                }
773
774                                $slide.parent().find('.rwd-Pager').css({'position': ''});
775
776                                $('.rwd-SlideOuter.vertical').append($('.rwd-SlideOuter.vertical .rwd-Gallery').parent());
777
778                                $('.rwd-SlideOuter.vertical .rwd-Gallery').parent().css({
779                                    'overflow': 'hidden',
780                                    'margin-top': '5px'
781                                });
782
783                                $('.thumbAction').hide();
784                            }
785                        } else {
786                            if($el.parent().parent().parent().parent().width() > 600) {
787                                $slide.parent().find('.rwd-Pager').css({'position': 'absolute'});
788                                if (settings.title || settings.description) {
789                                    $('.rwd-SlideOuter.vertical .rwd-Gallery').css({
790                                        'margin-top': -$('.rwd-SlideWrapper').height() + 'px',
791                                        'margin-left': 'calc(100% - ' + (settings.vThumbWidth + 150) + 'px)'
792                                    });
793                                } else {
794                                    $('.rwd-SlideOuter.vertical .rwd-Gallery').css({
795                                        'margin-top': -$('.rwd-SlideWrapper').height() + 'px',
796                                        'margin-left': 'calc(100% - ' + settings.vThumbWidth + 'px)'
797                                    });
798                                }
799                                $('.rwd-SlideOuter.vertical .rwd-Gallery').parent().css({
800                                    'overflow': '',
801                                    'margin-top': ''
802                                });
803
804                                $('.thumbAction').show();
805                            } else {
806                                $('.rwd-SlideOuter.vertical .rwd-Gallery').css({
807                                    'margin-top': '',
808                                    'margin-left': '',
809                                    'position': ''
810                                });
811                                $('.rwd-SlideOuter.vertical .rwd-Gallery').parent().css({
812                                    'overflow': 'hidden',
813                                    'margin-top': '5px'
814                                });
815
816                                $('.thumbAction').hide();
817                            }
818                        }
819
820                        if($el.parent().parent().parent().parent().width() <= 600){
821                            $('.rwd-SlideOuter.vertical').css('height', (settings.sliderHeight + 5 + 4 * (settings.sliderHeight - settings.thumbItem * settings.thumbMargin + settings.thumbMargin) / settings.thumbItem) + 'px');
822                        } else {
823                            $('.rwd-SlideOuter.vertical').css('height', '');
824                        }
825                    } else {
826                        if(settings.thumbPosition){
827                            gMargin = 'margin-bottom';
828                            $s = $slide.parent().find('.rwd-Pager');
829                            $('.rwd-SlideOuter').prepend($s);
830                        } else {
831                            gMargin = 'margin-top';
832                        }
833                    }
834
835                    $slide.parent().find('.rwd-Pager').css(gMargin, gM + 'px');
836                }
837            };
838
839            if (settings.pager) {
840                var cl = 'rwd-pg';
841                if (settings.gallery) {
842                    cl = 'rwd-Gallery';
843                }
844
845                if((hugeitSliderObj.navigation_position === 'top' && !sett
845ings.gallery) || (settings.vertical && settings.thumbPosition)){
846                    $slide.before('<div><ul class="rwd-Pager ' + cl + '"></ul></div>');
847                } else {
848                    $slide.after('<div><ul class="rwd-Pager ' + cl + '"></ul></div>');
849                }
850
851                refresh.createPager();
852            }
853
854            setTimeout(function () {
855                refresh.init();
856            }, 0);
857        };
858        plugin.setHeight = function (ob, fade) {
859            var obj = null,
860                $this = this;
861
862            obj = ob.children('.rwd-slide ').first();
863
864            var setCss = function () {
865                var tH = obj.outerHeight(),
866                    tP = 0,
867                    tHT = tH,
868                    tH_;
869
870                tH_ = obj.parent().find('li:not(.video_iframe)').outerHeight();
871
872                if(tH < tH_){
873                    tH = tH_;
874                }
875
876                if (fade) {
877                    tH = settings.sliderHeight;
878                    tP = ((tHT) * 100) / elSize;
879                }
880
881                if(settings.view === 'carousel1'){
882                    $('.rwd-SlideWrapper').css({
883                        height: tH + 20 + 'px'
884                    });
885                }
886
887                if(!$slide.hasClass('rwd-fullscreen-on')){
888                    ob.css({
889                        'height': tH + 'px',
890                        'padding-bottom': tP + '%'
891                    });
892                } else {
893                    ob.css({
894                        'height': '100%',
895                        'padding-bottom': tP + '%'
896                    });
897                }
898            };
899            setCss();
900            if (obj.find('img, iframe').length) {
901                if ( obj.find('img, iframe')[0].complete) {
902                    setCss();
903                    if (!interval) {
904                        $this.auto();
905                    }
906                }else{
907                    obj.find('img, iframe').on('load', function () {
908                        setTimeout(function () {
909                            setCss();
910                            if (!interval) {
911                                $this.auto();
912                            }
913                        }, 100);
914                    });
915                }
916            }else{
917                if (!interval) {
918                    $this.auto();
919                }
920            }
921        };
922        plugin.active = function (ob, t) {
923            if (this.doCss() && settings.mode === 'fade') {
924                $slide.addClass('on');
925            }
926            var sc = 0;
927            if (scene < length) {
928                ob.removeClass('active');
929                if (!this.doCss() && settings.mode === 'fade' && t === false) {
930                    ob.fadeOut(settings.speed);
931                }
932
933                sc = scene;
934
935                var l, nl;
936                if (t === true) {
937                    l = ob.length;
938                    nl = l - 1;
939                    if (sc + 1 >= l) {
940                        sc = nl;
941                    }
942                }
943                if (settings.mode === 'slide') {
944                    if (t === true) {
945                        sc = scene - $el.find('.clone.left').length;
946                    } else {
947                        sc = scene;
948                    }
949                    if (t === true) {
950                        l = ob.length;
951                        nl = l - 1;
952                        if (sc + 1 === l) {
953                            sc = nl;
954                        } else if (sc + 1 > l) {
955                            sc = 0;
956                        }
957                    }
958                }
959
960                if (!this.doCss() && settings.mode === 'fade' && t === false) {
961                    ob.eq(sc).fadeIn(settings.speed);
962                }
963                ob.eq(sc).addClass('active');
964            } else {
965                ob.removeClass('active');
966                ob.eq(ob.length - 1).addClass('active');
967                if (!this.doCss() && settings.mode === 'fade' && t === false) {
968                    ob.fadeOut(settings.speed);
969                    ob.eq(sc).fadeIn(settings.speed);
970                }
971            }
972        };
973        plugin.move = function (ob, v) {
974            ob.attr('data-left', v);
975
976            if(settings.view === 'carousel1') {
977                if (settings.item === 3) {
978                    settings.slideMargin = 20;
979                }
980
981                v = v - Math.floor(settings.item / 2) * slideWidth;
982            }
983
984            if (this.doCss()) {
985                if (settings.vertical === true) {
986                    ob.css({
987                        'transform': 'translate3d(0px, ' + (-v) + 'px, 0px)',
988                        '-webkit-transform': 'translate3d(0px, ' + (-v) + 'px, 0px)'
989                    });
990                } else {
991                    ob.css({
992                        'transform': 'translate3d(' + (-v) + 'px, 0px, 0px)',
993                        '-webkit-transform': 'translate3d(' + (-v) + 'px, 0px, 0px)'
994                    });
995                }
996            } else {
997                if (settings.vertical === true) {
998                    ob.css('position', 'relative').animate({
999                        top: -v + 'px'
1000                    }, settings.speed, 'linear');
1001                } else {
1002                    ob.css('position', 'relative').animate({
1003                        left: -v + 'px'
1004                    }, settings.speed, 'linear');
1005                }
1006            }
1007            var $thumb = $slide.parent().find('.rwd-Pager').find('li');
1008            this.active($thumb, true);
1009        };
1010        plugin.move_ = function (ob, v) {
1011            if (settings.rtl === true) {
1012                v = -v;
1013            }
1014
1015            if (this.doCss()) {
1016                ob.css({
1017                    'transform': 'translate3d(' + (-v) + 'px, 0px, 0px)',
1018                    '-webkit-transform': 'translate3d(' + (-v) + 'px, 0px, 0px)'
1019                });
1020            } else {
1021                ob.css('position', 'relative').animate({
1022                    left: -v + 'px'
1023                }, settings.speed, settings.easing);
1024            }
1025            var $thumb = $slide.parent().find('.rwd-Pager').find('li');
1026            this.active($thumb, true);
1027        };
1028        plugin.fade = function () {
1029            this.active($children, false);
1030            var $thumb = $slide.parent().find('.rwd-Pager').find('li');
1031            this.active($thumb, true);
1032        };
1033        plugin.slide = function () {
1034            var $this = this;
1035            refresh.calSlide = function () {
1036                if (w > elSize) {
1037                    slideValue = $this.slideValue();
1038                    $this.active($children, false);
1039                    if ((slideValue) > w - elSize) {
1040                        slideValue = w - elSize;
1041                    } else if (slideValue < 0) {
1042                        slideValue = 0;
1043                    }
1044                    $this.move($el, slideValue);
1045                    if (settings.mode === 'slide') {
1046                        if (scene >= length - $el.find('.clone.left').length) {
1047                            $this.resetSlide($el.find('.clone.left').length);
1048                        }
1049                        if (scene === 0) {
1050                            $this.resetSlide($slide.find('.rwd-slide').length);
1051                        }
1052                    }
1053                }
1054            };
1055            refresh.calSlide();
1056        };
1057        plugin.resetSlide = function (s) {
1058            var $this = this;
1059            $slide.find('.rwd-Action a').addClass('disabled');
1060            setTimeout(function () {
1061                scene = s;
1062                $slide.css('transition-duration', '0ms');
1063                slideValue = $this.slideValue();
1064                $this.active($children, false);
1065                plugin.move($el, slideValue);
1066                setTimeout(function () {
1067                    $slide.css('transition-duration', settings.speed + 'ms');
1068                    $slide.find('.rwd-Action a').removeClass('disabled');
1069                }, 50);
1070            }, settings.speed + 100);
1071        };
1072        plugin.slideValue = function () {
1073            var _sV = 0;
1074            _sV = scene * slideWidth;
1075
1076            return _sV;
1077        };
1078        plugin.slideThumb = function () {
1079            var position;
1080
1081            position = (elSize / 2) - (thumbWidth / 2);
1082
1083            var sc = scene - $el.find('.clone.left').length;
1084            var $pager = $slide.parent().find('.rwd-Pager');
1085            if (settings.mode === 'slide') {
1086                if (sc >= $pager.children().length) {
1087                    sc = 0;
1088                } else if (sc < 0) {
1089                    sc = $pager.children().length;
1090                }
1091            }
1092            var thumbSlide = sc * ((thumbWidth + settings.thumbMargin)) - (position);
1093            if ((thumbSlide + elSize) > pagerWidth) {
1094                thumbSlide = pagerWidth - elSize - settings.thumbMargin;
1095            }
1096            if (thumbSlide < 0) {
1097                thumbSlide = 0;
1098            }
1099            if(settings.view === 'carousel1'){
1100                this.move_($pager, thumbSlide);
1101            } else {
1102                if(!$slide.hasClass('thumb_move')){
1103                    this.move($pager, thumbSlide);
1104                }
1105            }
1106        };
1107        plugin.auto = function () {
1108            clearInterval(interval);
1109            interval = setInterval(function () {
1110                $el.goToNextSlide();
1111            }, settings.pause);
1112        };
1113        plugin.pauseOnHover = function(){
1114            var $this = this;
1115            if (settings.pauseOnHover) {
1116                $slide.on('mouseenter', function(){
1117                    $(this).addClass('isHover');
1118                    $el.pause();
1119                });
1120                $slide.on('mouseleave',function(){
1121                    $(this).removeClass('isHover');
1122                    if (!$slide.find('.huge_it_slider').hasClass('isGrabbing')) {
1123                        if(!$('.rwd-SlideWrapper').hasClass('videoIsPlay')){
1124                            $this.auto();
1125                        }
1126                    }
1127                });
1128            }
1129        };
1130        plugin.touchMove = function (endCoords, startCoords) {
1131            $slide.css('transition-duration', '0ms');
1132            if (settings.mode === 'slide') {
1133                var distance = endCoords - startCoords;
1134                var swipeVal = slideValue - distance;
1135                if ((swipeVal) >= w - elSize) {
1136                    var swipeValT = w - elSize;
1137                    swipeVal = swipeValT + ((swipeVal - swipeValT) / 5);
1138                } else if (swipeVal < 0) {
1139                    swipeVal = swipeVal / 5;
1140                }
1141                this.move($el, swipeVal);
1142            }
1143        };
1144        plugin.touchEnd = function (distance) {
1145            $slide.css('transition-duration', settings.speed + 'ms');
1146            if (settings.mode === 'slide') {
1147                var mxVal = false;
1148                var _next = true;
1149                slideValue = slideValue - distance;
1150                if ((slideValue) > w - elSize) {
1151                    slideValue = w - elSize;
1152                    mxVal = true;
1153                } else if (slideValue < 0) {
1154                    slideValue = 0;
1155                }
1156                var gC = function (next) {
1157                    var ad = 0;
1158                    if (!mxVal) {
1159                        if (next) {
1160                            ad = 1;
1161                        }
1162                    }
1163                    var num = slideValue / slideWidth;
1164                    scene = parseInt(num) + ad;
1165                    if (slideValue >= (w - elSize)) {
1166                        if (num % 1 !== 0) {
1167                            scene++;
1168                        }
1169                    }
1170                };
1171                if (distance >= 45) {
1172                    gC(false);
1173                    _next = false;
1174                } else if (distance <= -45) {
1175                    gC(true);
1176                    _next = false;
1177                }
1178                $el.mode(_next);
1179                this.slideThumb();
1180            } else {
1181                if (distance >= 45) {
1182                    $el.goToPrevSlide();
1183                } else if (distance <= -45) {
1184                    $el.goToNextSlide();
1185                }
1186            }
1187        };
1188        plugin.enableDrag = function () {
1189            var $this = this;
1190            if (!isTouch) {
1191                var startCoords = 0,
1192                    endCoords = 0,
1193                    isDraging = false;
1194                $slide.find('.huge_it_slider').addClass('isGrab');
1195                $slide.on('mousedown', function (e) {
1196                    if (w < elSize) {
1197                        if (w !== 0) {
1198                            return false;
1199                        }
1200                    }
1201                    if ($(e.target).attr('class') !== ('rwd-Prev') && $(e.target).attr('class') !== ('rwd-Next')) {
1202                        startCoords = (settings.vertical === true) ? e.pageY : e.pageX;
1203                        isDraging = true;
1204                        if (e.preventDefault) {
1205                            e.preventDefault();
1206                        } else {
1207                            e.returnValue = false;
1208                        }
1209                        $slide.scrollLeft += 1;
1210                        $slide.scrollLeft -= 1;
1211                        $slide.find('.huge_it_slider').removeClass('isGrab').addClass('isGrabbing');
1212                        clearInterval(interval);
1213                    }
1214                });
1215                $(window).on('mousemove', function (e) {
1216                    if (isDraging) {
1217                        endCoords = (settings.vertical === true) ? e.pageY : e.pageX;
1218                        $this.touchMove(endCoords, startCoords);
1219                    }
1220                });
1221                $(window).on('mouseup', function (e) {
1222                    if (isDraging) {
1223                        $slide.find('.huge_it_slider').removeClass('isGrabbing').addClass('isGrab');
1224                        isDraging = false;
1225                        endCoords = (settings.vertical === true) ? e.pageY : e.pageX;
1226                        var distance = endCoords - startCoords;
1227                        if (Math.abs(distance) >= 45) {
1228                            $(window).on('click', function (e) {
1229                                if (e.preventDefault) {
1230                                    e.preventDefault();
1231                                } else {
1232                                    e.returnValue = false;
1233                                }
1234                                e.stopImmediatePropagation();
1235                                e.stopPropagation();
1236                                $(window).off('click');
1237                            });
1238                        }
1239                        $this.touchEnd(distance);
1240                    }
1241                });
1242            }
1243        };
1244        plugin.enableThumbDrag = function(){
1245            if (settings.pager && settings.gallery) {
1246                var $this = this,
1247                    $pager = $slide.parent().find('.rwd-Pager');
1248
1249                if (!isTouch) {
1250                    var tempLeft = 0,
1251                        startCoords = 0,
1252                        endCoords = 0,
1253                        swipeVal = 0,
1254                        distance,
1255                        isDraging = false;
1256
1257                    $slide.find('.rwd-Gallery').addClass('isGrab');
1258
1259                    $('.rwd-Gallery').on('mousedown', function (e) {
1260                        $slide.addClass('thumb_move');
1261
1262                        tempLeft = parseInt($pager.attr('data-left'));
1263
1264                        startCoords = (settings.vertical === true) ? e.pageY : e.pageX;
1265                        isDraging = true;
1266                        if (e.preventDefault) {
1267                            e.preventDefault();
1268                        } else {
1269                            e.returnValue = false;
1270                        }
1271                        $slide.scrollLeft += 1;
1272                        $slide.scrollLeft -= 1;
1273                        $slide.find('.rwd-Gallery').removeClass('isGrab').addClass('isGrabbing');
1274                    });
1275
1276                    $('.rwd-Gallery').on('mousemove', function (e) {
1277                        if (isDraging) {
1278                            $pager.css('transition-duration', '0ms');
1279                            $slide.addClass('thumb_moving');
1280
1281                            endCoords = (settings.vertical === true) ? e.pageY : e.pageX;
1282
1283                            distance = endCoords - startCoords;
1284
1285                            swipeVal = tempLeft - distance;
1286                            if (settings.vertical === true) {
1287                                if (swipeVal > $pager.height() - $('.rwd-SlideWrapper').height()) {
1288                                    swipeVal = $pager.height() - $('.rwd-SlideWrapper').height() - settings.thumbMargin;
1289                                }
1290                            } else {
1291                                if (swipeVal > $pager.width() - $('.rwd-SlideWrapper').width()) {
1292                                    swipeVal = $pager.width() - $('.rwd-SlideWrapper').width() - settings.thumbMargin;
1293                                }
1294                            }
1295
1296                            if (swipeVal < 0) {
1297                                swipeVal = 0;
1298                            }
1299
1300                            $this.move($pager, swipeVal);
1301                        }
1302                    });
1303
1304                    $('.rwd-Gallery').on('mouseup', function (e) {
1305                        if (isDraging) {
1306                            setTimeout(function(){
1307                                $slide.removeClass('thumb_moving');
1308                            }, 0);
1309
1310                            endCoords = (settings.vertical === true) ? e.pageY : e.pageX;
1311
1312                            distance = endCoords - startCoords;
1313
1314                            swipeVal = tempLeft - distance;
1315                            if (settings.vertical === true) {
1316                                if (swipeVal > $pager.height() - $('.rwd-SlideWrapper').height()) {
1317                                    swipeVal = $pager.height() - $('.rwd-SlideWrapper').height() - settings.thumbMargin;
1318                                }
1319                            } else {
1320                                if (swipeVal > $pager.width() - $('.rwd-SlideWrapper').width()) {
1321                                    swipeVal = $pager.width() - $('.rwd-SlideWrapper').width() - settings.thumbMargin;
1322                                }
1323                            }
1324
1325                            if (swipeVal < 0) {
1326                                swipeVal = 0;
1327                            }
1328
1329                            $this.move($pager, swipeVal);
1330
1331                            $pager.attr('data-left', swipeVal);
1332
1333                            $slide.find('.rwd-Gallery').removeClass('isGrabbing').addClass('isGrab');
1334                            isDraging = false;
1335                            endCoords = (settings.vertical === true) ? e.pageY : e.pageX;
1336                            var distance = endCoords - startCoords;
1337                            if (Math.abs(distance) >= 45) {
1338                                $(window).on('click', function (e) {
1339                                    if (e.preventDefault) {
1340                                        e.preventDefault();
1341                                    } else {
1342                                        e.returnValue = false;
vendor: 2,344 bytes, lines 1343-1397
1343                                    }
1344                                    e.stopImmediatePropagation();
1345                                    e.stopPropagation();
1346                                    $(window).off('click');
1347                                });
1348                            }
1349                        }
1350                    });
1351                }
1352            }
1353        };
1354        plugin.enableTouch = function () {
1355            var $this = this;
1356            if (isTouch) {
1357                var startCoords = {},
1358                    endCoords = {};
1359                $slide.on('touchstart', function (e) {
1360                    endCoords = e.originalEvent.targetTouches[0];
1361                    startCoords.pageX = e.originalEvent.targetTouches[0].pageX;
1362                    startCoords.pageY = e.originalEvent.targetTouches[0].pageY;
1363                    clearInterval(interval);
1364                });
1365                $slide.on('touchmove', function (e) {
1366                    if (w < elSize) {
1367                        if (w !== 0) {
1368                            return false;
1369                        }
1370                    }
1371                    var orig = e.originalEvent;
1372                    endCoords = orig.targetTouches[0];
1373                    var xMovement = Math.abs(endCoords.pageX - startCoords.pageX);
1374                    var yMovement = Math.abs(endCoords.pageY - startCoords.pageY);
1375                    if (settings.vertical === true) {
1376                        if ((yMovement * 3) > xMovement) {
1377                            e.preventDefault();
1378                        }
1379                        $this.touchMove(endCoords.pageY, startCoords.pageY);
1380                    } else {
1381                        if ((xMovement * 3) > yMovement) {
1382                            e.preventDefault();
1383                        }
1384                        $this.touchMove(endCoords.pageX, startCoords.pageX);
1385                    }
1386
1387                });
1388                $slide.on('touchend', function () {
1389                    if (w < elSize) {
1390                        if (w !== 0) {
1391                            return false;
1392                        }
1393                    }
1394                    var distance;
1395                    if (settings.vertical === true) {
1396                        distance = endCoords.pageY - startCoords.pageY;
1397                    } else {
1398                        distance = endCoords.pageX - startCoords.pageX;
1399                    }
1400                    $this.touchEnd(distance);
1401                });
1402            }
1403        };
1404        plugin.enableThumbTouch = function () {
1405            if (settings.pager && settings.gallery) {
1406                var $this = this,
1407                    $pager = $slide.parent().find('.rwd-Pager');
1408
1409                if (isTouch) {
1410                    var startCoords = {},
1411                        endCoords = {},
1412                        tempLeft = 0;
1413
1414                    $('.rwd-Gallery').on('touchstart', function (e) {
1415                        tempLeft = +$pager.attr('data-left');
1416
1417                        endCoords = e.originalEvent.targetTouches[0];
1418                        startCoords.pageX = e.originalEvent.targetTouches[0].pageX;
1419                        startCoords.pageY = e.originalEvent.targetTouches[0].pageY;
1420                        clearInterval(interval);
1421                    });
1422                    $('.rwd-Gallery').on('touchmove', function (e) {
1423                        $pager.css('transition-duration', '0ms');
1424
1425                        $slide.addClass('thumb_move');
1426
1427                        if (w < elSize) {
1428                            if (w !== 0) {
1429                                return false;
1430                            }
1431                        }
1432                        var orig = e.originalEvent;
1433                        endCoords = orig.targetTouches[0];
1434                        var xMovement = Math.abs(endCoords.pageX 
1434- startCoords.pageX);
1435                        var yMovement = Math.abs(endCoords.pageY - startCoords.pageY);
1436                        if (settings.vertical) {
1437                            if ((yMovement * 3) > xMovement) {
1438                                e.preventDefault();
1439                            }
1440
1441                            tempLeft = tempLeft - (endCoords.pageY - startCoords.pageY);
1442
1443                            if (tempLeft > $pager.height() - $('.rwd-SlideWrapper').height()) {
1444                                tempLeft = $pager.height() - $('.rwd-SlideWrapper').height() - settings.thumbMargin;
1445                            }
1446
1447                            if (tempLeft < 0) {
1448                                tempLeft = 0;
1449                            }
1450
1451                            $this.move($pager, tempLeft);
1452                        } else {
1453                            if ((xMovement * 3) > yMovement) {
1454                                e.preventDefault();
1455                            }
1456
1457                            tempLeft = tempLeft - (endCoords.pageX 
1457- startCoords.pageX);
1458
1459                            if (tempLeft > $pager.width() - $('.rwd-SlideWrapper').width()) {
1460                                tempLeft = $pager.width() - $('.rwd-SlideWrapper').width();
1461                            }
1462
1463                            if (tempLeft < 0) {
1464                                tempLeft = 0;
1465                            }
1466
1467                            $this.move($pager, tempLeft);
1468                        }
1469                    });
1470                    $('.rwd-Gallery').on('touchend', function () {
1471                        if (settings.vertical) {
1472                            if ((yMovement * 3) > xMovement) {
1473                                e.preventDefault();
1474                            }
1475
1476                            tempLeft = tempLeft - (endCoords.pageY - startCoords.pageY);
1477
1478                            if (tempLeft > $pager.height() - $('.rwd-SlideWrapper').height()) {
1479                                tempLeft = $pager.height() - $('.rwd-SlideWrapper').height() - settings.thumbMargin;
1480                            }
1481
1482                            if (tempLeft < 0) {
1483                                tempLeft = 0;
1484                            }
1485
1486                            $this.move($pager, tempLeft);
1487                        } else {
1488                            if ((xMovement * 3) > yMovement) {
1489                                e.preventDefault();
1490                            }
1491
1492                            tempLeft = tempLeft - (endCoords.pageX 
1492- startCoords.pageX);
1493
1494                            if (tempLeft > $pager.width() - $('.rwd-SlideWrapper').width()) {
1495                                tempLeft = $pager.width() - $('.rwd-SlideWrapper').width();
1496                            }
1497
1498                            if (tempLeft < 0) {
1499                                tempLeft = 0;
1500                            }
1501
1502                            $this.move($pager, tempLeft);
1503                        }
1504
1505                        $pager.attr('data-left', tempLeft);
1506
1507                        if (w < elSize) {
1508                            if (w !== 0) {
1509                                return false;
1510                            }
1511                        }
1512                        var distance;
1513                        if (settings.vertical === true) {
1514                            distance = endCoords.pageY - startCoords.pageY;
1515                        } else {
1516                            distance = endCoords.pageX - startCoords.pageX;
1517                        }
1518                        $this.touchEnd(distance);
1519                    });
1520                }
1521            }
1522        };
1523        plugin.build = function () {
1524            var $this = this;
1525            $this.initialStyle();
1526            if (this.doCss()) {
1527                if(settings.dragdrop){
1528                    $this.enableDrag();
1529                }
1530                if(settings.swipe){
1531                    $this.enableTouch();
1532                }
1533            }
1534
1535            $(window).on('focus', function(){
1536                $this.auto();
1537            });
1538
1539            $(window).on('blur', function(){
1540                clearInterval(interval);
1541            });
1542
1543            $this.pager();
1544            $this.pauseOnHover();
1545            $this.controls();
1546            $this.thumbControls();
1547            $this.keyPress();
1548            $this.fullscreen();
1549            $this.videoControl();
1550        };
1551        plugin.build();
1552        refresh.init = function () {
1553            if (settings.vertical) {
1554                if (settings.item > 1) {
1555                    elSize = settings.sliderHeight;
1556                } else {
1557                    elSize = $children.outerHeight();
1558                }
1559
1560                if(settings.vertical){
1561                    if(!$slide.hasClass('rwd-fullscreen-on')){
1562                        $slide.css('height', elSize + 'px');
1563                    } else {
1564                        $slide.css('height', ($(window).height() - 30) + 'px');
1565                    }
1566                } else {
1567                    $slide.css('height', elSize + 'px');
1568                }
1569            } else {
1570                elSize = $slide.outerWidth();
1571            }
1572            if (settings.mode === 'slide') {
1573                refresh.clone();
1574            }
1575            refresh.calL();
1576            if (settings.mode === 'slide') {
1577                $el.removeClass('rwd-Slide');
1578            }
1579            if (settings.mode === 'slide') {
1580                refresh.calSW();
1581                refresh.sSW();
1582            }
1583            setTimeout(function () {
1584                if (settings.mode === 'slide') {
1585                    $el.addClass('rwd-Slide');
1586                }
1587            }, 1000);
1588            if (settings.pager) {
1589                refresh.createPager();
1590            }
1591            if (settings.mode === 'slide') {
1592                if (settings.vertical === false) {
1593                    plugin.setHeight($el, false);
1594                }else{
1595                    plugin.auto();
1596                }
1597            } else {
1598                plugin.setHeight($el, true);
1599            }
1600            if (settings.gallery === true) {
1601                plugin.slideThumb();
1602            }
1603            if (settings.mode === 'slide') {
1604                plugin.slide();
1605            }
1606            if ($children.length <= settings.item) {
1607                $slide.find('.rwd-Action').hide();
1608            } else {
1609                $slide.find('.rwd-Action').show();
1610            }
1611        };
1612        $el.goToPrevSlide = function () {
1613            if (scene > 0) {
1614                scene--;
1615                $el.mode(false);
1616                if (settings.gallery === true) {
1617                    plugin.slideThumb();
1618                }
1619            } else {
1620                if (settings.mode === 'fade') {
1621                    var l = (length - 1);
1622                    scene = l;
1623                }
1624                $el.mode(false);
1625                if (settings.gallery === true) {
1626                    plugin.slideThumb();
1627                }
1628            }
1629        };
1630        $el.goToNextSlide = function () {
1631            var nextI = true;
1632            if (settings.mode === 'slide') {
1633                var _slideValue = plugin.slideValue();
1634                nextI = _slideValue < w - elSize;
1635            }
1636            if ((scene < length) && nextI) {
1637                scene++;
1638                $el.mode(false);
1639                if (settings.gallery === true) {
1640                    plugin.slideThumb();
1641                }
1642            } else {
1643                scene = 0;
1644                $el.mode(false);
1645                if (settings.gallery === true) {
1646                    plugin.slideThumb();
1647                }
1648            }
1649        };
1650        $el.mode = function (b) {
1651            if (on === false) {
1652                if (settings.mode === 'slide') {
1653                    if (plugin.doCss()) {
1654                        $el.addClass('rwd-Slide');
1655                        if (settings.speed !== '') {
1656                            $slide.css('transition-duration', settings.speed + 'ms');
1657                        }
1658                        $slide.css('transition-timing-function','ease');
1659                    }
1660                } else {
1661                    if (plugin.doCss()) {
1662                        if (settings.speed !== '') {
1663                            $el.css('transition-duration', settings.speed + 'ms');
1664                        }
1665                        $el.css('transition-timing-function', 'ease');
1666                    }
1667                }
1668            }
1669            if (settings.mode === 'slide') {
1670                plugin.slide();
1671            } else {
1672                plugin.fade();
1673            }
1674            if (!$slide.hasClass('isHover')) {
1675                plugin.auto();
1676            }
1677
1678            if (!b) {
1679                $el.onBeforeSlide.call(this);
1680            }
1681
1682            setTimeout(function () {
1683                if (!b) {
1684                    $el.onAfterSlide.call(this, scene);
1685                }
1686            }, settings.speed);
1687            on = true;
1688        };
1689        $el.onBeforeSlide = function(){
1690            $('.rwd-SlideWrapper').addClass('lightboxOff');
1691
1692            $('.rslider_iframe_cover').show();
1693
1694            $('.rwd-SlideWrapper iframe').each(function(){
1695                if($(this).attr('src').indexOf('youtube') !== -1){
1696                    $(this).get(0).contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*')
1697                } else if($(this).attr('src').indexOf('vimeo') !== -1){
1698                    try {
1699                        $f($(this).get(0)).api('pause');
1700                    } catch (e) {
1701                        console.error('Make sure you have included froogaloop2 js');
1702                    }
1703                }
1704            });
1705
1706            $('.rwd-SlideWrapper').removeClass('videoIsPlay');
1707        };
1708        $el.onAfterSlide = function(scene){
1709            $('.rwd-SlideWrapper').removeClass('lightboxOff');
1710
1711            $('.rslider_iframe_cover').show();
1712
1713            $('.rwd-SlideWrapper iframe').each(function(){
1714                if($(this).attr('src').indexOf('youtube') !== -1){
1715                    $(this).get(0).contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*')
1716                } else if($(this).attr('src').indexOf('vimeo') !== -1){
1717                    try {
1718                        $f($(this).get(0)).api('pause');
1719                    } catch (e) {
1720                        console.error('Make sure you have included froogaloop2 js');
1721                    }
1722                }
1723            });
1724
1725            $('.rwd-SlideWrapper').removeClass('videoIsPlay');
1726
1727            if(parseInt($('.rwd-SlideWrapper ul').attr('data-autoplay')) === 1){
1728                $('.rslider_iframe_cover').hide();
1729
1730                var $iframe = $('.rwd-slide').eq(scene - 1).find('iframe');
1731
1732                if($('.rwd-slide').eq(scene - 1).hasClass('video_iframe')){
1733                    if($iframe.attr('src').indexOf('youtube') !== -1){
1734                        $iframe.get(0).contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*')
1735                    } else if($iframe.attr('src').indexOf('vimeo') !== -1){
1736                        try {
1737                            $f($iframe.get(0)).api('play');
1738                        } catch (e) {
1739                            console.error('Make sure you have included froogaloop2 js');
1740                        }
1741                    }
1742                }
1743
1744                $('.rwd-SlideWrapper').addClass('videoIsPlay');
1745
1746                $el.pause();
1747            }
1748        };
1749        $el.play = function () {
1750            $el.goToNextSlide();
1751            plugin.auto();
1752        };
1753        $el.pause = function () {
1754            clearInterval(interval);
1755        };
1756        $el.refresh = function () {
1757            refresh.init();
1758        };
1759        $el.getCurrentSlideCount = function () {
1760            var sc = scene;
1761            var ln = $slide.find('.rwd-slide').length,
1762                cl = $el.find('.clone.left').length;
1763            if (scene <= cl - 1) {
1764                sc = ln + (scene - cl);
1765            } else if (scene >= (ln + cl)) {
1766                sc = scene - ln - cl;
1767            } else {
1768                sc = scene - cl;
1769            }
1770            return sc + 1;
1771        };
1772        $el.getTotalSlideCount = function () {
1773            return $slide.find('.rwd-slide').length;
1774        };
1775        $el.goToSlide = function (s) {
1776            scene = (s + $el.find('.clone.left').length - 1);
1777
1778            $el.mode(false);
1779            if (settings.gallery === true) {
1780                plugin.slideThumb();
1781            }
1782        };
1783        $el.destroy = function () {
1784            if ($el.RSlider) {
1785                $el.goToPrevSlide = function(){};
1786                $el.goToNextSlide = function(){};
1787                $el.mode = function(){};
1788                $el.play = function(){};
1789                $el.pause = function(){};
1790                $el.refresh = function(){};
1791                $el.getCurrentSlideCount = function(){};
1792                $el.getTotalSlideCount = function(){};
1793                $el.goToSlide = function(){};
1794                $el.onBeforeSlide = function(){};
1795                $el.onAfterSlide = function(){};
1796                $el.RSlider = null;
1797                refresh = {
1798                    init : function(){}
1799                };
1800                $el.parent().parent().find('.rwd-Action, .rwd-Pager').remove();
1801                $el.removeClass('huge_it_slider iSFade iSSlide isGrab isGrabbing leftEnd right').removeAttr('style').unwrap().unwrap();
1802                $el.children().removeAttr('style');
1803                $children.removeClass('rwd-slide active');
1804                $el.find('.clone').remove();
1805                $children = null;
1806                interval = null;
1807                on = false;
1808                scene = 0;
1809            }
1810
1811        };
1812
1813        $(window).on('resize orientationchange', function (e) {
1814            setTimeout(function () {
1815                if (e.preventDefault) {
1816                    e.preventDefault();
1817                } else {
1818                    e.returnValue = false;
1819                }
1820
1821                if(!$('.rwd-SlideWrapper').hasClass('rwd-fullscreen-on')){
1822                    refresh.init();
1823                }
1824
1825                if(settings.view === 'carousel1') {
1826                    var $h = (settings.maxHeight / settings.maxWidth) * jQuery('.rwd-SlideOuter').width();
1827                    jQuery('.rwd-SlideOuter').height($h);
1828                    if (settings.dotsPos === 'top') {
1829                        jQuery('.rwd-Pager.rwd-pg').css({
1830                            top: (jQuery('.rwd-SlideWrapper').height() - jQuery('.rwd-SlideOuter').height()) / 2 + 10 + 'px'
1831                        });
1832                    } else {
1833                        jQuery('.rwd-Pager.rwd-pg').css({
1834                            bottom: (jQuery('.rwd-SlideWrapper').height() - jQuery('.rwd-SlideOuter').height()) / 2 - jQuery('.rwd-SlideWrapper').height() + 15 + 'px'
1835                        });
1836                    }
1837                }
1838            }, 200);
1839        });
1840
1841        return this;
1842    };
1843
1844})(jQuery);
1845
1846
1847
1848
1849
1850//////////////////////////////////////////
1851
1852
1853
1854
1855
1856(function ($, window, document) {
1857
1858    'use strict';
1859
1860    var defaults = {
1861        maxWidth: 900,
1862        maxHeight: 700,
1863        transition: 'random',
1864        customTransitions: [],
1865        fallback3d: 'fade',
1866        perspective: 1000,
1867        navigation: +hugeitSliderObj.show_arrows,
1868        thumbMargin: .5,
1869        autoPlay: true,
1870        controls: 'dot',
1871        cropImage: 'stretch',
1872        delay: 5000,
1873        transitionDuration: 2000,
1874        pauseOnHover: true,
1875        startSlide: 0,
1876        keyNav: false
1877    };
1878
1879    function Slider(elem, settings) {
1880        this.$slider = $(elem).addClass('huge-it-slider');
1881        this.settings = $.extend({}, defaults, settings);
1882        this.$slides = this.$slider.find('> li');
1883        this.totalSlides = this.$slides.length;
1884        this.cssTransitions = testBrowser.cssTransitions();
1885        this.cssTransforms3d = testBrowser.cssTransforms3d();
1886        this.currentPlace = this.settings.startSlide;
1887        this.$currentSlide = this.$slides.eq(this.currentPlace);
1888        this.inProgress = false;
1889        this.$sliderWrap = this.$slider.wrap('<div class="huge-it-wrap" />').parent();
1890        this.$sliderBG = this.$slider.wrap('<div class="huge-it-slide-bg" />').parent();
1891        this.settings.slider = this;
1892
1893        this.init();
1894    }
1895
1896    Slider.prototype.cycling = null;
1897
1898    Slider.prototype.$slideImages = null;
1899
1900    Slider.prototype.init = function () {
1901
1902        var _this = this;
1903
1904        this.captions();
1905
1906        (this.settings.transition === 'custom') && (this.nextAnimIndex = -1);
1907
1908        +this.settings.navigation && this.setArrows();
1909
1910
1911        this.settings.keyNav && this.setKeys();
1912
1913        for (var i = 0; i < this.totalSlides; i++) {
1914            this.$slides.eq(i).addClass('huge-it-slide-' + i);
1915        }
1916
1917        this.settings.autoPlay && this.setAutoPlay();
1918
1919        if (+this.settings.pauseOnHover) {
1920            this.$slider.hover(function () {
1921
1922                _this.$slider.addClass('slidePause');
1923                _this.setPause();
1924
1925            }, function () {
1926
1927                _this.$slider.removeClass('slidePause');
1928
1929                if(!jQuery('.huge-it-wrap').hasClass('isPlayed')){
1930                    _this.setAutoPlay();
1931                }
1932
1933            });
1934        }
1935
1936        jQuery('.playSlider').on('click', function () {
1937            _this.setAutoPlay();
1938            jQuery('.huge-it-wrap').removeClass('isPlayed');
1939        });
1940        jQuery('.pauseSlider').on('click', function () {
1941            _this.setPause();
1942            jQuery('.huge-it-wrap').addClass('isPlayed');
1943        });
1944
1945        this.$slideImages = this.$slides.find('img:eq(0)').addClass('huge-it-slide-image');
1946
1947        this.setup();
1948
1949        var $id = $(this)[0].$currentSlide.context.id;
1950
1951        jQuery(window).resize(function(){
1952            _this.cropImage();
1953
1954            if(_this.settings.controls === 'thumbnail'){
1955                jQuery('.huge-it-wrap').height(jQuery('#' + $id).height() + +hugeitSliderObj.thumb_height);
1956            } else {
1957                jQuery('.huge-it-wrap').height(jQuery('#' + $id).height());
1958            }
1959
1960        });
1961
1962        if(_this.settings.controls === 'thumbnail'){
1963            jQuery('.huge-it-wrap').height(jQuery('#' + $id).height() + +hugeitSliderObj.thumb_height);
1964        } else {
1965            jQuery('.huge-it-wrap').height(jQuery('#' + $id).height());
1966        }
1967    };
1968
1969    Slider.prototype.setup = function () {
1970        var sliderWidth, sliderHeight;
1971        sliderWidth = +this.settings.maxWidth;
1972        sliderHeight = (this.settings.controls === 'thumbnail') ?
1973        +this.settings.maxHeight + +hugeitSliderObj.thumb_height + 3 * +hugeitSliderObj.slideshow_border_size + 2 * this.settings.thumbMargin
1974            : +this.settings.maxHeight;
1975        this.$sliderWrap.css({
1976            maxWidth: sliderWidth + 'px',
1977            maxHeight: sliderHeight + 'px'
1978        });
1979
1980        switch (this.settings.controls) {
1981            case 'dot':
1982                this.setDots();
1983                break;
1984            case 'thumbnail':
1985                this.setThumbs();
1986                break;
1987            case 'none':
1988                break;
1989        }
1990
1991        jQuery('.slider-description div').each(function(){
1992            if(jQuery(this).text().length > 300){
1993                var text = jQuery(this).text();
1994                jQuery(this).attr('title', text);
1995                text = jQuery(this).text().substring(0, 300) + '...';
1996                jQuery(this).text(text);
1997            }
1998        });
1999
2000        this.cropImage();
2001
2002        this.$currentSlide.css({'opacity': 1, 'z-index': 2});
2003    };
2004
2005    Slider.prototype.cropImage = function(){
2006
2007        var w = this.settings.maxWidth,
2008            h = this.settings.maxHeight,
2009            wT, hT, r, d, mTop, mLeft;
2010
2011        if(jQuery(window).width() < +this.settings.maxWidth || jQuery(window).height() < +this.settings.maxHeight){
2012            w = jQuery(window).width();
2013            h = +this.settings.maxHeight / +this.settings.maxWidth * w;
2014        }
2015
2016        if(jQuery('.huge-it-slide-bg').width() < +this.settings.maxWidth || jQuery('.huge-it-slide-bg').height() < +this.settings.maxHeight){
2017            w = jQuery('.huge-it-slide-bg').width();
2018        }
2019
2020        switch (hugeitSliderObj.crop_image) {
2021            case 'stretch':
2022                this.$slideImages.css({
2023                    'width': '100%',
2024                    'height': h + 'px',
2025                    'visibility': 'visible',
2026                    'max-height': 'none'
2027                });
2028                break;
2029            case 'fill':
2030                this.$slideImages.each(function () {
2031                    wT = $(this)[0].naturalWidth;
2032                    hT = $(this)[0].naturalHeight;
2033                    if ((wT / hT) < (w / h)) {
2034                        r = w / wT;
2035                        d = (Math.abs(h - (hT * r))) * 0.5;
2036                        mTop = '-' + d + 'px';
2037                        $(this).css({
2038                            'height': hT * r,
2039                            'margin-left': 0,
2040                            'margin-right': 0,
2041                            'margin-top': mTop,
2042                            'visibility': 'visible',
2043                            'width': w,
2044                            'max-width': 'none',
2045                            'max-height': 'none'
2046                        });
2047                    } else {
2048                        r = h / hT;
2049                        d = (Math.abs(w - (wT * r))) * 0.5;
2050                        mLeft = '-' + d + 'px';
2051                        $(this).css({
2052                            'height': h,
2053                            'margin-left': mLeft,
2054                            'margin-right': mLeft,
2055                            'margin-top': 0,
2056                            'visibility': 'visible',
2057                            'width': wT * r,
2058                            'max-width': 'none',
2059                            'max-height': 'none'
2060                        });
2061                    }
2062                });
2063                break;
2064        }
2065    };
2066
2067    Slider.prototype.setArrows = function () {
2068        var _this = this;
2069
2070        this.$sliderWrap.append('<a href="#" class="huge-it-arrows huge-it-prev"></a><a href="#" class="huge-it-arrows huge-it-next"></a>');
2071
2072        if(hugeitSliderObj.navigation_type === '17' || hugeitSliderObj.navigation_type === '18' || hugeitSliderObj.navigation_type === '19' || hugeitSliderObj.navigation_type === '20' || hugeitSliderObj.navigation_type === '21'){
2073            var $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-333 335.5 31.5 31.5" >' +
2074                '<path d="M-311.8,340.5c-0.4-0.4-1.1-0.4-1.6,0c-0.4,0.4-0.4,1.1,0,1.6l8,8h-26.6c-0.6,0-1.1,0.5-1.1,1.1s0.5,1.1,1.1,1.1h26.6l-8,8c-0.4,0.4-0.4,1.2,0,1.6c0.4,0.4,1.2,0.4,1.6,0l10-10c0.4-0.4,0.4-1.1,0-1.6L-311.8,340.5z"/>' +
2075                '</svg>';
2076            var $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-333 335.5 31.5 31.5" >' +
2077                '<path d="M-322.7,340.5c0.4-0.4,1.1-0.4,1.6,0c0.4,0.4,0.4,1.1,0,1.6l-8,8h26.6c0.6,0,1.1,0.5,1.1,1.1c0,0.6-0.5,1.1-1.1,1.1h-26.6l8,8c0.4,0.4,0.4,1.2,0,1.6c-0.4,0.4-1.1,0.4-1.6,0l-10-10c-0.4-0.4-0.4-1.1,0-1.6L-322.7,340.5z"/>' +
2078                '</svg>';
2079            jQuery('.huge-it-prev').append($_prev);
2080            jQuery('.huge-it-next').append($_next);
2081
2082            if(hugeitSliderObj.navigation_type === '21'){
2083                jQuery('.huge-it-prev').append('<p class="prev_title"></p>');
2084                jQuery('.huge-it-next').append('<p class="next_title"></p>');
2085            }
2086
2087            var $nextIndex, $prevIndex, $nextImg, $prevImg, $nextTitle = '', $prevTitle = '';
2088
2089
2090            if(hugeitSliderObj.navigation_type !== '17'){
2091                jQuery('.huge-it-next').hover(function(){
2092                    if(_this.currentPlace + 1 == _this.totalSlides){
2093                        $nextIndex = 0;
2094                    } else {
2095                        $nextIndex = _this.currentPlace + 1;
2096                    }
2097
2098                    $nextImg = jQuery('li.group').eq($nextIndex).find('img').attr('src');
2099                    $nextTitle = jQuery('li.group').eq($nextIndex).find('img').attr('alt');
2100
2101                    jQuery(this).find('.next_title').text($nextTitle);
2102                    jQuery(this).css({
2103                        backgroundImage: 'url(' + $nextImg + ')',
2104                        backgroundPosition: 'left center',
2105                        backgroundSize: '100px 90px',
2106                        backgroundRepeat: 'no-repeat'
2107
2108                    });
2109                }, function(){
2110                    jQuery(this).find('.next_title').text('');
2111                    jQuery(this).css({
2112                        backgroundImage: ''
2113                    });
2114                });
2115                jQuery('.huge-it-prev').hover(function(){
2116                    if(_this.currentPlace - 1 < 0){
2117                        $prevIndex = _this.totalSlides - 1;
2118                    } else {
2119                        $prevIndex = _this.currentPlace - 1;
2120                    }
2121
2122                    $prevImg = jQuery('li.group').eq($prevIndex).find('img').attr('src');
2123                    $prevTitle = jQuery('li.group').eq($prevIndex).find('img').attr('alt');
2124
2125                    jQuery(this).find('.prev_title').text($prevTitle);
2126                    jQuery(this).css({
2127                        backgroundImage: 'url(' + $prevImg + ')',
2128                        backgroundPosition: 'right center',
2129                        backgroundSize: '100px 90px',
2130                        backgroundRepeat: 'no-repeat'
2131                    });
2132                }, function(){
2133                    jQuery(this).find('.prev_title').text('');
2134                    jQuery(this).css({
2135                        backgroundImage: ''
2136                    });
2137                });
2138            } else {
2139                jQuery('.huge-it-next').hover(function(){
2140                    if(_this.currentPlace + 1 == _this.totalSlides){
2141                        $nextIndex = 0;
2142                    } else {
2143                        $nextIndex = _this.currentPlace + 1;
2144                    }
2145                    $nextImg = jQuery('li.group').eq($nextIndex).find('img').attr('src');
2146                    jQuery(this).css({
2147                        backgroundImage: 'url(' + $nextImg + ')',
2148                        backgroundPosition: 'center center'
2149
2150                    });
2151                }, function(){
2152                    jQuery(this).css({
2153                        backgroundImage: ''
2154                    });
2155                });
2156                jQuery('.huge-it-prev').hover(function(){
2157                    if(_this.currentPlace - 1 < 0){
2158                        $prevIndex = _this.totalSlides - 1;
2159                    } else {
2160                        $prevIndex = _this.currentPlace - 1;
2161                    }
2162
2163                    $prevImg = jQuery('li.group').eq($prevIndex).find('img').attr('src');
2164                    jQuery(this).css({
2165                        backgroundImage: 'url(' + $prevImg + ')',
2166                        backgroundPosition: 'center center'
2167                    });
2168                }, function(){
2169                    jQuery(this).css({
2170                        backgroundImage: ''
2171                    });
2172                });
2173            }
2174        }
2175
2176        $('.huge-it-next', this.$sliderWrap).on('click', function (e) {
2177            e.preventDefault();
2178            _this.next();
2179        });
2180
2181        $('.huge-it-prev', this.$sliderWrap).on('click', function (e) {
2182            e.preventDefault();
2183            _this.prev();
2184        });
2185
2186        if(this.settings.controls === 'thumbnail'){
2187            this.$sliderWrap.append('<a href="#" class="thumb_arr thumb_prev"></a><a href="#" class="thumb_arr thumb_next"></a>');
2188        }
2189
2190        $('.thumb_next').on('click', function (e) {
2191            e.preventDefault();
2192            var width = (Math.min(jQuery('.huge-it-slide-bg').width(), +_this.settings.maxWidth) - (2 * +hugeitSliderObj.thumb_count_slides * _this.settings.thumbMargin)) / +hugeitSliderObj.thumb_count_slides + 1,
2193                position = parseFloat($('.huge-it-thumb-wrap').css('marginLeft')) || 0;
2194
2195            position = +position.toFixed(4) - +width.toFixed(4);
2196
2197            if (position >= (_this.totalSlides - hugeitSliderObj.thumb_count_slides) * (-width)) {
2198                $('.huge-it-thumb-wrap').css({
2199                    'marginLeft': position + 'px'
2200                });
2201            }
2202
2203            if (_this.currentPlace == 0) {
2204                $('.huge-it-thumb-wrap').css({
2205                    'marginLeft': '0'
2206                });
2207            }
2208        });
2209
2210        $('.thumb_prev').on('click', function (e) {
2211            e.preventDefault();
2212            var width = (Math.min(jQuery('.huge-it-slide-bg').width(), +_this.settings.maxWidth) - (2 * +hugeitSliderObj.thumb_count_slides * _this.settings.thumbMargin)) / +hugeitSliderObj.thumb_count_slides + 1,
2213                position = parseFloat($('.huge-it-thumb-wrap').css('marginLeft')) || 0;
2214
2215            position = +position.toFixed(4) + +width.toFixed(4);
2216
2217            if (position <= 0) {
2218                $('.huge-it-thumb-wrap').css({
2219                    'marginLeft': position + 'px'
2220                });
2221            }
2222
2223            if (this.currentPlace == _this.totalSlides - 1) {
2224                position = (_this.totalSlides - hugeitSliderObj.thumb_count_slides) * (-width);
2225                $('.huge-it-thumb-wrap').css({
2226                    'marginLeft': position + 'px'
2227                });
2228            }
2229        });
2230    };
2231
2232    Slider.prototype.next = function () {
2233        if (this.settings.transition === 'custom') {
2234            this.nextAnimIndex++;
2235        }
2236
2237        if (this.currentPlace === this.totalSlides - 1) {
2238            this.transition(0, true);
2239        } else {
2240            this.transition(this.currentPlace + 1, true);
2241        }
2242
2243        if(jQuery('li.group').eq(this.currentPlace).hasClass('video_iframe') && jQuery('.huge-it-slider').attr('data-autoplay') == 1){
2244            jQuery('li.group').eq(this.currentPlace).find('.playButton').click();
2245        }
2246
2247        var width = (Math.min(jQuery('.huge-it-slide-bg').width(), +this.settings.maxWidth) - (2 * +hugeitSliderObj.thumb_count_slides * this.settings.thumbMargin)) / +hugeitSliderObj.thumb_count_slides + 1;
2248
2249        $('.huge-it-thumb-wrap').css({
2250            'marginLeft': -this.currentPlace * width + 'px'
2251        });
2252
2253        if(this.totalSlides - +hugeitSliderObj.thumb_count_slides <= this.currentPlace){
2254            $('.huge-it-thumb-wrap').css({
2255                'marginLeft': -(this.totalSlides - +hugeitSliderObj.thumb_count_slides) * width + 'px'
2256            });
2257        }
2258
2259        if (this.currentPlace == 0) {
2260            $('.huge-it-thumb-wrap').css({
2261                'marginLeft': '0'
2262            });
2263        }
2264    };
2265
2266    Slider.prototype.prev = function () {
2267        if (this.settings.transition === 'custom') {
2268            this.nextAnimIndex--;
2269        }
2270
2271        if (this.currentPlace == 0) {
2272            this.transition(this.totalSlides - 1, false);
2273        } else {
2274            this.transition(this.currentPlace - 1, false);
2275        }
2276
2277        if(jQuery('li.group').eq(this.currentPlace).hasClass('video_iframe') && jQuery('.huge-it-slider').attr('data-autoplay') == 1){
2278            jQuery('li.group').eq(this.currentPlace).find('.playButton').click();
2279        }
2280
2281        var width = (Math.min(jQuery('.huge-it-slide-bg').width(), +this.settings.maxWidth) - (2 * +hugeitSliderObj.thumb_count_slides * this.settings.thumbMargin)) / +hugeitSliderObj.thumb_count_slides + 1;
2282
2283        $('.huge-it-thumb-wrap').css({
2284            'marginLeft': -this.currentPlace * width + 'px'
2285        });
2286
2287        if(this.totalSlides - +hugeitSliderObj.thumb_count_slides <= this.currentPlace){
2288            $('.huge-it-thumb-wrap').css({
2289                'marginLeft': -(this.totalSlides - +hugeitSliderObj.thumb_count_slides) * width + 'px'
2290            });
2291        }
2292    };
2293
2294    Slider.prototype.setKeys = function () {
2295        var _this = this;
2296
2297        $(document).on('keydown', function (e) {
2298            if (e.keyCode === 39) {
2299                _this.next();
2300            } else if (e.keyCode === 37) {
2301                _this.prev();
2302            }
2303        });
2304    };
2305
2306    Slider.prototype.setAutoPlay = function () {
2307        var _this = this;
2308
2309        if(!this.$slider.hasClass('slidePause')){
2310            this.cycling = setTimeout(function () {
2311                _this.next();
2312            }, this.settings.delay);
2313        }
2314    };
2315
2316    Slider.prototype.setPause = function () {
2317        clearTimeout(this.cycling);
2318    };
2319
2320    Slider.prototype.setDots = function () {
2321        var _this = this;
2322
2323        this.$dotWrap = $('<div class="huge-it-dot-wrap" />').appendTo(this.$sliderWrap);
2324
2325        for (var i = 0; i < this.totalSlides; i++) {
2326            var $thumb = $('<a />')
2327                .attr('href', '#')
2328                .data('huge-it-num', i);
2329
2330            $thumb.appendTo(this.$dotWrap);
2331        }
2332
2333        this.$dotWrapLinks = this.$dotWrap.find('a');
2334
2335        this.$dotWrapLinks.eq(this.settings.startSlide).addClass('active');
2336
2337        this.$dotWrap.on('click', 'a', function (e) {
2338            e.preventDefault();
2339
2340            _this.transition(parseInt($(this).data('huge-it-num')));
2341        });
2342    };
2343
2344    Slider.prototype.setThumbs = function () {
2345        var _this = this,
2346            width = (Math.min(jQuery('.huge-it-slide-bg').width(), +this.settings.maxWidth) - (2 * +hugeitSliderObj.thumb_count_slides * this.settings.thumbMargin)) / +hugeitSliderObj.thumb_count_slides;
2347
2348        this.$thumbWrap = $('<div class="huge-it-thumb-wrap" />').appendTo(this.$sliderWrap);
2349
2350        this.$slider.parents('.huge-it-wrap').find('.huge-it-thumb-wrap').css({
2351            width: this.totalSlides * (width + 2) + 'px',
2352            position: 'absolute'
2353        });
2354
2355        var k = +this.settings.maxHeight / +this.settings.maxWidth * jQuery(window).width() + +hugeitSliderObj.thumb_height + 1;
2356
2357        $('.huge-it
2357-wrap').height(k);
2358
2359        for (var i = 0; i < this.totalSlides; i++) {
2360            var $thumb = $('<a />')
2361                .css({
2362                    width: width + 'px',
2363                    margin: this.settings.thumbMargin + 'px'
2364                })
2365                .attr('href', '#')
2366                .data('huge-it-num', i);
2367
2368            this.$slideImages.eq(i).clone()
2369                .removeAttr('style')
2370                .appendTo(this.$thumbWrap)
2371                .wrap($thumb);
2372        }
2373
2374        this.$thumbWrapLinks = this.$thumbWrap.find('a');
2375
2376        this.$thumbWrap.children().last().css('margin-right', -10);
2377
2378        this.$thumbWrapLinks.eq(this.settings.startSlide).addClass('active');
2379
2380        this.$thumbWrap.on('click', 'a', function (e) {
2381            e.preventDefault();
2382
2383            _this.transition(parseInt($(this).data('huge-it-num')));
2384        });
2385    };
2386
2387    Slider.prototype.captions = function () {
2388        var _this = this,
2389            $captions = this.$slides.find('.huge-it-caption');
2390
2391        $captions.css({
2392            opacity: 0
2393        });
2394
2395        this.$currentSlide.find('.huge-it-caption').css('opacity', 1);
2396
2397        $captions.each(function () {
2398            $(this).css({
2399                transition: 'opacity ' + _this.settings.transitionDuration + 'ms linear',
2400                backfaceVisibility: 'hidden'
2401            });
2402        });
2403    };
2404
2405    Slider.prototype.transition = function (slideNum, forward) {
2406        if (!this.inProgress) {
2407            if (slideNum !== this.currentPlace) {
2408                if (typeof forward === 'undefined') {
2409                    forward = (slideNum > this.currentPlace);
2410                }
2411
2412                switch (this.settings.controls) {
2413                    case 'dot':
2414                        this.$dotWrapLinks.eq(this.currentPlace).removeClass('active');
2415                        this.$dotWrapLinks.eq(slideNum).addClass('active');
2416                        break;
2417                    case 'thumbnail':
2418                        this.$thumbWrapLinks.eq(this.currentPlace).removeClass('active');
2419                        this.$thumbWrapLinks.eq(slideNum).addClass('active');
2420                        break;
2421                    case 'none':
2422                        break;
2423                }
2424
2425                this.$nextSlide = this.$slides.eq(slideNum);
2426
2427                this.currentPlace = slideNum;
2428
2429                if (jQuery('li.group').eq(this.currentPlace - 1).hasClass('video_iframe') || jQuery('li.group').eq(this.currentPlace).hasClass('video_iframe')) {
2430                    var streffect = this.settings.transition;
2431                    if (streffect == "cube_v" || streffect == "cube_h" || streffect == "none" || streffect == "fade") {
2432                        new Transition(this, this.settings.transition, forward);
2433                    } else {
2434                        new Transition(this, 'fade', forward);
2435                    }
2436                } else {
2437                    new Transition(this, this.settings.transition, forward);
2438                }
2439
2440            }
2441        }
2442    };
2443
2444    function Transition(Slider, transition, forward) {
2445        this.Slider = Slider;
2446        this.Slider.inProgress = true;
2447        this.forward = forward;
2448        this.transition = transition;
2449
2450        if (this.transition === 'custom') {
2451            this.customAnims = this.Slider.settings.customTransitions;
2452        }
2453
2454        if (this.transition === 'custom') {
2455            var _this = this;
2456            $.each(this.customAnims, function (i, obj) {
2457                if ($.inArray(obj, _this.anims) === -1) {
2458                    _this.customAnims.splice(i, 1);
2459                }
2460            });
2461        }
2462
2463        this.fallback3d = this.Slider.settings.fallback3d;
2464
2465        this.init();
2466    }
2467
2468    Transition.prototype.fallback = 'fade';
2469
2470    Transition.prototype.anims = ['cube_h', 'cube_v', 'fade', 'slice_h', 'slice_v', 'slide_h', 'slide_v', 'scale_out', 'scale_in', 'block_scale', 'kaleidoscope', 'fan', 'blind_h', 'blind_v'];
2471
2472    Transition.prototype.customAnims = [];
2473
2474    Transition.prototype.init = function () {
2475        this[this.transition]();
2476    };
2477
2478    Transition.prototype.before = function (callback) {
2479        var _this = this;
2480
2481        this.Slider.$currentSlide.css('z-index', 2);
2482        this.Slider.$nextSlide.css({'opacity': 1, 'z-index': 1});
2483
2484        if (this.Slider.cssTransitions) {
2485            this.Slider.$currentSlide.find('.huge-it-caption').css('opacity', 0);
2486            this.Slider.$nextSlide.find('.huge-it-caption').css('opacity', 1);
2487        } else {
2488            this.Slider.$currentSlide.find('.huge-it-caption').animate({'opacity': 0}, _this.Slider.settings.transitionDuration);
2489            this.Slider.$nextSlide.find('.huge-it-caption').animate({'opacity': 1}, _this.Slider.settings.transitionDuration);
2490        }
2491
2492        if (typeof this.setup === 'function') {
2493            var transition = this.setup();
2494
2495            setTimeout(function () {
2496                callback(transition);
2497            }, 20);
2498        } else {
2499            this.execute();
2500        }
2501
2502        if (this.Slider.cssTransitions) {
2503            $(this.listenTo).one('webkitTransitionEnd transitionend otransitionend oTransitionEnd mstransitionend', $.proxy(this.after, this));
2504        }
2505    };
2506
2507    Transition.prototype.after = function () {
2508        this.Slider.$sliderBG.removeAttr('style');
2509        this.Slider.$slider.removeAttr('style');
2510        this.Slider.$currentSlide.removeAttr('style');
2511        this.Slider.$nextSlide.removeAttr('style');
2512
2513        this.Slider.$currentSlide.css({
2514            zIndex: 1,
2515            opacity: 0
2516        });
2517        this.Slider.$nextSlide.css({
2518            zIndex: 2,
2519            opacity: 1
2520        });
2521
2522        if (typeof this.reset === 'function') {
2523            this.reset();
2524        }
2525
2526        if (this.Slider.settings.autoPlay && !jQuery('.huge-it-wrap').hasClass('isPlayed')) {
2527            clearTimeout(this.Slider.cycling);
2528            this.Slider.setAutoPlay();
2529        }
2530
2531        this.Slider.$currentSlide = this.Slider.$nextSlide;
2532
2533        this.Slider.inProgress = false;
2534
2535    };
2536
2537    Transition.prototype.fade = function () {
2538        var _this = this;
2539
2540        if (this.Slider.cssTransitions) {
2541            this.setup = function () {
2542                _this.listenTo = _this.Slider.$currentSlide;
2543
2544                _this.Slider.$currentSlide.css('transition', 'opacity ' + _this.Slider.settings.transitionDuration + 'ms linear');
2545            };
2546
2547            this.execute = function () {
2548                _this.Slider.$currentSlide.css('opacity', 0);
2549            }
2550        } else {
2551            this.execute = function () {
2552                _this.Slider.$currentSlide.animate({'opacity': 0}, _this.Slider.settings.transitionDuration, function () {
2553                    _this.after();
2554                });
2555            }
2556        }
2557
2558        this.before($.proxy(this.execute, this));
2559    };
2560
2561    Transition.prototype.cube = function (tz, ntx, nty, nrx, nry, wrx, wry) {
2562        if (!this.Slider.cssTransitions || !this.Slider.cssTransforms3d) {
2563            return this[this['fallback3d']]();
2564        }
2565
2566        var _this = this;
2567
2568        this.setup = function () {
2569            _this.listenTo = _this.Slider.$slider;
2570
2571            this.Slider.$sliderBG.css('perspective', 1000);
2572
2573            _this.Slider.$currentSlide.css({
2574                transform: 'translateZ(' + tz + 'px)',
2575                backfaceVisibility: 'hidden'
2576            });
2577
2578            _this.Slider.$nextSlide.css({
2579                opacity: 1,
2580                backfaceVisibility: 'hidden',
2581                transform: 'translateY(' + nty + 'px) translateX(' + ntx + 'px) rotateY(' + nry + 'deg) rotateX(' + nrx + 'deg)'
2582            });
2583
2584            _this.Slider.$slider.css({
2585                transform: 'translateZ(-' + tz + 'px)',
2586                transformStyle: 'preserve-3d'
2587            });
2588        };
2589
2590        this.execute = function () {
2591            _this.Slider.$slider.css({
2592                transition: 'all ' + _this.Slider.settings.transitionDuration + 'ms ease-in-out',
2593                transform: 'translateZ(-' + tz + 'px) rotateX(' + wrx + 'deg) rotateY(' + wry + 'deg)'
2594            });
2595        };
2596
2597        this.before($.proxy(this.execute, this));
2598    };
2599
2600    Transition.prototype.none = function () {
2601
2602        this.Slider.settings.transitionDuration = 1;
2603
2604        if (this.forward) {
2605            this.cube(1, 1, 0, 0, 0, 0, 0);
2606        } else {
2607            this.cube(1, -1, 0, 0, 0, 0, 0);
2608        }
2609    };
2610
2611    Transition.prototype.cube_h = function () {
2612        var dimension = $(this.Slider.$slides).width() / 2;
2613
2614        if (this.forward) {
2615            this.cube(dimension, dimension, 0, 0, 90, 0, -90);
2616        } else {
2617            this.cube(dimension, -dimension, 0, 0, -90, 0, 90);
2618        }
2619    };
2620
2621    Transition.prototype.cube_v = function () {
2622        var dimension = $(this.Slider.$slides).height() / 2;
2623
2624        if (this.forward) {
2625            this.cube(dimension, 0, -dimension, 90, 0, -90, 0);
2626        } else {
2627            this.cube(dimension, 0, dimension, -90, 0, 90, 0);
2628        }
2629    };
2630
2631    Transition.prototype.grid = function (cols, rows, ro, tx, ty, sc, op) {
2632        if (!this.Slider.cssTransitions) {
2633            return this[this['fallback']]();
2634        }
2635
2636        var _this = this;
2637
2638        this.setup = function () {
2639            var count = (_this.Slider.settings.transitionDuration) / (cols + rows);
2640
2641            function gridlet(width, height, t, l, top, left, src, imgWidth, imgHeight, c, r) {
2642                var delay = (c + r) * count;
2643
2644                return $('<div class="huge-it-gridlet" />').css({
2645                    width: width,
2646                    height: height,
2647                    top: t,
2648                    left: l,
2649                    backgroundImage: 'url(' + src + ')',
2650                    backgroundPosition: '-' + left + 'px -' + top + 'px',
2651                    backgroundSize: imgWidth + 'px ' + imgHeight + 'px',
2652                    transition: 'all ' + _this.Slider.settings.transitionDuration + 'ms ease-in-out ' + delay + 'ms',
2653                    transform: 'none'
2654                });
2655            }
2656
2657            _this.$img = _this.Slider.$currentSlide.find('img.huge-it-slide-image');
2658
2659            _this.$grid = $('<div />').addClass('huge-it-grid');
2660
2661            _this.Slider.$currentSlide.prepend(_this.$grid);
2662
2663            var imgWidth = _this.$img.width(),
2664                imgHeight = _this.$img.height(),
2665                imgSrc = _this.$img.attr('src'),
2666                colWidth = Math.floor(imgWidth / cols),
2667                rowHeight = Math.floor(imgHeight / rows),
2668                colRemainder = imgWidth - (cols * colWidth),
2669                colAdd = Math.ceil(colRemainder / cols),
2670                rowRemainder = imgHeight - (rows * rowHeight),
2671                rowAdd = Math.ceil(rowRemainder / rows),
2672                leftDist = 0,
2673                l = (_this.$grid.width() - _this.$img.width()) / 2;
2674
2675            tx = tx === 'auto' ? imgWidth : tx;
2676            tx = tx === 'min-auto' ? -imgWidth : tx;
2677            ty = ty === 'auto' ? imgHeight : ty;
2678            ty = ty === 'min-auto' ? -imgHeight : ty;
2679
2680            for (var i = 0; i < cols; i++) {
2681                var t = (_this.$grid.height() - _this.$img.height()) / 2,
2682                    topDist = 0,
2683                    newColWidth = colWidth;
2684
2685                if (colRemainder > 0) {
2686                    var add = colRemainder >= colAdd ? colAdd : colRemainder;
2687                    newColWidth += add;
2688                    colRemainder -= add;
2689                }
2690
2691                for (var j = 0; j < rows; j++) {
2692                    var newRowHeight = rowHeight,
2693                        newRowRemainder = rowRemainder;
2694
2695                    if (newRowRemainder > 0) {
2696                        add = newRowRemainder >= rowAdd ? rowAdd : rowRemainder;
2697                        newRowHeight += add;
2698                        newRowRemainder -= add;
2699                    }
2700
2701                    _this.$grid.append(gridlet(newColWidth, newRowHeight, t, l, topDist, leftDist, imgSrc, imgWidth, imgHeight, i, j));
2702
2703                    topDist += newRowHeight;
2704                    t += newRowHeight;
2705                }
2706
2707                leftDist += newColWidth;
2708                l += newColWidth;
2709            }
2710
2711            _this.listenTo = _this.$grid.children().last();
2712
2713            _this.$grid.show();
2714            _this.$img.css('opacity', 0);
2715
2716            _this.$grid.children().first().addClass('huge-it-top-left');
2717            _this.$grid.children().last().addClass('huge-it-bottom-right');
2718            _this.$grid.children().eq(rows - 1).addClass('huge-it-bottom-left');
2719            _this.$grid.children().eq(-rows).addClass('huge-it-top-right');
2720        };
2721
2722        this.execute = function () {
2723            _this.$grid.children().css({
2724                opacity: op,
2725                transform: 'rotate(' + ro + 'deg) translateX(' + tx + 'px) translateY(' + ty + 'px) scale(' + sc + ')'
2726            });
2727        };
2728
2729        this.before($.proxy(this.execute, this));
2730
2731        this.reset = function () {
2732            _this.$img.css('opacity', 1);
2733            _this.$grid.remove();
2734        }
2735    };
2736
2737    Transition.prototype.slice_h = function () {
2738        this.grid(1, 8, 0, 'min-auto', 0, 1, 0);
2739    };
2740
2741    Transition.prototype.slice_v = function () {
2742        this.grid(10, 1, 0, 0, 'auto', 1, 0);
2743    };
2744
2745    Transition.prototype.slide_v = function () {
2746        var dir = this.forward ?
2747            'min-auto' :
2748            'auto';
2749
2750        this.grid(1, 1, 0, 0, dir, 1, 1);
2751    };
2752
2753    Transition.prototype.slide_h = function () {
2754        var dir = this.forward ?
2755            'min-auto' :
2756            'auto';
2757
2758        this.grid(1, 1, 0, dir, 0, 1, 1);
2759    };
2760
2761    Transition.prototype.scale_out = function () {
2762        this.grid(1, 1, 0, 0, 0, 1.5, 0);
2763    };
2764
2765    Transition.prototype.scale_in = function () {
2766        this.grid(1, 1, 0, 0, 0, .5, 0);
2767    };
2768
2769    Transition.prototype.block_scale = function () {
2770        this.grid(8, 6, 0, 0, 0, .6, 0);
2771    };
2772
2773    Transition.prototype.kaleidoscope = function () {
2774        this.grid(10, 8, 0, 0, 0, 1, 0);
2775    };
2776
2777    Transition.prototype.fan = function () {
2778        this.grid(1, 10, 45, 100, 0, 1, 0);
2779    };
2780
2781    Transition.prototype.blind_v = function () {
2782        this.grid(1, 8, 0, 0, 0, .7, 0);
2783    };
2784
2785    Transition.prototype.blind_h = function () {
2786        this.grid(10, 1, 0, 0, 0, .7, 0);
2787    };
2788
2789    Transition.prototype.random = function () {
2790        this[this.anims[Math.floor(Math.random() * this.anims.length)]]();
2791    };
2792
2793    Transition.prototype.custom = function () {
2794        if (this.Slider.nextAnimIndex < 0) {
2795            this.Slider.nextAnimIndex = this.customAnims.length - 1;
2796        }
2797        if (this.Slider.nextAnimIndex === this.customAnims.length) {
2798            this.Slider.nextAnimIndex = 0;
2799        }
2800
2801        this[this.customAnims[this.Slider.nextAnimIndex]]();
2802    };
2803
2804    var testBrowser = {
2805        browserVendors: ['', '-webkit-', '-moz-', '-ms-', '-o-', '-khtml-'],
2806
2807        domPrefixes: ['', 'Webkit', 'Moz', 'ms', 'O', 'Khtml'],
2808
2809        testDom: function (prop) {
2810            var i = this.domPrefixes.length;
2811
2812            while (i--) {
2813                if (typeof document.body.style[this.domPrefixes[i] + prop] !== 'undefined') {
2814                    return true;
2815                }
2816            }
2817
2818            return false;
2819        },
2820
2821        cssTransitions: function () {
2822            if (typeof window.Modernizr !== 'undefined' && Modernizr.csstransitions !== 'undefined') {
2823                return Modernizr.csstransitions;
2824            }
2825
2826            return this.testDom('Transition');
2827        },
2828
2829        cssTransforms3d: function () {
2830            if (typeof window.Modernizr !== 'undefined' && Modernizr.csstransforms3d !== 'undefined') {
2831                return Modernizr.csstransforms3d;
2832            }
2833
2834            if (typeof document.body.style['perspectiveProperty'] !== 'undefined') {
2835                return true;
2836            }
2837
2838            return this.testDom('Perspective');
2839        }
2840    };
2841
2842    $.fn['sliderPlugin'] = function (settings) {
2843        return this.each(function () {
2844            if (!$.data(this, 'sliderPlugin')) {
2845                $.data(this, 'sliderPlugin', new Slider(this, settings));
2846            }
2847        });
2848    }
2849
2850})(window.jQuery, window, window.document);
2851
2852jQuery(window).load(function () {
2853    jQuery('div[class*=slider-loader-]').css({
2854        display: 'none'
2855    });
2856    jQuery('.huge-it-wrap, .rwd-SlideOuter, .huge-it-slider').css({
2857        opacity: '1'
2858    });
2859});
2860}

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.