PageSourceSearch

https://sc7bog.ru/wp-content/plugins/lightbox/js/frontend/lightbox.js?ver=1.0

js sc7bog.ru collected 2026-10-08 14:31:04 UTC 166,422 bytes, 3,237 lines download raw bytes

1(function ($) {
2
3    'use strict';
4
5    jQuery.each(hugeit_gen_resp_lightbox_obj, function (index, value) {
6        if (value.indexOf('true') > -1 || value.indexOf('false') > -1)
7            hugeit_gen_resp_lightbox_obj[index] = value == "true";
8    });
9
10    function Lightbox(element, options) {
11
12        this.el = element;
13        this.$element = $(element);
14        this.$body = $('body');
15        this.objects = {};
16        this.lightboxModul = {};
17        this.$item = '';
18        this.$cont = '';
19        this.$items = this.$body.find('a.responsive_lightbox');
20
21        this.settings = $.extend({}, this.constructor.defaults, options);
22
23        this.init();
24
25        return this;
26    }
27
28    Lightbox.defaults = {
29        idPrefix: 'rwd-',
30        classPrefix: 'rwd-',
31        attrPrefix: 'data-',
32        slideAnimationType: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_slideAnimationType, /*  effect_1   effect_2    effect_3
33         effect_4   effect_5    effect_6
34         effect_7   effect_8    effect_9   */
35        lightboxView: hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView,              //  view1, view2, view3, view4, view5, view6, view7
36        speed: hugeit_resp_lightbox_obj.hugeit_lightbox_speed_new,
37        width: hugeit_resp_lightbox_obj.hugeit_lightbox_width_new + '%',
38        height: hugeit_resp_lightbox_obj.hugeit_lightbox_height_new + '%',
39        videoMaxWidth: '700',
40        sizeFix: true, //not for option
41        overlayDuration: +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_overlayDuration,
42        slideAnimation: true, //not for option
43        overlayClose: hugeit_resp_lightbox_obj.hugeit_lightbox_overlayClose_new,
44        loop: hugeit_resp_lightbox_obj.hugeit_lightbox_loop_new,
45        escKey: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_escKey_new,
46        keyPress: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_keyPress_new,
47        arrows: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_arrows,
48        mouseWheel: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_mouseWheel,
49        download: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_download,
50        showTitle: hugeit_resp_lightbox_obj.hugeit_lightbox_showTitle === 'true',
51        showDesc: hugeit_resp_lightbox_obj.hugeit_lightbox_showDesc === 'true',
52        showBorder: hugeit_resp_lightbox_obj.hugeit_lightbox_showBorder === 'true',
53        showCounter: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_showCounter,
54        defaultTitle: '',  //some text
55        preload: 10,  //not for option
56        showAfterLoad: true,  //not for option
57        nextHtml: '',  //not for option
58        prevHtml: '',  //not for option
59        sequence_info: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_sequence_info,
60        sequenceInfo: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_sequenceInfo,
61        slideshow: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_slideshow_new,
62        slideshowAuto: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_slideshow_auto_new,
63        slideshowSpeed: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_slideshow_speed_new,
64        slideshowStart: '',  //not for option
65        slideshowStop: '',   //not for option
66        hideControlOnEnd: false,  //not for option
67        watermark: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark,
68        socialSharing: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_socialSharing,
69        titlePos: hugeit_resp_lightbox_obj.hugeit_lightbox_title_pos,
70        fullwidth: hugeit_resp_lightbox_obj.hugeit_lightbox_fullwidth_effect === 'true',
71        zoomLogo: hugeit_resp_lightbox_obj.hugeit_lightbox_zoomlogo,
72        wURL: hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_link,
73        watermarkURL: hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_url,
74        wURLnewTab: hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_url_new_tab,
75        openCloseType: hugeit_resp_lightbox_obj.lightbox_open_close_effect,
76        thumbnail: hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs === 'true',
77        share: {
78            facebookButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_facebookButton,
79            twitterButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_twitterButton,
80            googleplusButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_googleplusButton,
81            pinterestButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_pinterestButton,
82            linkedinButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_linkedinButton,
83            tumblrButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_tumblrButton,
84            redditButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_redditButton,
85            bufferButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_bufferButton,
86            diggButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_diggButton,
87            vkButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_vkButton,
88            yummlyButton: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_yummlyButton
89        }
90    };
91
92    Lightbox.prototype.init = function () {
93
94        var $object = this,
95            $hash,
96            $openCloseType;
97
98        switch(this.settings.openCloseType){
99            case '0':
100                $openCloseType = {
101                    0: 'open_0',
102                    1: 'close_0'
103                };
104                break;
105            case '1':
106                $openCloseType = {
107                    0: 'open_1',
108                    1: 'close_1'
109                };
110                break;
111            case '2':
112                $openCloseType = {
113                    0: 'open_1_r',
114                    1: 'close_1_r'
115                };
116                break;
117            case '3':
118                $openCloseType = {
119                    0: 'open_2',
120                    1: 'close_2'
121                };
122                break;
123            case '4':
124                $openCloseType = {
125                    0: 'open_2_r',
126                    1: 'close_2_r'
127                };
128                break;
129            case '5':
130                $openCloseType = {
131                    0: 'open_3',
132                    1: 'close_3'
133                };
134                break;
135            case '6':
136                $openCloseType = {
137                    0: 'open_3_r',
138                    1: 'close_3_r'
139                };
140                break;
141            case '7':
142                $openCloseType = {
143                    0: 'open_4',
144                    1: 'close_4'
145                };
146                break;
147            case '8':
148                $openCloseType = {
149                    0: 'open_4_r',
150                    1: 'close_4_r'
151                };
152                break;
153            case '9':
154                $openCloseType = {
155                    0: 'open_5',
156                    1: 'close_5'
157                };
158                break;
159            case '10':
160                $openCloseType = {
161                    0: 'open_5_r',
162                    1: 'close_5_r'
163                };
164                break;
165        }
166
167        if(this.settings.lightboxView !== 'view7'){
168            this.settings.openCloseType = $openCloseType;
169        } else {
170            this.settings.openCloseType = {0: 'open_1', 1: 'close_1'};
171            this.settings.slideAnimationType = 'effect_2';
172        }
173
174        $hash = window.location.hash;
175
176        ($object.settings.watermark && $('.watermark').watermark());
177
178        if ($hash.indexOf('lightbox&') > 0) {
179            $object.index = parseInt($hash.split('&slide=')[1], 10) - 1;
180
181            $object.$body.addClass('rwd-share');
182            if (!$object.$body.hasClass('rwd-on')) {
183                setTimeout(function () {
184                    $object.build($object.index);
185                }, 900);
186                $object.$body.addClass('rwd-on');
187            }
188        }
189
190        if (($object.settings.preload <= $object.$items.length) && ($object.settings.preload = $object.$items.length)){
191            $object.settings.preload = $object.$items.length;
192        }
193
194        $object.$items.on('click.rwdcustom', function (event) {
195
196            event = event || window.event;
197            event.preventDefault ? event.preventDefault() : (event.returnValue = false);
198
199            $object.index = $object.$items.index(this);
200
201            if (!$object.$body.hasClass($object.settings.classPrefix + 'on')) {
202                $object.build($object.index);
203                $object.$body.addClass($object.settings.classPrefix + 'on');
204            }
205
206        });
207
208        $object.$body.on('click', function () {
209            $object.$_y_ = window.pageYOffset;
210        });
211
212        switch (this.settings.zoomLogo) {
213            case '1':
214                $object.$body.addClass('rwd-zoomGlass');
215                break;
216            case '2':
217                $object.$body.addClass('rwd-zoomHand');
218                break;
219        }
220
221    };
222
223    Lightbox.prototype.build = function (index) {
224
225        var $object = this;
226
227        $object.structure(index);
228
229        $object.lightboxModul['modul'] = new $.fn.lightbox.lightboxModul['modul']($object.el);
230
231        $object.slide(index, false, false);
232
233        ($object.settings.keyPress && $object.addKeyEvents());
234
235        if ($object.$items.length > 1) {
236
237            $object.arrow();
238
239            ($object.settings.mouseWheel && $object.mousewheel());
240
241            ($object.settings.slideshow && $object.slideShow());
242
243        }
244
245        $object.counter();
246
247        $object.closeGallery();
248
249        $object.$cont.on('click.rwd-container', function () {
250
251            $object.$cont.removeClass($object.settings.classPrefix + 'hide-items');
252
253        });
254
255        $('.shareLook').on('click.rwd-container', function () {
256            $(this).css({'display': 'none'});
257            $('.rwd-share-buttons').css({'display': 'block'});
258            setTimeout(function(){
259                $('.shareLook').css({'display' : 'block'});
260                $('.rwd-share-buttons').css({'display' : 'none'});
261            }, 9000);
262        });
263
264        if(!this.settings.thumbnail){
265            $object.calculateDimensions(index);
266        } else {
267            setTimeout(function(){
268                $object.calculateDimensions(index);
269            }, 800);
270        }
271
272        if(this.settings.lightboxView === 'view7'){
273            setTimeout(function(){
274                $('.view7_share, .rwd-close-bar, .rwd-toolbar').css({
275                    visibility: 'visible',
276                    opacity: '1'
277                });
278
279                $object.calculateDimensions(index);
280            }, 1100);
281            
282            jQuery('.rwd-close').hover(function(){
283                $('.rwd-cont').addClass('close_hover_on');
284            }, function(){
285                $('.rwd-cont').removeClass('close_hover_on');
286            });
287
288            var $w, $l;
289
290            if($('.rwd-container').width() > 768){
291                $('.rwd-view7-title').width($('.rwd-container').width() * 0.2 - 46);
292                $('.rwd-view7-desc').width($('.rwd-container').width() * 0.2 - 36);
293
294                setTimeout(function(){
295                    $('.rwd-view7-desc').height($('.view7_inner').height() - 79);
296                }, 200);
297
298                $w = 256;
299                $l = $('.tool_bar .rwd-icon:not(.zoom_cont)').length;
300
301                if(hugeit_resp_lightbox_obj.hugeit_lightbox_zoom && hugeit_resp_lightbox_obj.hugeit_lightbox_zoomtype === '1'){
302                    $('.zoom_cont').css({
303                        'max-width': '220px'
304                    });
305
306                    $w = 220;
307                } else {
308                    $('.zoom_cont').css({
309                        'max-width': '145px'
310                    });
311
312                    $w = 145;
313                }
314
315                $('.tool_bar').width(50 * $l + $w);
316            } else {
317                $('.tool_bar').css('width', '80%');
318            }
319        }
320    };
321
322    Lightbox.prototype.structure = function (index) {
323
324        var $object = this, list = '', controls = '', i,
325            subHtmlCont1 = '', subHtmlCont2 = '', subHtmlCont3 = '',
326            close1 = '', close2 = '', close3 = '', socialIcons = '',
327            template, $arrows, $next, $prev,
328            $_next, $_prev, $close_bg, $download_bg, $download_bg_, $contInner, $view;
329
330        $view = (this.settings.lightboxView === 'view6') ? 'rwd-view6' : '';
331
332        this.$body.append(
333            this.objects.overlay = $('<div class="' + this.settings.classPrefix + 'overlay ' + $view + '"></div>')
334        );
335        this.objects.overlay.css('transition-duration', this.settings.overlayDuration + 'ms');
336
337        var $wURL = '',
338            $target = '';
339
340        if($object.settings.watermark && $object.settings.wURL && hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_text){
341            if($object.settings.wURLnewTab){
342                $target = 'target="_blank"';
343            }
344            $wURL = '<a href="' + $object.settings.watermarkURL + '" class="w_url" ' + $target + '></a>';
345        }
346
347        for (i = 0; i < this.$items.length; i++) {
348            list += '<div class="' + this.settings.classPrefix + 'item">' + $wURL + '</div>';
349        }
350
351        $close_bg = '<svg class="close_bg" width="16px" height="16px" fill="#999" viewBox="-341 343.4 15.6 15.6">' +
352            '<path d="M-332.1,351.2l6.5-6.5c0.3-0.3,0.3-0.8,0-1.1s-0.8-0.3-1.1,0l-6.5,6.5l-6.5-6.5c-0.3-0.3-0.8-0.3-1.1,0s-0.3,0.8,0,1.1l6.5,6.5l-6.5,6.5c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2l6.5-6.5l6.5,6.5c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2c0.3-0.3,0.3-0.8,0-1.1L-332.1,351.2z"/>' +
353            '</svg>';
354
355        switch (this.settings.lightboxView) {
356            case 'view1':
357            default:
358                $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-333 335.5 31.5 31.5" >' +
359                    '<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"/>' +
360                    '</svg>';
361                $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-333 335.5 31.5 31.5" >' +
362                    '<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"/>' +
363                    '</svg>';
364                if(this.settings.showTitle){
365                    subHtmlCont1 = '<div class="' + this.settings.classPrefix + 'title"></div>';
366                }
367                close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>';
368                break;
369            case 'view2':
370                $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' +
371                    '<g><path d="M222.4,373.4L28.2,567.7c-12.4,12.4-32.4,12.4-44.8,0c-12.4-12.4-12.4-32.4,0-44.7l171.9-171.9L-16.6,179.2c-12.4-12.4-12.4-32.4,0-44.7c12.4-12.4,32.4
371-12.4,44.8,0l194.3,194.3c6.2,6.2,9.3,14.3,9.3,22.4C231.7,359.2,228.6,367.3,222.4,373.4z"/></g>' +
372                    '</svg>';
373                $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' +
374                    '<g><path d="M-25.9,351.1c0-8.1,3.1-16.2,9.3-22.4l194.3-194.3c12.4-12.4,32.4-12.4,44.8,0c12.4,12.4,12.4,32.4,0,44.7L50.5,351.1L222.4,523c12.4,12.4,12.4,32.4,0,44.7c-12.4,12.4-32.4,12.4-44.7,0L-16.6,373.4C-22.8,367.3-25.9,359.2-25.9,351.1z"/></g>' +
375                    '</svg>';
376                if(this.settings.showTitle){
377                    subHtmlCont2 = '<div class="' + this.settings.classPrefix + 'title"></div>';
378                }
379                close2 = '<div class="barCont"></div><span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>';
380                break;
381            case 'view3':
382                $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-104 105.6 490.4 490.4" >' +
383                    '<g><g><path d="M141.2,596c135.2,0,245.2-110,245.2-245.2s-110-245.2-245.2-245.2S-104,215.6-104,350.8S6,596,141.2,596z M141.2,130.1c121.7,0,220.7,99,220.7,220.7s-99,220.7-220.7,220.7s-220.7-99-220.7-220.7S19.5,130.1,141.2,130.1z"/>' +
384                    '<path d="M34.7,363.1h183.4l-48,48c-4.8,4.8-4.8,12.5,0,17.3c2.4,2.4,5.5,3.6,8.7,3.6s6.3-1.2,8.7-3.6l68.9-68.9c4.8-4.8,4.8-12.5,0-17.3l-68.9-68.9c-4.8-4.8-12.5-4.8-17.3,0s-4.8,12.5,0,17.3l48,48H34.7c-6.8,0-12.3,5.5-12.3,12.3C22.4,357.7,27.9,363.1,34.7,363.1z"/></g></g>' +
385                    '</svg>';
386                $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-104 105.6 490.4 490.4" >' +
387                    '<g><g><path d="M141.2,596c135.2,0,245.2-110,245.2-245.2s-110-245.2-245.2-245.2S-104,215.6-104,350.8S6,596,141.2,596z M141.2,130.1c121.7,0,220.7,99,220.7,220.7s-99,220.7-220.7,220.7s-220.7-99-220.7-220.7S19.5,130.1,141.2,130.1z"/>' +
388                    '<path d="M94.9,428.4c2.4,2.4,5.5,3.6,8.7,3.6s6.3-1.2,8.7-3.6c4.8-4.8,4.8-12.5,0-17.3l-48-48h183.4c6.8,0,12.3-5.5,12.3-12.3c0-6.8-5.5-12.3-12.3-12.3H64.3l48-48c4.8-4.8,4.8-12.5,0-17.3c-4.8-4.8-12.5-4.8-17.3,0l-68.9,68.9c-4.8,4.8-4.8,12.5,0,17.3L94.9,428.4z"/></g></g>' +
389                    '</svg>';
390                if(this.settings.showTitle){
391                    subHtmlCont1 = '<div class="' + this.settings.classPrefix + 'title"></div>';
392                }
393                close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>';
394                break;
395            case 'view4':
396                $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' +
397                    '<g><path d="M222.4,373.4L28.2,567.7c-12.4,12.4-32.4,12.4-44.8,0c-12.4-12.4-12.4-32.4,0-44.7l171.9-171.9L-16.6,179.2c-12.4-12.4-12.4-32.4,0-44.7c12.4-12.4,32.4-12.4,44.8,0l194.3,194.3c6.2,6.2,9.3,14.3,9.3,22.4C231.7,359.2,228.6,367.3,222.4,373.4z"/></g>' +
398                    '</svg>';
399                $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' +
400                    '<g><path d="M-25.9,351.1c0-8.1,3.1-16.2,9.3-22.4l194.3-194.3c12.4-12.4,32.4-12.4,44.8,0c12.4,12.4,12.4,32.4,0,44.7L50.5,351.1L222.4,523c12.4,12.4,12.4,32.4,0,44.7c-12.4,12.4-32.4,12.4-44.7,0L-16.6,373.4C-22.8,367.3-25.9,359.2-25.9,351.1z"/></g>' +
401                    '</svg>';
402                $close_bg = '<svg class="close_bg" width="16px" height="16px" fill="#999" viewBox="-341 343.4 15.6 15.6">' +
403                    '<path d="M-332.1,351.2l6.5-6.5c0.3-0.3,0.3-0.8,0-1.1s-0.8-0.3-1.1,0l-6.5,6.5l-6.5-6.5c-0.3-0.3-0.8-0.3-1.1,0s-0.3,0.8,0,1.1l6.5,6.5l-6.5,6.5c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2l6.5-6.5l6.5,6.5c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2c0.3-0.3,0.3-0.8,0-1.1L-332.1,351.2z"/>' +
404                    '</svg>';
405                if(this.settings.showTitle){
406                    subHtmlCont2 = '<div class="' + this.settings.classPrefix + 'title"></div>';
407                }
408                close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>';
409                break;
410            case 'view5':
411            case 'view6':
412                $_next = '<svg class="next_bg" width="22px" height="44px" fill="#999" x="0px" y="0px"' +
413                    'viewBox="0 0 40 70" style="enable-background:new 0 0 40 70;" xml:space="preserve">' +
414                    '<path id="XMLID_2_" class="st0" d="M3.3,1.5L1.8,2.9l31.8,31.8c0.5,0.5,0.5,0.9,0,1.4L1.8,67.9l1.5,1.4c0.3,0.5,0.9,0.5,1.4,0' +
415                    'l33.2-33.2c0.3-0.5,0.3-0.9,0-1.4L4.7,1.5C4.3,1,3.6,1,3.3,1.5L3.3,1.5z"/>' +
416                    '</svg>';
417                $_prev = '<svg class="prev_bg" width="22px" height="44px" fill="#999" x="0px" y="0px"' +
418                    'viewBox="0 0 40 70" style="enable-background:new 0 0 40 70;" xml:space="preserve">' +
419                    '<path id="XMLID_2_" class="st0" d="M37.1,68.9l1.5-1.4L6.8,35.7c-0.3-0.5-0.3-0.9,0-1.4L38.6,2.5l-1.5-1.4c-0.3-0.5-0.9-0.5-1.2,0' +
420                    'L2.5,34.3c-0.3,0.5-0.3,0.9,0,1.4l33.4,33.2C36.2,69.4,36.8,69.4,37.1,68.9L37.1,68.9z"/>' +
421                    '</svg>';
422                $close_bg = '<svg class="close_bg" width="16px" height="16px" fill="#999" viewBox="-341 343.4 15.6 15.6">' +
423                    '<path d="M-332.1,351.2l6.5-6.5c0.3-0.3,0.3-0.8,0-1.1s-0.8-0.3-1.1,0l-6.5,6.5l-6.5-6.5c-0.3-0.3-0.8-0.3-1.1,0s-0.3,0.8,0,1.1l6.5,6.5l-6.5,6.5c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2l6.5-6.5l6.5,6.5c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2c0.3-0.3,0.3-0.8,0-1.1L-332.1,351.2z"/>' +
424                    '</svg>';
425                if(this.settings.showTitle){
426                    subHtmlCont3 += '<div class="' + this.settings.classPrefix + 'title"></div>';
427                }
428                if(this.settings.showDesc){
429                    subHtmlCont3 += '<div class="' + this.settings.classPrefix + 'description"></div>';
430                }
431                close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>';
432                break;
433            case 'view7':
434                $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="0 0 43 70.8">' +
435                    '<path id="XMLID_133_" d="M40,33L9.4,2.4c-1.3-1.3-3.5-1.3-4.7,0L1.9,5.2L29.7,33c1.3,1.4,1.3,3.5,0,4.7L1.9,65.5' +
436                    'l2.8,2.8c1.3,1.4,3.5,1.4,4.7,0L40,37.7C41.3,36.5,41.3,34.4,40,33L40,33z"/>' +
437                    '<path id="XMLID_132_" d="M4.1,3.2L3.8,3.5l31.4,31.2c0.3,0.4,0.3,1,0,1.3L3.8,67.4l0.3,0.1c0.3,0.4,0.9,0.4,1.3,0' +
438                    'L36.9,36c0.3-0.3,0.3-0.9,0-1.3L5.5,3.2C5,2.9,4.4,2.9,4.1,3.2L4.1,3.2z"/>' +
439                    '</svg>';
440                $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" x="0px" y="0px" viewBox="0 0 43 70.8">' +
441                    '<path id="XMLID_133_" d="M2.9,37.8l30.6,30.6c1.3,1.3,3.5,1.3,4.7,0l2.8-2.8L13.2,37.8c-1.3-1.4-1.3-3.5,0-4.7L41,5.3' +
442                    'l-2.8-2.8c-1.3-1.4-3.5-1.4-4.7,0L2.9,33.1C1.6,34.3,1.6,36.4,2.9,37.8L2.9,37.8z"/>' +
443                    '<path id="XMLID_132_" d="M38.8,67.5l0.3-0.3L7.7,36.1c-0.3-0.4-0.3-1,0-1.3L39.1,3.4l-0.3-0.1c-0.3-0.4-0.9-0.4-1.3,0' +
444                    'L6,34.8c-0.3,0.3-0.3,0.9,0,1.3l31.4,31.5C37.9,67.8,38.5,67.8,38.8,67.5L38.8,67.5z"/>' +
445                    '</svg>';
446                $close_bg = '<svg id="close_hover" class="close_bg" viewBox="0 0 24.3 23.8" style="enable-background:new 0 0 24.3 23.8;" xml:space="preserve">' +
447                    '<style type="text/css">.st0{opacity:0.3;}.st2{fill:#FFFFFF;}.st3{fill:#010101;}.st4{fill:#231F20;}</style>' +
448                    '<g id="XMLID_248_" class="st0"><g id="XMLID_249_"><g id="XMLID_250_"><defs><rect id="XMLID_137_" x="1.3" y="0.5" width="22.5" height="22.8"/></defs>' +
449                    '<clipPath id="XMLID_140_"><use xlink:href="#XMLID_137_"  style="overflow:visible;"/></clipPath><g id="XMLID_251_" class="st1"><g id="XMLID_252_">' +
450                    '<path id="XMLID_132_" class="st2" d="M14.4,11.7l9-9c0.5-0.5,0.5-1.3,0-1.9c-0.5-0.5-1.3-0.5-1.9,0l-9,9l-9-9' +
451                    'C3,0.3,2.2,0.3,1.7,0.8c-0.5,0.5-0.5,1.3,0,1.9l9,9l-9,9c-0.5,0.5-0.5,1.3,0,1.9C2,22.9,2.3,23,2.6,23s0.7-0.1,0.9-0.4l9-9l9,9' +
452                    'c0.3,0.3,0.6,0.4,0.9,0.4s0.7-0.1,0.9-0.4c0.5-0.5,0.5-1.3,0-1.9L14.4,11.7z"/>' +
453                    '</g></g></g></g></g><g id="XMLID_142_" class="st0"><line id="XMLID_135_" class="st3" x1="1.9" y1="1.1" x2="23.1" y2="22.3"/>' +
454                    '<rect id="XMLID_136_" x="-2.5" y="11.2" transform="matrix(0.7077 0.7066 -0.7066 0.7077 11.918 -5.4355
454)" class="st4" width="30" height="1"/>' +
455                    '</g><g id="XMLID_139_" class="st0"><line id="XMLID_133_" class="st3" x1="23.4" y1="1" x2="2.2" y2="22.2"/>' +
456                    '<rect id="XMLID_134_" x="12.3" y="-3.4" transform="matrix(0.7071 0.7071 -0.7071 0.7071 11.9598 -5.6442)" class="st4" width="1" height="30"/>' +
457                    '</g></svg>' +
458                    '<svg id="close_hover_on" class="close_bg" viewBox="0 0 24.3 23.8" style="enable-background:new 0 0 24.3 23.8;" xml:space="preserve">' +
459                    '<style type="text/css">.st0{opacity:0.7;}.st2{fill:#FFFFFF;}.st3{opacity:1;}.st4{fill:#010101;}.st5{fill:#231F20;}</style>' +
460                    '<g id="XMLID_248_" class="st0"><g id="XMLID_249_"><g id="XMLID_250_"><defs><rect id="XMLID_137_" x="0.6" y="0.5" width="23" height="23.2"/></defs>' +
461                    '<clipPath id="XMLID_140_"><use xlink:href="#XMLID_137_"  style="overflow:visible;"/></clipPath><g id="XMLID_251_" class="st1"><g id="XMLID_252_">' +
462                    '<path id="XMLID_132_" class="st2" d="M14.1,12l9.2-9.2c0.5-0.5,0.5-1.4,0-1.9c-0.5-0.5-1.4-0.5-1.9,0L12.1,10L2.9,0.8' +
463                    'C2.4,0.3,1.6,0.3,1,0.8C0.5,1.4,0.5,2.2,1,2.8l9.2,9.2l-9.2,9.2c-0.5,0.5-0.5,1.4,0,1.9c0.3,0.3,0.6,0.4,1,0.4s0.7-0.1,1-0.4' +
464                    'l9.2-9.2l9.2,9.2c0.3,0.3,0.6,0.4,1,0.4c0.3,0,0.7-0.1,1-0.4c0.5-0.5,0.5-1.4,0-1.9L14.1,12z"/>' +
465                    '</g></g></g></g></g><g id="XMLID_142_" class="st3"><line id="XMLID_135_" class="st4" x1="1.3" y1="1.1" x2="22.9" y2="22.7"/>' +
466                    '<rect id="XMLID_136_" x="-3.2" y="11.4" transform="matrix(0.7077 0.7066 -0.7066 0.7077 11.9668 -5.0772)" class="st5" width="30.6" height="1"/>' +
467                    '</g><g id="XMLID_139_" class="st3"><line id="XMLID_133_" class="st4" x1="23.2" y1="1" x2="1.6" y2="22.7"/>' +
468                    '<rect id="XMLID_134_" x="11.9" y="-3.5" transform="matrix(0.7072 0.707 -0.707 0.7072 12.0069 -5.2896)" class="st5" width="1" height="30.6"/>' +
469                    '</g></svg>';
470                close3 = '<div class="' + this.settings.classPrefix + 'close-bar">' +
471                    '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>' +
472                    '</div>';
473                break;
474        }
475
476        if (this.settings.arrows && this.$items.length > 1) {
477            controls = '<div class="' + this.settings.classPrefix + 'arrows">' +
478                '<div class="' + this.settings.classPrefix + 'prev ' + $object.settings.classPrefix + 'icon">' + $_prev + this.settings.prevHtml + '</div>' +
479                '<div class="' + this.settings.classPrefix + 'next ' + $object.settings.classPrefix + 'icon">' + $_next + this.settings.nextHtml + '</div>' +
480                '</div>';
481        }
482
483        if (this.settings.socialSharing && (this.settings.lightboxView !== 'view5' || this.settings.lightboxView !== 'view6')) {
484            socialIcons = '<div class="' + this.settings.classPrefix + 'socialIcons"><button class="shareLook">share</button></div>';
485        }
486
487        $contInner = (this.settings.lightboxView === 'view5' || this.settings.lightboxView === 'view6') ? '<div class="contInner">' + subHtmlCont3 + '</div>' : '';
488
489        var arrowHE = (this.settings.lightboxView !== 'view2' && this.settings.lightboxView !== 'view3') ? this.settings.arrowsHoverEffect : '',
490            $up = '<svg class="rwd-up" width="15px" height="12px" viewBox="0 0 26.5 21" style="enable-background:new 0 0 26.5 21;">' +
491                '<g id="Shape_1"><g>' +
492                '<path class="st0" d="M23.7,15.3l-9.2-9.2c-0.4-0.4-1-0.4-1.4,0L3.7,15c-0.4,0.4-0.4,1,0,1.4l0.9,0.9l8.6-8.1' +
493                'c0.4-0.4,1.1-0.4,1.4,0l8.3,8.3l0.9-0.8C24.1,16.3,24.1,15.7,23.7,15.3z"/>' +
494                '</g></g></svg>',
495            $down = '<svg class="rwd-down" width="15px" height="12px" viewBox="0 0 26.5 21" style="enable-background:new 0 0 26.5 21;">' +
496                '<g id="Shape_1"><g>' +
497                '<path class="st0" d="M23.8,6.8l-0.9-0.8l-8.5,8.2c-0.4,0.4-1.1,0.4-1.4,0L4.6,5.8L3.7,6.7C3.3,7,3.3,7.7,3.7,8l9.3,9.1' +
498                'c0.4,0.4,1,0.4,1.4,0l9.4-9C24.2,7.8,24.2,7.1,23.8,6.8z"/>' +
499                '</g></g></svg>',
500            $toggle_bar = (this.settings.lightboxView === 'view7') ? '<div class="toggle_bar">' + $up + $down + '</div>' : '',
501            nw = '', nh = '', $lens;
502
503        if(this.settings.lightboxView === 'view7'){
504            nw = $object.$items.eq(index).find('img').prop('naturalWi
504dth');
505            nh = $object.$items.eq(index).find('img').prop('naturalHeight');
506        }
507
508        $lens = (this.settings.lightboxView === 'view7') ? '<div class="tool_bar"><div class="zoom_cont rwd-icon"><div class="zoom_size"></div><div class="img_size">' + nw + 'px &times; ' + nh + 'px</div></div></div>' : '';
509
510        template = '<div class="' + this.settings.classPrefix + 'cont ">' +
511            '<div class="rwd-container rwd-' + this.settings.lightboxView + ' rwd-arrows_hover_effect-' + arrowHE + '">' +
512            '<div class="cont-inner">' + list + '</div>' +
513            $contInner +
514            '<div class="' + this.settings.classPrefix + 'toolbar group">' +
515            close1 + subHtmlCont2 + $toggle_bar + $lens +
516            '</div>' +
517            close3 +
518            controls +
519            '<div class="' + this.settings.classPrefix + 'bar">' +
520            close2 + subHtmlCont1 + socialIcons + '</div>' +
521            '</div>' +
522            '</div>';
523
524        switch($object.settings.openCloseType[0]){
525            case 'open_1':
526            case 'open_2':
527            case 'open_3':
528            case 'open_4':
529            case 'open_5':
530            case 'open_1_r':
531            case 'open_2_r':
532            case 'open_3_r':
533            case 'open_4_r':
534            case 'open_5_r':
535                setTimeout(function(){
536                    $object.$cont.addClass('rwd-visible');
537                    $('.rwd-container').addClass($object.settings.openCloseType[0]);
538                }, 0);
539                break;
540            default:
541                $('.rwd-container').addClass($object.settings.openCloseType[0]);
542                setTimeout(function () {
543                    $object.$cont.addClass('rwd-visible');
544                }, this.settings.overlayDuration);
545                break;
546        }
547
548        if ($object.settings.socialSharing) {
549            setTimeout(function () {
550                $object.socialShare();
551            }, 50);
552        }
553
554        this.$body.append(template);
555        this.$cont = $('.' + $object.settings.classPrefix + 'cont');
556        this.$item = this.$cont.find('.' + $object.settings.classPrefix + 'item');
557
558        if (!this.settings.slideAnimation) {
559            this.$cont.addClass(this.settings.classPrefix + 'animation');
560            this.settings.slideAnimationType = this.settings.classPrefix + 'slide';
561        } else {
562            this.$cont.addClass(this.settings.classPrefix + 'use');
563        }
564
565        $object.calculateDimensions(index);
566
567        this.$item.eq(this.index).addClass(this.settings.classPrefix + 'current');
568
569        if (this.effectsSupport()) {
570            this.$cont.addClass(this.settings.classPrefix + 'support');
571        } else {
572            this.$cont.addClass(this.settings.classPrefix + 'noSupport');
573            this.settings.speed = 0;
574        }
575
576        this.$cont.addClass(this.settings.slideAnimationType);
577
578        ((this.settings.showAfterLoad) && (this.$cont.addClass(this.settings.classPrefix + 'show-after-load')));
579
580        if (this.effectsSupport()) {
581            var $inner = this.$cont.find('.cont-inner');
582            $inner.css('transition-timing-function', 'ease');
583            $inner.css('transition-duration', this.settings.speed + 'ms');
584        }
585
586        switch($object.settings.lightboxView){
587            case 'view1':
588            case 'view2':
589            case 'view3':
590                $inner.css({
591                    height: 'calc(100% - 92px)',
592                    top: '47px'
593                });
594                break;
595            case 'view4':
596                $inner.css({
597                    height: 'calc(100% - 92px)',
598                    top: '45px'
599                });
600                break;
601            case 'view5':
602                jQuery('.cont-inner').css({
603                    width: '60%'
604                });
605                break;
606            case 'view6':
607                jQuery('.cont-inner').css({
608                    width: '80%'
609                });
610                break;
611            case 'view7':
612                $('.toggle_bar').on('click', function(){
613                    $('.rwd-container').toggleClass('rwd_toggle_bar');
614
615                    if (jQuery('.rwd-toolbar').height() === 40) {
616                        jQuery('.rwd-toolbar').animate({
617                            height: '',
618                            top: jQuery('.rwd-toolbar').position().top + 40 + 'px'
619                        }, 1000);
620                        jQuery('.tool_bar > *').css('display', 'none');
621                    } else {
622                        jQuery('.rwd-toolbar').animate({
623                            height: '40px',
624                            top: jQuery('.rwd-toolbar').position().top - 40 + 'px'
625                        }, 1000);
626                        setTimeout(function () {
627                            jQuery('.tool_bar > *').css('display', 'block');
628                        }, 1000);
629                    }
630                });
631                break;
632        }
633
634        $object.objects.overlay.addClass('in');
635
636        setTimeout(function () {
637            $object.$cont.addClass($object.settings.classPrefix + 'visible');
638        }, this.settings.overlayDuration);
639
640        if (this.settings.download) {
641            $download_bg = '<svg class="download_bg" width="20px" height="20px" stroke="#999" fill="#999"  viewBox="-328 330.3 41.7 41.7" >' +
642                '<path class="st0" d="M-296.4,352.1c0.4-0.4,0.4-1.1,0-1.6c-0.4-0.4-1.1-0.4-1.6,0l-8,8V332c0-0.6-0.5-1.1-1.1-1.1c-0.6,0-1.1,0.5-1.1,1.1v26.5l-8-8c-0.4-0.4-1.2-0.4-1.6,0c-0.4,0.4-0.4,1.1,0,1.6l10,10c0.4,0.4,1.1,0.4,1.6,0L-296.4,352.1zM-288.5,359.4c0-0.6,0.5-1.1,1.1-1.1c0.6,0,1.1,0.5,1.1,1.1v10.9c0,0.6-0.5,1.1-1.1,1.1h-39.5c-0.6,0-1.1-0.5-1.1-1.1v-10.9c0-0.6,0.5-1.1,1.1-1.1c0.6,0,1.1,0.5,1.1,1.1v9.8h37.2V359.4z"/>' +
643                '</svg>';
644            $download_bg_ = '<svg class="download_bg" width="36px" height="34px" stroke="#999" fill="#999" x="0px" y="0px"' +
645                'viewBox="0 0 90 90" style="enable-background:new 0 0 90 90;" xml:space="preserve">' +
646                '<path id="XMLID_2_" class="st0" d="M61.3,31.8L45.5,47.7c-0.2,0.2-0.5,0.2-0.7,0l-16-15.9c-0.2-0.2-0.2-0.5,0-0.7l2.1-2.1l12.6,12.6' +
647                'V7.4c0-0.9,0.7-1.7,1.7-1.7s1.8,0.8,1.8,1.7v34l12.2-12.3l2.1,2.1C61.5,31.3,61.5,31.6,61.3,31.8L61.3,31.8z"/>' +
648                '<path id="XMLID_3_" class="st0" d="M25.6,50.7L25.6,50.7h38.7c1.6,0,2.8,1.2,2.8,2.7v1.5c0,1.6-1.2,2.9-2.8,2.9H25.6' +
649                'c-1.5,0-2.8-1.3-2.8-2.9v-1.5C22.9,51.9,24.1,50.7,25.6,50.7L25.6,50.7z"/>' +
650                '</svg>';
651            switch (this.settings.lightboxView) {
652                case 'view1':
653                default:
654                    this.$cont.find('.' + $object.settings.classPrefix + 'toolbar').append('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg + '</a>');
655                    break;
656                case 'view2':
657                    this.$cont.find('.' + $object.settings.classPrefix + 'bar').append('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg + '</a>');
658                    break;
659                case 'view4':
660                    $('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg + '</a>').insertBefore($('.rwd-title'));
661                    break;
662                case 'view5':
663                case 'view6':
664                    $('.rwd-toolbar').append('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg_ + '</a>');
665                    break;
666                case 'view7':
667                    $('.tool_bar').append('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg_ + '</a>');
668                    break;
669            }
670        }
671
672        if(this.settings.lightboxView === 'view7' && hugeit_resp_lightbox_obj.hugeit_lightbox_view_info === 'true'){
673            var $info = '<svg id="rwd-view7-info" width="20" height="20" stroke="#999" fill="#999" viewBox="0 0 543.906 543.906" style="enable-background:new 0 0 543.906 543.906;">' +
674                '<g><path d="M271.953,0C121.759,0,0,121.759,0,271.953s121.759,271.953,271.953,271.953' +
675                's271.953-121.759,271.953-271.953S422.148,0,271.953,0z M316.994,76.316c1.055-0.049,2.138-0.06,3.231,0' +
676                'c14.724-0.484,27.533,10.622,29.578,24.987c6.576,27.581-22.719,55.228-49.631,44.192' +
677                'C268.032,130.576,284.224,77.909,316.994,76.316z M303.739,196.318c20.875-1.327,24.519,22.964,18.014,47.592' +
678                'c-12.695,56.583-32.455,111.403-43.175,168.442c5.178,22.523,33.575-3.312,45.721-11.558c10.329-8.213,12.124,2.083,15.637,10.71' +
679                'c-25.776,18.058-51.687,36.447-80.395,50.991c-26.972,16.361-49.049-9.072-42.321-37.394' +
680                'c11.128-52.841,25.776-104.882,37.736-157.564c3.737-28.468-33.728,0.511-44.872,7.136c-8.985,11.292-13.25,3.051-16.997-7.136' +
681                'c29.871-21.816,60.325-48.593,93.313-65.949C293.138,198.238,298.92,196.622,303.739,196.318z"/>' +
682                '</g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g><g></g></svg>';
683            $('.tool_bar').append('<span class="info_show_hide rwd-icon">' + $info + '</span>');
684        }
685
686        $arrows = $('.rwd-arrows .rwd-next, .rwd-arrows .rwd-prev');
687        $next = $('.rwd-arrows .rwd-next');
688        $prev = $('.rwd-arrows .rwd-prev');
689
690        var title_text = $('.rwd-title');
691
692        switch (this.settings.titlePos) {
693            case 'left':
694                title_text.css({'text-align': 'left'});
695                break;
696            case 'center':
697                title_text.css({'text-align': 'center'});
698                break;
699            case 'right':
700                title_text.css({'text-align': 'right'});
701                break;
702        }
703
704        switch (this.settings.lightboxView) {
705            case 'view1':
706            default:
707                $arrows.css({'top': '50%'});
708                $next.css({'right': '20px'});
709                $prev.css({'left': '20px'});
710                break;
711            case 'view2':
712                $arrows.css({'bottom': '0'});
713                $next.css({'right': '40%'});
714                $prev.css({'left': '40%'});
715                break;
716            case 'view3':
717                $arrows.css({'top': '14px', 'z-index': '1090'});
718                $next.css({'right': '20px'});
719                $prev.css({'right': '55px'});
720                title_text.css({'text-align': 'left', 'border-top': '1px solid #999'});
721                $('.rwd-close').css({'margin-right': '45%'});
722                $('.rwd-overlay, .rwd-toolbar, .rwd-title, .rwd-next, .rwd-prev').css({'background': 'rgba(255, 255, 255, 1)'});
723                $('.rwd-title, .shareLook').css({'color': '#999'});
724                $('.rwd-toolbar').css({'border-bottom': '1px solid #999'});
725                $('.rwd-toolbar .rwd-icon, .rwd-arrows .rwd-icon').addClass('rwd-icon0');
726                break;
727        }
728
729        this.prevScrollTop = $(window).scrollTop();
730
731        $object.objects.content = $('.rwd-container');
732
733        $object.objects.content.css({
734            'width': $object.settings.width,
735            'height': $object.settings.height
736        });
737
738        if($(window).width() < 768 && this.settings.lightboxView === 'view7'){
739            $object.objects.content.css({
740                'width': '100%',
741                'height': '100%'
742            });
743        }
744        
745        var $color, $zoomTop = (document.documentElement.clientHeight - $object.objects.content.height()) / 2;
746        switch (this.settings.lightboxView){
747            case 'view3':
748                $color = 'rgba(255,255,255,.9)';
749                break;
750            default:
751                $color = 'rgba(0,0,0,.9)';
752                break;
753        }
754
755        if(hugeit_resp_lightbox_obj.hugeit_lightbox_rightclick_protection === 'true'){
756            setTimeout(function () {
757                $('.rwd-container').bind('contextmenu', function () {
758                    return false;
759                });
760            }, 50);
761        }
762
763        if(this.settings.showBorder){
764            $('.rwd-container').css({
765                border: '2px solid #999'
766            });
767        }
768    };
769
770    Lightbox.prototype.calculateDimensions = function (index) {
771        var $object = this, $width;
772
773        $width = $('.' + $object.settings.classPrefix + 'current').height() * 16 / 9;
774
775        if ($width > $object.settings.videoMaxWidth) {
776            $width = $object.settings.videoMaxWidth;
777        }
778
779        $('.' + $object.settings.classPrefix + 'video-cont ').css({
780            'max-width': $width + 'px'
781        });
782
783        if(this.settings.lightboxView === 'view7') {
784            var $img, $video, $_inner,
785                $_width, $_height, $_wrap, $wrapHeight,
786                $_top, $top, $left, $_left = 0, $t,
787                $length, $k;
788
789            setTimeout(function() {
790
791                $img = document.querySelector('.rwd-item:nth-child(' + (index + 1) + ') img');
792                $video = document.querySelector('.rwd-item:nth-child(' + (index + 1) + ') .rwd-video-cont');
793                $_inner = document.querySelector('.rwd-item:nth-child(' + (index + 1) + ') .view7_inner');
794
795                if($img && $(window).width() > 768){
796                    $k = $object.$item.eq(index).find('img').prop('naturalWidth') / $object.$item.eq(index).find('img').prop('naturalHeight');
797
798                    if ($object.$item.eq(index).find('img').prop('naturalWidth') > $object.$item.eq(index).find('img').prop('naturalHeight') && $k > 2) {
799                        if($object.$item.eq(index).find('img').prop('naturalWidth') < 500 ){
800                            $object.$item.eq(index).find('img').css({
801                                minWidth: '70%'
802                            });
803                        }
804                    } else {
805                        if($object.$item.eq(index).find('img').prop('naturalHeight') < 500){
806                            $object.$item.eq(index).find('img').css({
807                                minHeight: '70%'
808                            });
809                        }
810                    }
811                }
812
813                $_width = parseFloat(window.getComputedStyle($img || $video, null).width);
814                $_height = parseFloat(window.getComputedStyle($img || $video, null).height);
815
816                switch($img || $video){
817                    case $img:
818                        $_wrap = document.querySelector('.rwd-item:nth-child(' + (index + 1) + ') .rwd-img-wrap');
819                        break;
820                    case $video:
821                        $_wrap = document.querySelector('.rwd-item:nth-child(' + (index + 1) + ')');
822                        break;
823                }
824
825                $wrapHeight = parseFloat(window.getComputedStyle($_wrap, null).height);
826
827                $top = ($wrapHeight - $_height) / 2 + $_height - 40;
828                $_top = ($wrapHeight - $_height) / 2;
829                $left = ($('.rwd-container').width() - (parseFloat(window.getComputedStyle($_inner, null).width) + $_width)) / 2;
830                $t = ($object.settings.thumbnail) ? 47 : 0;
831
832                if ($('.rwd-container').width() > 768) {
833
834                    $('.rwd-view7-title').eq(index).width($('.rwd-container').width() * 0.2 - 46);
835                    $('.rwd-view7-desc').eq(index).width($('.rwd-container').width() * 0.2 - 36);
836
837                    setTimeout(function(){
838                        $('.rwd-view7-desc').height($('.view7_inner').height() - ($object.settings.showTitle ? 120 : 9));
839                    }, 200);
840
841                    $_left = ($_inner.classList.contains('is_close')) ? 0 : $('.rwd-container').width() * 0.1;
842
843                    $('.rwd-toolbar').css({
844                        width: $_width + 1 + 'px',
845                        top: $top + $t + ($('.rwd-container').hasClass('rwd_toggle_bar') ? 40 : 0) + 1 + 'px',
846                        left: $left + 'px'
847                    });
848
849                    $('.rwd-close-bar').css({
850                        top: $_top + $t + 'px',
851                        left: $left + $_width - 25 + 'px'
852                    });
853
854                    ($img || $video).style.left = -$_left + ($object.settings.showBorder ? $object.settings.borderSize : 0);
855
856                    $('.view7_inner').eq(index).css({
857                        top: $_top + 'px',
858                        left: $_left + $left + $_width + 'px',
859                        height: $_height + 1 + 'px'
860                    });
861
862                    $('.view7_share').css({
863                        top: $_top + $t + 12 + 'px',
864                        right: 2*$_left + $_width + $left + 5 + 'px'
865                    });
866
867                    $length = $('.view7_share li').length + 1;
868
869                    $('.view7_share, .view7_share > div').width(($_height - 42) / $length).height(($_height - 42) / $length);
870                    $('.view7_share li').width(($_height - 42) / $length).height(($_height - 42) / $length);
871
872                } else {
873                    $('.rwd-toolbar').css({
874                        width: $(window).width() + 'px',
875                        top: '0'
876                    });
877
878                    $('.rwd-toolbar .rwd-icon, .view7_share').width($(window).width() * 0.2);
879
880                    $('.view7_share').css({
881                        'top': '0',
882                        'z-index': '999999999',
883                        'left': ($(window).width() * 0.2 - 40) * 0.5 + 'px'
884                    });
885
886                    $('.rwd-share-buttons').css({
887                        height: $(window).height() + 'px',
888                        width: $(window).width() + 'px',
889                        left: -($(window).width() * 0.2 - 40) * 0.5 + 'px'
890                    });
891
892                    $('.rwd-share-buttons li').css({
893                        width: ($(window).width() - ($object.settings.showBorder ? 8 : 0)) * 0.2 + 'px',
894                        maxWidth: 'none'
895                    });
896
897                    $('.rwd-share-buttons li a').css({
898                        marginLeft: $(window).width() * 0.1 - 20 + 'px'
899                    });
900
901                    $('.rwd-close-bar').css({
902                        top: $_top + $t + 5 + 'px',
903                        left: ($(window).width() - $_width) / 2 + $_width - 30 + 'px'
904                    });
905                }
906            }, 0);
907        }
908    };
909
910    Lightbox.prototype.innerOpenClose = function(){
911        var $object = this;
912
913        $('.info_show_hide').off('click');
914
915        $('.info_show_hide').on('click', function(){
916            var $view7_inner = $('.rwd-item.rwd-current').find('.view7_inner'),
917                $toolbar = $('.rwd-toolbar'),
918                $closebar = $('.rwd-close-bar'),
919                $imgcont = $('.rwd-item.rwd-current').find('img'),
920                $videoCont = $('.rwd-item.rwd-current').find('.rwd-video-cont '),
921                $zoomcont = $('.zoomContainer'),
922                $view7_share = $('.view7_share');
923
924            if($('.rwd-container').width() > 768) {
925                if ($('.rwd-item.rwd-current').hasClass('isImg')) {
926                    if (!$view7_inner.hasClass('is_close')) {
927                        $view7_inner.addClass('is_close');
928
929                        $view7_inner.animate({
930                            width: '0',
931                            left: parseFloat($view7_inner.css('left')) + 'px'
932                        }, 1000);
933
934                        $toolbar.animate({
935                            width: parseFloat($toolbar.css('width')) + 1 + 'px',
936                            left: parseFloat($toolbar.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
937                        }, 1000);
938
939                        $closebar.animate({
940                            left: parseFloat($closebar.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
941                        }, 1000);
942
943                        $imgcont.animate({
944                            left: parseFloat($imgcont.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
945                        }, 1000);
946
947                        $zoomcont.animate({
948                            left: parseFloat($imgcont.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
949                        }, 1000);
950
951                        $view7_share.animate({
952                            left: parseFloat($view7_share.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
953                        }, 1000);
954                    } else {
955                        $view7_inner.removeClass('is_close');
956
957                        $view7_inner.animate({
958                            width: $('.rwd-container').width() * 0.2 + 'px',
959                            left: parseFloat($view7_inner.css('left')) + 'px'
960                        }, 1000);
961
962                        $toolbar.animate({
963                            width: parseFloat($toolbar.css('width')) - 1 + 'px',
964                            left: parseFloat($toolbar.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
965                        }, 1000);
966
967                        $closebar.animate({
968                            left: parseFloat($closebar.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
969                        }, 1000);
970
971                        $imgcont.animate({
972                            left: parseFloat($imgcont.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
973                        }, 1000);
974
975                        $zoomcont.animate({
976                            left: parseFloat($imgcont.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
977                        }, 1000);
978
979                        $view7_share.animate({
980                            left: parseFloat($view7_share.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
981                        }, 1000);
982                    }
983                } else if ($('.rwd-item.rwd-current').hasClass('isVideo')) {
984                    if (!$view7_inner.hasClass('is_close')) {
985                        $view7_inner.addClass('is_close');
986
987                        $view7_inner.animate({
988                            width: '0',
989                            left: parseFloat($view7_inner.css('left')) + 'px'
990                        }, 1000);
991
992                        $toolbar.animate({
993                            left: parseFloat($toolbar.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 0.5 + 'px'
994                        }, 1000);
995
996                        $closebar.animate({
997                            left: parseFloat($closebar.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
998                        }, 1000);
999
1000                        $videoCont.animate({
1001                            left: parseFloat($videoCont.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
1002                        }, 1000);
1003
1004                        $view7_share.animate({
1005                            left: parseFloat($view7_share.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
1006                        }, 1000);
1007                    } else {
1008                        $view7_inner.removeClass('is_close');
1009
1010                        $view7_inner.animate({
1011                            width: $('.rwd-container').width() * 0.2 + 'px',
1012                            left: parseFloat($view7_inner.css('left')) + 'px'
1013                        }, 1000);
1014
1015                        $toolbar.animate({
1016                            left: parseFloat($toolbar.css('left')) - $('.rwd-container').width() * 0.1 - 0.5 + 'px'
1017                        }, 1000);
1018
1019                        $closebar.animate({
1020                            left: parseFloat($closebar.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
1021                        }, 1000);
1022
1023                        $videoCont.animate({
1024                            left: parseFloat($videoCont.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
1025                        }, 1000);
1026
1027                        $view7_share.animate({
1028                            left: parseFloat($view7_share.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
1029                        }, 1000);
1030                    }
1031                }
1032            } else {
1033                if (!$view7_inner.hasClass('is_open')) {
1034                    $view7_inner.addClass('is_open');
1035
1036                    if($('.rwd-share-buttons').css('display') === 'block'){
1037                        $('.rwd-share-buttons').css({
1038                            'display': 'none'
1039                        });
1040                    }
1041
1042                    $('.rwd-close-bar,.rwd-arrows .rwd-next, .rwd-arrows .rwd-prev').css({
1043                        zIndex: '1'
1044                    });
1045
1046                    if(!$object.settings.thumbnail){
1047                        $view7_inner.css({
1048                            top: '40px'
1049                        });
1050                    }
1051
1052                    if($object.settings.thumbnail && hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs_position === '1'){
1053                        $view7_inner.css({
1054                            top: -(+hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs_height) + 'px'
1055                        });
1056                    }
1057
1058                    $view7_inner.animate({
1059                        height: $(window).height() + 'px'
1060                    }, 1000);
1061                } else {
1062                    $view7_inner.removeClass('is_open');
1063
1064                    $('.rwd-close-bar,.rwd-arrows .rwd-next, .rwd-arrows .rwd-prev').animate({
1065                        zIndex: '999999999'
1066                    }, 700);
1067
1068                    $view7_inner.animate({
1069                        height: '0'
1070                    }, 1000);
1071                }
1072            }
1073        });
1074    };
1075
1076    Lightbox.prototype.effectsSupport = function () {
1077        var transition, root, support;
1078        support = function () {
1079            transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition'];
1080            root = document.documentElement;
1081            for (var i = 0; i < transition.length; i++) {
1082                if (transition[i] in root.style) {
1083                    return transition[i] in root.style;
1084                }
1085            }
1086        };
1087
1088        return support();
1089    };
1090
1091    Lightbox.prototype.isVideo = function (src, index) {
1092        var youtube, vimeo, dailymotion;
1093
1094        youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i);
1095        vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i);
1096        dailymotion = src.match(/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/);
1097
1098        if (youtube) {
1099            return {
1100                youtube: youtube
1101            };
1102        } else if (vimeo) {
1103            return {
1104                vimeo: vimeo
1105            };
1106        } else if (dailymotion) {
1107            return {
1108                dailymotion: dailymotion
1109            };
1110        }
1111    };
1112
1113    Lightbox.prototype.counter = function () {
1114        if (this.settings.showCounter) {
1115            switch (this.settings.lightboxView) {
1116                case 'view1':
1117                default:
1118                    $('.' + this.settings.classPrefix + 'toolbar').append(this.objects.counter = $('<div id="' + this.settings.idPrefix + 'counter"></div>'));
1119                    $('#rwd-counter').css({'padding-left': '23px'});
1120                    break;
1121                case 'view2':
1122                case 'view4':
1123                case 'view7':
1124                    $('.' + this.settings.classPrefix + 'bar').append('<div class="barCont"></div>').append(this.objects.counter = $('<div id="' + this.settings.idPrefix + 'counter"></div>'));
1125                    break;
1126                case 'view5':
1127                case 'view6':
1128                    $('.contInner').append(this.objects.counter = $('<div id="' + this.settings.idPrefix + 'counter"></div>'));
1129                    break;
1130            }
1131
1132            this.objects.counter.append(
1133                this.objects.current = $('<div>' + this.settings.sequence_info + ' <span id="' + this.settings.idPrefix + 'counter-current">' + (parseInt(this.index, 10) + 1) + '</span> ' +
1134                    this.settings.sequenceInfo + ' <span id="' + this.settings.idPrefix + 'counter-all">' + this.$items.length + '</span></div>')
1135            );
1136        }
1137    };
1138
1139    Lightbox.prototype.setTitle = function (index) {
1140        var $object = this, $title, $currentElement;
1141
1142        $currentElement = this.$items.eq(index);
1143        $title = $currentElement.find('img').attr('alt') ||
1144            $currentElement.find('img').attr('title') ||
1145            this.settings.defaultTitle || '';
1146
1147        this.$cont.find('.' + this.settings.classPrefix + 'title').html('<div class="rwd-title-text">' + $title + '</div>');
1148
1149        (($object.settings.lightboxView === 'view2') && $('.rwd-title-text').css({'width': '100%'}));
1150
1151        if ($object.settings.lightboxView !== 'view1' && $object.settings.lightboxView !== 'view3' && $object.settings.lightboxView !== 'view4') {
1152            ($title === '' && $object.settings.socialSharing) ?
1153                this.$cont.find('.' + this.settings.classPrefix + 'title').hide() :
1154                this.$cont.find('.' + this.settings.classPrefix + 'title').show();
1155        }
1156
1157        if($object.settings.lightboxView === 'view7'){
1158            if(this.settings.showTitle){
1159                $('.rwd-view7-title').eq(index).html($title);
1160                setTimeout(function(){
1161                    $('.rwd-view7-title').eq(index).html($title);
1162                }, 200);
1163            }
1164        }
1165    };
1166
1167    Lightbox.prototype.setDescription = function (index) {
1168        var $object = this, $description, $currentElement;
1169
1170        $currentElement = this.$items.eq(index);
1171        $description = $currentElement.find('img').attr('data-description') || '';
1172
1173        this.$cont.find('.' + this.settings.classPrefix + 'description').html('<div class="rwd-description-text" title="' + $description + '">' + $description + '</div>');
1174
1175        if($object.settings.lightboxView === 'view7'){
1176            if(this.settings.showDesc){
1177                setTimeout(function(){
1178                    $('.rwd-view7-desc').eq(index).html($description);
1179                    $('.rwd-view7-desc').eq(index).attr('title', $description);
1180                }, 200);
1181            }
1182        }
1183    };
1184
1185    Lightbox.prototype.preload = function (index) {
1186        for (var i = 1; i <= this.settings.preload; i++) {
1187            if (i >= this.$items.length - index) {
1188                break;
1189            }
1190
1191            this.loadContent(index + i, false, 0);
1192        }
1193
1194        for (var j = 1; j <= this.settings.preload; j++) {
1195            if (index - j < 0) {
1196                break;
1197            }
1198
1199            this.loadContent(index - j, false, 0);
1200        }
1201    };
1202
1203    Lightbox.prototype.socialShare = function () {
1204        var $object = this, shareButtons;
1205
1206        if(this.settings.lightboxView !== 'view7'){
1207            shareButtons = '<ul class="rwd-share-buttons">';
1208            shareButtons += $object.settings.share.facebookButton ? '<li><a title="Facebook" id="rwd-share-facebook" target="_blank"></a></li>' : '';
1209            shareButtons += $object.settings.share.twitterButton ? '<li><a title="Twitter" id="rwd-share-twitter" target="_blank"></a></li>' : '';
1210            shareButtons += $object.settings.share.googleplusButton ? '<li><a title="Google Plus" id="rwd-share-googleplus" target="_blank"></a></li>' : '';
1211            shareButtons += $object.settings.share.pinterestButton ? '<li><a title="Pinterest" id="rwd-share-pinterest" target="_blank"></a></li>' : '';
1212            shareButtons += $object.settings.share.linkedinButton ? '<li><a title="Linkedin" id="rwd-share-linkedin" target="_blank"></a></li>' : '';
1213            shareButtons += $object.settings.share.tumblrButton ? '<li><a title="Tumblr" id="rwd-share-tumblr" target="_blank"></a></li>' : '';
1214            shareButtons += $object.settings.share.redditButton ? '<li><a title="Reddit" id="rwd-share-reddit" target="_blank"></a></li>' : '';
1215            shareButtons += $object.settings.share.bufferButton ? '<li><a title="Buffer" id="rwd-share-buffer" target="_blank"></a></li>' : '';
1216            shareButtons += $object.settings.share.diggButton ? '<li><a title="Digg" id="rwd-share-digg" target="_blank"></a></li>' : '';
1217            shareButtons += $object.settings.share.vkButton ? '<li><a title="VK" id="rwd-share-vk" target="_blank"></a></li>' : '';
1218            shareButtons += $object.settings.share.yummlyButton ? '<li><a title="Yummly" id="rwd-share-yummly" target="_blank"></a></li>' : '';
1219            shareButtons += '</ul>';
1220        } else {
1221            var $fb = '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 34.5"' +
1222                'style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><style type="text/css">.st0 {fill-rule: evenodd;clip-rule: evenodd;fill: #FFFFFF;</style>' +
1223                '<g id="Shape_3"> <g id="XMLID_84_"> <path id="XMLID_85_" class="st0"' +
1224                'd="M16.8,12.8V11c0-0.9,0.6-1.1,1.1-1.1c0.4,0,2.7,0,2.7,0V6l-3.7,0c-4.1,0-5.1,2.9-5.1,4.8v2.1H9.4v4.6h2.4c0,5.2,0,11.4,0,11.4h4.8c0,0,0-6.3,0-11.4h3.6l0.2-1.8l0.3-2.8H16.8z"></path>' +
1225                '</g> </g></svg>';
1226
1227            var $gp = '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 34.5"' +
1228                'style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><style type="text/css">.st0 {fill: #FFFFFF;}</style>' +
1229                '<g id="Shape_4"> <g id="XMLID_99_"> <path id="XMLID_100_" class="st0"' +
1230                'd="M23.4,16.1v-0.4c0-0.6,0-1.1,0-1.7c0-0.1-0.1-0.3-0.2-0.3c-0.5,0-1,0-1.6,0v2.3h-2.4c0,0.2,0,0.3,0,0.4c0,0.4,0,0.8,0.1,1.3c0.4,0,0.8,0,1.3,0c0.4,0,0.7,0,1.1,0v2.3h1.7v-2.3h2.4v-1.7H23.4z M17.1,15.9c-1.5,0-3,0-4.5,0c-0.4,0-0.9,0-1.3,0c-0.1,0-0.2,0.1-0.2,0.2c0,0.8,0,1.7,0,2.5h3.7c0,0.2
1230-0.1,0.3-0.1,0.4c-0.6,1.6-2.3,2.4-4.1,2.1c-2.3-0.4-3.7-2.4-3.3-4.6c0.1-0.3,0.2-0.6,0.3-0.9c0.8-1.6,2.6-2.6,4.5-2.2c0.7,0.1,1.2,0.5,1.7,0.9c0.7-0.7,1.3-1.3,2-2c0,0-0.1-0.1-0.2-0.1c-1.6-1.3-3.5-1.8-5.5-1.5c-3,0.5-5.1,2.8-5.6,5.4c-0.2,1.1-0.1,2.3,0.4,3.5c1.1,2.8,4.1,4.6,7.2,4.2c1.5-0.2,2.9-0.7,4-1.8c1.6-1.6,2-3.6,1.7-5.7C17.6,15.9,17.4,15.9,17.1,15.9z"></path>' +
1231                '</g> </g></svg>';
1232
1233            var $twitter = '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 34.5"' +
1234                'style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><style type="text/css">.st0 {fill-rule: evenodd;clip-rule: evenodd;fill: #FFFFFF;}</style> <g id="Shape_5"> <g id="XMLID_84_"> <path id="XMLID_85_" class="st0"' +
1235                'd="M27,11.9c-0.8,0.4-1.6,0.6-2.5,0.7c0.9-0.6,1.6-1.5,1.9-2.5c-0.9,0.5-1.8,0.9-2.8,1.1c-0.8-0.9-2-1.4-3.2-1.4c-2.4,0-4.4,2-4.4,4.6c0,0.4,0,0.7,0.1,1c-3.7-0.2-6.9-2-9.1-4.8c-0.4,0.7-0.6,1.5-0.6,2.3c0,1.6,0.8,3,2,3.8c-0.7,0-1.4-0.2-2-0.6v0.1c0,0.6,0.1,1.1,0.3,1.7c0.5,1.4,1.8,2.5,3.2,2.8c-0.4,0.1-0.8,0.2-1.2,0.2c-0.3,0-0.6,0-0.8-0.1c0.6,1.8,2.2,3.1,4.1,3.2c-1.5,1.2-3.4,2-5.5,2c-0.4,0-0.7,0-1.1-0.1c2,1.3,4.3,2,6.8,2c6.9,0,11.2-5,12.3-10.2c0.2-0.9,0.3-1.8,0.3-2.8c0-0.2,0-0.4,0-0.6C25.6,13.6,26.4,12.8,27,11.9z"></path>' +
1236                '</g> </g></svg>';
1237
1238            var $vk = '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 34.5"' +
1239                'style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><style type="text/css">.st0 {fill-rule: evenodd;clip-rule: evenodd;fill: #FFFFFF;}</style> <g id="Shape_12"> <g id="XMLID_86_"> <path id="XMLID_87_" class="st0"' +
1240                'd="M26,23.7c-0.4-0.7-1.1-1.6-2.2-2.7l0,0l0,0l0,0h0c-0.5-0.5-0.8-0.8-0.9-1c-0.2-0.3-0.3-0.7-0.2-1c0.1-0.3,0.4-0.8,1.1-1.6c0.3-0.4,0.6-0.8,0.8-1c1.3-1.9,1.9-3.1,1.8-3.6l-0.1-0.1c0-0.1-0.2-0.1-0.4-0.2c-0.2-0.1-0.4-0.1-0.7,0l-3.4,0c-0.1,0-0.1,0-0.2,0c-0.1,0-0.2,0-0.2,0l-0.1,0l0,0c0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2c-0.4,1-0.8,1.9-1.3,2.7c-0.3,0.5-0.6,0.9-0.8,1.3c-0.2,0.4-0.4,0.6-0.6,0.8c-0.2,0.2-0.3,0.3-0.4,0.4c-0.1,0.1-0.2,0.1-0.3,0.1c-0.1,0-0.1,0-0.2,0c-0.1-0.1-0.2-0.2-0.3-0.3c-0.1-0.1-0.1-0.3-0.1-0.5c0-0.2,0-0.4,0-0.5c0-0.1,0-0.3,0-0.6c0-0.3,0-0.4,0-0.5c0-0.3,0-0.6,0-1c0-0.4,0-0.6,0-0.9s0-0.4,0-0.7c0-0.2,0-0.4,0-0.6c0-0.1-0.1-0.3-0.1-0.4c-0.1-0.1-0.1-0.2-0.2-0.3c-0.1-0.1-0.2-0.1-0.4-0.2c-0.4-0.1-0.9-0.1-1.6-0.2c-1.5,0-2.4,0.1-2.8,0.3c-0.2,0.1-0.3,0.2-0.4,0.4c-0.1,0.2-0.2,0.3-0.1,0.3c0.5,0.1,0.8,0.2,1,0.5l0.1,0.1c0.1,0.1,0.1,0.3,0.2,0.6c0.1,0.3,0.1,0.6,0.1,0.9c0,0.6,0,1.1,0,1.5c0,0.4-0.1,0.7-0.1,1c0,0.2-0.1,0.4-0.2,0.6c-0.1,0.1-0.1,0.2-0.1,0.3c0,0,0,0.1-0.1,0.1c-0.1,0-0.2,0.1-0.3,0.1c-0.1,0-0.2-0.1-0.4-0.2c-0.2-0.1-0.3-0.3-0.5-0.5c-0.2-0.2-0.4-0.5-0.6-0.8c-0.2-0.4-0.4-0.8-0.7-1.3l-0.2-0.4c-0.1-0.2-0.3-0.6-0.5-1c-0.2-0.4-0.4-0.9-0.5-1.3c-0.1-0.2-0.2-0.3-0.3-0.4l-0.1,0c0,0-0.1-0.1-0.2-0.1c-0.1,0-0.2-0.1-0.3-0.1l-3.2,0c-0.3,0-0.5,0.1-0.7,0.2l0,0.1c0,0,0,0.1,0,0.2c0,0.1,0,0.2,0.1,0.3c0.5,1.1,1,2.2,1.5,3.3c0.5,1.1,1,1.9,1.4,2.6C7.2,19.8,7.6,20.4,8,21c0.4,0.6,0.7,0.9,0.8,1.1c0.1,0.2,0.2,0.3,0.3,0.4l0.3,0.3c0.2,0.2,0.5,0.4,0.8,0.7c0.4,0.3,0.8,0.5,1.2,0.8c0.4,0.3,1,0.5,1.5,0.6c0.6,0.2,1.2,0.2,1.7,0.2h1.3c0.3,0,0.5-0.1,0.6-0.3l0-0.1c0,0,0.1-0.1,0.1-0.2c0-0.1,0-0.2,0-0.3c0-0.3,0-0.7,0.1-0.9c0.1-0.3,0.1-0.5,0.2-0.6c0.1-0.1,0.2-0.3,0.3-0.4c0.1-0.1,0.2-0.2,0.2-0.2c0,0,0.1,0,0.1,0c0.2-0.1,0.4,0,0.7,0.2c0.3,0.2,0.5,0.4,0.7,0.7c0.2,0.3,0.5,0.6,0.8,0.9c0.3,0.3,0.6,0.6,0.8,0.8l0.2,0.1c0.2,0.1,0.4,0.2,0.6,0.3c0.2,0.1,0.5,0.1,0.7,0.1l3,0c0.3,0,0.5-0.1,0.7-0.2c0.2-0.1,0.3-0.2,0.3-0.3c0-0.1,0-0.3,0-0.4c0-0.2-0.1-0.3-0.1-0.3C26.1,23.8,26.1,23.8,26,23.7z"></path> </g> </g></svg>';
1241
1242            var $pinterest = '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 34.5"style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><style type="text/css">.st0 {fill-rule: evenodd;clip-rule: evenodd;fill: #FFFFFF;}</style> <g id="Shape_7"> <g id="XMLID_84_"> <path id="XMLID_85_" class="st0"d="M16.6,4.4c-6.9,0-10.4,5-10.4,9.2c0,0.8,0.1,1.5,0.3,2.2c0.4,1.6,1.3,2.8,2.7,3.4c0.3,0.1,0.6,0,0.7-0.4c0.1-0.3,0.2-0.9,0.3-1.2c0.1-0.4,0.1-0.5-0.2-0.8c-0.4-0.4-0.6-0.9-0.8-1.5C9.1,15,9,14.5,9,14c0-3.7,2.8-7.1,7.2-7.1c3.9,0,6.1,2.4,6.1,5.6c0,1-0.1,1.9-0.3,2.7c-0.6,3-2.2,5.1-4.4,5.1c-1.5,0-2.7-1.3-2.3-2.8c0.2-0.9,0.5-1.8,0.8-2.7c0.3-1,0.5-1.8,0.5-2.5c0-1.2-0.6-2.2-2-2.2c-1.6,0-2.8,1.6-2.8,3.8c0,0.4,0,0.8,0.1,1.1c0.1,0.8,0.4,1.2,0.4,1.2s-1.6,6.8-1.9,8c-0.6,2.4-0.1,5.3,0,5.6c0,0.2,0.2,0.2,0.3,0.1c0.1-0.2,2-2.5,2.6-4.8c0.2-0.7,1-4,1-4c0.5,1,2,1.8,3.6,1.8c3.8,0,6.6-2.9,7.5-7c0.2-1,0.3-2,0.3-3C25.8,8.5,22.2,4.4,16.6,4.4z"></path> </g> </g></svg>';
1243
1244            var $linkedin = '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 34.5"style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><style type="text/css">.st0 {fill: #FFFFFF;}</style> <g id="Shape_8"> <g id="XMLID_107_"> <path id="XMLID_108_" class="st0"d="M9.8,12.5l-4.6,0l0,3.5l0,9.8l4.6,0l0-10.5L9.8,12.5z M7.5,10.5c1.3,0,2.3-1,2.3-2.3c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3C5.2,9.5,6.2,10.5,7.5,10.5z M24.8,18.5L24.8,18.5c0-0.7,0-1.3-0.1-1.9c-0.3-2.5-1.4-4.1-4.8-4.1c-2,0-3.3,0.7-3.8,1.8l-0.1,0l0-1.8l-3.6,0l0,2.5l0,10.7l3.8,0l0-6.6c0-1.7,0.3-3.4,2.4-3.4c2.1,0,2.3,2,2.3,3.5l0,6.5l3.9,0L24.8,18.5z"></path> </g> </g></svg>';
1245
1246            var $tumblr = ' <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 30.101 30.102" style="enable-background:new 0 0 30.101 30.102;" xml:space="preserve"><g> <path d="M24.313,28.246c0,0.154-0.041,0.23-0.187,0.301c-2.326,1.117-4.771,1.661-7.354,1.537 c-1.592-0.077-3.122-0.395-4.528-1.182c-0.612-0.344-1.158-0.772-1.653-1.271c-0.884-0.884-1.327-1.962-1.421-3.192c-0.043-0.57-0.073-1.144-0.
1246074-1.715c-0.007-3.347-0.003-6.695-0.003-10.042c0-0.101,0-0.202,0-0.342c-1.113,0-2.19,0-3.287,0c-0.005-0.098-0.013-0.174-0.013-0.251c0-1.277,0.002-2.556-0.004-3.833c0-0.146,0.035-0.222,0.183-0.273 c3.151-1.107,5.005-3.342,5.688-6.583c0.049-0.229,0.094-0.461,0.133-0.692C11.832,0.478,11.863,0.245,11.9,0 c1.414,0,2.822,0,4.26,0c0,2.526,0,5.053,0,7.602c2.393,0,4.756,0,7.141,0c0,1.585,0,3.147,0,4.732c-2.365,0-4.729,0-7.108,0c-0.013,0.079-0.021,0.139-0.021,0.198c0.002,2.837-0.004,5.677,0.012,8.515c0.004,0.617,0.07,1.234,0.139,1.852 c0.082,0.741,0.475,1.295,1.107,1.687c0.938,0.577,1.963,0.698,3.033,0.592c1.297-0.13,2.475-0.601,3.575-1.278  c0.076-0.048,0.156-0.094,0.271-0.162c0,0.092,0,0.151,0,0.211C24.308,25.377,24.306,26.811,24.313,28.246z"fill="#FFFFFF"></path> </g> <g></g> <g></g> <g></g> <g></g> <g></g> <g></g> <g></g> <g></g> <g></g> <g></g> <g></g> <g></g> <g></g> <g></g> <g></g></svg>';
1247
1248            var $reddit = ' <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 34.5" style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><style type="text/css">.st0 {fill-rule: evenodd;clip-rule: evenodd;fill: #FFFFFF;}</style> <g id="Shape_25"> <g id="XMLID_146_"> <path id="XMLID_147_" class="st0"d="M26.7,16.2L26.7,16.2L26.7,16.2L26.7,16.2c-0.1-0.7-0.3-1.4-0.7-1.9c-0.4-0.5-1-0.9-1.6-1.1c0,0,0,0,0,0l0,0h0c-0.3-0.1-0.5-0.1-0.8-0.1c-0.6,0-1.2,0.2-1.7,0.6c-0.1,0.1-0.3,0.2-0.4,0.3c-0.1,0-0.1-0.1-0.1-0.1l0,0h0c-1.7-1.1-3.6-1.6-5.4-1.7c0-0.9,0.1-1.7,0.4-2.4v0c0.2-0.5,0.7-0.8,1.2-0.9h0c0.1,0,0.2,0,0.3,0c0.7,0,1.3,0.3,1.9,0.6c0,0,0,0.1,0,0.1c0,0.8,0.3,1.5,0.7,2c0.5,0.5,1.1,0.9,1.7,0.9c0.1,0,0.2,0,0.3,0c0.7,0,1.3-0.3,1.8-0.8c0.5-0.5,0.9-1.2,0.9-2v0l0,0c0-0.1,0-0.2,0-0.3c0-0.6-0.2-1.2-0.5-1.7s-0.7-0.9-1.2-1.1c0,0,0,0,0,0c0,0,0,0,0,0v0c-0.3-0.2-0.7-0.2-1.1-0.2c-0.3,0-0.7,0.1-1,0.2l0,0l0,0c-0.6,0.2-1,0.7-1.4,1.2c-0.7-0.3-1.5-0.5-2.4-0.5c-0.3,0-0.6,0-0.9,0.1h0l0,0C16,7.5,15.4,8.2,15,9c-0.5,1-0.6,2.1-0.6,3.1c-1.9,0.1-3.9,0.6-5.6,1.7c-0.1,0-0.2,0.1-0.3,0.2c-0.3-0.2-0.6-0.4-0.9-0.6h0l0,0c-0.4-0.2-0.8-0.2-1.1-0.2c-0.1,0-0.2,0-0.2,0h0c-0.8,0-1.5,0.4-2,1c-0.5,0.6-0.9,1.4-0.9,2.3v0c0,0.6,0.2,1.2,0.5,1.7c0.3,0.5,0.7,0.9,1.1,1.1c0,0.3,0,0.5,0,0.8c0,1.1,0.3,2.3,0.8,3.2c1,1.8,2.6,3,4.2,3.8h0v0c1.6,0.7,3.3,1.1,5.1,1.1c1.2,0,2.3-0.2,3.4-0.5l0,0c2.1-0.6,4.2-1.8,5.6-3.8h0v0c0.7-1.1,1.2-2.4,1.2-3.8c0-0.3,0-0.5,0-0.8c0.5-0.3,0.8-0.7,1.1-1.2c0.3-0.5,0.5-1.1,0.5-1.8C26.7,16.3,26.7,16.3,26.7,16.2z M21.4,8.4c0.2-0.2,0.4-0.4,0.7-0.5l0,0h0c0.1,0,0.2-0.1,0.3-0.1c0.3,0,0.7,0.2,0.9,0.4c0.2,0.3,0.4,0.6,0.4,1c0,0,0,0.1,0,0.1v0c0,0.4-0.2,0.7-0.4,1c-0.2,0.3-0.6,0.4-0.9,0.4c0,0,0,0-0.1,0h0c-0.3,0-0.6-0.2-0.9-0.4c-0.2-0.3-0.4-0.6-0.4-1v0c0,0,0-0.1,0-0.1C21.1,9,21.3,8.7,21.4,8.4z M5.4,17.7c-0.1-0.1-0.3-0.3-0.3-0.5c-0.1-0.2-0.2-0.5-0.2-0.8c0,0,0-0.1,0-0.1l0,0v0c0-0.4,0.2-0.8,0.5-1.1c0.3-0.3,0.7-0.5,1-0.5l0,0h0c0,0,0.1,0,0.1,0c0.3,0,0.5,0.1,0.8,0.2C6.5,15.7,5.8,16.6,5.4,17.7z M23.6,20.9L23.6,20.9c-0.1,0.7-0.4,1.3-0.8,1.9c-0.4,0.6-0.8,1.1-1.3,1.5v0c-1.6,1.3-3.5,2-5.5,2.1c-0.3,0-0.7,0-1,0c-1.9,0-3.9-0.5-5.6-1.5c-0.1-0.1-0.3-0.2-0.4-0.3c-0.6-0.4-1.1-0.9-1.6-1.5c-0.5-0.6-0.8-1.3-1-2l0,0c-0.1-0.3-0.1-0.7-0.1-1c0-0.9,0.3-1.9,0.8-2.7v0c1-1.5,2.5-2.5,4.1-3.1c1.2-0.4,2.5-0.6,3.8-0.6c0.9,0,1.9,0.1,2.8,0.4c0.3,0.1,0.6,0.2,0.9,0.3l0,0c1.6,0.6,3.1,1.6,4.1,3.1c0.5,0.8,0.8,1.7,0.8,2.7C23.7,20.4,23.6,20.7,23.6,20.9z M25,17.2c-0.1,0.2-0.2,0.4-0.4,0.5c-0.4-1.1-1.1-2-1.9-2.7c0.2-0.1,0.5-0.2,0.8-0.2c0.3,0,0.6,0.1,0.9,0.2c0.3,0.2,0.5,0.4,0.6,0.7l0,0l0,0c0.1,0.2,0.1,0.4,0.1,0.7C25.2,16.7,25.1,16.9,25,17.2z M10.9,20.3C10.9,20.3,10.9,20.3,10.9,20.3c0.2,0.1,0.3,0.1,0.5,0.1c0.4,0,0.7-0.2,1-0.5c0.3-0.3,0.5-0.7,0.5-1.1v0c0,0,0,0,0-0.1c0-0.5-0.2-0.9-0.5-1.1c-0.3-0.3-0.6-0.5-1-0.5c-0.1,0-0.2,0-0.3,0c0,0,0,0,0,0h0c-0.5,0.1-0.9,0.5-1.1,1.1c0,0,0,0,0,0c0,0.2-0.1,0.3-0.1,0.5c0,0.4,0.1,0.7,0.3,1C10.3,20,10.6,20.2,10.9,20.3C10.9,20.3,10.9,20.3,10.9,20.3z M19.1,22.4c-0.1-0.1-0.3-0.1-0.4-0.1c-0.1,0-0.2,0-0.4,0.1c-1,0.7-2.2,1.1-3.5,1.1c-0.9,0-1.8-0.2-2.6-0.7l0,0l0,0c-0.1-0.1-0.3-0.2-0.4-0.3c-0.1-0.1-0.2-0.1-0.2-0.2c-0.1,0-0.2-0.1-0.3-0.1c-0.1,0-0.2,0-0.3,0.1c0,0,0,0,0,0c-0.1,0.1-0.3,0.2-0.3,0.3c-0.1,0.1-0.1,0.3-0.
12481,0.5c0,0.1,0,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.3,0.3c1.2,0.9,2.5,1.3,3.9,1.3c1.2,0,2.5-0.3,3.6-0.9l0,0l0,0c0.1-0.1,0.3-0.2,0.5-0.3c0.1-0.1,0.2-0.1,0.3-0.2c0.1-0.1,0.1-0.2,0.2-0.4c0-0.1,0-0.1,0-0.2c0-0.1,0-0.2-0.1-0.3C19.3,22.7,19.2,22.5,19.1,22.4z M20,18.2C20,18.2,20,18.2,20,18.2C20,18.2,20,18.2,20,18.2c-0.1-0.4-0.3-0.6-0.6-0.8c-0.3-0.2-0.6-0.3-0.9-0.3c-0.2,0-0.3,0-0.5,0.1c0,0,0,0,0,0c0,0,0,0,0,0c-0.3,0.1-0.5,0.3-0.7,0.6c-0.2,0.3-0.3,0.6-0.3,0.9c0,0.1,0,0.2,0,0.3h0c0,0,0,0,0,0v0c0.1,0.4,0.3,0.7,0.5,1c0.3,0.2,0.6,0.4,0.9,0.4c0.1,0,0.3,0,0.4-0.1h0c0,0,0,0,0,0h0c0.3-0.1,0.6-0.3,0.7-0.6c0.2-0.3,0.3-0.6,0.3-1C20.1,18.6,20.1,18.4,20,18.2L20,18.2z"></path> </g> </g></svg>';
1249
1250            var $digg = '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 34.5" style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><style type="text/css">.st0 {fill-rule: evenodd;clip-rule: evenodd;fill: #FFFFFF;}</style> <g id="Shape_11"> <g id="XMLID_158_"> <path id="XMLID_159_" class="st0" d="M20.2,14.4v8.1h4v1.8h-4v2.3h6V14.4H20.2z M24.2,20.5h-1.7v-4h1.7V20.5z M13.8,22.5h3.7v1.8h-3.7v2.3h6V14.4h-6V22.5z M16,16.4h1.5v4H16V16.4z M7.8,14.4h-4v8.1H10V10.4H7.8V14.4z M7.8,20.5H6v-4h1.7V20.5z M10.5,22.5h2.2v-8.1h-2.2V22.5z M10.5,12.7h2.2v-2.3h-2.2V12.7z"></path> </g> </g></svg>';
1251
1252            var $buffer = '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 34.5" style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><style type="text/css">.st0 {fill: #FFFFFF;}</style> <g id="Shape_13"> <g id="XMLID_104_"> <path id="XMLID_105_" class="st0"d="M4.5,13l10.3,5.2c0.1,0.1,0.3,0.1,0.4,0L25.5,13c0.3-0.2,0.3-0.7,0-0.8L15.2,7C15.1,7,14.9,7,14.8,7L4.5,12.2C4.1,12.3,4.1,12.8,4.5,13z M25.5,18.4l-2.2-1.1l-6.9,3.5C16,21,15.5,21.1,15,21.1c-0.5,0-1-0.1-1.4-0.3l-6.9-3.5l-2.2,1.1c-0.3,0.2-0.3,0.7,0,0.8l10.3,5.2c0.1,0.1,0.3,0.1,0.4,0l10.3-5.2C25.8,19.1,25.8,18.6,25.5,18.4z M25.5,24.7l-2.2-1.1l-6.9,3.5c-0.4,0.2-0.9,0.3-1.4,0.3c-0.5,0-1-0.1-1.4-0.3l-6.9-3.5l-2.2,1.1c-0.3,0.2-0.3,0.7,0,0.8l10.3,5.2c0.1,0.1,0.3,0.1,0.4,0l10.3-5.2C25.8,25.3,25.8,24.9,25.5,24.7z"></path> </g> </g></svg>';
1253
1254            var $yummly = ' <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 30 34.5" style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><image style="overflow:visible;" width="36" height="14" id="Layer_3_copy_xA0_Image" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAPCAYAAACInr1QAAAACXBIWXMAAA4mAAAOJgGi7yX8AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABWxJREFUeNrMVWtsVEUUnpl7797t3e3utt0u22wJtVisjYCIhhITQiKJMUYMUWIiqRET0JjoP
125401QQkyIf0yIxhh/ScIvfEREUYogCAUqfWHf25YtfWxLu+1uu6/7fsx47jZpICb8QRJvsrtzZ86eOd/5zvkOQv/nx8rMXmWUMmpohj7c/oG7p3S3Buxsqsu8k/hZG7wa+q/uUrrObmS2xcz5iWP3syPuF2NUsTOz32GPKHDhWHPpoCxQhUUpijBRqanb93Oi9l7kVi/uPieurjt/W12rPed59xd7fRHE8Ygq+bn7+SwZmxP9r2DCN/HVta9SOTtWCixYvR5xQoQWlzr40Jq3jakhCXu8x5hlvo8cC9kL06c8DU8dYqZeJJ6yWnMuMYscR4eLG5x8ZphRpwLOonYh04ts6zHIkqj0nDsMPurAR5aqxdtGcuQTphYS1FA7+HDty0yXFWYZp72NzYulwPzbXlK14b+eAccups5SyNRpIIIoMkObEKL1R5HgCVizY18Iax8/yGwzR9VCP18V288cu4ABFUeIBIGk4OI1yLb3MMdM4VAkykztBSRiFfbDVjrZCkxsYNSSkW3khVjDYTs1eZxhnOLX1L1GC5l58HsZbl8sUSlfP1XOV9XsoJo86bgIS/zSRyA4DTFHR7wg0MJypz13m0AM5ZDVHtiLQCayxq2eA3Zm5geqFOLGWNcBp7DUbecXfzEnB94F9AvWwtSX5tTQxwBARpQViRR8glnWMiYEfHEclXN9yDK8UE8icuxpN2urNQYGUa4ispMZ6qi0ZVcSAg3wFdHtEP0IInwZ5oQKJ5tqxaLXjwjxMDk3SKRAI7X0JSe3cB3znhqqFcaolo9DZmpoYbGd6uoy5uF/y/MXEMYCRphHpj5H/IFGBrZY8IYBuOrk05cQHEImBMbYDABUV2sMiVIYe6Qo9uPNVnrmW0h3E5H8jdb8xHEEFCCOK+NC1c9ylZEdgJRzdGXSUxXbDbWyBO8CKa982k5Pn8Siby3xSjGqKdNceeVWQOyBrKW4YPgA0L8EoHgCVNuqPIilQAzOBT5a9zrxhTZBrclUl8tIsOqQkRz+phSYm3KgsI8LhJ8kQk2YasWE6xQKdJzmM4OAzOKj9e8ghhzAxiHTUIkvsAnO+xAv+rAgVkGQC5DFWjf/pYBD0V1g775q2F/RxGyjANkMAQM+quRmXZ9uJj21jR+5zAFbM3xlbB8iXDXs/7rSwhhPAVUvWtPD9cglP1i90+MLbSa+4KN2Ovm9PtqxB2rLAtSIk0IbAEQ/1NZBZFl50LoZfaxrH82l+5ipytBALfZyaojpSp4q2T+hHtPm7d4PgS0ObG8at7rfAPqvwqVpbeBKMycFtnCRur2cP9gMNZuDBjnqLM/F0V36IxkTA4epqd2htlVk7gPtT01jyc4uXDQSf7fI7T9V6oPXSnWp3ryA1c5WXFoPtBG5/XRprfVfWWmoaz9ibWjFVun5Hbv2pfPBNlL44wQGjWuyUhNfgajPQmModm6xzZwbf86YHCgDXVwJSr5xhtdvdR8BA91Ixj+DOjsFulPURjta9MTNNx21OArvMnTXESPRyz2o+gPAbRBQhqr5OIC+THUlBXceMcZ7I/cov1i/cZ1Qs/4taPUboCsnoWPWAh0dUF/nvQ1bTxijN7YDkhYzGT8uNmxxHiQofbTTA/r1PNRbFdzXATJhgWSMMF1tg+mTvcfYTI6sszJ3uih1KLVMFT4FSOfehzGXlc4zWOu/tBvGXIbapmIXs31A4X4t3h7810iC0TDLhyJfg8h+6s4xc2rwc2iGMw8jMN+23UzpPnsJxuB7yCvVwZQ4D7owDppXvNvuHwEGAPkITPojTuUzAAAAAElFTkSuQmCC" transform="matrix(0.7857 0 0 0.7857 0.8557 11.75)"></image></svg>';
1255
1256            shareButtons = '<ul class="rwd-share-buttons">';
1257            shareButtons += $object.settings.share.facebookButton ? '<li><a title="Facebook" id="rwd-share-facebook" class="view7" target="_blank">' + $fb + '</a></li>' : '';
1258            shareButtons += $object.settings.share.googleplusButton ? '<li><a title="Google Plus" id="rwd-share-googleplus" class="view7" target="_blank">' + $gp + '</a></li>' : '';
1259            shareButtons += $object.settings.share.twitterButton ? '<li><a title="Twitter" id="rwd-share-twitter" class="view7" target="_blank">' + $twitter + '</a></li>' : '';
1260            shareButtons += $object.settings.share.vkButton ? '<li><a title="VK" id="rwd-share-vk" class="view7" target="_blank">' + $vk + '</a></li>' : '';
1261            shareButtons += $object.settings.share.pinterestButton ? '<li><a title="Pinterest" id="rwd-share-pinterest" class="view7" target="_blank">' + $pinterest + '</a></li>' : '';
1262            shareButtons += $object.settings.share.linkedinButton ? '<li><a title="Linkedin" id="rwd-share-linkedin" class="view7" target="_blank">' + $linkedin + '</a></li>' : '';
1263            shareButtons += $object.settings.share.tumblrButton ? '<li><a title="Tumblr" id="rwd-share-tumblr" class="view7" target="_blank">' + $tumblr + '</a></li>' : '';
1264            shareButtons += $object.settings.share.redditButton ? '<li><a title="Reddit" id="rwd-share-reddit" class="view7" target="_blank">' + $reddit + '</a></li>' : '';
1265            shareButtons += $object.settings.share.diggButton ? '<li><a title="Digg" id="rwd-share-digg" class="view7" target="_blank">' + $digg + '</a></li>' : '';
1266            shareButtons += $object.settings.share.bufferButton ? '<li><a title="Buffer" id="rwd-share-buffer" class="view7" target="_blank">' + $buffer + '</a></li>' : '';
1267            shareButtons += $object.settings.share.yummlyButton ? '<li><a title="Yummly" id="rwd-share-yummly" class="view7" target="_blank">' + $yummly + '</a></li>' : '';
1268            shareButtons += '</ul>';
1269        }
1270
1271        switch(this.settings.lightboxView){
1272            case 'view5':
1273            case 'view6':
1274                $('.contInner').append(shareButtons);
1275                break;
1276            case 'view7':
1277                var $view7_share = '', $share = '', socialIcons_ = '', $m_share_event = '';
1278
1279                $m_share_event = "if(!this.classList.contains('share_open')){this.classList.add('share_open');document.querySelector('.rwd-share-buttons').style.visibility = 'visible';document.querySelector('.rwd-share-buttons').style.opacity = '1';document.querySelector('.rwd-share-buttons').style.display = 'block';if(document.querySelector('.rwd-current .view7_inner').classList.contains('is_open')){document.querySelector('.rwd-current .view7_inner').classList.remove('is_open');document.querySelector('.rwd-current .view7_inner').style.height = 0;document.querySelector('.rwd-close-bar').style.zIndex = 999999999;document.querySelector('.rwd-next').style.zIndex = 999999999;document.querySelector('.rwd-prev').style.zIndex = 999999999;}} else {this.classList.remove('share_open');document.querySelector('.rwd-share-buttons').style.visibility = 'hidden';document.querySelector('.rwd-share-buttons').style.opacity = '0';}";
1280
1281                $share ='<svg onclick="' + $m_share_event + '" class="rwd-share" version="1.1" id="Layer_1"' +
1282                    'xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"' +
1283                    'viewBox="0 0 30 34.5" style="enable-background:new 0 0 30 34.5;" xml:space="preserve">' +
1284                    '<style type="text/css">.st0 {fill-rule: evenodd;clip-rule: evenodd;fill: #999;}</style><g id="Shape_2">' +
1285                    '<g id="XMLID_84_"> <path id="XMLID_85_" class="st0"' +
1286                    'd="M22.1,20.3c-1.3,0-2.5,0.6-3.2,1.6l-7-3.6C12,18,12,17.6,12,17.2c0-0.4-0.1-0.8-0.2-1.2l7-3.6c0.8,1,1.9,1.7,3.3,1.7c2.3,0,4.1-1.9,4.1-4.2c0-2.3-1.8-4.2-4.1-4.2C19.8,5.9,18,7.7,18,10c0,0.4,0.1,0.7,0.2,1.1l-7,3.6c-0.8-1-1.9-1.6-3.2-1.6c-2.3,0-4.1,1.9-4.1,4.2c0,2.3,1.8,4.2,4.1,4.2c1.4,0,2.5-0.7,3.3-1.7l7,3.6c-0.1,0.4-0.2,0.8-0.2,1.2c0,2.3,1.8,4.2,4.1,4.2c2.3,0,4.1-1.9,4.1-4.2C26.2,22.2,24.4,20.3,22.1,20.3z"></path>' +
1287                    '</g> </g></svg>';
1288
1289                socialIcons_ = '<div class="share_open_close rwd-icon">' + $share + '</div>';
1290
1291                var $share_event = '';
1292
1293                if($(window).width() > 768){
1294                    $share_event = 'onmouseover="document.querySelector(\'.share_open_close\').style.background = \'rgba(0,0,0,.85)\'; document.querySelector(\'.rwd-share-buttons\').style.visibility = \'visible\'; document.querySelector(\'.rwd-share-buttons\').style.opacity = \'1\'; document.querySelector(\'.rwd-share-buttons\').style.transition = \'visibility 0s, opacity 0.5s linear\'" '+
1295                        'onmouseout="document.querySelector(\'.share_open_close\').style.background = \'\'; document.querySelector(\'.rwd-share-buttons\').style.visibility = \'hidden\'; document.querySelector(\'.rwd-share-buttons\').style.opacity = \'0\'; document.querySelector(\'.rwd-share-buttons\').style.transition = \'visibility 0.5s, opacity 0.5s linear\'"';
1296                }
1297
1298                $view7_share = '<div class="view7_share"' + $share_event + '>' + socialIcons_ + shareButtons + '</div>';
1299
1300                $('.rwd-container').append($view7_share);
1301                break;
1302            default:
1303                $('.' + this.settings.classPrefix + 'socialIcons').append(shareButtons);
1304                break;
1305        }
1306
1307        setTimeout(function () {
1308            $('#rwd-share-facebook').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + (encodeURIComponent(window.location.href)));
1309            $('#rwd-share-twitter').attr('href', 'https://twitter.com/intent/tweet?text=&url=' + (encodeURIComponent(window.location.href)));
1310            $('#rwd-share-googleplus').attr('href', 'https://plus.google.com/share?url=' + (encodeURIComponent(window.location.href)));
1311            $('#rwd-share-pinterest').attr('href', 'http://www.pinterest.com/pin/create/button/?url=' + (encodeURIComponent(window.location.href)));
1312            $('#rwd-share-linkedin').attr('href', 'http://www.linkedin.com/shareArticle?mini=true&amp;url=' + (encodeURIComponent(window.location.href)));
1313            $('#rwd-share-tumblr').attr('href', 'http://www.tumblr.com/share/link?url=' + (encodeURIComponent(window.location.href)));
1314            $('#rwd-share-reddit').attr('href', 'http://reddit.com/submit?url=' + (encodeURIComponent(window.location.href)));
1315            $('#rwd-share-buffer').attr('href', 'https://bufferapp.com/add?url=' + (encodeURIComponent(window.location.href)));
1316            $('#rwd-share-digg').attr('href', 'http://www.digg.com/submit?url=' + (encodeURIComponent(window.location.href)));
1317            $('#rwd-share-vk').attr('href', 'http://vkontakte.ru/share.php?url=' + (encodeURIComponent(window.location.href)));
1318            $('#rwd-share-yummly').attr('href', 'http://www.yummly.com/urb/ver
1318ify?url=' + (encodeURIComponent(window.location.href)));
1319        }, 200);
1320    };
1321
1322    Lightbox.prototype.changeHash = function (index) {
1323        var $object = this;
1324
1325        (($object.settings.socialSharing) && (window.location.hash = '/lightbox&slide=' + (index + 1)));
1326    };
1327
1328    Lightbox.prototype.loadContent = function (index, rec, delay) {
1329
1330        var $object, src, isVideo;
1331
1332        $object = this;
1333
1334        function isImg() {
1335            src = $object.$items.eq(index).attr('href');
1336            return src.match(/\.(jpg|png|gif)\b/);
1337        }
1338
1339        if ($object.settings.watermark) {
1340            if (isImg()) {
1341                src = $object.$items.eq(index).find('img').attr('data-src');
1342            }
1343        } else {
1344            src = $object.$items.eq(index).attr('href');
1345        }
1346
1347        var $view7_inner = '';
1348
1349        if(this.settings.lightboxView === 'view7'){
1350            if(this.settings.showTitle){
1351                var $t = '<div class="rwd-view7-title"></div>';
1352            }
1353            if(this.settings.showDesc){
1354                var $d = '<div class="rwd-view7-desc"></div>';
1355            }
1356
1357            $view7_inner = '<div class="view7_inner is_close">' + $t + $d + '</div>';
1358        }
1359
1360        isVideo = $object.isVideo(src, index);
1361        if (!$object.$item.eq(index).hasClass($object.settings.classPrefix + 'loaded')) {
1362            if (isVideo) {
1363                $object.$item.eq(index).addClass('isVideo');
1364                $object.$item.eq(index).prepend('<div class="' + this.settings.classPrefix + 'video-cont "><div class="' + this.settings.classPrefix + 'video"></div></div>' + $view7_inner);
1365                $object.$element.trigger('hasVideo.rwd-container', [index, src]);
1366            } else {
1367                $object.$item.eq(index).addClass('isImg');
1368                $object.$item.eq(index).prepend('<div class="' + this.settings.classPrefix + 'img-wrap">' +
1369                    '<img class="' + this.settings.classPrefix + 'object ' + $object.settings.classPrefix + 'image watermark lightbox_zoom" src="' + src + '" data-zoom-image="' + src + '" />' +
1370                    $view7_inner +
1371                    '</div>');
1372            }
1373
1374            $object.$element.trigger('onAferAppendSlide.rwd-container', [index]);
1375
1376            $object.$item.eq(index).addClass($object.settings.classPrefix + 'loaded');
1377        }
1378
1379        $object.$item.eq(index).find('.' + $object.settings.classPrefix + 'object').on('load.rwd-container error.rwd-container', function () {
1380
1381            var speed = 0;
1382            if (delay) {
1383                speed = delay;
1384            }
1385
1386            setTimeout(function () {
1387                $object.$item.eq(index).addClass($object.settings.classPrefix + 'complete');
1388            }, speed);
1389
1390        });
1391
1392        if (rec === true) {
1393
1394            if (!$object.$item.eq(index).hasClass($object.settings.classPrefix + 'complete')) {
1395                $object.$item.eq(index).find('.' + $object.settings.classPrefix + 'object').on('load.rwd-container error.rwd-container', function () {
1396                    $object.preload(index);
1397                });
1398            } else {
1399                $object.preload(index);
1400            }
1401        }
1402
1403        if(this.settings.lightboxView !== 'view7' && hugeit_resp_lightbox_obj.hugeit_lightbox_imageframe !== 'frame_0'){
1404            $('.rwd-image').css({
1405                borderColor: '#f4be52',
1406                borderStyle: 'inset',
1407                borderWidth: '60px'
1408            });
1409            if(hugeit_resp_lightbox_obj.hugeit_lightbox_imageframe !== 'frame_8'){
1410                $('.rwd-image').css({
1411                    borderImage: 'url("' + hugeit_resp_lightbox_plugins_url + hugeit_resp_lightbox_obj.hugeit_lightbox_imageframe + '.png") 90 95 95 90 stretch stretch'
1412                });
1413            } else {
1414                $('.rwd-image').css({
1415                    borderImage: 'url("' + hugeit_resp_lightbox_plugins_url + hugeit_resp_lightbox_obj.hugeit_lightbox_imageframe + '.png") 90 123 85 129 stretch stretch'
1416                });
1417            }
1418        }
1419
1420    };
1421
1422    Lightbox.prototype.slide = function (index, fromSlide, fromThumb) {
1423        var $object, prevIndex;
1424
1425        $object = this;
1426        prevIndex = this.$cont.find('.' + $object.settings.classPrefix + 'current').index();
1427
1428        if(this.settings.lightboxView === 'view7'){
1429            this.innerOpenClose();
1430
1431            setTimeout(function(){
1432                var nw, nh;
1433
1434                if($('.rwd-current').hasClass('isImg')){
1435                    nw = document.querySelector('.rwd-current img').naturalWi
1435dth;
1436                    nh = document.querySelector('.rwd-current img').naturalHeight;
1437                } else if($('.rwd-current').hasClass('isVideo')){
1438                    nw = $('.rwd-current iframe').width();
1439                    nh = $('.rwd-current iframe').height();
1440                }
1441
1442                $('.img_size').html(nw + 'px &times; ' + nh + 'px');
1443            }, 200);
1444        }
1445
1446        var length = this.$item.length,
1447            time = 0,
1448            next = false,
1449            prev = false;
1450
1451        if (this.settings.download) {
1452            var src;
1453            if (!this.settings.watermark) {
1454                src = $object.$items.eq(index).attr('data-download-url') !== 'false' && ($object.$items.eq(index).attr('data-download-url') || $object.$items.eq(index).attr('href'));
1455            }
1456            else {
1457                src = $object.$items.eq(index).find('img').attr('data-src');
1458            }
1459            if (src) {
1460                $('#' + $object.settings.classPrefix + 'download').attr('href', src);
1461                $object.$cont.removeClass($object.settings.classPrefix + 'hide-download');
1462                $object.$cont.removeClass($object.settings.classPrefix + 'hide-actual-size');
1463                $object.$cont.removeClass($object.settings.classPrefix + 'hide-fullwidth');
1464                $object.$cont.removeClass($object.settings.classPrefix + 'hide-zoom-in');
1465                $object.$cont.removeClass($object.settings.classPrefix + 'hide-zoom-out');
1466            } else {
1467                $object.$cont.addClass($object.settings.classPrefix + 'hide-download');
1468                $object.$cont.addClass($object.settings.classPrefix + 'hide-actual-size');
1469                $object.$cont.addClass($object.settings.classPrefix + 'hide-fullwidth');
1470                $object.$cont.addClass($object.settings.classPrefix + 'hide-zoom-in');
1471                $object.$cont.addClass($object.settings.classPrefix + 'hide-zoom-out');
1472            }
1473        } else {
1474            if(this.$cont.find('.' + $object.settings.classPrefix + 'item').eq(index).find('iframe').length){
1475                $object.$cont.addClass($object.settings.classPrefix + 'hide-download');
1476                $object.$cont.addClass($object.settings.classPrefix + 'hide-actual-size');
1477                $object.$cont.addClass($object.settings.classPrefix + 'hide-fullwidth');
1478                $object.$cont.addClass($object.settings.classPrefix + 'hide-zoom-in');
1479                $object.$cont.addClass($object.settings.classPrefix + 'hide-zoom-out');
1480            } else {
1481                $object.$cont.removeClass($object.settings.classPrefix + 'hide-download');
1482                $object.$cont.removeClass($object.settings.classPrefix + 'hide-actual-size');
1483                $object.$cont.removeClass($object.settings.classPrefix + 'hide-fullwidth');
1484                $object.$cont.removeClass($object.settings.classPrefix + 'hide-zoom-in');
1485                $object.$cont.removeClass($object.settings.classPrefix + 'hide-zoom-out');
1486            }
1487        }
1488
1489        this.$element.trigger('onBeforeSlide.rwd-container', [prevIndex, index, fromSlide, fromThumb]);
1490
1491        setTimeout(function () {
1492            $object.setTitle(index);
1493        }, time);
1494
1495        if ($object.settings.lightboxView === 'view5' || $object.settings.lightboxView === 'view6' || $object.settings.lightboxView === 'view7') {
1496            setTimeout(function () {
1497                $object.setDescription(index);
1498            }, time);
1499        }
1500
1501        this.arrowDisable(index);
1502
1503
1504        $object.$cont.addClass($object.settings.classPrefix + 'no-trans');
1505
1506        this.$item.removeClass($object.settings.classPrefix + 'prev-slide ' + $object.settings.classPrefix + 'next-slide');
1507        if (!fromSlide) {
1508
1509            if (index < prevIndex) {
1510                prev = true;
1511                if ((index === 0) && (prevIndex === length - 1) && !fromThumb) {
1512                    prev = false;
1513                    next = true;
1514                }
1515            } else if (index > prevIndex) {
1516                next = true;
1517                if ((index === length - 1) && (prevIndex === 0) && !fromThumb) {
1518                    prev = true;
1519                    next = false;
1520                }
1521            }
1522
1523            if (prev) {
1524
1525                this.$item.eq(index).addClass($object.settings.classPrefix + 'prev-slide');
1526                this.$item.eq(prevIndex).addClass($object.settings.classPrefix + 'next-slide');
1527            } else if (next) {
1528
1529                this.$item.eq(index).addClass($object.settings.classPrefix + 'next-slide');
1530                this.$item.eq(prevIndex).addClass($object.settings.classPrefix + 'prev-slide');
1531            }
1532
1533            setTimeout(function () {
1534                $object.$item.removeClass($object.settings.classPrefix + 'current');
1535
1536                $object.$item.eq(index).addClass($object.settings.classPrefix + 'current');
1537
1538                $object.$cont.removeClass($object.settings.classPrefix + 'no-trans');
1539            }, 50);
1540        } else {
1541
1542            var slidePrev = index - 1;
1543            var slideNext = index + 1;
1544
1545            if ((index === 0) && (prevIndex === length - 1)) {
1546
1547                slideNext = 0;
1548                slidePrev = length - 1;
1549            } else if ((index === length - 1) && (prevIndex === 0)) {
1550
1551                slideNext = 0;
1552                slidePrev = length - 1;
1553            }
1554
1555            this.$item.removeClass($object.settings.classPrefix + 'prev-slide ' + $object.settings.classPrefix + 'current ' + $object.settings.classPrefix + 'next-slide');
1556            $object.$item.eq(slidePrev).addClass($object.settings.classPrefix + 'prev-slide');
1557            $object.$item.eq(slideNext).addClass($object.settings.classPrefix + 'next-slide');
1558            $object.$item.eq(index).addClass($object.settings.classPrefix + 'current');
1559        }
1560
1561        $object.loadContent(index, true, $object.settings.overlayDuration);
1562
1563        $object.$element.trigger('onAfterSlide.rwd-container', [prevIndex, index, fromSlide, fromThumb]);
1564
1565        if (this.settings.showCounter) {
1566            $('#' + $object.settings.classPrefix + 'counter-current').text(index + 1);
1567        }
1568
1569        if (this.settings.socialSharing) {
1570            $object.changeHash(index);
1571        }
1572
1573        var $top, $left, $wWidth, $wHeight, $imgWidth, $imgHeight, $wmWidth, $wmHeight, $pos, $item;
1574        $item = $('.rwd-item.rwd-current');
1575        $pos = +hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_margin;
1576        $wWidth = +hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_containerWidth;
1577        $wHeight = +hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_textFontSize;
1578        $imgWidth = $object.$item.eq(index).find('img').width();
1579        $imgHeight = $object.$item.eq(index).find('img').height();
1580        $wmWidth = $item.width();
1581        $wmHeight = $item.height();
1582
1583        switch ('pos' + hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_position_new) {
1584            case 'pos1':
1585                $top = ($wmHeight - $imgHeight) / 2 + $pos;
1586                $left = ($wmWidth - $imgWidth) / 2 + $pos;
1587                break;
1588            case 'pos2':
1589                $top = ($wmHeight - $imgHeight) / 2 + $pos;
1590                $left = ($wmWidth - $wWidth) / 2;
1591                break;
1592            case 'pos3':
1593                $top = ($wmHeight - $imgHeight) / 2 + $pos;
1594                $left = ($wmWidth + $imgWidth) / 2 - $wWidth - $pos;
1595                break;
1596            case 'pos4':
1597                $top = ($wmHeight - $wHeight) / 2;
1598                $left = ($wmWidth - $imgWidth) / 2 + $pos;
1599                break;
1600            case 'pos5':
1601                $top = ($wmHeight - $wHeight) / 2;
1602                $left = ($wmWidth - $wWidth) / 2;
1603                break;
1604            case 'pos6':
1605                $top = ($wmHeight - $wHeight) / 2;
1606                $left = ($wmWidth + $imgWidth) / 2 - $wWidth - $pos;
1607                break;
1608            case 'pos7':
1609                $top = ($wmHeight + $imgHeight) / 2 - $wHeight - $pos;
1610                $left = ($wmWidth - $imgWidth) / 2 + $pos;
1611                break;
1612            case 'pos8':
1613                $top = ($wmHeight + $imgHeight) / 2 - $wHeight - $pos;
1614                $left = ($wmWidth - $wWidth) / 2;
1615                break;
1616            case 'pos9':
1617                $top = ($wmHeight + $imgHeight) / 2 - $wHeight - $pos;
1618                $left = ($wmWidth + $imgWidth) / 2 - $wWidth - $pos;
1619                break;
1620            default:
1621                $top = ($wmHeight - $wHeight) / 2;
1622                $left = ($wmWidth - $wWidth) / 2;
1623        }
1624
1625        $('.w_url').css({
1626            position: 'absolute',
1627            width: $wWidth + 'px',
1628            height: $wHeight + 'px',
1629            top: $top + 'px',
1630            left: $left + 'px'
1631        });
1632
1633        $object.calculateDimensions(index);
1634
1635        $('.rwd-container .rwd-thumb-item img').css({
1636            opacity: 1 - 10 / 100
1637        });
1638
1639        $('.rwd-container .rwd-thumb-item.active img').css({
1640            opacity: 1
1641        });
1642
1643        if(this.settings.lightboxView === 'view7'){
1644            this.$element.on('onBeforeSlide.rwd-container', function() {
1645                $('.view7_share, .rwd-close-bar, .rwd-toolbar').css({
1646                    visibility: 'hidden',
1647                    opacity: '0',
1648                    transition: 'visibility 0s, opacity 0.5s linear'
1649                });
1650            });
1651
1652            this.$element.on('onAfterSlide.rwd-container', function() {
1653                setTimeout(function(){
1654                    $('.view7_share, .rwd-close-bar, .rwd-toolbar').css({
1655                        visibility: 'visible',
1656                        opacity: '1'
1657                    });
1658                }, 450);
1659            });
1660        }
1661
1662        $(window).on('resize.rwd-container orientationchange.rwd-container', function () {
1663            var $t = ($object.settings.lightboxView !== 'view7') ? 100 : 0;
1664            setTimeout(function () {
1665                $object.calculateDimensions(index);
1666            }, $t);
1667        });
1668    };
1669
1670    Lightbox.prototype.goToNextSlide = function (fromSlide) {
1671        var $object = this,
1672            $cont = $('.rwd-cont'),
1673            $imageObject, k;
1674        if (($object.index + 1) < $object.$item.length) {
1675            $object.index++;
1676            $object.slide($object.index, fromSlide, false);
1677        } else {
1678            if ($object.settings.loop === 'true') {
1679                $object.index = 0;
1680                $object.slide($object.index, fromSlide, false);
1681            }
1682        }
1683
1684        if ($object.settings.fullwidth && $cont.hasClass('rwd-fullwidth-on')) {
1685            $imageObject = $cont.find('.rwd-image').eq($object.index);
1686
1687            k = $imageObject.width() / $imageObject.height();
1688            if ($imageObject.width() > $imageObject.height() && k > 2) {
1689                $imageObject.css({
1690                    'min-width': '100%'
1691                });
1692            } else {
1693                $imageObject.css({
1694                    'min-height': '100%'
1695                });
1696            }
1697        }
1698    };
1699
1700    Lightbox.prototype.goToPrevSlide = function (fromSlide) {
1701        var $object = this,
1702            $cont = $('.rwd-cont'),
1703            $imageObject, k;
1704
1705        if ($object.index > 0) {
1706            $object.index--;
1707            $object.slide($object.index, fromSlide, false);
1708        } else {
1709            if ($object.settings.loop === 'true') {
1710                $object.index = $object.$items.length - 1;
1711                $object.slide($object.index, fromSlide, false);
1712            }
1713        }
1714
1715        if ($object.settings.fullwidth && $cont.hasClass('rwd-fullwidth-on')) {
1716            $imageObject = $cont.find('.rwd-image').eq($object.index);
1717
1718            k = $imageObject.width() / $imageObject.height();
1719            if ($imageObject.width() > $imageObject.height() && k > 2) {
1720                $imageObject.css({
1721                    'min-width': '100%'
1722                });
1723            } else {
1724                $imageObject.css({
1725                    'min-height': '100%'
1726                });
1727            }
1728        }
1729    };
1730
1731    Lightbox.prototype.slideShow = function () {
1732        var $object = this, $toolbar, $play_bg, $pause_bg;
1733
1734        $play_bg = '<svg class="play_bg" width="20px" height="20px" fill="#999" viewBox="-192 193.9 314.1 314.1">' +
1735            '<g><g id="_x33_56._Play"><g><path d="M101,272.5C57.6,197.4-38.4,171.6-113.5,215c-75.1,43.4-100.8,139.4-57.5,214.5c43.4,75.1,139.4,100.8,214.5,57.5C118.6,443.6,144.4,347.6,101,272.5z M27.8,459.7c-60.1,34.7-136.9,14.1-171.6-46c-34.7-60.1-14.1-136.9,46-171.6c60.1-34.7,136.9-14.1,171.6,46C108.5,348.2,87.9,425,27.8,459.7z M21.6,344.6l-82.2-47.9c-7.5-4.4-13.5-0.9-13.5,7.8l0.4,95.2c0,8.7,6.2,12.2,13.7,7.9l81.6-47.1C29,356,29,349,21.6,344.6z"/></g></g></g>' +
1736            '</svg>';
1737        $pause_bg = '<svg class="pause_bg" width="20px" height="20px" fill="#999" viewBox="-94 96 510 510" >' +
1738            '<g><g id="pause-circle-outline"><path d="M84.5,453h51V249h-51V453z M161,96C20.8,96-94,210.8-94,351S20.8,606,161,606s255-114.8,255-255S301.3,96,161,96zM161,555C48.8,555-43,463.2-43,351s91.8-204,204-204s204,91.8,204,204S273.2,555,161,555z M186.5,453h51V249h-51V453z"/></g></g>' +
1739            '</svg>';
1740
1741        $toolbar = $('.' + $object.settings.classPrefix + 'toolbar');
1742        switch (this.settings.lightboxView) {
1743            case 'view1':
1744            default:
1745                $toolbar.append('<span class="' + $object.settings.classPrefix + 'auto
1745play-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>');
1746                break;
1747            case 'view2':
1748                $('.' + $object.settings.classPrefix + 'bar').append('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>');
1749                break;
1750            case 'view3':
1751                $toolbar.append('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>');
1752                $('.rwd-toolbar .rwd-icon').addClass('rwd-icon0');
1753                break;
1754            case 'view4':
1755                $('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>').insertBefore($('.rwd-title'));
1756                $('.rwd-toolbar .rwd-icon').addClass('rwd-icon0');
1757                break;
1758            case 'view7':
1759                $('.tool_bar').append('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>');
1760                break;
1761        }
1762
1763        if ($object.settings.slideshowAuto) {
1764            $object.slideshowAuto();
1765        }
1766
1767        $object.$cont.find('.' + $object.settings.classPrefix + 'autoplay-button').on('click.rwd-container', function () {
1768            !$($object.$cont).hasClass($object.settings.classPrefix + 'show-autoplay') ? $object.startSlide() : $object.stopSlide();
1769        });
1770
1771    };
1772
1773    Lightbox.prototype.slideshowAuto = function () {
1774        var $object = this;
1775
1776        $object.$cont.addClass('' + $object.settings.classPrefix + 'show-autoplay');
1777        $object.startSlide();
1778    };
1779
1780    Lightbox.prototype.startSlide = function () {
1781        var $object = this;
1782        $object.$cont.addClass('' + $object.settings.classPrefix + 'show-autoplay');
1783        $('.rwd-autoplay-button > .pause_bg').css({'display': 'inline-block'});
1784        $('.rwd-autoplay-button > .play_bg').css({'display': 'none'});
1785        $object.interval = setInterval(function () {
1786            $object.goToNextSlide();
1787        }, $object.settings.slideshowSpeed);
1788    };
1789
1790    Lightbox.prototype.stopSlide = function () {
1791        clearInterval(this.interval);
1792        this.$cont.removeClass(this.settings.classPrefix + 'show-autoplay');
1793        $('.rwd-thumb').removeClass('thumb_move');
1794        $('.rwd-autoplay-button > .pause_bg').css({'display': 'none'});
1795        $('.rwd-autoplay-button > .play_bg').css({'display': 'inline-block'});
1796    };
1797
1798    Lightbox.prototype.addKeyEvents = function () {
1799        var $object = this;
1800        if (this.$items.length > 1) {
1801            $(window).on('keyup.rwd-container', function (e) {
1802                if ($object.$items.length > 1) {
1803                    if (e.keyCode === 37) {
1804                        e.preventDefault();
1805                        $object.goToPrevSlide();
1806                    }
1807
1808                    if (e.keyCode === 39) {
1809                        e.preventDefault();
1810                        $object.goToNextSlide();
1811                    }
1812                }
1813            });
1814        }
1815
1816        $(window).on('keydown.rwd-container', function (e) {
1817            if ($object.settings.escKey === true && e.keyCode === 27) {
1818                e.preventDefault();
1819                if (!$object.$cont.hasClass($object.settings.classPrefix + 'thumb-open')) {
1820                    $object.destroy();
1821                } else {
1822                    $object.$cont.removeClass($object.settings.classPrefix + 'thumb-open');
1823                }
1824            }
1825        });
1826    };
1827
1828    Lightbox.prototype.arrow = function () {
1829        var $object = this;
1830        this.$cont.find('.' + $object.settings.classPrefix + 'prev').on('click.rwd-container', function () {
1831            $object.goToPrevSlide();
1832        });
1833
1834        this.$cont.find('.' + $object.settings.classPrefix + 'next').on('click.rwd-container', function () {
1835            $object.goToNextSlide();
1836        });
1837    };
1838
1839    Lightbox.prototype.arrowDisable = function (index) {
1840
1841        if (!this.settings.loop === 'true' && this.settings.hideControlOnEnd) {
1842            if ((index + 1) < this.$item.length) {
1843                this.$cont.find('.' + this.settings.classPrefix + 'next').removeAttr('disabled').removeClass('disabled');
1844            } else {
1845                this.$cont.find('.' + this.settings.classPrefix + 'next').attr('disabled', 'disabled').addClass('disabled');
1846            }
1847
1848            if (index > 0) {
1849                this.$cont.find('.' + this.settings.classPrefix + 'prev').removeAttr('disabled').removeClass('disabled');
1850            } else {
1851                this.$cont.find('.' + this.settings.classPrefix + 'prev').attr('disabled', 'disabled').addClass('disabled');
1852            }
1853        }
1854    };
1855
1856    Lightbox.prototype.mousewheel = function () {
1857        var $object = this, delta;
1858
1859        $object.$cont.on('mousewheel', function (e) {
1860            e = e || window.event;
1861            delta = e.deltaY || e.detail || e.wheelDelta;
1862
1863            (delta > 0) ? $object.goToNextSlide() : $object.goToPrevSlide();
1864            e.preventDefault ? e.preventDefault() : (e.returnValue = false);
1865        });
1866
1867    };
1868
1869    Lightbox.prototype.closeGallery = function () {
1870
1871        var $object = this, mousedown = false;
1872
1873        this.$cont.find('.' + $object.settings.classPrefix + 'close').on('click.rwd-container', function () {
1874            $object.destroy();
1875        });
1876
1877        if ($object.settings.overlayClose === 'true') {
1878
1879            $object.$cont.on('mousedown.rwd-container', function (e) {
1880
1881                mousedown = ($(e.target).is('.' + $object.settings.classPrefix + 'cont') || $(e.target).is('.' + $object.settings.classPrefix + 'item ') || $(e.target).is('.' + $object.settings.classPrefix + 'img-wrap'));
1882
1883            });
1884
1885            $object.$cont.on('mouseup.rwd-container', function (e) {
1886
1887                if ($(e.target).is('.contInner') || $(e.target).is('.' + $object.settings.classPrefix + 'cont') || $(e.target).is('.' + $object.settings.classPrefix + 'item ') || $(e.target).is('.' + $object.settings.classPrefix + 'img-wrap') && mousedown) {
1888                    if (!$object.$cont.hasClass($object.settings.classPrefix + 'dragEvent')) {
1889                        $object.destroy();
1890                    }
1891                }
1892
1893            });
1894
1895        }
1896    };
1897
1898    Lightbox.prototype.destroy = function (d) {
1899
1900        var $object = this, $time;
1901
1902        $('.rwd-container').removeClass(this.settings.openCloseType[0]).addClass(this.settings.openCloseType[1]);
1903
1904        switch(this.settings.openCloseType[1]){
1905            case 'close_1':
1906            case 'close_1_r':
1907                $time = 1000;
1908                break;
1909            case 'close_2':
1910            case 'close_2_r':
1911                $time = 300;
1912                break;
1913            case 'close_3':
1914            case 'close_4':
1915            case 'close_3_r':
1916            case 'close_4_r':
1917                $time = 340;
1918                break;
1919            case 'close_5':
1920            case 'close_5_r':
1921                $time = 250;
1922                break;
1923        }
1924
1925        $('html, body').on('mousewheel', function(){
1926            return false;
1927        });
1928
1929        setTimeout(function(){
1930            clearInterval($object.interval);
1931
1932            $object.$body.removeClass($object.settings.classPrefix + 'on');
1933
1934            $(window).scrollTop($object.prevScrollTop);
1935
1936            if (d) {
1937                $.removeData($object.el, 'lightbox');
1938            }
1939
1940            ($object.settings.socialSharing && (window.location.hash = ''));
1941
1942            $object.$element.off('.rwd-container');
1943
1944            $(window).off('.rwd-container');
1945
1946            if ($object.$cont) {
1947                $object.$cont.removeClass($object.settings.classPrefix + 'visible');
1948            }
1949
1950            $object.objects.overlay.removeClass('in');
1951
1952            setTimeout(function () {
1953                if ($object.$cont) {
1954                    $object.$cont.remove();
1955                }
1956
1957                $object.objects.overlay.remove();
1958
1959            }, $object.settings.overlayDuration + 50);
1960
1961            window.scrollTo(0, $object.$_y_);
1962
1963            $.fn.lightbox.lightboxModul['modul'].prototype.destroy();
1964
1965            $('html, body').off('mousewheel');
1966        }, $time);
1967    };
1968
1969    $.fn.lightbox = function (options) {
1970        return this.each(function () {
1971            if (!$.data(this, 'lightbox')) {
1972                $.data(this, 'lightbox', new Lightbox(this, options));
1973            }
1974        });
1975    };
1976
1977    $.fn.lightbox.lightboxModul = {};
1978
1979    var Modul = function (element) {
1980
1981        this.dataL = $(element).data('lightbox');
1982        this.$element = $(element);
1983        this.dataL.modulSettings = $.extend({}, this.constructor.defaultsModul);
1984
1985        this.init();
1986
1987        if (this.dataL.modulSettings.zoom && this.dataL.effectsSupport()) {
1988            if(hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView !== 'view7' && this.dataL.modulSettings.zoomType === '0'){
1989                this.initZoom();
1990
1991                this.zoomabletimeout = false;
1992
1993                this.pageX = $(window).width() / 2;
1994                this.pageY = ($(window).height() / 2) + $(window).scrollTop();
1995            }
1996        }
1997
1998        if (hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView !== 'view7' && this.dataL.modulSettings.fullwidth && this.dataL.effectsSupport()) {
1999            this.initFullWidth();
2000        }
2001
2002        this.$el = $(element);
2003        this.$thumbCont = null;
2004        this.thumbContWidth = 0;
2005        this.thumbTotalWidth = (this.dataL.$items.length * (this.dataL.modulSettings.thumbsWidth + this.dataL.modulSettings.thumbMargin));
2006        this.thumbIndex = this.dataL.index;
2007        this.left = 0;
2008        if(hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs === 'true'){
2009            this.initThumbs();
2010        }
2011
2012        if(this.dataL.modulSettings.fullscreen){
2013            this.initFullscreen();
2014        }
2015
2016        return this;
2017    };
2018
2019    Modul.defaultsModul = {
2020        idPrefix: 'rwd-',
2021        classPrefix: 'rwd-',
2022        attrPrefix: 'data-',
2023        videoMaxWidth: '700',
2024        fullwidth: hugeit_resp_lightbox_obj.hugeit_lightbox_fullwidth_effect === 'true',
2025        zoom: hugeit_resp_lightbox_obj.hugeit_lightbox_zoom,
2026        scale: +hugeit_resp_lightbox_obj.hugeit_lightbox_zoomsize / 10,
2027        thumbnail: hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs,
2028        thumbsWidth: 100,
2029        thumbsHeight: 100,
2030        thumbMargin: 5,
2031        showByDefault: true,
2032        toogleThumb: false,
2033        thumbPosition: '0',
2034        thumbsOverlayColor: 'black',
2035        thumbsOverlayOpacity: 10,
2036        fullscreen: hugeit_resp_lightbox_obj.hugeit_lightbox_fullscreen_effect === 'true'
2037    };
2038
2039    Modul.prototype.init = function () {
2040        var $object = this;
2041
2042        $object.dataL.$element.on('hasVideo.rwd-container', function (event, index, src) {
2043            $object.dataL.$item.eq(index).find('.' + $object.dataL.modulSettings.classPrefix + 'video').append($object.loadVideo(src, '' + $object.dataL.modulSettings.classPrefix + 'object', index));
2044        });
2045
2046        $object.dataL.$element.on('onAferAppendSlide.rwd-container', function (event, index) {
2047            $object.dataL.$item.eq(index).find('.' + $object.dataL.settings.classPrefix + 'video-cont').css({
2048                'max-width': $object.dataL.modulSettings.videoMaxWidth + 'px'
2049            });
2050        });
2051
2052        $object.dataL.$element.on('onBeforeSlide.rwd-container', function (event, prevIndex, index) {
2053
2054            var $videoSlide = $object.dataL.$item.eq(prevIndex),
2055                youtubePlayer = $videoSlide.find('.rwd-youtube').get(0),
2056                vimeoPlayer = $videoSlide.find('.rwd-vimeo').get(0),
2057                dailymotionPlayer = $videoSlide.find('.rwd-dailymotion').get(0);
2058
2059            if (youtubePlayer) {
2060                youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
2061            } else if (vimeoPlayer) {
2062                try {
2063                    $f(vimeoPlayer).api('pause');
2064                } catch (e) {
2065                    console.error('Make sure you have included froogaloop2 js');
2066                }
2067            } else if (dailymotionPlayer) {
2068                dailymotionPlayer.contentWindow.postMessage('pause', '*');
2069            }
2070
2071            var src;
2072            src = $object.dataL.$items.eq(index).attr('href');
2073
2074            var isVideo = $object.dataL.isVideo(src, index) || {};
2075            if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
2076                $object.dataL.$cont.addClass($object.dataL.modulSettings.classPrefix + 'hide-download');
2077                $object.dataL.$cont.addClass($object.dataL.modulSettings.classPrefix + 'hide-actual-size');
2078                $object.dataL.$cont.addClass($object.dataL.modulSettings.classPrefix + 'hide-fullwidth');
2079                $object.dataL.$cont.addClass($object.dataL.modulSettings.classPrefix + 'hide-zoom-in');
2080                $object.dataL.$cont.addClass($object.dataL.modulSettings.classPrefix + 'hide-zoom-out');
2081            }
2082
2083        });
2084
2085        $object.dataL.$element.on('onAfterSlide.rwd-container', function (event, prevIndex) {
2086            $object.dataL.$item.eq(prevIndex).removeClass($object.dataL.modulSettings.classPrefix + 'video-playing');
2087        });
2088    };
2089
2090    Modul.prototype.loadVideo = function (src, addClass, index) {
2091        var video = '',
2092            autoplay = 0,
2093            a = '',
2094            isVideo = this.dataL.isVideo(src, index) || {};
2095
2096        if (isVideo.youtube) {
2097
2098            a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
2099
2100            video = '<iframe class="' + this.dataL.modulSettings.classPrefix + 'video-object ' + this.dataL.modulSettings.classPrefix + 'youtube ' + addClass + '" width="560" height="315" src="//www.youtube.com/embed/' + isVideo.youtube[1] + a + '" frameborder="0" allowfullscreen></iframe>';
2101
2102        } else if (isVideo.vimeo) {
2103
2104            a = '?autoplay=' + autoplay + '&api=1';
2105
2106            video = '<iframe class="' + this.dataL.modulSettings.classPrefix + 'video-object ' + this.dataL.modulSettings.classPrefix + 'vimeo ' + addClass + '" width="560" height="315"  src="//player.vimeo.com/video/' + isVideo.vimeo[1] + a + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
2107
2108        } else if (isVideo.dailymotion) {
2109
2110            a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
2111
2112            video = '<iframe class="rwd-video-object rwd-dailymotion ' + addClass + '" width="560" height="315" src="//www.dailymotion.com/embed/video/' + isVideo.dailymotion[2] + a + '" frameborder="0" allowfullscreen></iframe>';
2113
2114        }
2115
2116        return video;
2117    };
2118
2119    Modul.prototype.initFullscreen = function() {
2120        var fullScreen = '';
2121        if (this.dataL.modulSettings.fullscreen) {
2122            if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled && !document.mozFullScreenEnabled && !document.msFullscreenEnabled) {
2123                return;
2124            } else {
2125                fullScreen = '<span class="rwd-fullscreen rwd-icon">' +
2126                    '<svg id="rwd-fullscreen-on" width="20px" height="20px" stroke="#999" fill="#999" x="0px" y="0px" viewBox="134 -133 357 357" style="enable-background:new 134 -133 357 357;">' +
2127                    '<g><g id="fullscreen"><path d="M165,96.5h-31V224h127.5v-31H165V96.5z M134-5.5h31V-82h96.5v-31H134V-5.5z M440,193h-76.5v31H491V96.5h-31V192z M363.5-103v21H460v76.5h31V-113H363.5z"></path>' +
2128                    '</g></g></svg>
2128' +
2129                    '<svg id="rwd-fullscreen-off" width="20px" height="20px" stroke="#999" fill="#999" x="0px" y="0px" viewBox="134 -133 357 357" style="enable-background:new 134 -133 357 357;">' +
2130                    '<g><g id="fullscreen-exit"><path d="M134, 127.5h 96.5V 224h 31V 96.5H 114V 147.5z M210.5 -36.5H 134v 31h 127.5V -133h -31V -36.5z M363.5, 224h 31v -96.5H 491v -31H 363.5V 224z M394.5 -56.5V -133h -31V -5.5H 491v -31H 395.5z"></path>' +
2131                    '</g></g></svg>' +
2132                    '</span>';
2133                switch (hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView) {
2134                    case 'view1':
2135                    default:
2136                        $('.rwd-cont').find('.rwd-toolbar').append(fullScreen);
2137                        break;
2138                    case 'view2':
2139                        $('.rwd-cont').find('.rwd-bar').append(fullScreen);
2140                        break;
2141                    case 'view4':
2142                        $(fullScreen).insertBefore('.rwd-title');
2143                        break;
2144                    case 'view7':
2145                        $('.tool_bar').append(fullScreen);
2146                        break;
2147                }
2148
2149                this.fullScreen();
2150            }
2151        }
2152    };
2153
2154    Modul.prototype.requestFullscreen = function() {
2155        var el = document.documentElement;
2156
2157        if (el.requestFullscreen) {
2158            el.requestFullscreen();
2159        } else if (el.msRequestFullscreen) {
2160            el.msRequestFullscreen();
2161        } else if (el.mozRequestFullScreen) {
2162            el.mozRequestFullScreen();
2163        } else if (el.webkitRequestFullscreen) {
2164            el.webkitRequestFullscreen();
2165        }
2166    };
2167
2168    Modul.prototype.exitFullscreen = function() {
2169        if (document.exitFullscreen) {
2170            document.exitFullscreen();
2171        } else if (document.msExitFullscreen) {
2172            document.msExitFullscreen();
2173        } else if (document.mozCancelFullScreen) {
2174            document.mozCancelFullScreen();
2175        } else if (document.webkitExitFullscreen) {
2176            document.webkitExitFullscreen();
2177        }
2178    };
2179
2180    Modul.prototype.fullScreen = function() {
2181        var $object = this;
2182
2183        $(document).on('fullscreenchange.rwd-container webkitfullscreenchange.rwd-container mozfullscreenchange.rwd-container MSFullscreenChange.rwd-container', function() {
2184            $('.rwd-cont').toggleClass('rwd-fullscreen-on');
2185        });
2186
2187        $('.rwd-cont').find('.rwd-fullscreen').on('click.rwd-container', function() {
2188            if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {
2189                $object.requestFullscreen();
2190            } else {
2191                $object.exitFullscreen();
2192            }
2193        });
2194
2195        $(window).on('keydown', function(e){
2196           if(e.keyCode === 27){
2197               console.log(1);
2198           }
2199        });
2200
2201    };
2202
2203    Modul.prototype.initFullWidth = function () {
2204        var $object = this,
2205            $fullWidth, $fullWidthOn;
2206
2207        $fullWidth = '<svg id="rwd-fullwidth" width="50px" height="25px" stroke="#999" fill="#999" x="0px" y="0px" viewBox="0 0 960 500" style="enable-background:new 0 0 960 560;">' +
2208            '<g><path d="M769.4,280L651.7,397.6l0.1-90.5L543.1,307l0-54.3l108.6,0.1l0.1-90.5L769.4,280z M416.4,306.9l-108.6-0.1l-0.1,90.5' +
2209            'L190.2,279.6L307.9,162l-0.1,90.5l108.6,0.1L416.4,306.9z M416.4,306.9"/></g></svg>';
2210
2211        $fullWidthOn = '<svg  id="rwd-fullwidth_on" width="50px" height="25px" stroke="#999" fill="#999" x="0px" y="0px" viewBox="0 0 960 500" style="enable-background:new 0 0 960 560;">' +
2212            '<path d="M516,280.3l117.3-118l0.3,90.5l108.6-0.3l0.2,54.3l-108.6,0.3l0.3,90.5L516,280.3z M217.3,252.8l108.6-0.3l-0.2-90.5' +
2213            'l117.9,117.4l-117.4,118l-0.2-90.5l-108.6,0.3L217.3,252.8z M416.4,306.9"/></svg>';
2214
2215        if (this.dataL.modulSettings.fullwidth) {
2216            var fullwidth = '<span class="rwd-fullwidth rwd-icon">' + $fullWidth + $fullWidthOn + '</span>';
2217            switch (hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView) {
2218                case 'view1':
2219                default:
2220                    this.dataL.$cont.find('.rwd-toolbar').append(fullwidth);
2221                    break;
2222                case 'view2':
2223                    this.dataL.$cont.find('.rwd-bar').append(fullwidth);
2224                    break;
2225                case 'view4':
2226                    $(fullwidth).insertBefore('.rwd-title');
2227                    break;
2228            }
2229
2230        }
2231
2232        if (this.dataL.modulSettings.fullwidth) {
2233            $('.rwd-fullwidth').on('click.rwd-container', function () {
2234                !$('.rwd-cont').hasClass('rwd-fullwidth-on') ? $object.onFullWidth() : $object.offFullWidth();
2235            });
2236        }
2237    };
2238
2239    Modul.prototype.onFullWidth = function () {
2240
2241        var $imageObject = this.dataL.$cont.find('.rwd-current .rwd-image');
2242
2243        $('#rwd-fullwidth').css({'display': 'none'});
2244        $('#rwd-fullwidth_on').css({'display': 'inline-block'});
2245
2246        $('.rwd-cont').addClass('rwd-fullwidth-on');
2247
2248        $('.rwd-container').css({
2249            width: '100%',
2250            height: '100%'
2251        });
2252
2253        var k = $imageObject.width() / $imageObject.height();
2254        if ($imageObject.width() > $imageObject.height() && k > 2) {
2255            $imageObject.css({
2256                'min-width': '100%'
2257            });
2258        } else {
2259            $imageObject.css({
2260                'min-height': '100%'
2261            });
2262        }
2263    };
2264
2265    Modul.prototype.offFullWidth = function () {
2266        var $imageObject = this.dataL.$cont.find('.rwd-current .rwd-image');
2267
2268        $('#rwd-fullwidth').css({'display': 'inline-block'});
2269        $('#rwd-fullwidth_on').css({'display': 'none'});
2270
2271        $('.rwd-cont').removeClass('rwd-fullwidth-on');
2272        $('.rwd-container').css({
2273            width: hugeit_resp_lightbox_obj.hugeit_lightbox_width_new + '%',
2274            height: hugeit_resp_lightbox_obj.hugeit_lightbox_height_new + '%'
2275        });
2276        $imageObject.css({
2277            'min-width': '',
2278            'min-height': ''
2279        });
2280    };
2281
2282    Modul.prototype.initZoom = function () {
2283
2284        var $object = this, zoomIcons,
2285            $zoomIn, $zoomOut, scale;
2286
2287        $zoomIn = '<svg id="zoom_in" width="20px" height="20px" stroke="#999" fill="#999" x="0px" y="0px" viewBox="-18 19 53 53" style="enable-background:new -18 19 53 53;">' +
2288            '<g><path d="M11,39H5v-6c0-0.6-0.4-1-1-1s-1,0.4-1,1v6h-6c-0.6,0-1,0.4-1,1s0.4,1,1,1h6v6c0,0.6,0.4,1,1,1s1-0.4,1-1v-6h6' +
2289            'c0.6,0,1-0.4,1-1S11.5,39,11,39z"/>' +
2290            '<path d="M33.7,70.3L18.8,54.9c3.8-3.8,6.1-9,6.1-14.8c0-11.6-9.4-21-21-21s-21,9.4-21,21s9.4,21,21,21c5.1,0,9.7-1.8,13.4-4.8' +
2291            'l14.9,15.5c0.2,0.2,0.5,0.3,0.7,0.3c0.3,0,0.5-0.1,0.7-0.3C34.1,71.3,34.1,70.7,33.7,70.3z M-15,40c0-10.5,8.5-19,19-19' +
2292            's19,8.5,19,19S14.5,59,4,59S-15,50.5-15,40z"/></g>' +
2293            '</svg>';
2294
2295        $zoomOut = '<svg id="zoom_out" width="20px" height="20px" stroke="#999" fill="#999" x="0px" y="0px" x="0px" y="0px" viewBox="-18 19 53 53" style="enable-background:new -18 19 53 53;">' +
2296            '<g><path d="M11,39H-3c-0.6,0-1,0.4-1,1s0.4,1,1,1h14c0.6,0,1-0.4,1-1S11.5,39,11,39z"/>' +
2297            '<path d="M33.7,70.3L18.8,54.9c3.8-3.8,6.1-9,6.1-14.8c0-11.6-9.4-21-21-21s-21,9.4-21,21s9.4,21,21,21c5.1,0,9.7-1.8,13.4-4.8' +
2298            'l14.9,15.5c0.2,0.2,0.5,0.3,0.7,0.3c0.3,0,0.5-0.1,0.7-0.3C34.1,71.3,34.1,70.7,33.7,70.3z M-15,40c0-10.5,8.5-19,19-19' +
2299            's19,8.5,19,19S14.5,59,4,59S-15,50.5-15,40z"/></g>' +
2300            '</svg>';
2301
2302        zoomIcons = '<span id="rwd-zoom-out" class="rwd-icon">' + $zoomOut + '</span><span id="rwd-zoom-in" class="rwd-icon">' + $zoomIn + '</span>';
2303
2304        switch (hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView) {
2305            case 'view1':
2306            default:
2307                this.dataL.$cont.find('.rwd-toolbar').append(zoomIcons);
2308                break;
2309            case 'view2':
2310                this.dataL.$cont.find('.rwd-bar').append(zoomIcons);
2311                break;
2312            case 'view4':
2313                $(zoomIcons).insertBefore('.rwd-title');
2314                break;
2315        }
2316
2317        scale = 1;
2318        function zoom(scaleVal) {
2319            var $imageObject, _x, _y, offsetX, offsetY, x, y;
2320
2321            $imageObject = $object.dataL.$cont.find('.rwd-current .rwd-image');
2322
2323            offsetX = ($(window).width() - $imageObject.width()) / 2;
2324            offsetY = (($(window).height() - $imageObject.height()) / 2) + $(window).scrollTop();
2325
2326            _x = $object.pageX - offsetX;
2327            _y = $object.pageY - offsetY;
2328
2329            x = _x;
2330            y = _y;
2331
2332            $imageObject.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal);
2333
2334            $imageObject.parent().css({
2335                transform: 'translate3d(0, ' + -y + 'px, 0)'
2336            }).attr('data-y', -y);
2337        }
2338
2339        function callScale() {
2340            if (scale > 1) {
2341                $object.dataL.$cont.addClass('rwd-zoomed');
2342            } else {
2343                $object.dataL.$cont.removeClass('rwd-zoomed');
2344            }
2345
2346            if (scale < 1) {
2347                scale = 1;
2348            }
2349
2350            zoom(scale);
2351        }
2352
2353        $(window).on('resize.rwd-container.zoom scroll.rwd-container.zoom orientationchange.rwd-container.zoom', function () {
2354            $object.pageX = $(window).width() / 2;
2355            $object.pageY = ($(window).height() / 2) + $(window).scrollTop();
2356            zoom(scale);
2357        });
2358
2359        $('#rwd-zoom-out').on('click.rwd-container', function () {
2360            if ($object.dataL.$cont.find('.rwd-current .rwd-image').length) {
2361                scale -= $object.dataL.modulSettings.scale;
2362                callScale();
2363            }
2364        });
2365
2366        $('#rwd-zoom-in').on('click.rwd-container', function () {
2367            if ($object.dataL.$cont.find('.rwd-current .rwd-image').length) {
2368                scale += $object.dataL.modulSettings.scale;
2369                callScale();
2370            }
2371        });
2372
2373        if (hugeit_resp_lightbox_obj.hugeit_lightbox_zoomlogo !== '0') {
2374            $object.dataL.$cont.dblclick(function () {
2375                if (!$object.dataL.$cont.hasClass('dbl-zoomed')) {
2376                    $object.dataL.$cont.addClass('dbl-zoomed');
2377                    if ($object.dataL.$cont.find('.rwd-current .rwd-image').length) {
2378                        scale += $object.dataL.modulSettings.scale;
2379                        callScale();
2380                    }
2381                } else {
2382                    $object.dataL.$cont.removeClass('dbl-zoomed');
2383                    if ($object.dataL.$cont.find('.rwd-current .rwd-image').length) {
2384                        scale -= $object.dataL.modulSettings.scale;
2385                        callScale();
2386                    }
2387                }
2388            });
2389        }
2390
2391        if (!('ontouchstart' in document.documentElement)) {
2392            $object.zoomDrag();
2393        }
2394
2395        if (('ontouchstart' in document.documentElement)) {
2396            $object.zoomSwipe();
2397        }
2398
2399    };
2400
2401    Modul.prototype.touchendZoom = function (startCoords, endCoords, abscissa, ordinate) {
2402
2403        var $object = this, _$el, $imageObject, distanceX, distanceY, maxX, maxY;
2404
2405        _$el = $object.dataL.$item.eq($object.dataL.index).find('.rwd-img-wrap');
2406        $imageObject = $object.dataL.$item.eq($object.dataL.index).find('.rwd-object');
2407        maxX = Math.abs($imageObject.outerWidth() * Math.abs($imageObject.attr('data-scale')) - $object.dataL.$cont.find('.rwd-container').width()) / 2;
2408        maxY = Math.abs($imageObject.outerHeight() * Math.abs($imageObject.attr('data-scale')) - $object.dataL.$cont.find('.rwd-container').height()) / 2 + $(window).scrollTop();
2409
2410        if (_$el.attr('data-x')) {
2411            distanceX = +_$el.attr('data-x') + (endCoords.x - startCoords.x);
2412        } else {
2413            distanceX = endCoords.x - startCoords.x;
2414        }
2415
2416        distanceY = +_$el.attr('data-y') + (endCoords.y - startCoords.y);
2417
2418        if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
2419
2420            if (abscissa) {
2421                if (endCoords.x - startCoords.x < 0) {
2422                    if(distanceX <= -maxX){
2423                        distanceX = -maxX;
2424                    }
2425                } else {
2426                    if(distanceX >= maxX) {
2427                        distanceX = maxX;
2428                    }
2429                }
2430
2431                _$el.attr('data-x', distanceX);
2432            }
2433
2434            if (ordinate) {
2435                if (endCoords.y - startCoords.y < 0) {
2436                    if(distanceY <= -(maxY + ($object.pageY - ($(window).height() - $imageObject.height()) / 2)) + 2 * $(window).scrollTop()) {
2437                        distanceY = -(maxY + ($object.pageY - ($(window).height() - $imageObject.height()) / 2)) + 2 * $(window).scrollTop();
2438                    }
2439                } else {
2440                    if(distanceY >= maxY - ($object.pageY - ($(window).height() - $imageObject.height()) / 2)) {
2441                        distanceY = maxY - ($object.pageY - ($(window).height() - $imageObject.height()) / 2);
2442                    }
2443                }
2444
2445                _$el.attr('data-y', distanceY);
2446            }
2447
2448            _$el.css({
2449                transform: 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'
2450            });
2451
2452        }
2453    };
2454
2455    Modul.prototype.zoomDrag = function () {
2456
2457        var $object = this,
2458            startCoords = {},
2459            endCoords = {},
2460            isDraging = false,
2461            isMoved = false,
2462            abscissa = false,
2463            ordinate = false;
2464
2465        $object.dataL.$item.on('mousedown.rwd-container.zoom', function (e) {
2466
2467            var $imageObject = $object.dataL.$item.eq($object.dataL.index).find('.rwd-object');
2468
2469            ordinate = $imageObject.outerHeight() * $imageObject.attr('data-scale') > $object.dataL.$cont.find('.rwd-container').height();
2470            abscissa = $imageObject.outerWidth() * $imageObject.attr('data-scale') > $object.dataL.$cont.find('.rwd-container').width();
2471
2472            if ($object.dataL.$cont.hasClass('rwd-zoomed')) {
2473                if ($(e.target).hasClass('rwd-object') && (abscissa || ordinate)) {
2474                    e.preventDefault();
2475                    startCoords = {
2476                        x: e.pageX,
2477                        y: e.pageY
2478                    };
2479
2480                    isDraging = true;
2481
2482                    $object.dataL.$cont.scrollLeft += 1;
2483                    $object.dataL.$cont.scrollLeft -= 1;
2484
2485                }
2486            }
2487        });
2488
2489        $(window).on('mousemove.rwd-container.zoom', function (e) {
2490            if (isDraging) {
2491                var _$el = $object.dataL.$item.eq($object.dataL.index).find('.rwd-img-wrap');
2492                var distanceX;
2493                var distanceY;
2494
2495                isMoved = true;
2496                endCoords = {
2497                    x: e.pageX,
2498                    y: e.pageY
2499                };
2500
2501                if (_$el.attr('data-x')) {
2502                    distanceX = +_$el.attr('data-x') + (endCoords.x - startCoords.x);
2503                } else {
2504                    distanceX = endCoords.x - startCoords.x;
2505                }
2506
2507                if (ordinate) {
2508                    distanceY = +_$el.attr('data-y') + (endCoords.y - startCoords.y);
2509                }
2510
2511                _$el.css({
2512                    transform: 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'
2513                });
2514            }
2515        });
2516
2517        $(window).on('mouseup.rwd-container.zoom', function (e) {
2518
2519            if (isDraging) {
2520                isDraging = false;
2521
2522                if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) {
2523                    endCoords = {
2524                        x: e.pageX,
2525                        y: e.pageY
2526                    };
2527                    $object.touchendZoom(startCoords, endCoords, abscissa, ordinate);
2528
2529                }
2530
2531                isMoved = false;
2532            }
2533
2534        });
2535    };
2536
2537    Modul.prototype.zoomSwipe = function () {
2538        var $object = this,
2539            startCoords = {},
2540            endCoords = {},
2541            isMoved = false,
2542            abscissa = false,                   ordinate = false;
2543
2544        $object.dataL.$item.on('touchstart.rwd-container', function (e) {
2545
2546            if ($object.dataL.$cont.hasClass('rwd-zoomed')) {
2547                var $imageObject = $object.dataL.$item.eq($object.dataL.index).find('.rwd-object');
2548
2549                ordinate = $imageObject.outerHeight() * $imageObject.attr('data-scale') > $object.dataL.$cont.find('.rwd-container').height();
2550                abscissa = $imageObject.outerWidth() * $imageObject.attr('data-scale') > $object.dataL.$cont.find('.rwd-container').width();
2551                if ((abscissa || ordinate)) {
2552                    e.preventDefault();
2553                    startCoords = {
2554                        x: e.originalEvent.targetTouches[0].pageX,
2555                        y: e.originalEvent.targetTouches[0].pageY
2556                    };
2557                }
2558            }
2559
2560        });
2561
2562        $object.dataL.$item.on('touchmove.rwd-container', function (e) {
2563
2564            if ($object.dataL.$cont.hasClass('rwd-zoomed')) {
2565
2566                var _$el = $object.dataL.$item.eq($object.dataL.index).find('.rwd-img-wrap');
2567                var distanceX;
2568                var distanceY;
2569
2570                e.preventDefault();
2571                isMoved = true;
2572
2573                endCoords = {
2574                    x: e.originalEvent.targetTouches[0].pageX,
2575                    y: e.originalEvent.targetTouches[0].pageY
2576                };
2577
2578                if (_$el.attr('data-x')) {
2579                    distanceX = +_$el.attr('data-x') + (endCoords.x - startCoords.x);
2580                } else {
2581                    distanceX = endCoords.x - startCoords.x;
2582                }
2583
2584                if (ordinate) {
2585                    distanceY = +_$el.attr('data-y') + (endCoords.y - startCoords.y);
2586                }
2587
2588                if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
2589                    _$el.css({
2590                        transform: 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'
2591                    });
2592                }
2593
2594            }
2595
2596        });
2597
2598        $object.dataL.$item.on('touchend.rwd-container', function () {
2599            if ($object.dataL.$cont.hasClass('rwd-zoomed')) {
2600                if (isMoved) {
2601                    isMoved = false;
2602                    $object.touchendZoom(startCoords, endCoords, abscissa, ordinate);
2603
2604                }
2605            }
2606        });
2607
2608    };
2609
2610    Modul.prototype.initThumbs = function() {
2611        var $object = this;
2612
2613        if (this.dataL.modulSettings.thumbnail === 'true' && this.dataL.$items.length > 1) {
2614
2615            if (this.dataL.modulSettings.showByDefault) {
2616                setTimeout(function(){
2617                    $object.dataL.$cont.addClass('rwd-thumb-open');
2618                }, 100);
2619            }
2620
2621            this.buildThumbs();
2622
2623            this.dataL.effectsSupport() && this.enableThumbDrag();
2624
2625            this.activatedThumbs = false;
2626
2627            if ($object.dataL.modulSettings.toogleThumb) {
2628                $object.$thumbCont.append('<span class="rwd-toggle-thumb rwd-icon"></span>');
2629                $object.dataL.$cont.find('.rwd-toggle-thumb').on('click.rwd-container', function() {
2630                    $object.dataL.$cont.toggleClass('rwd-thumb-open');
2631                });
2632            }
2633        }
2634
2635        $('.rwd-container .rwd-thumb-item').css({
2636            background: '#' + this.dataL.modulSettings.thumbsOverlayColor
2637        });
2638        $('.rwd-container .rwd-thumb-item img').css({
2639            opacity: 1 - +this.dataL.modulSettings.thumbsOverlayOpacity / 100
2640        });
2641
2642        $('.rwd-thumb-cont').css({
2643            bottom: -$object.dataL.modulSettings.thumbsHeight + 'px'
2644        });
2645
2646        if (this.dataL.modulSettings.showByDefault) {
2647            var $cont_ = $('.cont-inner'),
2648                $thumb_ = $('.rwd-thumb-cont'),
2649                $toolbar_ = $('.rwd-toolbar');
2650            setTimeout(function(){
2651                switch(hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView){
2652                    case 'view1':
2653                        switch($object.dataL.modulSettings.thumbPosition){
2654                            case '0':
2655                                $cont_.css({
2656                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)',
2657                                    top: '47px'
2658                                });
2659                                $thumb_.css({
2660                                    bottom: '0',
2661                                    backgroundColor: 'rgba(0,0,0,.9)'
2662                                });
2663                                $('.rwd-bar > *').css({
2664                                    bottom: $object.dataL.modulSettings.thumbsHeight + 'px'
2665                                });
2666                                break;
2667                            case '1':
2668                                $cont_.css({
2669                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)',
2670                                    top: $object.dataL.modulSettings.thumbsHeight + 47 + 'px'
2671                                });
2672                                $thumb_.css({
2673                                    top: '47px',
2674                                    backgroundColor: 'rgba(0,0,0,.9)'
2675                                });
2676                                break;
2677                        }
2678                        break;
2679                    case 'view2':
2680                        switch($object.dataL.modulSettings.thumbPosition) {
2681                            case '0':
2682                                $cont_.css({
2683                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)',
2684                                    top: '45px'
2685                                });
2686                                $thumb_.css({
2687                                    bottom: '45px',
2688                                    backgroundColor: 'rgba(0,0,0,.9)'
2689                                });
2690                                break;
2691                            case '1':
2692                                $cont_.css({
2693                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)',
2694                                    top: $object.dataL.modulSettings.thumbsHeight + 45 + 'px'
2695                                });
2696                                $thumb_.css({
2697                                    top: '0',
2698                                    backgroundColor: 'rgba(0,0,0,.9)'
2699                                });
2700                                $toolbar_.css({
2701                                    top: $object.dataL.modulSettings.thumbsHeight + 'px'
2702                                });
2703                                break;
2704                        }
2705                        break;
2706                    case 'view3':
2707                        switch($object.dataL.modulSettings.thumbPosition) {
2708                            case '0':
2709                                $cont_.css({
2710                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)',
2711                                    top: '47px'
2712                                });
2713                                $thumb_.css({
2714                                    bottom: '0',
2715                                    backgroundColor: 'white'
2716                                });
2717                                $('
2717.rwd-title').css({
2718                                    bottom: $object.dataL.modulSettings.thumbsHeight + 'px'
2719                                });
2720                                break;
2721                            case '1':
2722                                $cont_.css({
2723                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 93) + 'px)',
2724                                    top: ($object.dataL.modulSettings.thumbsHeight + 48) + 'px'
2725                                });
2726                                $thumb_.css({
2727                                    top: '48px',
2728                                    backgroundColor: 'white'
2729                                });
2730                                break;
2731                        }
2732                        break;
2733                    case 'view4':
2734                    case 'view7':
2735                        switch($object.dataL.modulSettings.thumbPosition) {
2736                            case '0':
2737                                $cont_.css({
2738                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)'
2739                                });
2740                                $thumb_.css({
2741                                    bottom: '0',
2742                                    backgroundColor: 'none'
2743                                });
2744                                $('.rwd-socialIcons').css({
2745                                    bottom: ($object.dataL.modulSettings.thumbsHeight - 10) + 'px'
2746                                });
2747                                $('.barCont').css({
2748                                    bottom: $object.dataL.modulSettings.thumbsHeight + 'px'
2749                                });
2750                                $('#rwd-counter').css({
2751                                    bottom: ($object.dataL.modulSettings.thumbsHeight + 5) + 'px'
2752                                });
2753                                $('.rwd-item').css({
2754                                    top: '47px'
2755                                });
2756                                break;
2757                            case '1':
2758                                $cont_.css({
2759                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 90) + 'px)',
2760                                    top: $object.dataL.modulSettings.thumbsHeight + 45 + 'px'
2761                                });
2762                                $thumb_.css({
2763                                    top: '45px',
2764                                    backgroundColor: 'none'
2765                                });
2766                                break;
2767                        }
2768                        break;
2769                    case 'view5':
2770                    case 'view6':
2771                        switch($object.dataL.modulSettings.thumbPosition) {
2772                            case '0':
2773                                $cont_.css({
2774                                    height: 'calc(100% - ' + $object.dataL.modulSettings.thumbsHeight + 'px)'
2775                                });
2776                                $thumb_.css({
2777                                    bottom: '0'
2778                                });
2779                                break;
2780                            case '1':
2781                                $cont_.css({
2782                                    height: 'calc(100% - ' + $object.dataL.modulSettings.thumbsHeight + 'px)',
2783                                    top: $object.dataL.modulSettings.thumbsHeight + 'px'
2784                                });
2785                                $thumb_.css({
2786                                    top: '0'
2787                                });
2788                                break;
2789                        }
2790                        break;
2791                }
2792            }, 100);
2793        }
2794    };
2795
2796    Modul.prototype.buildThumbs = function() {
2797        var $object = this,
2798            thumbList = '',
2799            $thumb,
2800            html = '<div class="rwd-thumb-cont"><div class="rwd-thumb group"></div></div>';
2801
2802        $object.dataL.$cont.addClass('rwd-has-thumb');
2803
2804        $object.dataL.$cont.find('.rwd-container').append(html);
2805
2806        $object.$thumbCont = $object.dataL.$cont.find('.rwd-thumb-cont');
2807        $object.thumbContWidth = $object.$thumbCont.width();
2808
2809        $object.dataL.$cont.find('.rwd-thumb').css({
2810            width: $object.thumbTotalWidth + 'px',
2811            position: 'relative'
2812        });
2813
2814        $object.$thumbCont.css('height', $object.dataL.modulSettings.thumbsHeight + 'px');
2815
2816        function getThumb(src, thumb, index) {
2817            var isVideo = $object.dataL.isVideo(src, index) || {};
2818            var thumbImg;
2819            var vimeoId = '';
2820
2821            if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
2822                if (isVideo.youtube) {
2823                    thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/1.jpg';
2824                } else if (isVideo.vimeo) {
2825                    thumbImg = '//i.vimeocdn.com/video/error_100x75.jpg';
2826                    vimeoId = isVideo.vimeo[1];
2827                } else if (isVideo.dailymotion) {
2828                    thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[2];
2829                }
2830            } else {
2831                thumbImg = thumb;
2832            }
2833
2834            thumbList += '<div data-vimeo-id="' + vimeoId + '" class="rwd-thumb-item" style="width:' + $object.dataL.modulSettings.thumbsWidth + 'px; margin-right: ' + $object.dataL.modulSettings.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>';
2835            vimeoId = '';
2836        }
2837
2838        $object.dataL.$items.each(function(i) {
2839
2840            getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i);
2841
2842        });
2843
2844        $object.dataL.$cont.find('.rwd-thumb').html(thumbList);
2845
2846        $thumb = $object.dataL.$cont.find('.rwd-thumb-item');
2847
2848        $thumb.each(function() {
2849            var $this = $(this);
2850            var vimeoVideoId = $this.attr('data-vimeo-id');
2851
2852            if (vimeoVideoId) {
2853                $.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', {
2854                    format: 'json'
2855                }, function(data) {
2856                    $this.find('img').attr('src', data[0]['thumbnail_small']);
2857                });
2858            }
2859        });
2860
2861        $thumb.eq($object.dataL.index).addClass('active');
2862        $object.dataL.$element.on('onBeforeSlide.rwd-container', function() {
2863            $thumb.removeClass('active');
2864            $thumb.eq($object.dataL.index).addClass('active');
2865        });
2866
2867        $thumb.on('click.rwd-container touchend.rwd-container', function() {
2868            var _$this = $(this);
2869            setTimeout(function() {
2870                if ($object.activatedThumbs || !$object.dataL.effectsSupport()) {
2871                    $object.dataL.index = _$this.index();
2872                    $object.dataL.slide($object.dataL.index, false, true);
2873                    $('.rwd-thumb').removeClass('thumb_move');
2874                }
2875            }, 50);
2876        });
2877
2878        $object.dataL.$element.on('onBeforeSlide.rwd-container', function() {
2879            $object.animateThumb($object.dataL.index);
2880        });
2881
2882        $(window).on('resize.rwd-container.thumb orientationchange.rwd-container.thumb', function() {
2883            setTimeout(function() {
2884                $object.animateThumb($object.dataL.index);
2885                $object.thumbContWidth = $object.$thumbCont.width();
2886            }, 200);
2887        });
2888
2889    };
2890
2891    Modul.prototype.animateThumb = function(index) {
2892        var $thumb = this.dataL.$cont.find('.rwd-thumb'),
2893            position = (this.thumbContWidth / 2) - (this.dataL.modulSettings.thumbsWidth / 2);
2894
2895        this.left = ((this.dataL.modulSettings.thumbsWidth + this.dataL.modulSettings.thumbMargin) * index - 1) - position;
2896        if (this.left > (this.thumbTotalWidth - this.thumbContWidth)) {
2897            this.left = this.thumbTotalWidth - this.thumbContWidth;
2898        }
2899
2900        if (this.left < 0) {
2901            this.left = 0;
2902        }
2903
2904        if (!$thumb.hasClass('on')) {
2905            this.dataL.$cont.find('.rwd-thumb').css('transition-duration', this.dataL.modulSettings.speed + 'ms');
2906        }
2907
2908        if (!this.dataL.effectsSupport()) {
2909            $thumb.animate({
2910                left: -this.left + 'px'
2911            }, this.dataL.modulSettings.speed);
2912        }
2913
2914        if(!$('.rwd-thumb').hasClass('thumb_move')){
2915            this.dataL.$cont.find('.rwd-thumb').css({
2916                transform: 'translate3d(-' + (this.left) + 'px, 0px, 0px)'
2917            });
2918        }
2919    };
2920
2921    Modul.prototype.enableThumbDrag = function() {
2922
2923        var $object = this,
2924            startCoords = 0,
2925            endCoords = 0,
2926            isDraging = false,
2927            isMoved = false,
2928            tempLeft = 0,
2929            $left_ = ((this.dataL.modulSettings.thumbsWidth + this.dataL.modulSettings.thumbMargin) * $object.dataL.index - 1) - (this.thumbContWidth / 2) - (this.dataL.modulSettings.thumbsWidth / 2);
2930
2931        $('.rwd-thumb').attr('data-left', $left_);
2932
2933        $object.dataL.$cont.find('.rwd-thumb').on('mousedown.rwd-container.thumb', function(e) {
2934            if ($object.thumbTotalWidth > $object.thumbContWidth) {
2935                e.preventDefault();
2936                startCoords = e.pageX;
2937                isDraging = true;
2938
2939                $object.dataL.$cont.scrollLeft += 1;
2940                $object.dataL.$cont.scrollLeft -= 1;
2941
2942                $object.activatedThumbs = false;
2943            }
2944        });
2945
2946        $(window).on('mousemove.rwd-container.thumb', function(e) {
2947            if (isDraging) {
2948                tempLeft = +$('.rwd-thumb').attr('data-left');                isMoved = true;
2949                endCoords = e.pageX;
2950
2951                if(Math.abs(endCoords - startCoords) > 0 && $('.rwd-cont').hasClass('rwd-show-autoplay')){
2952                    $('.rwd-thumb').addClass('thumb_move');
2953                }
2954
2955                tempLeft = tempLeft - (endCoords - startCoords);
2956
2957                if (tempLeft > ($object.thumbTotalWidth - $object.thumbContWidth)) {
2958                    tempLeft = $object.thumbTotalWidth - $object.thumbContWidth;
2959                }
2960
2961                if (tempLeft < 0) {
2962                    tempLeft = 0;
2963                }
2964
2965                $object.dataL.$cont.find('.rwd-thumb').css({
2966                    transform: 'translate3d(-' + (tempLeft) + 'px, 0px, 0px)'
2967                });
2968            }
2969        });
2970
2971        $(window).on('mouseup.rwd-container.thumb', function() {
2972            if (isMoved) {
2973                isMoved = false;
2974
2975                $('.rwd-thumb').attr('data-left', tempLeft);
2976
2977            } else {
2978                $object.activatedThumbs = true;
2979            }
2980
2981            if (isDraging) {
2982                isDraging = false;
2983            }
2984        });
2985
2986    };
2987
2988    Modul.prototype.destroy = function () {
2989        var $object = this;
2990
2991        $(window).off('.rwd-container.zoom');
2992        $('.rwd-cont').removeClass('rwd-zoomed');
2993        clearTimeout($object.zoomabletimeout);
2994        $object.zoomabletimeout = false;
2995
2996        if (hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs === 'true') {
2997            $(window).off('resize.rwd-container.thumb orientationchange.rwd-container.thumb keydown.rwd-container.thumb');
2998            $('.rwd-cont').removeClass('rwd-has-thumb');
2999            $('.cont-inner').css({
3000                height: '100%'
3001            });
3002        }
3003
3004        $object.exitFullscreen();
3005        $(document).off('fullscreenchange.rwd-container webkitfullscreenchange.rwd-container mozfullscreenchange.rwd-container MSFullscreenChange.rwd-container');
3006    };
3007
3008    $.fn.lightbox.lightboxModul.modul = Modul;
3009
3010    var WaterMark = function (element) {
3011        this.element = element;
3012        this.settings = $.extend({}, this.constructor.defaults);
3013        this.init();
3014    };
3015
3016    WaterMark.defaults = {
3017        imgSrc: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_img_src_new,
3018        text: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_text,
3019        textColor: '#' + hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_textColor,
3020        textFontSize: +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_textFontSize,
3021        containerBackground: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_container_bg_color,
3022        containerWidth: +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_containerWidth,
3023        position: 'pos' + hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_position_new,
3024        opacity: +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_opacity / 100,
3025        margin: +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_margin,
3026        done: function (imgURL) {
3027            this.dataset.src = imgURL;
3028        }
3029    };
3030
3031    WaterMark.prototype.init = function () {
3032        var $object = this,
3033            $elem = $object.element,
3034            $settings = $object.settings,
3035            wmData = {},
3036            imageData = {};
3037
3038        var WatermarkImage = jQuery('<img />');
3039        WatermarkImage.attr('src', $object.settings.imgSrc);
3040        WatermarkImage.css('display', 'none').attr('id', 'huge_it_watermark_img_sample');
3041        if (!jQuery('body').find('#huge_it_watermark_img_sample').length) {
3042            jQuery('body').append(WatermarkImage);
3043        }
3044
3045        wmData = {
3046            imgurl: $settings.imgSrc,
3047            type: 'jpeg'
3048        };
3049
3050        imageData = {
3051            imgurl: $elem.dataset.imgsrc
3052        };
3053
3054        var defer = $.Deferred();
3055
3056        $.when(defer).done(function (imgObj) {
3057            imageData.$wmObject = imgObj;
3058
3059            $object.imgurltodata(imageData, function (dataURL) {
3060                $settings.done.call($elem, dataURL);
3061            });
3062        });
3063
3064        if ($settings.text !== '') {
3065            wmData.imgurl = $object.textwatermark();
3066        }
3067
3068        $object.imgurltodata(wmData, function (imgObj) {
3069            defer.resolve(imgObj);
3070        });
3071    };
3072
3073    WaterMark.prototype.textwatermark = function () {
3074        var $object = this,
3075            $settings,
3076            canvas,
3077            context,
3078            $width,
3079            $height;
3080
3081        $settings = $object.settings;
3082        canvas = document.createElement('canvas');
3083        context = canvas.getContext('2d');
3084
3085        $width = $settings.containerWidth;
3086        $height = $settings.textFontSize;
3087
3088        canvas.width = $width;
3089        canvas.height = $height;
3090
3091        context.fillStyle = $settings.containerBackground;
3092        context.fillRect(0, 0, $width, $height);
3093
3094        context.fillStyle = $settings.textColor;
3095        context.textAlign = 'center';
3096        context.font = '500 ' + $settings.textFontSize + 'px Sans-serif';
3097
3098        context.fillText($settings.text, ($width / 2), ($height - 5));
3099
3100        return canvas.toDataURL();
3101    };
3102
3103    WaterMark.prototype.imgurltodata = function (data, callback) {
3104        var $object = this,
3105            $settings = $object.settings,
3106            img;
3107
3108        img = new Image();
3109        img.setAttribute('crossOrigin', 'anonymous');
3110        img.onload = function () {
3111
3112            var canvas = document.createElement('canvas'),
3113                context = canvas.getContext('2d'),
3114
3115                $imgWidth = this.width,
3116                $imgHeight = this.height;
3117
3118            if (data.$wmObject) {
3119
3120                if (data.width !== 'auto' && data.height === 'auto' && data.width < $imgWidth) {
3121                    $imgHeight = $imgHeight / $imgWidth * data.width;
3122                    $imgWidth = data.width;
3123                } else if (data.width === 'auto' && data.height !== 'auto' && data.height < $imgHeight) {
3124                    $imgWidth = $imgWidth / $imgHeight * data.height;
3125                    $imgHeight = data.height;
3126                } else if (data.width !== 'auto' && data.height !== 'auto' && data.width < $imgWidth && data.height < $imgHeight) {
3127                    $imgWidth = data.width;
3128                    $imgHeight = data.height;
3129                }
3130
3131            }
3132
3133
3134            canvas.width = $imgWidth;
3135            canvas.height = $imgHeight;
3136
3137            /*if (data.type === 'jpeg') {
3138             context.fillStyle = '#ffffff';
3139             context.fillRect(0, 0, $imgWidth, $imgHeight);
3140             }*/
3141
3142            context.drawImage(this, 0, 0, $imgWidth, $imgHeight);
3143
3144            if (data.$wmObject) {
3145
3146                var $opacity = +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_containerOpacity / 100;
3147                if ($opacity >= 0 && $opacity <= 1) {
3148                    //context.globalAlpha = $settings.opacity;
3149                    context.globalAlpha = $opacity;
3150                }
3151
3152                var $wmWidth,
3153                    $wmHeight,
3154                    pos = $settings.margin,
3155                    $x, $y;
3156                if ($settings.text !== '') {
3157                    $wmWidth = data.$wmObject.width;
3158                    $wmHeight = data.$wmObject.height;
3159                }
3160                else {
3161                    $wmWidth = $settings.containerWidth;
3162                    $wmHeight = (jQuery('img#huge_it_watermark_img_sample').prop('naturalHeight') * $wmWidth) / jQuery('img#huge_it_watermark_img_sample').prop('naturalWidth');
3163                }
3164
3165                switch ($settings.position) {
3166                    case 'pos1':
3167                        $x = pos;
3168                        $y = pos;
3169                        break;
3170                    case 'pos2':
3171                        $x = $imgWidth / 2 - $wmWidth / 2;
3172                        $y = pos;
3173                        break;
3174                    case 'pos3':
3175                        $x = $imgWidth - $wmWidth - pos;
3176                        $y = pos;
3177                        break;
3178                    case 'pos4':
3179                        $x = pos;
3180                        $y = $imgHeight / 2 - $wmHeight / 2;
3181                        break;
3182                    case 'pos5':
3183                        $x = $imgWidth / 2 - $wmWidth / 2;
3184                        $y = $imgHeight / 2 - $wmHeight / 2;
3185                        break;
3186                    case 'pos6':
3187                        $x = $imgWidth - $wmWidth - pos;
3188                        $y = $imgHeight / 2 - $wmHeight / 2;
3189                        break;
3190                    case 'pos7':
3191                        $x = pos;
3192                        $y = $imgHeight - $wmHeight - pos;
3193                        break;
3194                    case 'pos8':
3195                        $x = $imgWidth / 2 - $wmWidth / 2;
3196                        $y = $imgHeight - $wmHeight - pos;
3197                        break;
3198                    case 'pos9':
3199                        $x = $imgWidth - $wmWidth - pos;
3200                        $y = $imgHeight - $wmHeight - pos;
3201                        break;
3202                    default:
3203                        $x = $imgWidth - $wmWidth - pos;
3204                        $y = $imgHeight - $wmHeight - pos;
3205                }
3206                context.drawImage(data.$wmObject, $x, $y, $wmWidth, $wmHeight);
3207            }
3208
3209            var dataURL = canvas.toDataURL('image/' + data.type);
3210
3211            if (typeof callback === 'function') {
3212
3213                if (data.$wmObject) {
3214                    callback(dataURL);
3215
3216                } else {
3217                    var $wmNew = new Image();
3218                    $wmNew.src = dataURL;
3219                    callback($wmNew);
3220                }
3221            }
3222
3223            canvas = null;
3224        };
3225
3226        img.src = data.imgurl;
3227    };
3228
3229    $.fn['watermark'] = function () {
3230        return this.each(function () {
3231            if (!$.data(this, 'watermark')) {
3232                $.data(this, 'watermark', new WaterMark(this));
3233            }
3234        });
3235    };
3236
3237})(jQuery);

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.