PageSourceSearch

https://svenruebhagen.de/wp-content/plugins/lightbox/js/frontend/lightbox.js?ver=1.0

js svenruebhagen.de collected 2026-09-28 02:33:56 UTC 166,137 bytes, 3,230 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        (($object.settings.preload > $object.$items.length) && ($object.settings.preload = $object.$items.length));
191
192        $object.$items.on('click.rwdcustom', function (event) {
193
194            event = event || window.event;
195            event.preventDefault ? event.preventDefault() : (event.returnValue = false);
196
197            $object.index = $object.$items.index(this);
198
199            if (!$object.$body.hasClass($object.settings.classPrefix + 'on')) {
200                $object.build($object.index);
201                $object.$body.addClass($object.settings.classPrefix + 'on');
202            }
203
204        });
205
206        $object.$body.on('click', function () {
207            $object.$_y_ = window.pageYOffset;
208        });
209
210        switch (this.settings.zoomLogo) {
211            case '1':
212                $object.$body.addClass('rwd-zoomGlass');
213                break;
214            case '2':
215                $object.$body.addClass('rwd-zoomHand');
216                break;
217        }
218
219    };
220
221    Lightbox.prototype.build = function (index) {
222
223        var $object = this;
224
225        $object.structure(index);
226
227        $object.lightboxModul['modul'] = new $.fn.lightbox.lightboxModul['modul']($object.el);
228
229        $object.slide(index, false, false);
230
231        ($object.settings.keyPress && $object.addKeyEvents());
232
233        if ($object.$items.length > 1) {
234
235            $object.arrow();
236
237            ($object.settings.mouseWheel && $object.mousewheel());
238
239            ($object.settings.slideshow && $object.slideShow());
240
241        }
242
243        $object.counter();
244
245        $object.closeGallery();
246
247        $object.$cont.on('click.rwd-container', function () {
248
249            $object.$cont.removeClass($object.settings.classPrefix + 'hide-items');
250
251        });
252
253        $('.shareLook').on('click.rwd-container', function () {
254            $(this).css({'display': 'none'});
255            $('.rwd-share-buttons').css({'display': 'block'});
256            setTimeout(function(){
257                $('.shareLook').css({'display' : 'block'});
258                $('.rwd-share-buttons').css({'display' : 'none'});
259            }, 9000);
260        });
261
262        if(!this.settings.thumbnail){
263            $object.calculateDimensions(index);
264        } else {
265            setTimeout(function(){
266                $object.calculateDimensions(index);
267            }, 800);
268        }
269
270        if(this.settings.lightboxView === 'view7'){
271            setTimeout(function(){
272                $('.view7_share, .rwd-close-bar, .rwd-toolbar').css({
273                    visibility: 'visible',
274                    opacity: '1'
275                });
276
277                $object.calculateDimensions(index);
278            }, 1100);
279            
280            jQuery('.rwd-close').hover(function(){
281                $('.rwd-cont').addClass('close_hover_on');
282            }, function(){
283                $('.rwd-cont').removeClass('close_hover_on');
284            });
285
286            var $w, $l;
287
288            if($('.rwd-container').width() > 768){
289                $('.rwd-view7-title').width($('.rwd-container').width() * 0.2 - 46);
290                $('.rwd-view7-desc').width($('.rwd-container').width() * 0.2 - 36);
291
292                setTimeout(function(){
293                    $('.rwd-view7-desc').height($('.view7_inner').height() - 79);
294                }, 200);
295
296                $w = 256;
297                $l = $('.tool_bar .rwd-icon:not(.zoom_cont)').length;
298
299                if(hugeit_resp_lightbox_obj.hugeit_lightbox_zoom && hugeit_resp_lightbox_obj.hugeit_lightbox_zoomtype === '1'){
300                    $('.zoom_cont').css({
301                        'max-width': '220px'
302                    });
303
304                    $w = 220;
305                } else {
306                    $('.zoom_cont').css({
307                        'max-width': '145px'
308                    });
309
310                    $w = 145;
311                }
312
313                $('.tool_bar').width(50 * $l + $w);
314            } else {
315                $('.tool_bar').css('width', '80%');
316            }
317        }
318    };
319
320    Lightbox.prototype.structure = function (index) {
321
322        var $object = this, list = '', controls = '', i,
323            subHtmlCont1 = '', subHtmlCont2 = '', subHtmlCont3 = '',
324            close1 = '', close2 = '', close3 = '', socialIcons = '',
325            template, $arrows, $next, $prev,
326            $_next, $_prev, $close_bg, $download_bg, $download_bg_, $contInner, $view;
327
328        $view = (this.settings.lightboxView === 'view6') ? 'rwd-view6' : '';
329
330        this.$body.append(
331            this.objects.overlay = $('<div class="' + this.settings.classPrefix + 'overlay ' + $view + '"></div>')
332        );
333        this.objects.overlay.css('transition-duration', this.settings.overlayDuration + 'ms');
334
335        var $wURL = '',
336            $target = '';
337
338        if($object.settings.watermark && $object.settings.wURL && hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_text){
339            if($object.settings.wURLnewTab){
340                $target = 'target="_blank"';
341            }
342            $wURL = '<a href="' + $object.settings.watermarkURL + '" class="w_url" ' + $target + '></a>';
343        }
344
345        for (i = 0; i < this.$items.length; i++) {
346            list += '<div class="' + this.settings.classPrefix + 'item">' + $wURL + '</div>';
347        }
348
349        $close_bg = '<svg class="close_bg" width="16px" height="16px" fill="#999" viewBox="-341 343.4 15.6 15.6">' +
350            '<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"/>' +
351            '</svg>';
352
353        switch (this.settings.lightboxView) {
354            case 'view1':
355            default:
356                $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-333 335.5 31.5 31.5" >' +
357                    '<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"/>' +
358                    '</svg>';
359                $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-333 335.5 31.5 31.5" >' +
360                    '<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"/>' +
361                    '</svg>';
362                if(this.settings.showTitle){
363                    subHtmlCont1 = '<div class="' + this.settings.classPrefix + 'title"></div>';
364                }
365                close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>';
366                break;
367            case 'view2':
368                $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' +
369                    '<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
369-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>' +
370                    '</svg>';
371                $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' +
372                    '<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>' +
373                    '</svg>';
374                if(this.settings.showTitle){
375                    subHtmlCont2 = '<div class="' + this.settings.classPrefix + 'title"></div>';
376                }
377                close2 = '<div class="barCont"></div><span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>';
378                break;
379            case 'view3':
380                $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-104 105.6 490.4 490.4" >' +
381                    '<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"/>' +
382                    '<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>' +
383                    '</svg>';
384                $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-104 105.6 490.4 490.4" >' +
385                    '<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"/>' +
386                    '<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>' +
387                    '</svg>';
388                if(this.settings.showTitle){
389                    subHtmlCont1 = '<div class="' + this.settings.classPrefix + 'title"></div>';
390                }
391                close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>';
392                break;
393            case 'view4':
394                $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' +
395                    '<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>' +
396                    '</svg>';
397                $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' +
398                    '<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>' +
399                    '</svg>';
400                $close_bg = '<svg class="close_bg" width="16px" height="16px" fill="#999" viewBox="-341 343.4 15.6 15.6">' +
401                    '<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"/>' +
402                    '</svg>';
403                if(this.settings.showTitle){
404                    subHtmlCont2 = '<div class="' + this.settings.classPrefix + 'title"></div>';
405                }
406                close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>';
407                break;
408            case 'view5':
409            case 'view6':
410                $_next = '<svg class="next_bg" width="22px" height="44px" fill="#999" x="0px" y="0px"' +
411                    'viewBox="0 0 40 70" style="enable-background:new 0 0 40 70;" xml:space="preserve">' +
412                    '<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' +
413                    '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"/>' +
414                    '</svg>';
415                $_prev = '<svg class="prev_bg" width="22px" height="44px" fill="#999" x="0px" y="0px"' +
416                    'viewBox="0 0 40 70" style="enable-background:new 0 0 40 70;" xml:space="preserve">' +
417                    '<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' +
418                    '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"/>' +
419                    '</svg>';
420                $close_bg = '<svg class="close_bg" width="16px" height="16px" fill="#999" viewBox="-341 343.4 15.6 15.6">' +
421                    '<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"/>' +
422                    '</svg>';
423                if(this.settings.showTitle){
424                    subHtmlCont3 += '<div class="' + this.settings.classPrefix + 'title"></div>';
425                }
426                if(this.settings.showDesc){
427                    subHtmlCont3 += '<div class="' + this.settings.classPrefix + 'description"></div>';
428                }
429                close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>';
430                break;
431            case 'view7':
432                $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="0 0 43 70.8">' +
433                    '<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' +
434                    '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"/>' +
435                    '<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' +
436                    '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"/>' +
437                    '</svg>';
438                $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" x="0px" y="0px" viewBox="0 0 43 70.8">' +
439                    '<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' +
440                    '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"/>' +
441                    '<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' +
442                    '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"/>' +
443                    '</svg>';
444                $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">' +
445                    '<style type="text/css">.st0{opacity:0.3;}.st2{fill:#FFFFFF;}.st3{fill:#010101;}.st4{fill:#231F20;}</style>' +
446                    '<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>' +
447                    '<clipPath id="XMLID_140_"><use xlink:href="#XMLID_137_"  style="overflow:visible;"/></clipPath><g id="XMLID_251_" class="st1"><g id="XMLID_252_">' +
448                    '<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' +
449                    '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' +
450                    '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"/>' +
451                    '</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"/>' +
452                    '<rect id="XMLID_136_" x="-2.5" y="11.2" transform="matrix(0.7077 0.7066 -0.7066 0.7077 11.918 -5.4355
452)" class="st4" width="30" height="1"/>' +
453                    '</g><g id="XMLID_139_" class="st0"><line id="XMLID_133_" class="st3" x1="23.4" y1="1" x2="2.2" y2="22.2"/>' +
454                    '<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"/>' +
455                    '</g></svg>' +
456                    '<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">' +
457                    '<style type="text/css">.st0{opacity:0.7;}.st2{fill:#FFFFFF;}.st3{opacity:1;}.st4{fill:#010101;}.st5{fill:#231F20;}</style>' +
458                    '<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>' +
459                    '<clipPath id="XMLID_140_"><use xlink:href="#XMLID_137_"  style="overflow:visible;"/></clipPath><g id="XMLID_251_" class="st1"><g id="XMLID_252_">' +
460                    '<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' +
461                    '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' +
462                    '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"/>' +
463                    '</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"/>' +
464                    '<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"/>' +
465                    '</g><g id="XMLID_139_" class="st3"><line id="XMLID_133_" class="st4" x1="23.2" y1="1" x2="1.6" y2="22.7"/>' +
466                    '<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"/>' +
467                    '</g></svg>';
468                close3 = '<div class="' + this.settings.classPrefix + 'close-bar">' +
469                    '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>' +
470                    '</div>';
471                break;
472        }
473
474        if (this.settings.arrows && this.$items.length > 1) {
475            controls = '<div class="' + this.settings.classPrefix + 'arrows">' +
476                '<div class="' + this.settings.classPrefix + 'prev ' + $object.settings.classPrefix + 'icon">' + $_prev + this.settings.prevHtml + '</div>' +
477                '<div class="' + this.settings.classPrefix + 'next ' + $object.settings.classPrefix + 'icon">' + $_next + this.settings.nextHtml + '</div>' +
478                '</div>';
479        }
480
481        if (this.settings.socialSharing && (this.settings.lightboxView !== 'view5' || this.settings.lightboxView !== 'view6')) {
482            socialIcons = '<div class="' + this.settings.classPrefix + 'socialIcons"><button class="shareLook">share</button></div>';
483        }
484
485        $contInner = (this.settings.lightboxView === 'view5' || this.settings.lightboxView === 'view6') ? '<div class="contInner">' + subHtmlCont3 + '</div>' : '';
486
487        var arrowHE = (this.settings.lightboxView !== 'view2' && this.settings.lightboxView !== 'view3') ? this.settings.arrowsHoverEffect : '',
488            $up = '<svg class="rwd-up" width="15px" height="12px" viewBox="0 0 26.5 21" style="enable-background:new 0 0 26.5 21;">' +
489                '<g id="Shape_1"><g>' +
490                '<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' +
491                '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"/>' +
492                '</g></g></svg>',
493            $down = '<svg class="rwd-down" width="15px" height="12px" viewBox="0 0 26.5 21" style="enable-background:new 0 0 26.5 21;">' +
494                '<g id="Shape_1"><g>' +
495                '<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' +
496                'c0.4,0.4,1,0.4,1.4,0l9.4-9C24.2,7.8,24.2,7.1,23.8,6.8z"/>' +
497                '</g></g></svg>',
498            $toggle_bar = (this.settings.lightboxView === 'view7') ? '<div class="toggle_bar">' + $up + $down + '</div>' : '',
499            nw = '', nh = '', $lens;
500
501        if(this.settings.lightboxView === 'view7'){
502            nw = $object.$items.eq(index).find('img').prop('naturalWi
502dth');
503            nh = $object.$items.eq(index).find('img').prop('naturalHeight');
504        }
505
506        $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>' : '';
507
508        template = '<div class="' + this.settings.classPrefix + 'cont ">' +
509            '<div class="rwd-container rwd-' + this.settings.lightboxView + ' rwd-arrows_hover_effect-' + arrowHE + '">' +
510            '<div class="cont-inner">' + list + '</div>' +
511            $contInner +
512            '<div class="' + this.settings.classPrefix + 'toolbar group">' +
513            close1 + subHtmlCont2 + $toggle_bar + $lens +
514            '</div>' +
515            close3 +
516            controls +
517            '<div class="' + this.settings.classPrefix + 'bar">' +
518            close2 + subHtmlCont1 + socialIcons + '</div>' +
519            '</div>' +
520            '</div>';
521
522        switch($object.settings.openCloseType[0]){
523            case 'open_1':
524            case 'open_2':
525            case 'open_3':
526            case 'open_4':
527            case 'open_5':
528            case 'open_1_r':
529            case 'open_2_r':
530            case 'open_3_r':
531            case 'open_4_r':
532            case 'open_5_r':
533                setTimeout(function(){
534                    $object.$cont.addClass('rwd-visible');
535                    $('.rwd-container').addClass($object.settings.openCloseType[0]);
536                }, 0);
537                break;
538            default:
539                $('.rwd-container').addClass($object.settings.openCloseType[0]);
540                setTimeout(function () {
541                    $object.$cont.addClass('rwd-visible');
542                }, this.settings.overlayDuration);
543                break;
544        }
545
546        if ($object.settings.socialSharing) {
547            setTimeout(function () {
548                $object.socialShare();
549            }, 50);
550        }
551
552        this.$body.append(template);
553        this.$cont = $('.' + $object.settings.classPrefix + 'cont');
554        this.$item = this.$cont.find('.' + $object.settings.classPrefix + 'item');
555
556        if (!this.settings.slideAnimation) {
557            this.$cont.addClass(this.settings.classPrefix + 'animation');
558            this.settings.slideAnimationType = this.settings.classPrefix + 'slide';
559        } else {
560            this.$cont.addClass(this.settings.classPrefix + 'use');
561        }
562
563        $object.calculateDimensions(index);
564
565        this.$item.eq(this.index).addClass(this.settings.classPrefix + 'current');
566
567        if (this.effectsSupport()) {
568            this.$cont.addClass(this.settings.classPrefix + 'support');
569        } else {
570            this.$cont.addClass(this.settings.classPrefix + 'noSupport');
571            this.settings.speed = 0;
572        }
573
574        this.$cont.addClass(this.settings.slideAnimationType);
575
576        ((this.settings.showAfterLoad) && (this.$cont.addClass(this.settings.classPrefix + 'show-after-load')));
577
578        if (this.effectsSupport()) {
579            var $inner = this.$cont.find('.cont-inner');
580            $inner.css('transition-timing-function', 'ease');
581            $inner.css('transition-duration', this.settings.speed + 'ms');
582        }
583
584        switch($object.settings.lightboxView){
585            case 'view1':
586            case 'view2':
587            case 'view3':
588                $inner.css({
589                    height: 'calc(100% - 92px)',
590                    top: '47px'
591                });
592                break;
593            case 'view4':
594                $inner.css({
595                    height: 'calc(100% - 92px)',
596                    top: '45px'
597                });
598                break;
599            case 'view5':
600                jQuery('.cont-inner').css({
601                    width: '60%'
602                });
603                break;
604            case 'view6':
605                jQuery('.cont-inner').css({
606                    width: '80%'
607                });
608                break;
609            case 'view7':
610                $('.toggle_bar').on('click', function(){
611                    $('.rwd-container').toggleClass('rwd_toggle_bar');
612
613                    if (jQuery('.rwd-toolbar').height() === 40) {
614                        jQuery('.rwd-toolbar').animate({
615                            height: '',
616                            top: jQuery('.rwd-toolbar').position().top + 40 + 'px'
617                        }, 1000);
618                        jQuery('.tool_bar > *').css('display', 'none');
619                    } else {
620                        jQuery('.rwd-toolbar').animate({
621                            height: '40px',
622                            top: jQuery('.rwd-toolbar').position().top - 40 + 'px'
623                        }, 1000);
624                        setTimeout(function () {
625                            jQuery('.tool_bar > *').css('display', 'block');
626                        }, 1000);
627                    }
628                });
629                break;
630        }
631
632        $object.objects.overlay.addClass('in');
633
634        setTimeout(function () {
635            $object.$cont.addClass($object.settings.classPrefix + 'visible');
636        }, this.settings.overlayDuration);
637
638        if (this.settings.download) {
639            $download_bg = '<svg class="download_bg" width="20px" height="20px" stroke="#999" fill="#999"  viewBox="-328 330.3 41.7 41.7" >' +
640                '<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"/>' +
641                '</svg>';
642            $download_bg_ = '<svg class="download_bg" width="36px" height="34px" stroke="#999" fill="#999" x="0px" y="0px"' +
643                'viewBox="0 0 90 90" style="enable-background:new 0 0 90 90;" xml:space="preserve">' +
644                '<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' +
645                '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"/>' +
646                '<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' +
647                '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"/>' +
648                '</svg>';
649            switch (this.settings.lightboxView) {
650                case 'view1':
651                default:
652                    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>');
653                    break;
654                case 'view2':
655                    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>');
656                    break;
657                case 'view4':
658                    $('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg + '</a>').insertBefore($('.rwd-title'));
659                    break;
660                case 'view5':
661                case 'view6':
662                    $('.rwd-toolbar').append('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg_ + '</a>');
663                    break;
664                case 'view7':
665                    $('.tool_bar').append('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg_ + '</a>');
666                    break;
667            }
668        }
669
670        if(this.settings.lightboxView === 'view7' && hugeit_resp_lightbox_obj.hugeit_lightbox_view_info === 'true'){
671            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;">' +
672                '<g><path d="M271.953,0C121.759,0,0,121.759,0,271.953s121.759,271.953,271.953,271.953' +
673                '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' +
674                'c14.724-0.484,27.533,10.622,29.578,24.987c6.576,27.581-22.719,55.228-49.631,44.192' +
675                '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' +
676                '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' +
677                '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' +
678                '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' +
679                'c29.871-21.816,60.325-48.593,93.313-65.949C293.138,198.238,298.92,196.622,303.739,196.318z"/>' +
680                '</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>';
681            $('.tool_bar').append('<span class="info_show_hide rwd-icon">' + $info + '</span>');
682        }
683
684        $arrows = $('.rwd-arrows .rwd-next, .rwd-arrows .rwd-prev');
685        $next = $('.rwd-arrows .rwd-next');
686        $prev = $('.rwd-arrows .rwd-prev');
687
688        var title_text = $('.rwd-title');
689
690        switch (this.settings.titlePos) {
691            case 'left':
692                title_text.css({'text-align': 'left'});
693                break;
694            case 'center':
695                title_text.css({'text-align': 'center'});
696                break;
697            case 'right':
698                title_text.css({'text-align': 'right'});
699                break;
700        }
701
702        switch (this.settings.lightboxView) {
703            case 'view1':
704            default:
705                $arrows.css({'top': '50%'});
706                $next.css({'right': '20px'});
707                $prev.css({'left': '20px'});
708                break;
709            case 'view2':
710                $arrows.css({'bottom': '0'});
711                $next.css({'right': '40%'});
712                $prev.css({'left': '40%'});
713                break;
714            case 'view3':
715                $arrows.css({'top': '14px', 'z-index': '1090'});
716                $next.css({'right': '20px'});
717                $prev.css({'right': '55px'});
718                title_text.css({'text-align': 'left', 'border-top': '1px solid #999'});
719                $('.rwd-close').css({'margin-right': '45%'});
720                $('.rwd-overlay, .rwd-toolbar, .rwd-title, .rwd-next, .rwd-prev').css({'background': 'rgba(255, 255, 255, 1)'});
721                $('.rwd-title, .shareLook').css({'color': '#999'});
722                $('.rwd-toolbar').css({'border-bottom': '1px solid #999'});
723                $('.rwd-toolbar .rwd-icon, .rwd-arrows .rwd-icon').addClass('rwd-icon0');
724                break;
725        }
726
727        this.prevScrollTop = $(window).scrollTop();
728
729        $object.objects.content = $('.rwd-container');
730
731        $object.objects.content.css({
732            'width': $object.settings.width,
733            'height': $object.settings.height
734        });
735
736        if($(window).width() < 768 && this.settings.lightboxView === 'view7'){
737            $object.objects.content.css({
738                'width': '100%',
739                'height': '100%'
740            });
741        }
742        
743        var $color, $zoomTop = (document.documentElement.clientHeight - $object.objects.content.height()) / 2;
744        switch (this.settings.lightboxView){
745            case 'view3':
746                $color = 'rgba(255,255,255,.9)';
747                break;
748            default:
749                $color = 'rgba(0,0,0,.9)';
750                break;
751        }
752
753        if(hugeit_resp_lightbox_obj.hugeit_lightbox_rightclick_protection === 'true'){
754            setTimeout(function () {
755                $('.rwd-container').bind('contextmenu', function () {
756                    return false;
757                });
758            }, 50);
759        }
760
761        if(this.settings.showBorder){
762            $('.rwd-container').css({
763                border: '2px solid #999'
764            });
765        }
766    };
767
768    Lightbox.prototype.calculateDimensions = function (index) {
769        var $object = this, $width;
770
771        $width = $('.' + $object.settings.classPrefix + 'current').height() * 16 / 9;
772
773        if ($width > $object.settings.videoMaxWidth) {
774            $width = $object.settings.videoMaxWidth;
775        }
776
777        $('.' + $object.settings.classPrefix + 'video-cont ').css({
778            'max-width': $width + 'px'
779        });
780
781        if(this.settings.lightboxView === 'view7') {
782            var $img, $video, $_inner,
783                $_width, $_height, $_wrap, $wrapHeight,
784                $_top, $top, $left, $_left = 0, $t,
785                $length, $k;
786
787            setTimeout(function() {
788
789                $img = document.querySelector('.rwd-item:nth-child(' + (index + 1) + ') img');
790                $video = document.querySelector('.rwd-item:nth-child(' + (index + 1) + ') .rwd-video-cont');
791                $_inner = document.querySelector('.rwd-item:nth-child(' + (index + 1) + ') .view7_inner');
792
793                if($img && $(window).width() > 768){
794                    $k = $object.$item.eq(index).find('img').prop('naturalWidth') / $object.$item.eq(index).find('img').prop('naturalHeight');
795
796                    if ($object.$item.eq(index).find('img').prop('naturalWidth') > $object.$item.eq(index).find('img').prop('naturalHeight') && $k > 2) {
797                        if($object.$item.eq(index).find('img').prop('naturalWidth') < 500 ){
798                            $object.$item.eq(index).find('img').css({
799                                minWidth: '70%'
800                            });
801                        }
802                    } else {
803                        if($object.$item.eq(index).find('img').prop('naturalHeight') < 500){
804                            $object.$item.eq(index).find('img').css({
805                                minHeight: '70%'
806                            });
807                        }
808                    }
809                }
810
811                $_width = parseFloat(window.getComputedStyle($img || $video, null).width);
812                $_height = parseFloat(window.getComputedStyle($img || $video, null).height);
813
814                switch($img || $video){
815                    case $img:
816                        $_wrap = document.querySelector('.rwd-item:nth-child(' + (index + 1) + ') .rwd-img-wrap');
817                        break;
818                    case $video:
819                        $_wrap = document.querySelector('.rwd-item:nth-child(' + (index + 1) + ')');
820                        break;
821                }
822
823                $wrapHeight = parseFloat(window.getComputedStyle($_wrap, null).height);
824
825                $top = ($wrapHeight - $_height) / 2 + $_height - 40;
826                $_top = ($wrapHeight - $_height) / 2;
827                $left = ($('.rwd-container').width() - (parseFloat(window.getComputedStyle($_inner, null).width) + $_width)) / 2;
828                $t = ($object.settings.thumbnail) ? 47 : 0;
829
830                if ($('.rwd-container').width() > 768) {
831
832                    $('.rwd-view7-title').eq(index).width($('.rwd-container').width() * 0.2 - 46);
833                    $('.rwd-view7-desc').eq(index).width($('.rwd-container').width() * 0.2 - 36);
834
835                    setTimeout(function(){
836                        $('.rwd-view7-desc').height($('.view7_inner').height() - ($object.settings.showTitle ? 120 : 9));
837                    }, 200);
838
839                    $_left = ($_inner.classList.contains('is_close')) ? 0 : $('.rwd-container').width() * 0.1;
840
841                    $('.rwd-toolbar').css({
842                        width: $_width + 1 + 'px',
843                        top: $top + $t + ($('.rwd-container').hasClass('rwd_toggle_bar') ? 40 : 0) + 1 + 'px',
844                        left: $left + 'px'
845                    });
846
847                    $('.rwd-close-bar').css({
848                        top: $_top + $t + 'px',
849                        left: $left + $_width - 25 + 'px'
850                    });
851
852                    ($img || $video).style.left = -$_left + ($object.settings.showBorder ? $object.settings.borderSize : 0);
853
854                    $('.view7_inner').eq(index).css({
855                        top: $_top + 'px',
856                        left: $_left + $left + $_width + 'px',
857                        height: $_height + 1 + 'px'
858                    });
859
860                    $('.view7_share').css({
861                        top: $_top + $t + 12 + 'px',
862                        right: 2*$_left + $_width + $left + 5 + 'px'
863                    });
864
865                    $length = $('.view7_share li').length + 1;
866
867                    $('.view7_share, .view7_share > div').width(($_height - 42) / $length).height(($_height - 42) / $length);
868                    $('.view7_share li').width(($_height - 42) / $length).height(($_height - 42) / $length);
869
870                } else {
871                    $('.rwd-toolbar').css({
872                        width: $(window).width() + 'px',
873                        top: '0'
874                    });
875
876                    $('.rwd-toolbar .rwd-icon, .view7_share').width($(window).width() * 0.2);
877
878                    $('.view7_share').css({
879                        'top': '0',
880                        'z-index': '999999999',
881                        'left': ($(window).width() * 0.2 - 40) * 0.5 + 'px'
882                    });
883
884                    $('.rwd-share-buttons').css({
885                        height: $(window).height() + 'px',
886                        width: $(window).width() + 'px',
887                        left: -($(window).width() * 0.2 - 40) * 0.5 + 'px'
888                    });
889
890                    $('.rwd-share-buttons li').css({
891                        width: ($(window).width() - ($object.settings.showBorder ? 8 : 0)) * 0.2 + 'px',
892                        maxWidth: 'none'
893                    });
894
895                    $('.rwd-share-buttons li a').css({
896                        marginLeft: $(window).width() * 0.1 - 20 + 'px'
897                    });
898
899                    $('.rwd-close-bar').css({
900                        top: $_top + $t + 5 + 'px',
901                        left: ($(window).width() - $_width) / 2 + $_width - 30 + 'px'
902                    });
903                }
904            }, 0);
905        }
906    };
907
908    Lightbox.prototype.innerOpenClose = function(){
909        var $object = this;
910
911        $('.info_show_hide').off('click');
912
913        $('.info_show_hide').on('click', function(){
914            var $view7_inner = $('.rwd-item.rwd-current').find('.view7_inner'),
915                $toolbar = $('.rwd-toolbar'),
916                $closebar = $('.rwd-close-bar'),
917                $imgcont = $('.rwd-item.rwd-current').find('img'),
918                $videoCont = $('.rwd-item.rwd-current').find('.rwd-video-cont '),
919                $zoomcont = $('.zoomContainer'),
920                $view7_share = $('.view7_share');
921
922            if($('.rwd-container').width() > 768) {
923                if ($('.rwd-item.rwd-current').hasClass('isImg')) {
924                    if (!$view7_inner.hasClass('is_close')) {
925                        $view7_inner.addClass('is_close');
926
927                        $view7_inner.animate({
928                            width: '0',
929                            left: parseFloat($view7_inner.css('left')) + 'px'
930                        }, 1000);
931
932                        $toolbar.animate({
933                            width: parseFloat($toolbar.css('width')) + 1 + 'px',
934                            left: parseFloat($toolbar.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
935                        }, 1000);
936
937                        $closebar.animate({
938                            left: parseFloat($closebar.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
939                        }, 1000);
940
941                        $imgcont.animate({
942                            left: parseFloat($imgcont.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
943                        }, 1000);
944
945                        $zoomcont.animate({
946                            left: parseFloat($imgcont.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
947                        }, 1000);
948
949                        $view7_share.animate({
950                            left: parseFloat($view7_share.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
951                        }, 1000);
952                    } else {
953                        $view7_inner.removeClass('is_close');
954
955                        $view7_inner.animate({
956                            width: $('.rwd-container').width() * 0.2 + 'px',
957                            left: parseFloat($view7_inner.css('left')) + 'px'
958                        }, 1000);
959
960                        $toolbar.animate({
961                            width: parseFloat($toolbar.css('width')) - 1 + 'px',
962                            left: parseFloat($toolbar.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
963                        }, 1000);
964
965                        $closebar.animate({
966                            left: parseFloat($closebar.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
967                        }, 1000);
968
969                        $imgcont.animate({
970                            left: parseFloat($imgcont.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
971                        }, 1000);
972
973                        $zoomcont.animate({
974                            left: parseFloat($imgcont.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
975                        }, 1000);
976
977                        $view7_share.animate({
978                            left: parseFloat($view7_share.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
979                        }, 1000);
980                    }
981                } else if ($('.rwd-item.rwd-current').hasClass('isVideo')) {
982                    if (!$view7_inner.hasClass('is_close')) {
983                        $view7_inner.addClass('is_close');
984
985                        $view7_inner.animate({
986                            width: '0',
987                            left: parseFloat($view7_inner.css('left')) + 'px'
988                        }, 1000);
989
990                        $toolbar.animate({
991                            left: parseFloat($toolbar.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 0.5 + 'px'
992                        }, 1000);
993
994                        $closebar.animate({
995                            left: parseFloat($closebar.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
996                        }, 1000);
997
998                        $videoCont.animate({
999                            left: parseFloat($videoCont.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
1000                        }, 1000);
1001
1002                        $view7_share.animate({
1003                            left: parseFloat($view7_share.css('left')) + parseFloat($view7_inner.css('width')) / 2 + 'px'
1004                        }, 1000);
1005                    } else {
1006                        $view7_inner.removeClass('is_close');
1007
1008                        $view7_inner.animate({
1009                            width: $('.rwd-container').width() * 0.2 + 'px',
1010                            left: parseFloat($view7_inner.css('left')) + 'px'
1011                        }, 1000);
1012
1013                        $toolbar.animate({
1014                            left: parseFloat($toolbar.css('left')) - $('.rwd-container').width() * 0.1 - 0.5 + 'px'
1015                        }, 1000);
1016
1017                        $closebar.animate({
1018                            left: parseFloat($closebar.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
1019                        }, 1000);
1020
1021                        $videoCont.animate({
1022                            left: parseFloat($videoCont.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
1023                        }, 1000);
1024
1025                        $view7_share.animate({
1026                            left: parseFloat($view7_share.css('left')) - $('.rwd-container').width() * 0.1 + 'px'
1027                        }, 1000);
1028                    }
1029                }
1030            } else {
1031                if (!$view7_inner.hasClass('is_open')) {
1032                    $view7_inner.addClass('is_open');
1033
1034                    if($('.rwd-share-buttons').css('display') === 'block'){
1035                        $('.rwd-share-buttons').css({
1036                            'display': 'none'
1037                        });
1038                    }
1039
1040                    $('.rwd-close-bar,.rwd-arrows .rwd-next, .rwd-arrows .rwd-prev').css({
1041                        zIndex: '1'
1042                    });
1043
1044                    if(!$object.settings.thumbnail){
1045                        $view7_inner.css({
1046                            top: '40px'
1047                        });
1048                    }
1049
1050                    if($object.settings.thumbnail && hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs_position === '1'){
1051                        $view7_inner.css({
1052                            top: -(+hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs_height) + 'px'
1053                        });
1054                    }
1055
1056                    $view7_inner.animate({
1057                        height: $(window).height() + 'px'
1058                    }, 1000);
1059                } else {
1060                    $view7_inner.removeClass('is_open');
1061
1062                    $('.rwd-close-bar,.rwd-arrows .rwd-next, .rwd-arrows .rwd-prev').animate({
1063                        zIndex: '999999999'
1064                    }, 700);
1065
1066                    $view7_inner.animate({
1067                        height: '0'
1068                    }, 1000);
1069                }
1070            }
1071        });
1072    };
1073
1074    Lightbox.prototype.effectsSupport = function () {
1075        var transition, root, support;
1076        support = function () {
1077            transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition'];
1078            root = document.documentElement;
1079            for (var i = 0; i < transition.length; i++) {
1080                if (transition[i] in root.style) {
1081                    return transition[i] in root.style;
1082                }
1083            }
1084        };
1085
1086        return support();
1087    };
1088
1089    Lightbox.prototype.isVideo = function (src, index) {
1090        var youtube, vimeo, dailymotion;
1091
1092        youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i);
1093        vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i);
1094        dailymotion = src.match(/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/);
1095
1096        if (youtube) {
1097            return {
1098                youtube: youtube
1099            };
1100        } else if (vimeo) {
1101            return {
1102                vimeo: vimeo
1103            };
1104        } else if (dailymotion) {
1105            return {
1106                dailymotion: dailymotion
1107            };
1108        }
1109    };
1110
1111    Lightbox.prototype.counter = function () {
1112        if (this.settings.showCounter) {
1113            switch (this.settings.lightboxView) {
1114                case 'view1':
1115                default:
1116                    $('.' + this.settings.classPrefix + 'toolbar').append(this.objects.counter = $('<div id="' + this.settings.idPrefix + 'counter"></div>'));
1117                    $('#rwd-counter').css({'padding-left': '23px'});
1118                    break;
1119                case 'view2':
1120                case 'view4':
1121                case 'view7':
1122                    $('.' + this.settings.classPrefix + 'bar').append('<div class="barCont"></div>').append(this.objects.counter = $('<div id="' + this.settings.idPrefix + 'counter"></div>'));
1123                    break;
1124                case 'view5':
1125                case 'view6':
1126                    $('.contInner').append(this.objects.counter = $('<div id="' + this.settings.idPrefix + 'counter"></div>'));
1127                    break;
1128            }
1129
1130            this.objects.counter.append(
1131                this.objects.current = $('<div>' + this.settings.sequence_info + ' <span id="' + this.settings.idPrefix + 'counter-current">' + (parseInt(this.index, 10) + 1) + '</span> ' +
1132                    this.settings.sequenceInfo + ' <span id="' + this.settings.idPrefix + 'counter-all">' + this.$items.length + '</span></div>')
1133            );
1134        }
1135    };
1136
1137    Lightbox.prototype.setTitle = function (index) {
1138        var $object = this, $title, $currentElement;
1139
1140        $currentElement = this.$items.eq(index);
1141        $title = $currentElement.find('img').attr('alt') ||
1142            $currentElement.find('img').attr('title') ||
1143            this.settings.defaultTitle || '';
1144
1145        this.$cont.find('.' + this.settings.classPrefix + 'title').html('<div class="rwd-title-text">' + $title + '</div>');
1146
1147        (($object.settings.lightboxView === 'view2') && $('.rwd-title-text').css({'width': '100%'}));
1148
1149        if ($object.settings.lightboxView !== 'view1' && $object.settings.lightboxView !== 'view3' && $object.settings.lightboxView !== 'view4') {
1150            ($title === '' && $object.settings.socialSharing) ?
1151                this.$cont.find('.' + this.settings.classPrefix + 'title').hide() :
1152                this.$cont.find('.' + this.settings.classPrefix + 'title').show();
1153        }
1154
1155        if($object.settings.lightboxView === 'view7'){
1156            if(this.settings.showTitle){
1157                $('.rwd-view7-title').eq(index).html($title);
1158            }
1159        }
1160    };
1161
1162    Lightbox.prototype.setDescription = function (index) {
1163        var $object = this, $description, $currentElement;
1164
1165        $currentElement = this.$items.eq(index);
1166        $description = $currentElement.find('img').attr('data-description') || '';
1167
1168        this.$cont.find('.' + this.settings.classPrefix + 'description').html('<div class="rwd-description-text" title="' + $description + '">' + $description + '</div>');
1169
1170        if($object.settings.lightboxView === 'view7'){
1171            if(this.settings.showDesc){
1172                $('.rwd-view7-desc').eq(index).html($description);
1173                $('.rwd-view7-desc').eq(index).attr('title', $description);
1174            }
1175        }
1176    };
1177
1178    Lightbox.prototype.preload = function (index) {
1179        for (var i = 1; i <= this.settings.preload; i++) {
1180            if (i >= this.$items.length - index) {
1181                break;
1182            }
1183
1184            this.loadContent(index + i, false, 0);
1185        }
1186
1187        for (var j = 1; j <= this.settings.preload; j++) {
1188            if (index - j < 0) {
1189                break;
1190            }
1191
1192            this.loadContent(index - j, false, 0);
1193        }
1194    };
1195
1196    Lightbox.prototype.socialShare = function () {
1197        var $object = this, shareButtons;
1198
1199        if(this.settings.lightboxView !== 'view7'){
1200            shareButtons = '<ul class="rwd-share-buttons">';
1201            shareButtons += $object.settings.share.facebookButton ? '<li><a title="Facebook" id="rwd-share-facebook" target="_blank"></a></li>' : '';
1202            shareButtons += $object.settings.share.twitterButton ? '<li><a title="Twitter" id="rwd-share-twitter" target="_blank"></a></li>' : '';
1203            shareButtons += $object.settings.share.googleplusButton ? '<li><a title="Google Plus" id="rwd-share-googleplus" target="_blank"></a></li>' : '';
1204            shareButtons += $object.settings.share.pinterestButton ? '<li><a title="Pinterest" id="rwd-share-pinterest" target="_blank"></a></li>' : '';
1205            shareButtons += $object.settings.share.linkedinButton ? '<li><a title="Linkedin" id="rwd-share-linkedin" target="_blank"></a></li>' : '';
1206            shareButtons += $object.settings.share.tumblrButton ? '<li><a title="Tumblr" id="rwd-share-tumblr" target="_blank"></a></li>' : '';
1207            shareButtons += $object.settings.share.redditButton ? '<li><a title="Reddit" id="rwd-share-reddit" target="_blank"></a></li>' : '';
1208            shareButtons += $object.settings.share.bufferButton ? '<li><a title="Buffer" id="rwd-share-buffer" target="_blank"></a></li>' : '';
1209            shareButtons += $object.settings.share.diggButton ? '<li><a title="Digg" id="rwd-share-digg" target="_blank"></a></li>' : '';
1210            shareButtons += $object.settings.share.vkButton ? '<li><a title="VK" id="rwd-share-vk" target="_blank"></a></li>' : '';
1211            shareButtons += $object.settings.share.yummlyButton ? '<li><a title="Yummly" id="rwd-share-yummly" target="_blank"></a></li>' : '';
1212            shareButtons += '</ul>';
1213        } else {
1214            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"' +
1215                '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>' +
1216                '<g id="Shape_3"> <g id="XMLID_84_"> <path id="XMLID_85_" class="st0"' +
1217                '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>' +
1218                '</g> </g></svg>';
1219
1220            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"' +
1221                'style="enable-background:new 0 0 30 34.5;" xml:space="preserve"><style type="text/css">.st0 {fill: #FFFFFF;}</style>' +
1222                '<g id="Shape_4"> <g id="XMLID_99_"> <path id="XMLID_100_" class="st0"' +
1223                '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
1223-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>' +
1224                '</g> </g></svg>';
1225
1226            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"' +
1227                '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"' +
1228                '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>' +
1229                '</g> </g></svg>';
1230
1231            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"' +
1232                '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"' +
1233                '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>';
1234
1235            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>';
1236
1237            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>';
1238
1239            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.
1239074-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>';
1240
1241            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.
12411,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>';
1242
1243            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>';
1244
1245            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>';
1246
1247            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
124701QQkyIf0yIxhh/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>';
1248
1249            shareButtons = '<ul class="rwd-share-buttons">';
1250            shareButtons += $object.settings.share.facebookButton ? '<li><a title="Facebook" id="rwd-share-facebook" class="view7" target="_blank">' + $fb + '</a></li>' : '';
1251            shareButtons += $object.settings.share.googleplusButton ? '<li><a title="Google Plus" id="rwd-share-googleplus" class="view7" target="_blank">' + $gp + '</a></li>' : '';
1252            shareButtons += $object.settings.share.twitterButton ? '<li><a title="Twitter" id="rwd-share-twitter" class="view7" target="_blank">' + $twitter + '</a></li>' : '';
1253            shareButtons += $object.settings.share.vkButton ? '<li><a title="VK" id="rwd-share-vk" class="view7" target="_blank">' + $vk + '</a></li>' : '';
1254            shareButtons += $object.settings.share.pinterestButton ? '<li><a title="Pinterest" id="rwd-share-pinterest" class="view7" target="_blank">' + $pinterest + '</a></li>' : '';
1255            shareButtons += $object.settings.share.linkedinButton ? '<li><a title="Linkedin" id="rwd-share-linkedin" class="view7" target="_blank">' + $linkedin + '</a></li>' : '';
1256            shareButtons += $object.settings.share.tumblrButton ? '<li><a title="Tumblr" id="rwd-share-tumblr" class="view7" target="_blank">' + $tumblr + '</a></li>' : '';
1257            shareButtons += $object.settings.share.redditButton ? '<li><a title="Reddit" id="rwd-share-reddit" class="view7" target="_blank">' + $reddit + '</a></li>' : '';
1258            shareButtons += $object.settings.share.diggButton ? '<li><a title="Digg" id="rwd-share-digg" class="view7" target="_blank">' + $digg + '</a></li>' : '';
1259            shareButtons += $object.settings.share.bufferButton ? '<li><a title="Buffer" id="rwd-share-buffer" class="view7" target="_blank">' + $buffer + '</a></li>' : '';
1260            shareButtons += $object.settings.share.yummlyButton ? '<li><a title="Yummly" id="rwd-share-yummly" class="view7" target="_blank">' + $yummly + '</a></li>' : '';
1261            shareButtons += '</ul>';
1262        }
1263
1264        switch(this.settings.lightboxView){
1265            case 'view5':
1266            case 'view6':
1267                $('.contInner').append(shareButtons);
1268                break;
1269            case 'view7':
1270                var $view7_share = '', $share = '', socialIcons_ = '', $m_share_event = '';
1271
1272                $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';}";
1273
1274                $share ='<svg onclick="' + $m_share_event + '" class="rwd-share" version="1.1" id="Layer_1"' +
1275                    'xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"' +
1276                    'viewBox="0 0 30 34.5" style="enable-background:new 0 0 30 34.5;" xml:space="preserve">' +
1277                    '<style type="text/css">.st0 {fill-rule: evenodd;clip-rule: evenodd;fill: #999;}</style><g id="Shape_2">' +
1278                    '<g id="XMLID_84_"> <path id="XMLID_85_" class="st0"' +
1279                    '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>' +
1280                    '</g> </g></svg>';
1281
1282                socialIcons_ = '<div class="share_open_close rwd-icon">' + $share + '</div>';
1283
1284                var $share_event = '';
1285
1286                if($(window).width() > 768){
1287                    $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\'" '+
1288                        '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\'"';
1289                }
1290
1291                $view7_share = '<div class="view7_share"' + $share_event + '>' + socialIcons_ + shareButtons + '</div>';
1292
1293                $('.rwd-container').append($view7_share);
1294                break;
1295            default:
1296                $('.' + this.settings.classPrefix + 'socialIcons').append(shareButtons);
1297                break;
1298        }
1299
1300        setTimeout(function () {
1301            $('#rwd-share-facebook').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + (encodeURIComponent(window.location.href)));
1302            $('#rwd-share-twitter').attr('href', 'https://twitter.com/intent/tweet?text=&url=' + (encodeURIComponent(window.location.href)));
1303            $('#rwd-share-googleplus').attr('href', 'https://plus.google.com/share?url=' + (encodeURIComponent(window.location.href)));
1304            $('#rwd-share-pinterest').attr('href', 'http://www.pinterest.com/pin/create/button/?url=' + (encodeURIComponent(window.location.href)));
1305            $('#rwd-share-linkedin').attr('href', 'http://www.linkedin.com/shareArticle?mini=true&amp;url=' + (encodeURIComponent(window.location.href)));
1306            $('#rwd-share-tumblr').attr('href', 'http://www.tumblr.com/share/link?url=' + (encodeURIComponent(window.location.href)));
1307            $('#rwd-share-reddit').attr('href', 'http://reddit.com/submit?url=' + (encodeURIComponent(window.location.href)));
1308            $('#rwd-share-buffer').attr('href', 'https://bufferapp.com/add?url=' + (encodeURIComponent(window.location.href)));
1309            $('#rwd-share-digg').attr('href', 'http://www.digg.com/submit?url=' + (encodeURIComponent(window.location.href)));
1310            $('#rwd-share-vk').attr('href', 'http://vkontakte.ru/share.php?url=' + (encodeURIComponent(window.location.href)));
1311            $('#rwd-share-yummly').attr('href', 'http://www.yummly.com/urb/ver
1311ify?url=' + (encodeURIComponent(window.location.href)));
1312        }, 200);
1313    };
1314
1315    Lightbox.prototype.changeHash = function (index) {
1316        var $object = this;
1317
1318        (($object.settings.socialSharing) && (window.location.hash = '/lightbox&slide=' + (index + 1)));
1319    };
1320
1321    Lightbox.prototype.loadContent = function (index, rec, delay) {
1322
1323        var $object, src, isVideo;
1324
1325        $object = this;
1326
1327        function isImg() {
1328            src = $object.$items.eq(index).attr('href');
1329            return src.match(/\.(jpg|png|gif)\b/);
1330        }
1331
1332        if ($object.settings.watermark) {
1333            if (isImg()) {
1334                src = $object.$items.eq(index).find('img').attr('data-src');
1335            }
1336        } else {
1337            src = $object.$items.eq(index).attr('href');
1338        }
1339
1340        var $view7_inner = '';
1341
1342        if(this.settings.lightboxView === 'view7'){
1343            if(this.settings.showTitle){
1344                var $t = '<div class="rwd-view7-title"></div>';
1345            }
1346            if(this.settings.showDesc){
1347                var $d = '<div class="rwd-view7-desc"></div>';
1348            }
1349
1350            $view7_inner = '<div class="view7_inner is_close">' + $t + $d + '</div>';
1351        }
1352
1353        isVideo = $object.isVideo(src, index);
1354        if (!$object.$item.eq(index).hasClass($object.settings.classPrefix + 'loaded')) {
1355            if (isVideo) {
1356                $object.$item.eq(index).addClass('isVideo');
1357                $object.$item.eq(index).prepend('<div class="' + this.settings.classPrefix + 'video-cont "><div class="' + this.settings.classPrefix + 'video"></div></div>' + $view7_inner);
1358                $object.$element.trigger('hasVideo.rwd-container', [index, src]);
1359            } else {
1360                $object.$item.eq(index).addClass('isImg');
1361                $object.$item.eq(index).prepend('<div class="' + this.settings.classPrefix + 'img-wrap">' +
1362                    '<img class="' + this.settings.classPrefix + 'object ' + $object.settings.classPrefix + 'image watermark lightbox_zoom" src="' + src + '" data-zoom-image="' + src + '" />' +
1363                    $view7_inner +
1364                    '</div>');
1365            }
1366
1367            $object.$element.trigger('onAferAppendSlide.rwd-container', [index]);
1368
1369            $object.$item.eq(index).addClass($object.settings.classPrefix + 'loaded');
1370        }
1371
1372        $object.$item.eq(index).find('.' + $object.settings.classPrefix + 'object').on('load.rwd-container error.rwd-container', function () {
1373
1374            var speed = 0;
1375            if (delay) {
1376                speed = delay;
1377            }
1378
1379            setTimeout(function () {
1380                $object.$item.eq(index).addClass($object.settings.classPrefix + 'complete');
1381            }, speed);
1382
1383        });
1384
1385        if (rec === true) {
1386
1387            if (!$object.$item.eq(index).hasClass($object.settings.classPrefix + 'complete')) {
1388                $object.$item.eq(index).find('.' + $object.settings.classPrefix + 'object').on('load.rwd-container error.rwd-container', function () {
1389                    $object.preload(index);
1390                });
1391            } else {
1392                $object.preload(index);
1393            }
1394        }
1395
1396        if(this.settings.lightboxView !== 'view7' && hugeit_resp_lightbox_obj.hugeit_lightbox_imageframe !== 'frame_0'){
1397            $('.rwd-image').css({
1398                borderColor: '#f4be52',
1399                borderStyle: 'inset',
1400                borderWidth: '60px'
1401            });
1402            if(hugeit_resp_lightbox_obj.hugeit_lightbox_imageframe !== 'frame_8'){
1403                $('.rwd-image').css({
1404                    borderImage: 'url("' + hugeit_resp_lightbox_plugins_url + hugeit_resp_lightbox_obj.hugeit_lightbox_imageframe + '.png") 90 95 95 90 stretch stretch'
1405                });
1406            } else {
1407                $('.rwd-image').css({
1408                    borderImage: 'url("' + hugeit_resp_lightbox_plugins_url + hugeit_resp_lightbox_obj.hugeit_lightbox_imageframe + '.png") 90 123 85 129 stretch stretch'
1409                });
1410            }
1411        }
1412
1413    };
1414
1415    Lightbox.prototype.slide = function (index, fromSlide, fromThumb) {
1416        var $object, prevIndex;
1417
1418        $object = this;
1419        prevIndex = this.$cont.find('.' + $object.settings.classPrefix + 'current').index();
1420
1421        if(this.settings.lightboxView === 'view7'){
1422            this.innerOpenClose();
1423
1424            setTimeout(function(){
1425                var nw, nh;
1426
1427                if($('.rwd-current').hasClass('isImg')){
1428                    nw = document.querySelector('.rwd-current img').naturalWi
1428dth;
1429                    nh = document.querySelector('.rwd-current img').naturalHeight;
1430                } else if($('.rwd-current').hasClass('isVideo')){
1431                    nw = $('.rwd-current iframe').width();
1432                    nh = $('.rwd-current iframe').height();
1433                }
1434
1435                $('.img_size').html(nw + 'px &times; ' + nh + 'px');
1436            }, 200);
1437        }
1438
1439        var length = this.$item.length,
1440            time = 0,
1441            next = false,
1442            prev = false;
1443
1444        if (this.settings.download) {
1445            var src;
1446            if (!this.settings.watermark) {
1447                src = $object.$items.eq(index).attr('data-download-url') !== 'false' && ($object.$items.eq(index).attr('data-download-url') || $object.$items.eq(index).attr('href'));
1448            }
1449            else {
1450                src = $object.$items.eq(index).find('img').attr('data-src');
1451            }
1452            if (src) {
1453                $('#' + $object.settings.classPrefix + 'download').attr('href', src);
1454                $object.$cont.removeClass($object.settings.classPrefix + 'hide-download');
1455                $object.$cont.removeClass($object.settings.classPrefix + 'hide-actual-size');
1456                $object.$cont.removeClass($object.settings.classPrefix + 'hide-fullwidth');
1457                $object.$cont.removeClass($object.settings.classPrefix + 'hide-zoom-in');
1458                $object.$cont.removeClass($object.settings.classPrefix + 'hide-zoom-out');
1459            } else {
1460                $object.$cont.addClass($object.settings.classPrefix + 'hide-download');
1461                $object.$cont.addClass($object.settings.classPrefix + 'hide-actual-size');
1462                $object.$cont.addClass($object.settings.classPrefix + 'hide-fullwidth');
1463                $object.$cont.addClass($object.settings.classPrefix + 'hide-zoom-in');
1464                $object.$cont.addClass($object.settings.classPrefix + 'hide-zoom-out');
1465            }
1466        } else {
1467            if(this.$cont.find('.' + $object.settings.classPrefix + 'item').eq(index).find('iframe').length){
1468                $object.$cont.addClass($object.settings.classPrefix + 'hide-download');
1469                $object.$cont.addClass($object.settings.classPrefix + 'hide-actual-size');
1470                $object.$cont.addClass($object.settings.classPrefix + 'hide-fullwidth');
1471                $object.$cont.addClass($object.settings.classPrefix + 'hide-zoom-in');
1472                $object.$cont.addClass($object.settings.classPrefix + 'hide-zoom-out');
1473            } else {
1474                $object.$cont.removeClass($object.settings.classPrefix + 'hide-download');
1475                $object.$cont.removeClass($object.settings.classPrefix + 'hide-actual-size');
1476                $object.$cont.removeClass($object.settings.classPrefix + 'hide-fullwidth');
1477                $object.$cont.removeClass($object.settings.classPrefix + 'hide-zoom-in');
1478                $object.$cont.removeClass($object.settings.classPrefix + 'hide-zoom-out');
1479            }
1480        }
1481
1482        this.$element.trigger('onBeforeSlide.rwd-container', [prevIndex, index, fromSlide, fromThumb]);
1483
1484        setTimeout(function () {
1485            $object.setTitle(index);
1486        }, time);
1487
1488        if ($object.settings.lightboxView === 'view5' || $object.settings.lightboxView === 'view6' || $object.settings.lightboxView === 'view7') {
1489            setTimeout(function () {
1490                $object.setDescription(index);
1491            }, time);
1492        }
1493
1494        this.arrowDisable(index);
1495
1496
1497        $object.$cont.addClass($object.settings.classPrefix + 'no-trans');
1498
1499        this.$item.removeClass($object.settings.classPrefix + 'prev-slide ' + $object.settings.classPrefix + 'next-slide');
1500        if (!fromSlide) {
1501
1502            if (index < prevIndex) {
1503                prev = true;
1504                if ((index === 0) && (prevIndex === length - 1) && !fromThumb) {
1505                    prev = false;
1506                    next = true;
1507                }
1508            } else if (index > prevIndex) {
1509                next = true;
1510                if ((index === length - 1) && (prevIndex === 0) && !fromThumb) {
1511                    prev = true;
1512                    next = false;
1513                }
1514            }
1515
1516            if (prev) {
1517
1518                this.$item.eq(index).addClass($object.settings.classPrefix + 'prev-slide');
1519                this.$item.eq(prevIndex).addClass($object.settings.classPrefix + 'next-slide');
1520            } else if (next) {
1521
1522                this.$item.eq(index).addClass($object.settings.classPrefix + 'next-slide');
1523                this.$item.eq(prevIndex).addClass($object.settings.classPrefix + 'prev-slide');
1524            }
1525
1526            setTimeout(function () {
1527                $object.$item.removeClass($object.settings.classPrefix + 'current');
1528
1529                $object.$item.eq(index).addClass($object.settings.classPrefix + 'current');
1530
1531                $object.$cont.removeClass($object.settings.classPrefix + 'no-trans');
1532            }, 50);
1533        } else {
1534
1535            var slidePrev = index - 1;
1536            var slideNext = index + 1;
1537
1538            if ((index === 0) && (prevIndex === length - 1)) {
1539
1540                slideNext = 0;
1541                slidePrev = length - 1;
1542            } else if ((index === length - 1) && (prevIndex === 0)) {
1543
1544                slideNext = 0;
1545                slidePrev = length - 1;
1546            }
1547
1548            this.$item.removeClass($object.settings.classPrefix + 'prev-slide ' + $object.settings.classPrefix + 'current ' + $object.settings.classPrefix + 'next-slide');
1549            $object.$item.eq(slidePrev).addClass($object.settings.classPrefix + 'prev-slide');
1550            $object.$item.eq(slideNext).addClass($object.settings.classPrefix + 'next-slide');
1551            $object.$item.eq(index).addClass($object.settings.classPrefix + 'current');
1552        }
1553
1554        $object.loadContent(index, true, $object.settings.overlayDuration);
1555
1556        $object.$element.trigger('onAfterSlide.rwd-container', [prevIndex, index, fromSlide, fromThumb]);
1557
1558        if (this.settings.showCounter) {
1559            $('#' + $object.settings.classPrefix + 'counter-current').text(index + 1);
1560        }
1561
1562        if (this.settings.socialSharing) {
1563            $object.changeHash(index);
1564        }
1565
1566        var $top, $left, $wWidth, $wHeight, $imgWidth, $imgHeight, $wmWidth, $wmHeight, $pos, $item;
1567        $item = $('.rwd-item.rwd-current');
1568        $pos = +hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_margin;
1569        $wWidth = +hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_containerWidth;
1570        $wHeight = +hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_textFontSize;
1571        $imgWidth = $object.$item.eq(index).find('img').width();
1572        $imgHeight = $object.$item.eq(index).find('img').height();
1573        $wmWidth = $item.width();
1574        $wmHeight = $item.height();
1575
1576        switch ('pos' + hugeit_resp_lightbox_obj.hugeit_lightbox_watermark_position_new) {
1577            case 'pos1':
1578                $top = ($wmHeight - $imgHeight) / 2 + $pos;
1579                $left = ($wmWidth - $imgWidth) / 2 + $pos;
1580                break;
1581            case 'pos2':
1582                $top = ($wmHeight - $imgHeight) / 2 + $pos;
1583                $left = ($wmWidth - $wWidth) / 2;
1584                break;
1585            case 'pos3':
1586                $top = ($wmHeight - $imgHeight) / 2 + $pos;
1587                $left = ($wmWidth + $imgWidth) / 2 - $wWidth - $pos;
1588                break;
1589            case 'pos4':
1590                $top = ($wmHeight - $wHeight) / 2;
1591                $left = ($wmWidth - $imgWidth) / 2 + $pos;
1592                break;
1593            case 'pos5':
1594                $top = ($wmHeight - $wHeight) / 2;
1595                $left = ($wmWidth - $wWidth) / 2;
1596                break;
1597            case 'pos6':
1598                $top = ($wmHeight - $wHeight) / 2;
1599                $left = ($wmWidth + $imgWidth) / 2 - $wWidth - $pos;
1600                break;
1601            case 'pos7':
1602                $top = ($wmHeight + $imgHeight) / 2 - $wHeight - $pos;
1603                $left = ($wmWidth - $imgWidth) / 2 + $pos;
1604                break;
1605            case 'pos8':
1606                $top = ($wmHeight + $imgHeight) / 2 - $wHeight - $pos;
1607                $left = ($wmWidth - $wWidth) / 2;
1608                break;
1609            case 'pos9':
1610                $top = ($wmHeight + $imgHeight) / 2 - $wHeight - $pos;
1611                $left = ($wmWidth + $imgWidth) / 2 - $wWidth - $pos;
1612                break;
1613            default:
1614                $top = ($wmHeight - $wHeight) / 2;
1615                $left = ($wmWidth - $wWidth) / 2;
1616        }
1617
1618        $('.w_url').css({
1619            position: 'absolute',
1620            width: $wWidth + 'px',
1621            height: $wHeight + 'px',
1622            top: $top + 'px',
1623            left: $left + 'px'
1624        });
1625
1626        $object.calculateDimensions(index);
1627
1628        $('.rwd-container .rwd-thumb-item img').css({
1629            opacity: 1 - 10 / 100
1630        });
1631
1632        $('.rwd-container .rwd-thumb-item.active img').css({
1633            opacity: 1
1634        });
1635
1636        if(this.settings.lightboxView === 'view7'){
1637            this.$element.on('onBeforeSlide.rwd-container', function() {
1638                $('.view7_share, .rwd-close-bar, .rwd-toolbar').css({
1639                    visibility: 'hidden',
1640                    opacity: '0',
1641                    transition: 'visibility 0s, opacity 0.5s linear'
1642                });
1643            });
1644
1645            this.$element.on('onAfterSlide.rwd-container', function() {
1646                setTimeout(function(){
1647                    $('.view7_share, .rwd-close-bar, .rwd-toolbar').css({
1648                        visibility: 'visible',
1649                        opacity: '1'
1650                    });
1651                }, 450);
1652            });
1653        }
1654
1655        $(window).on('resize.rwd-container orientationchange.rwd-container', function () {
1656            var $t = ($object.settings.lightboxView !== 'view7') ? 100 : 0;
1657            setTimeout(function () {
1658                $object.calculateDimensions(index);
1659            }, $t);
1660        });
1661    };
1662
1663    Lightbox.prototype.goToNextSlide = function (fromSlide) {
1664        var $object = this,
1665            $cont = $('.rwd-cont'),
1666            $imageObject, k;
1667        if (($object.index + 1) < $object.$item.length) {
1668            $object.index++;
1669            $object.slide($object.index, fromSlide, false);
1670        } else {
1671            if ($object.settings.loop === 'true') {
1672                $object.index = 0;
1673                $object.slide($object.index, fromSlide, false);
1674            }
1675        }
1676
1677        if ($object.settings.fullwidth && $cont.hasClass('rwd-fullwidth-on')) {
1678            $imageObject = $cont.find('.rwd-image').eq($object.index);
1679
1680            k = $imageObject.width() / $imageObject.height();
1681            if ($imageObject.width() > $imageObject.height() && k > 2) {
1682                $imageObject.css({
1683                    'min-width': '100%'
1684                });
1685            } else {
1686                $imageObject.css({
1687                    'min-height': '100%'
1688                });
1689            }
1690        }
1691    };
1692
1693    Lightbox.prototype.goToPrevSlide = function (fromSlide) {
1694        var $object = this,
1695            $cont = $('.rwd-cont'),
1696            $imageObject, k;
1697
1698        if ($object.index > 0) {
1699            $object.index--;
1700            $object.slide($object.index, fromSlide, false);
1701        } else {
1702            if ($object.settings.loop === 'true') {
1703                $object.index = $object.$items.length - 1;
1704                $object.slide($object.index, fromSlide, false);
1705            }
1706        }
1707
1708        if ($object.settings.fullwidth && $cont.hasClass('rwd-fullwidth-on')) {
1709            $imageObject = $cont.find('.rwd-image').eq($object.index);
1710
1711            k = $imageObject.width() / $imageObject.height();
1712            if ($imageObject.width() > $imageObject.height() && k > 2) {
1713                $imageObject.css({
1714                    'min-width': '100%'
1715                });
1716            } else {
1717                $imageObject.css({
1718                    'min-height': '100%'
1719                });
1720            }
1721        }
1722    };
1723
1724    Lightbox.prototype.slideShow = function () {
1725        var $object = this, $toolbar, $play_bg, $pause_bg;
1726
1727        $play_bg = '<svg class="play_bg" width="20px" height="20px" fill="#999" viewBox="-192 193.9 314.1 314.1">' +
1728            '<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>' +
1729            '</svg>';
1730        $pause_bg = '<svg class="pause_bg" width="20px" height="20px" fill="#999" viewBox="-94 96 510 510" >' +
1731            '<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>' +
1732            '</svg>';
1733
1734        $toolbar = $('.' + $object.settings.classPrefix + 'toolbar');
1735        switch (this.settings.lightboxView) {
1736            case 'view1':
1737            default:
1738                $toolbar.append('<span class="' + $object.settings.classPrefix + 'auto
1738play-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>');
1739                break;
1740            case 'view2':
1741                $('.' + $object.settings.classPrefix + 'bar').append('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>');
1742                break;
1743            case 'view3':
1744                $toolbar.append('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>');
1745                $('.rwd-toolbar .rwd-icon').addClass('rwd-icon0');
1746                break;
1747            case 'view4':
1748                $('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>').insertBefore($('.rwd-title'));
1749                $('.rwd-toolbar .rwd-icon').addClass('rwd-icon0');
1750                break;
1751            case 'view7':
1752                $('.tool_bar').append('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>');
1753                break;
1754        }
1755
1756        if ($object.settings.slideshowAuto) {
1757            $object.slideshowAuto();
1758        }
1759
1760        $object.$cont.find('.' + $object.settings.classPrefix + 'autoplay-button').on('click.rwd-container', function () {
1761            !$($object.$cont).hasClass($object.settings.classPrefix + 'show-autoplay') ? $object.startSlide() : $object.stopSlide();
1762        });
1763
1764    };
1765
1766    Lightbox.prototype.slideshowAuto = function () {
1767        var $object = this;
1768
1769        $object.$cont.addClass('' + $object.settings.classPrefix + 'show-autoplay');
1770        $object.startSlide();
1771    };
1772
1773    Lightbox.prototype.startSlide = function () {
1774        var $object = this;
1775        $object.$cont.addClass('' + $object.settings.classPrefix + 'show-autoplay');
1776        $('.rwd-autoplay-button > .pause_bg').css({'display': 'inline-block'});
1777        $('.rwd-autoplay-button > .play_bg').css({'display': 'none'});
1778        $object.interval = setInterval(function () {
1779            $object.goToNextSlide();
1780        }, $object.settings.slideshowSpeed);
1781    };
1782
1783    Lightbox.prototype.stopSlide = function () {
1784        clearInterval(this.interval);
1785        this.$cont.removeClass(this.settings.classPrefix + 'show-autoplay');
1786        $('.rwd-thumb').removeClass('thumb_move');
1787        $('.rwd-autoplay-button > .pause_bg').css({'display': 'none'});
1788        $('.rwd-autoplay-button > .play_bg').css({'display': 'inline-block'});
1789    };
1790
1791    Lightbox.prototype.addKeyEvents = function () {
1792        var $object = this;
1793        if (this.$items.length > 1) {
1794            $(window).on('keyup.rwd-container', function (e) {
1795                if ($object.$items.length > 1) {
1796                    if (e.keyCode === 37) {
1797                        e.preventDefault();
1798                        $object.goToPrevSlide();
1799                    }
1800
1801                    if (e.keyCode === 39) {
1802                        e.preventDefault();
1803                        $object.goToNextSlide();
1804                    }
1805                }
1806            });
1807        }
1808
1809        $(window).on('keydown.rwd-container', function (e) {
1810            if ($object.settings.escKey === true && e.keyCode === 27) {
1811                e.preventDefault();
1812                if (!$object.$cont.hasClass($object.settings.classPrefix + 'thumb-open')) {
1813                    $object.destroy();
1814                } else {
1815                    $object.$cont.removeClass($object.settings.classPrefix + 'thumb-open');
1816                }
1817            }
1818        });
1819    };
1820
1821    Lightbox.prototype.arrow = function () {
1822        var $object = this;
1823        this.$cont.find('.' + $object.settings.classPrefix + 'prev').on('click.rwd-container', function () {
1824            $object.goToPrevSlide();
1825        });
1826
1827        this.$cont.find('.' + $object.settings.classPrefix + 'next').on('click.rwd-container', function () {
1828            $object.goToNextSlide();
1829        });
1830    };
1831
1832    Lightbox.prototype.arrowDisable = function (index) {
1833
1834        if (!this.settings.loop === 'true' && this.settings.hideControlOnEnd) {
1835            if ((index + 1) < this.$item.length) {
1836                this.$cont.find('.' + this.settings.classPrefix + 'next').removeAttr('disabled').removeClass('disabled');
1837            } else {
1838                this.$cont.find('.' + this.settings.classPrefix + 'next').attr('disabled', 'disabled').addClass('disabled');
1839            }
1840
1841            if (index > 0) {
1842                this.$cont.find('.' + this.settings.classPrefix + 'prev').removeAttr('disabled').removeClass('disabled');
1843            } else {
1844                this.$cont.find('.' + this.settings.classPrefix + 'prev').attr('disabled', 'disabled').addClass('disabled');
1845            }
1846        }
1847    };
1848
1849    Lightbox.prototype.mousewheel = function () {
1850        var $object = this, delta;
1851
1852        $object.$cont.on('mousewheel', function (e) {
1853            e = e || window.event;
1854            delta = e.deltaY || e.detail || e.wheelDelta;
1855
1856            (delta > 0) ? $object.goToNextSlide() : $object.goToPrevSlide();
1857            e.preventDefault ? e.preventDefault() : (e.returnValue = false);
1858        });
1859
1860    };
1861
1862    Lightbox.prototype.closeGallery = function () {
1863
1864        var $object = this, mousedown = false;
1865
1866        this.$cont.find('.' + $object.settings.classPrefix + 'close').on('click.rwd-container', function () {
1867            $object.destroy();
1868        });
1869
1870        if ($object.settings.overlayClose === 'true') {
1871
1872            $object.$cont.on('mousedown.rwd-container', function (e) {
1873
1874                mousedown = ($(e.target).is('.' + $object.settings.classPrefix + 'cont') || $(e.target).is('.' + $object.settings.classPrefix + 'item ') || $(e.target).is('.' + $object.settings.classPrefix + 'img-wrap'));
1875
1876            });
1877
1878            $object.$cont.on('mouseup.rwd-container', function (e) {
1879
1880                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) {
1881                    if (!$object.$cont.hasClass($object.settings.classPrefix + 'dragEvent')) {
1882                        $object.destroy();
1883                    }
1884                }
1885
1886            });
1887
1888        }
1889    };
1890
1891    Lightbox.prototype.destroy = function (d) {
1892
1893        var $object = this, $time;
1894
1895        $('.rwd-container').removeClass(this.settings.openCloseType[0]).addClass(this.settings.openCloseType[1]);
1896
1897        switch(this.settings.openCloseType[1]){
1898            case 'close_1':
1899            case 'close_1_r':
1900                $time = 1000;
1901                break;
1902            case 'close_2':
1903            case 'close_2_r':
1904                $time = 300;
1905                break;
1906            case 'close_3':
1907            case 'close_4':
1908            case 'close_3_r':
1909            case 'close_4_r':
1910                $time = 340;
1911                break;
1912            case 'close_5':
1913            case 'close_5_r':
1914                $time = 250;
1915                break;
1916        }
1917
1918        $('html, body').on('mousewheel', function(){
1919            return false;
1920        });
1921
1922        setTimeout(function(){
1923            clearInterval($object.interval);
1924
1925            $object.$body.removeClass($object.settings.classPrefix + 'on');
1926
1927            $(window).scrollTop($object.prevScrollTop);
1928
1929            if (d) {
1930                $.removeData($object.el, 'lightbox');
1931            }
1932
1933            ($object.settings.socialSharing && (window.location.hash = ''));
1934
1935            $object.$element.off('.rwd-container');
1936
1937            $(window).off('.rwd-container');
1938
1939            if ($object.$cont) {
1940                $object.$cont.removeClass($object.settings.classPrefix + 'visible');
1941            }
1942
1943            $object.objects.overlay.removeClass('in');
1944
1945            setTimeout(function () {
1946                if ($object.$cont) {
1947                    $object.$cont.remove();
1948                }
1949
1950                $object.objects.overlay.remove();
1951
1952            }, $object.settings.overlayDuration + 50);
1953
1954            window.scrollTo(0, $object.$_y_);
1955
1956            $.fn.lightbox.lightboxModul['modul'].prototype.destroy();
1957
1958            $('html, body').off('mousewheel');
1959        }, $time);
1960    };
1961
1962    $.fn.lightbox = function (options) {
1963        return this.each(function () {
1964            if (!$.data(this, 'lightbox')) {
1965                $.data(this, 'lightbox', new Lightbox(this, options));
1966            }
1967        });
1968    };
1969
1970    $.fn.lightbox.lightboxModul = {};
1971
1972    var Modul = function (element) {
1973
1974        this.dataL = $(element).data('lightbox');
1975        this.$element = $(element);
1976        this.dataL.modulSettings = $.extend({}, this.constructor.defaultsModul);
1977
1978        this.init();
1979
1980        if (this.dataL.modulSettings.zoom && this.dataL.effectsSupport()) {
1981            if(hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView !== 'view7' && this.dataL.modulSettings.zoomType === '0'){
1982                this.initZoom();
1983
1984                this.zoomabletimeout = false;
1985
1986                this.pageX = $(window).width() / 2;
1987                this.pageY = ($(window).height() / 2) + $(window).scrollTop();
1988            }
1989        }
1990
1991        if (hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView !== 'view7' && this.dataL.modulSettings.fullwidth && this.dataL.effectsSupport()) {
1992            this.initFullWidth();
1993        }
1994
1995        this.$el = $(element);
1996        this.$thumbCont = null;
1997        this.thumbContWidth = 0;
1998        this.thumbTotalWidth = (this.dataL.$items.length * (this.dataL.modulSettings.thumbsWidth + this.dataL.modulSettings.thumbMargin));
1999        this.thumbIndex = this.dataL.index;
2000        this.left = 0;
2001        if(hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs === 'true'){
2002            this.initThumbs();
2003        }
2004
2005        if(this.dataL.modulSettings.fullscreen){
2006            this.initFullscreen();
2007        }
2008
2009        return this;
2010    };
2011
2012    Modul.defaultsModul = {
2013        idPrefix: 'rwd-',
2014        classPrefix: 'rwd-',
2015        attrPrefix: 'data-',
2016        videoMaxWidth: '700',
2017        fullwidth: hugeit_resp_lightbox_obj.hugeit_lightbox_fullwidth_effect === 'true',
2018        zoom: hugeit_resp_lightbox_obj.hugeit_lightbox_zoom,
2019        scale: +hugeit_resp_lightbox_obj.hugeit_lightbox_zoomsize / 10,
2020        thumbnail: hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs,
2021        thumbsWidth: 100,
2022        thumbsHeight: 100,
2023        thumbMargin: 5,
2024        showByDefault: true,
2025        toogleThumb: false,
2026        thumbPosition: '0',
2027        thumbsOverlayColor: 'black',
2028        thumbsOverlayOpacity: 10,
2029        fullscreen: hugeit_resp_lightbox_obj.hugeit_lightbox_fullscreen_effect === 'true'
2030    };
2031
2032    Modul.prototype.init = function () {
2033        var $object = this;
2034
2035        $object.dataL.$element.on('hasVideo.rwd-container', function (event, index, src) {
2036            $object.dataL.$item.eq(index).find('.' + $object.dataL.modulSettings.classPrefix + 'video').append($object.loadVideo(src, '' + $object.dataL.modulSettings.classPrefix + 'object', index));
2037        });
2038
2039        $object.dataL.$element.on('onAferAppendSlide.rwd-container', function (event, index) {
2040            $object.dataL.$item.eq(index).find('.' + $object.dataL.settings.classPrefix + 'video-cont').css({
2041                'max-width': $object.dataL.modulSettings.videoMaxWidth + 'px'
2042            });
2043        });
2044
2045        $object.dataL.$element.on('onBeforeSlide.rwd-container', function (event, prevIndex, index) {
2046
2047            var $videoSlide = $object.dataL.$item.eq(prevIndex),
2048                youtubePlayer = $videoSlide.find('.rwd-youtube').get(0),
2049                vimeoPlayer = $videoSlide.find('.rwd-vimeo').get(0),
2050                dailymotionPlayer = $videoSlide.find('.rwd-dailymotion').get(0);
2051
2052            if (youtubePlayer) {
2053                youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
2054            } else if (vimeoPlayer) {
2055                try {
2056                    $f(vimeoPlayer).api('pause');
2057                } catch (e) {
2058                    console.error('Make sure you have included froogaloop2 js');
2059                }
2060            } else if (dailymotionPlayer) {
2061                dailymotionPlayer.contentWindow.postMessage('pause', '*');
2062            }
2063
2064            var src;
2065            src = $object.dataL.$items.eq(index).attr('href');
2066
2067            var isVideo = $object.dataL.isVideo(src, index) || {};
2068            if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
2069                $object.dataL.$cont.addClass($object.dataL.modulSettings.classPrefix + 'hide-download');
2070                $object.dataL.$cont.addClass($object.dataL.modulSettings.classPrefix + 'hide-actual-size');
2071                $object.dataL.$cont.addClass($object.dataL.modulSettings.classPrefix + 'hide-fullwidth');
2072                $object.dataL.$cont.addClass($object.dataL.modulSettings.classPrefix + 'hide-zoom-in');
2073                $object.dataL.$cont.addClass($object.dataL.modulSettings.classPrefix + 'hide-zoom-out');
2074            }
2075
2076        });
2077
2078        $object.dataL.$element.on('onAfterSlide.rwd-container', function (event, prevIndex) {
2079            $object.dataL.$item.eq(prevIndex).removeClass($object.dataL.modulSettings.classPrefix + 'video-playing');
2080        });
2081    };
2082
2083    Modul.prototype.loadVideo = function (src, addClass, index) {
2084        var video = '',
2085            autoplay = 0,
2086            a = '',
2087            isVideo = this.dataL.isVideo(src, index) || {};
2088
2089        if (isVideo.youtube) {
2090
2091            a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
2092
2093            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>';
2094
2095        } else if (isVideo.vimeo) {
2096
2097            a = '?autoplay=' + autoplay + '&api=1';
2098
2099            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>';
2100
2101        } else if (isVideo.dailymotion) {
2102
2103            a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
2104
2105            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>';
2106
2107        }
2108
2109        return video;
2110    };
2111
2112    Modul.prototype.initFullscreen = function() {
2113        var fullScreen = '';
2114        if (this.dataL.modulSettings.fullscreen) {
2115            if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled && !document.mozFullScreenEnabled && !document.msFullscreenEnabled) {
2116                return;
2117            } else {
2118                fullScreen = '<span class="rwd-fullscreen rwd-icon">' +
2119                    '<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;">' +
2120                    '<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>' +
2121                    '</g></g></svg>
2121' +
2122                    '<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;">' +
2123                    '<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>' +
2124                    '</g></g></svg>' +
2125                    '</span>';
2126                switch (hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView) {
2127                    case 'view1':
2128                    default:
2129                        $('.rwd-cont').find('.rwd-toolbar').append(fullScreen);
2130                        break;
2131                    case 'view2':
2132                        $('.rwd-cont').find('.rwd-bar').append(fullScreen);
2133                        break;
2134                    case 'view4':
2135                        $(fullScreen).insertBefore('.rwd-title');
2136                        break;
2137                    case 'view7':
2138                        $('.tool_bar').append(fullScreen);
2139                        break;
2140                }
2141
2142                this.fullScreen();
2143            }
2144        }
2145    };
2146
2147    Modul.prototype.requestFullscreen = function() {
2148        var el = document.documentElement;
2149
2150        if (el.requestFullscreen) {
2151            el.requestFullscreen();
2152        } else if (el.msRequestFullscreen) {
2153            el.msRequestFullscreen();
2154        } else if (el.mozRequestFullScreen) {
2155            el.mozRequestFullScreen();
2156        } else if (el.webkitRequestFullscreen) {
2157            el.webkitRequestFullscreen();
2158        }
2159    };
2160
2161    Modul.prototype.exitFullscreen = function() {
2162        if (document.exitFullscreen) {
2163            document.exitFullscreen();
2164        } else if (document.msExitFullscreen) {
2165            document.msExitFullscreen();
2166        } else if (document.mozCancelFullScreen) {
2167            document.mozCancelFullScreen();
2168        } else if (document.webkitExitFullscreen) {
2169            document.webkitExitFullscreen();
2170        }
2171    };
2172
2173    Modul.prototype.fullScreen = function() {
2174        var $object = this;
2175
2176        $(document).on('fullscreenchange.rwd-container webkitfullscreenchange.rwd-container mozfullscreenchange.rwd-container MSFullscreenChange.rwd-container', function() {
2177            $('.rwd-cont').toggleClass('rwd-fullscreen-on');
2178        });
2179
2180        $('.rwd-cont').find('.rwd-fullscreen').on('click.rwd-container', function() {
2181            if (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {
2182                $object.requestFullscreen();
2183            } else {
2184                $object.exitFullscreen();
2185            }
2186        });
2187
2188        $(window).on('keydown', function(e){
2189           if(e.keyCode === 27){
2190               console.log(1);
2191           }
2192        });
2193
2194    };
2195
2196    Modul.prototype.initFullWidth = function () {
2197        var $object = this,
2198            $fullWidth, $fullWidthOn;
2199
2200        $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;">' +
2201            '<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' +
2202            'L190.2,279.6L307.9,162l-0.1,90.5l108.6,0.1L416.4,306.9z M416.4,306.9"/></g></svg>';
2203
2204        $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;">' +
2205            '<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' +
2206            'l117.9,117.4l-117.4,118l-0.2-90.5l-108.6,0.3L217.3,252.8z M416.4,306.9"/></svg>';
2207
2208        if (this.dataL.modulSettings.fullwidth) {
2209            var fullwidth = '<span class="rwd-fullwidth rwd-icon">' + $fullWidth + $fullWidthOn + '</span>';
2210            switch (hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView) {
2211                case 'view1':
2212                default:
2213                    this.dataL.$cont.find('.rwd-toolbar').append(fullwidth);
2214                    break;
2215                case 'view2':
2216                    this.dataL.$cont.find('.rwd-bar').append(fullwidth);
2217                    break;
2218                case 'view4':
2219                    $(fullwidth).insertBefore('.rwd-title');
2220                    break;
2221            }
2222
2223        }
2224
2225        if (this.dataL.modulSettings.fullwidth) {
2226            $('.rwd-fullwidth').on('click.rwd-container', function () {
2227                !$('.rwd-cont').hasClass('rwd-fullwidth-on') ? $object.onFullWidth() : $object.offFullWidth();
2228            });
2229        }
2230    };
2231
2232    Modul.prototype.onFullWidth = function () {
2233
2234        var $imageObject = this.dataL.$cont.find('.rwd-current .rwd-image');
2235
2236        $('#rwd-fullwidth').css({'display': 'none'});
2237        $('#rwd-fullwidth_on').css({'display': 'inline-block'});
2238
2239        $('.rwd-cont').addClass('rwd-fullwidth-on');
2240
2241        $('.rwd-container').css({
2242            width: '100%',
2243            height: '100%'
2244        });
2245
2246        var k = $imageObject.width() / $imageObject.height();
2247        if ($imageObject.width() > $imageObject.height() && k > 2) {
2248            $imageObject.css({
2249                'min-width': '100%'
2250            });
2251        } else {
2252            $imageObject.css({
2253                'min-height': '100%'
2254            });
2255        }
2256    };
2257
2258    Modul.prototype.offFullWidth = function () {
2259        var $imageObject = this.dataL.$cont.find('.rwd-current .rwd-image');
2260
2261        $('#rwd-fullwidth').css({'display': 'inline-block'});
2262        $('#rwd-fullwidth_on').css({'display': 'none'});
2263
2264        $('.rwd-cont').removeClass('rwd-fullwidth-on');
2265        $('.rwd-container').css({
2266            width: hugeit_resp_lightbox_obj.hugeit_lightbox_width_new + '%',
2267            height: hugeit_resp_lightbox_obj.hugeit_lightbox_height_new + '%'
2268        });
2269        $imageObject.css({
2270            'min-width': '',
2271            'min-height': ''
2272        });
2273    };
2274
2275    Modul.prototype.initZoom = function () {
2276
2277        var $object = this, zoomIcons,
2278            $zoomIn, $zoomOut, scale;
2279
2280        $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;">' +
2281            '<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' +
2282            'c0.6,0,1-0.4,1-1S11.5,39,11,39z"/>' +
2283            '<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' +
2284            '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' +
2285            's19,8.5,19,19S14.5,59,4,59S-15,50.5-15,40z"/></g>' +
2286            '</svg>';
2287
2288        $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;">' +
2289            '<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"/>' +
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        zoomIcons = '<span id="rwd-zoom-out" class="rwd-icon">' + $zoomOut + '</span><span id="rwd-zoom-in" class="rwd-icon">' + $zoomIn + '</span>';
2296
2297        switch (hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView) {
2298            case 'view1':
2299            default:
2300                this.dataL.$cont.find('.rwd-toolbar').append(zoomIcons);
2301                break;
2302            case 'view2':
2303                this.dataL.$cont.find('.rwd-bar').append(zoomIcons);
2304                break;
2305            case 'view4':
2306                $(zoomIcons).insertBefore('.rwd-title');
2307                break;
2308        }
2309
2310        scale = 1;
2311        function zoom(scaleVal) {
2312            var $imageObject, _x, _y, offsetX, offsetY, x, y;
2313
2314            $imageObject = $object.dataL.$cont.find('.rwd-current .rwd-image');
2315
2316            offsetX = ($(window).width() - $imageObject.width()) / 2;
2317            offsetY = (($(window).height() - $imageObject.height()) / 2) + $(window).scrollTop();
2318
2319            _x = $object.pageX - offsetX;
2320            _y = $object.pageY - offsetY;
2321
2322            x = _x;
2323            y = _y;
2324
2325            $imageObject.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal);
2326
2327            $imageObject.parent().css({
2328                transform: 'translate3d(0, ' + -y + 'px, 0)'
2329            }).attr('data-y', -y);
2330        }
2331
2332        function callScale() {
2333            if (scale > 1) {
2334                $object.dataL.$cont.addClass('rwd-zoomed');
2335            } else {
2336                $object.dataL.$cont.removeClass('rwd-zoomed');
2337            }
2338
2339            if (scale < 1) {
2340                scale = 1;
2341            }
2342
2343            zoom(scale);
2344        }
2345
2346        $(window).on('resize.rwd-container.zoom scroll.rwd-container.zoom orientationchange.rwd-container.zoom', function () {
2347            $object.pageX = $(window).width() / 2;
2348            $object.pageY = ($(window).height() / 2) + $(window).scrollTop();
2349            zoom(scale);
2350        });
2351
2352        $('#rwd-zoom-out').on('click.rwd-container', function () {
2353            if ($object.dataL.$cont.find('.rwd-current .rwd-image').length) {
2354                scale -= $object.dataL.modulSettings.scale;
2355                callScale();
2356            }
2357        });
2358
2359        $('#rwd-zoom-in').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        if (hugeit_resp_lightbox_obj.hugeit_lightbox_zoomlogo !== '0') {
2367            $object.dataL.$cont.dblclick(function () {
2368                if (!$object.dataL.$cont.hasClass('dbl-zoomed')) {
2369                    $object.dataL.$cont.addClass('dbl-zoomed');
2370                    if ($object.dataL.$cont.find('.rwd-current .rwd-image').length) {
2371                        scale += $object.dataL.modulSettings.scale;
2372                        callScale();
2373                    }
2374                } else {
2375                    $object.dataL.$cont.removeClass('dbl-zoomed');
2376                    if ($object.dataL.$cont.find('.rwd-current .rwd-image').length) {
2377                        scale -= $object.dataL.modulSettings.scale;
2378                        callScale();
2379                    }
2380                }
2381            });
2382        }
2383
2384        if (!('ontouchstart' in document.documentElement)) {
2385            $object.zoomDrag();
2386        }
2387
2388        if (('ontouchstart' in document.documentElement)) {
2389            $object.zoomSwipe();
2390        }
2391
2392    };
2393
2394    Modul.prototype.touchendZoom = function (startCoords, endCoords, abscissa, ordinate) {
2395
2396        var $object = this, _$el, $imageObject, distanceX, distanceY, maxX, maxY;
2397
2398        _$el = $object.dataL.$item.eq($object.dataL.index).find('.rwd-img-wrap');
2399        $imageObject = $object.dataL.$item.eq($object.dataL.index).find('.rwd-object');
2400        maxX = Math.abs($imageObject.outerWidth() * Math.abs($imageObject.attr('data-scale')) - $object.dataL.$cont.find('.rwd-container').width()) / 2;
2401        maxY = Math.abs($imageObject.outerHeight() * Math.abs($imageObject.attr('data-scale')) - $object.dataL.$cont.find('.rwd-container').height()) / 2 + $(window).scrollTop();
2402
2403        if (_$el.attr('data-x')) {
2404            distanceX = +_$el.attr('data-x') + (endCoords.x - startCoords.x);
2405        } else {
2406            distanceX = endCoords.x - startCoords.x;
2407        }
2408
2409        distanceY = +_$el.attr('data-y') + (endCoords.y - startCoords.y);
2410
2411        if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
2412
2413            if (abscissa) {
2414                if (endCoords.x - startCoords.x < 0) {
2415                    if(distanceX <= -maxX){
2416                        distanceX = -maxX;
2417                    }
2418                } else {
2419                    if(distanceX >= maxX) {
2420                        distanceX = maxX;
2421                    }
2422                }
2423
2424                _$el.attr('data-x', distanceX);
2425            }
2426
2427            if (ordinate) {
2428                if (endCoords.y - startCoords.y < 0) {
2429                    if(distanceY <= -(maxY + ($object.pageY - ($(window).height() - $imageObject.height()) / 2)) + 2 * $(window).scrollTop()) {
2430                        distanceY = -(maxY + ($object.pageY - ($(window).height() - $imageObject.height()) / 2)) + 2 * $(window).scrollTop();
2431                    }
2432                } else {
2433                    if(distanceY >= maxY - ($object.pageY - ($(window).height() - $imageObject.height()) / 2)) {
2434                        distanceY = maxY - ($object.pageY - ($(window).height() - $imageObject.height()) / 2);
2435                    }
2436                }
2437
2438                _$el.attr('data-y', distanceY);
2439            }
2440
2441            _$el.css({
2442                transform: 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'
2443            });
2444
2445        }
2446    };
2447
2448    Modul.prototype.zoomDrag = function () {
2449
2450        var $object = this,
2451            startCoords = {},
2452            endCoords = {},
2453            isDraging = false,
2454            isMoved = false,
2455            abscissa = false,
2456            ordinate = false;
2457
2458        $object.dataL.$item.on('mousedown.rwd-container.zoom', function (e) {
2459
2460            var $imageObject = $object.dataL.$item.eq($object.dataL.index).find('.rwd-object');
2461
2462            ordinate = $imageObject.outerHeight() * $imageObject.attr('data-scale') > $object.dataL.$cont.find('.rwd-container').height();
2463            abscissa = $imageObject.outerWidth() * $imageObject.attr('data-scale') > $object.dataL.$cont.find('.rwd-container').width();
2464
2465            if ($object.dataL.$cont.hasClass('rwd-zoomed')) {
2466                if ($(e.target).hasClass('rwd-object') && (abscissa || ordinate)) {
2467                    e.preventDefault();
2468                    startCoords = {
2469                        x: e.pageX,
2470                        y: e.pageY
2471                    };
2472
2473                    isDraging = true;
2474
2475                    $object.dataL.$cont.scrollLeft += 1;
2476                    $object.dataL.$cont.scrollLeft -= 1;
2477
2478                }
2479            }
2480        });
2481
2482        $(window).on('mousemove.rwd-container.zoom', function (e) {
2483            if (isDraging) {
2484                var _$el = $object.dataL.$item.eq($object.dataL.index).find('.rwd-img-wrap');
2485                var distanceX;
2486                var distanceY;
2487
2488                isMoved = true;
2489                endCoords = {
2490                    x: e.pageX,
2491                    y: e.pageY
2492                };
2493
2494                if (_$el.attr('data-x')) {
2495                    distanceX = +_$el.attr('data-x') + (endCoords.x - startCoords.x);
2496                } else {
2497                    distanceX = endCoords.x - startCoords.x;
2498                }
2499
2500                if (ordinate) {
2501                    distanceY = +_$el.attr('data-y') + (endCoords.y - startCoords.y);
2502                }
2503
2504                _$el.css({
2505                    transform: 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'
2506                });
2507            }
2508        });
2509
2510        $(window).on('mouseup.rwd-container.zoom', function (e) {
2511
2512            if (isDraging) {
2513                isDraging = false;
2514
2515                if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) {
2516                    endCoords = {
2517                        x: e.pageX,
2518                        y: e.pageY
2519                    };
2520                    $object.touchendZoom(startCoords, endCoords, abscissa, ordinate);
2521
2522                }
2523
2524                isMoved = false;
2525            }
2526
2527        });
2528    };
2529
2530    Modul.prototype.zoomSwipe = function () {
2531        var $object = this,
2532            startCoords = {},
2533            endCoords = {},
2534            isMoved = false,
2535            abscissa = false,                   ordinate = false;
2536
2537        $object.dataL.$item.on('touchstart.rwd-container', function (e) {
2538
2539            if ($object.dataL.$cont.hasClass('rwd-zoomed')) {
2540                var $imageObject = $object.dataL.$item.eq($object.dataL.index).find('.rwd-object');
2541
2542                ordinate = $imageObject.outerHeight() * $imageObject.attr('data-scale') > $object.dataL.$cont.find('.rwd-container').height();
2543                abscissa = $imageObject.outerWidth() * $imageObject.attr('data-scale') > $object.dataL.$cont.find('.rwd-container').width();
2544                if ((abscissa || ordinate)) {
2545                    e.preventDefault();
2546                    startCoords = {
2547                        x: e.originalEvent.targetTouches[0].pageX,
2548                        y: e.originalEvent.targetTouches[0].pageY
2549                    };
2550                }
2551            }
2552
2553        });
2554
2555        $object.dataL.$item.on('touchmove.rwd-container', function (e) {
2556
2557            if ($object.dataL.$cont.hasClass('rwd-zoomed')) {
2558
2559                var _$el = $object.dataL.$item.eq($object.dataL.index).find('.rwd-img-wrap');
2560                var distanceX;
2561                var distanceY;
2562
2563                e.preventDefault();
2564                isMoved = true;
2565
2566                endCoords = {
2567                    x: e.originalEvent.targetTouches[0].pageX,
2568                    y: e.originalEvent.targetTouches[0].pageY
2569                };
2570
2571                if (_$el.attr('data-x')) {
2572                    distanceX = +_$el.attr('data-x') + (endCoords.x - startCoords.x);
2573                } else {
2574                    distanceX = endCoords.x - startCoords.x;
2575                }
2576
2577                if (ordinate) {
2578                    distanceY = +_$el.attr('data-y') + (endCoords.y - startCoords.y);
2579                }
2580
2581                if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) {
2582                    _$el.css({
2583                        transform: 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'
2584                    });
2585                }
2586
2587            }
2588
2589        });
2590
2591        $object.dataL.$item.on('touchend.rwd-container', function () {
2592            if ($object.dataL.$cont.hasClass('rwd-zoomed')) {
2593                if (isMoved) {
2594                    isMoved = false;
2595                    $object.touchendZoom(startCoords, endCoords, abscissa, ordinate);
2596
2597                }
2598            }
2599        });
2600
2601    };
2602
2603    Modul.prototype.initThumbs = function() {
2604        var $object = this;
2605
2606        if (this.dataL.modulSettings.thumbnail === 'true' && this.dataL.$items.length > 1) {
2607
2608            if (this.dataL.modulSettings.showByDefault) {
2609                setTimeout(function(){
2610                    $object.dataL.$cont.addClass('rwd-thumb-open');
2611                }, 100);
2612            }
2613
2614            this.buildThumbs();
2615
2616            this.dataL.effectsSupport() && this.enableThumbDrag();
2617
2618            this.activatedThumbs = false;
2619
2620            if ($object.dataL.modulSettings.toogleThumb) {
2621                $object.$thumbCont.append('<span class="rwd-toggle-thumb rwd-icon"></span>');
2622                $object.dataL.$cont.find('.rwd-toggle-thumb').on('click.rwd-container', function() {
2623                    $object.dataL.$cont.toggleClass('rwd-thumb-open');
2624                });
2625            }
2626        }
2627
2628        $('.rwd-container .rwd-thumb-item').css({
2629            background: '#' + this.dataL.modulSettings.thumbsOverlayColor
2630        });
2631        $('.rwd-container .rwd-thumb-item img').css({
2632            opacity: 1 - +this.dataL.modulSettings.thumbsOverlayOpacity / 100
2633        });
2634
2635        $('.rwd-thumb-cont').css({
2636            bottom: -$object.dataL.modulSettings.thumbsHeight + 'px'
2637        });
2638
2639        if (this.dataL.modulSettings.showByDefault) {
2640            var $cont_ = $('.cont-inner'),
2641                $thumb_ = $('.rwd-thumb-cont'),
2642                $toolbar_ = $('.rwd-toolbar');
2643            setTimeout(function(){
2644                switch(hugeit_resp_lightbox_obj.hugeit_lightbox_lightboxView){
2645                    case 'view1':
2646                        switch($object.dataL.modulSettings.thumbPosition){
2647                            case '0':
2648                                $cont_.css({
2649                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)',
2650                                    top: '47px'
2651                                });
2652                                $thumb_.css({
2653                                    bottom: '0',
2654                                    backgroundColor: 'rgba(0,0,0,.9)'
2655                                });
2656                                $('.rwd-bar > *').css({
2657                                    bottom: $object.dataL.modulSettings.thumbsHeight + 'px'
2658                                });
2659                                break;
2660                            case '1':
2661                                $cont_.css({
2662                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)',
2663                                    top: $object.dataL.modulSettings.thumbsHeight + 47 + 'px'
2664                                });
2665                                $thumb_.css({
2666                                    top: '47px',
2667                                    backgroundColor: 'rgba(0,0,0,.9)'
2668                                });
2669                                break;
2670                        }
2671                        break;
2672                    case 'view2':
2673                        switch($object.dataL.modulSettings.thumbPosition) {
2674                            case '0':
2675                                $cont_.css({
2676                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)',
2677                                    top: '45px'
2678                                });
2679                                $thumb_.css({
2680                                    bottom: '45px',
2681                                    backgroundColor: 'rgba(0,0,0,.9)'
2682                                });
2683                                break;
2684                            case '1':
2685                                $cont_.css({
2686                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)',
2687                                    top: $object.dataL.modulSettings.thumbsHeight + 45 + 'px'
2688                                });
2689                                $thumb_.css({
2690                                    top: '0',
2691                                    backgroundColor: 'rgba(0,0,0,.9)'
2692                                });
2693                                $toolbar_.css({
2694                                    top: $object.dataL.modulSettings.thumbsHeight + 'px'
2695                                });
2696                                break;
2697                        }
2698                        break;
2699                    case 'view3':
2700                        switch($object.dataL.modulSettings.thumbPosition) {
2701                            case '0':
2702                                $cont_.css({
2703                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)',
2704                                    top: '47px'
2705                                });
2706                                $thumb_.css({
2707                                    bottom: '0',
2708                                    backgroundColor: 'white'
2709                                });
2710                                $('
2710.rwd-title').css({
2711                                    bottom: $object.dataL.modulSettings.thumbsHeight + 'px'
2712                                });
2713                                break;
2714                            case '1':
2715                                $cont_.css({
2716                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 93) + 'px)',
2717                                    top: ($object.dataL.modulSettings.thumbsHeight + 48) + 'px'
2718                                });
2719                                $thumb_.css({
2720                                    top: '48px',
2721                                    backgroundColor: 'white'
2722                                });
2723                                break;
2724                        }
2725                        break;
2726                    case 'view4':
2727                    case 'view7':
2728                        switch($object.dataL.modulSettings.thumbPosition) {
2729                            case '0':
2730                                $cont_.css({
2731                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 92) + 'px)'
2732                                });
2733                                $thumb_.css({
2734                                    bottom: '0',
2735                                    backgroundColor: 'none'
2736                                });
2737                                $('.rwd-socialIcons').css({
2738                                    bottom: ($object.dataL.modulSettings.thumbsHeight - 10) + 'px'
2739                                });
2740                                $('.barCont').css({
2741                                    bottom: $object.dataL.modulSettings.thumbsHeight + 'px'
2742                                });
2743                                $('#rwd-counter').css({
2744                                    bottom: ($object.dataL.modulSettings.thumbsHeight + 5) + 'px'
2745                                });
2746                                $('.rwd-item').css({
2747                                    top: '47px'
2748                                });
2749                                break;
2750                            case '1':
2751                                $cont_.css({
2752                                    height: 'calc(100% - ' + ($object.dataL.modulSettings.thumbsHeight + 90) + 'px)',
2753                                    top: $object.dataL.modulSettings.thumbsHeight + 45 + 'px'
2754                                });
2755                                $thumb_.css({
2756                                    top: '45px',
2757                                    backgroundColor: 'none'
2758                                });
2759                                break;
2760                        }
2761                        break;
2762                    case 'view5':
2763                    case 'view6':
2764                        switch($object.dataL.modulSettings.thumbPosition) {
2765                            case '0':
2766                                $cont_.css({
2767                                    height: 'calc(100% - ' + $object.dataL.modulSettings.thumbsHeight + 'px)'
2768                                });
2769                                $thumb_.css({
2770                                    bottom: '0'
2771                                });
2772                                break;
2773                            case '1':
2774                                $cont_.css({
2775                                    height: 'calc(100% - ' + $object.dataL.modulSettings.thumbsHeight + 'px)',
2776                                    top: $object.dataL.modulSettings.thumbsHeight + 'px'
2777                                });
2778                                $thumb_.css({
2779                                    top: '0'
2780                                });
2781                                break;
2782                        }
2783                        break;
2784                }
2785            }, 100);
2786        }
2787    };
2788
2789    Modul.prototype.buildThumbs = function() {
2790        var $object = this,
2791            thumbList = '',
2792            $thumb,
2793            html = '<div class="rwd-thumb-cont"><div class="rwd-thumb group"></div></div>';
2794
2795        $object.dataL.$cont.addClass('rwd-has-thumb');
2796
2797        $object.dataL.$cont.find('.rwd-container').append(html);
2798
2799        $object.$thumbCont = $object.dataL.$cont.find('.rwd-thumb-cont');
2800        $object.thumbContWidth = $object.$thumbCont.width();
2801
2802        $object.dataL.$cont.find('.rwd-thumb').css({
2803            width: $object.thumbTotalWidth + 'px',
2804            position: 'relative'
2805        });
2806
2807        $object.$thumbCont.css('height', $object.dataL.modulSettings.thumbsHeight + 'px');
2808
2809        function getThumb(src, thumb, index) {
2810            var isVideo = $object.dataL.isVideo(src, index) || {};
2811            var thumbImg;
2812            var vimeoId = '';
2813
2814            if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) {
2815                if (isVideo.youtube) {
2816                    thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/1.jpg';
2817                } else if (isVideo.vimeo) {
2818                    thumbImg = '//i.vimeocdn.com/video/error_100x75.jpg';
2819                    vimeoId = isVideo.vimeo[1];
2820                } else if (isVideo.dailymotion) {
2821                    thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[2];
2822                }
2823            } else {
2824                thumbImg = thumb;
2825            }
2826
2827            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>';
2828            vimeoId = '';
2829        }
2830
2831        $object.dataL.$items.each(function(i) {
2832
2833            getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i);
2834
2835        });
2836
2837        $object.dataL.$cont.find('.rwd-thumb').html(thumbList);
2838
2839        $thumb = $object.dataL.$cont.find('.rwd-thumb-item');
2840
2841        $thumb.each(function() {
2842            var $this = $(this);
2843            var vimeoVideoId = $this.attr('data-vimeo-id');
2844
2845            if (vimeoVideoId) {
2846                $.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', {
2847                    format: 'json'
2848                }, function(data) {
2849                    $this.find('img').attr('src', data[0]['thumbnail_small']);
2850                });
2851            }
2852        });
2853
2854        $thumb.eq($object.dataL.index).addClass('active');
2855        $object.dataL.$element.on('onBeforeSlide.rwd-container', function() {
2856            $thumb.removeClass('active');
2857            $thumb.eq($object.dataL.index).addClass('active');
2858        });
2859
2860        $thumb.on('click.rwd-container touchend.rwd-container', function() {
2861            var _$this = $(this);
2862            setTimeout(function() {
2863                if ($object.activatedThumbs || !$object.dataL.effectsSupport()) {
2864                    $object.dataL.index = _$this.index();
2865                    $object.dataL.slide($object.dataL.index, false, true);
2866                    $('.rwd-thumb').removeClass('thumb_move');
2867                }
2868            }, 50);
2869        });
2870
2871        $object.dataL.$element.on('onBeforeSlide.rwd-container', function() {
2872            $object.animateThumb($object.dataL.index);
2873        });
2874
2875        $(window).on('resize.rwd-container.thumb orientationchange.rwd-container.thumb', function() {
2876            setTimeout(function() {
2877                $object.animateThumb($object.dataL.index);
2878                $object.thumbContWidth = $object.$thumbCont.width();
2879            }, 200);
2880        });
2881
2882    };
2883
2884    Modul.prototype.animateThumb = function(index) {
2885        var $thumb = this.dataL.$cont.find('.rwd-thumb'),
2886            position = (this.thumbContWidth / 2) - (this.dataL.modulSettings.thumbsWidth / 2);
2887
2888        this.left = ((this.dataL.modulSettings.thumbsWidth + this.dataL.modulSettings.thumbMargin) * index - 1) - position;
2889        if (this.left > (this.thumbTotalWidth - this.thumbContWidth)) {
2890            this.left = this.thumbTotalWidth - this.thumbContWidth;
2891        }
2892
2893        if (this.left < 0) {
2894            this.left = 0;
2895        }
2896
2897        if (!$thumb.hasClass('on')) {
2898            this.dataL.$cont.find('.rwd-thumb').css('transition-duration', this.dataL.modulSettings.speed + 'ms');
2899        }
2900
2901        if (!this.dataL.effectsSupport()) {
2902            $thumb.animate({
2903                left: -this.left + 'px'
2904            }, this.dataL.modulSettings.speed);
2905        }
2906
2907        if(!$('.rwd-thumb').hasClass('thumb_move')){
2908            this.dataL.$cont.find('.rwd-thumb').css({
2909                transform: 'translate3d(-' + (this.left) + 'px, 0px, 0px)'
2910            });
2911        }
2912    };
2913
2914    Modul.prototype.enableThumbDrag = function() {
2915
2916        var $object = this,
2917            startCoords = 0,
2918            endCoords = 0,
2919            isDraging = false,
2920            isMoved = false,
2921            tempLeft = 0,
2922            $left_ = ((this.dataL.modulSettings.thumbsWidth + this.dataL.modulSettings.thumbMargin) * $object.dataL.index - 1) - (this.thumbContWidth / 2) - (this.dataL.modulSettings.thumbsWidth / 2);
2923
2924        $('.rwd-thumb').attr('data-left', $left_);
2925
2926        $object.dataL.$cont.find('.rwd-thumb').on('mousedown.rwd-container.thumb', function(e) {
2927            if ($object.thumbTotalWidth > $object.thumbContWidth) {
2928                e.preventDefault();
2929                startCoords = e.pageX;
2930                isDraging = true;
2931
2932                $object.dataL.$cont.scrollLeft += 1;
2933                $object.dataL.$cont.scrollLeft -= 1;
2934
2935                $object.activatedThumbs = false;
2936            }
2937        });
2938
2939        $(window).on('mousemove.rwd-container.thumb', function(e) {
2940            if (isDraging) {
2941                tempLeft = +$('.rwd-thumb').attr('data-left');                isMoved = true;
2942                endCoords = e.pageX;
2943
2944                if(Math.abs(endCoords - startCoords) > 0 && $('.rwd-cont').hasClass('rwd-show-autoplay')){
2945                    $('.rwd-thumb').addClass('thumb_move');
2946                }
2947
2948                tempLeft = tempLeft - (endCoords - startCoords);
2949
2950                if (tempLeft > ($object.thumbTotalWidth - $object.thumbContWidth)) {
2951                    tempLeft = $object.thumbTotalWidth - $object.thumbContWidth;
2952                }
2953
2954                if (tempLeft < 0) {
2955                    tempLeft = 0;
2956                }
2957
2958                $object.dataL.$cont.find('.rwd-thumb').css({
2959                    transform: 'translate3d(-' + (tempLeft) + 'px, 0px, 0px)'
2960                });
2961            }
2962        });
2963
2964        $(window).on('mouseup.rwd-container.thumb', function() {
2965            if (isMoved) {
2966                isMoved = false;
2967
2968                $('.rwd-thumb').attr('data-left', tempLeft);
2969
2970            } else {
2971                $object.activatedThumbs = true;
2972            }
2973
2974            if (isDraging) {
2975                isDraging = false;
2976            }
2977        });
2978
2979    };
2980
2981    Modul.prototype.destroy = function () {
2982        var $object = this;
2983
2984        $(window).off('.rwd-container.zoom');
2985        $('.rwd-cont').removeClass('rwd-zoomed');
2986        clearTimeout($object.zoomabletimeout);
2987        $object.zoomabletimeout = false;
2988
2989        if (hugeit_resp_lightbox_obj.hugeit_lightbox_thumbs === 'true') {
2990            $(window).off('resize.rwd-container.thumb orientationchange.rwd-container.thumb keydown.rwd-container.thumb');
2991            $('.rwd-cont').removeClass('rwd-has-thumb');
2992            $('.cont-inner').css({
2993                height: '100%'
2994            });
2995        }
2996
2997        $object.exitFullscreen();
2998        $(document).off('fullscreenchange.rwd-container webkitfullscreenchange.rwd-container mozfullscreenchange.rwd-container MSFullscreenChange.rwd-container');
2999    };
3000
3001    $.fn.lightbox.lightboxModul.modul = Modul;
3002
3003    var WaterMark = function (element) {
3004        this.element = element;
3005        this.settings = $.extend({}, this.constructor.defaults);
3006        this.init();
3007    };
3008
3009    WaterMark.defaults = {
3010        imgSrc: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_img_src_new,
3011        text: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_text,
3012        textColor: '#' + hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_textColor,
3013        textFontSize: +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_textFontSize,
3014        containerBackground: hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_container_bg_color,
3015        containerWidth: +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_containerWidth,
3016        position: 'pos' + hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_position_new,
3017        opacity: +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_opacity / 100,
3018        margin: +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_margin,
3019        done: function (imgURL) {
3020            this.dataset.src = imgURL;
3021        }
3022    };
3023
3024    WaterMark.prototype.init = function () {
3025        var $object = this,
3026            $elem = $object.element,
3027            $settings = $object.settings,
3028            wmData = {},
3029            imageData = {};
3030
3031        var WatermarkImage = jQuery('<img />');
3032        WatermarkImage.attr('src', $object.settings.imgSrc);
3033        WatermarkImage.css('display', 'none').attr('id', 'huge_it_watermark_img_sample');
3034        if (!jQuery('body').find('#huge_it_watermark_img_sample').length) {
3035            jQuery('body').append(WatermarkImage);
3036        }
3037
3038        wmData = {
3039            imgurl: $settings.imgSrc,
3040            type: 'jpeg'
3041        };
3042
3043        imageData = {
3044            imgurl: $elem.dataset.imgsrc
3045        };
3046
3047        var defer = $.Deferred();
3048
3049        $.when(defer).done(function (imgObj) {
3050            imageData.$wmObject = imgObj;
3051
3052            $object.imgurltodata(imageData, function (dataURL) {
3053                $settings.done.call($elem, dataURL);
3054            });
3055        });
3056
3057        if ($settings.text !== '') {
3058            wmData.imgurl = $object.textwatermark();
3059        }
3060
3061        $object.imgurltodata(wmData, function (imgObj) {
3062            defer.resolve(imgObj);
3063        });
3064    };
3065
3066    WaterMark.prototype.textwatermark = function () {
3067        var $object = this,
3068            $settings,
3069            canvas,
3070            context,
3071            $width,
3072            $height;
3073
3074        $settings = $object.settings;
3075        canvas = document.createElement('canvas');
3076        context = canvas.getContext('2d');
3077
3078        $width = $settings.containerWidth;
3079        $height = $settings.textFontSize;
3080
3081        canvas.width = $width;
3082        canvas.height = $height;
3083
3084        context.fillStyle = $settings.containerBackground;
3085        context.fillRect(0, 0, $width, $height);
3086
3087        context.fillStyle = $settings.textColor;
3088        context.textAlign = 'center';
3089        context.font = '500 ' + $settings.textFontSize + 'px Sans-serif';
3090
3091        context.fillText($settings.text, ($width / 2), ($height - 5));
3092
3093        return canvas.toDataURL();
3094    };
3095
3096    WaterMark.prototype.imgurltodata = function (data, callback) {
3097        var $object = this,
3098            $settings = $object.settings,
3099            img;
3100
3101        img = new Image();
3102        img.setAttribute('crossOrigin', 'anonymous');
3103        img.onload = function () {
3104
3105            var canvas = document.createElement('canvas'),
3106                context = canvas.getContext('2d'),
3107
3108                $imgWidth = this.width,
3109                $imgHeight = this.height;
3110
3111            if (data.$wmObject) {
3112
3113                if (data.width !== 'auto' && data.height === 'auto' && data.width < $imgWidth) {
3114                    $imgHeight = $imgHeight / $imgWidth * data.width;
3115                    $imgWidth = data.width;
3116                } else if (data.width === 'auto' && data.height !== 'auto' && data.height < $imgHeight) {
3117                    $imgWidth = $imgWidth / $imgHeight * data.height;
3118                    $imgHeight = data.height;
3119                } else if (data.width !== 'auto' && data.height !== 'auto' && data.width < $imgWidth && data.height < $imgHeight) {
3120                    $imgWidth = data.width;
3121                    $imgHeight = data.height;
3122                }
3123
3124            }
3125
3126
3127            canvas.width = $imgWidth;
3128            canvas.height = $imgHeight;
3129
3130            /*if (data.type === 'jpeg') {
3131             context.fillStyle = '#ffffff';
3132             context.fillRect(0, 0, $imgWidth, $imgHeight);
3133             }*/
3134
3135            context.drawImage(this, 0, 0, $imgWidth, $imgHeight);
3136
3137            if (data.$wmObject) {
3138
3139                var $opacity = +hugeit_gen_resp_lightbox_obj.hugeit_lightbox_watermark_containerOpacity / 100;
3140                if ($opacity >= 0 && $opacity <= 1) {
3141                    //context.globalAlpha = $settings.opacity;
3142                    context.globalAlpha = $opacity;
3143                }
3144
3145                var $wmWidth,
3146                    $wmHeight,
3147                    pos = $settings.margin,
3148                    $x, $y;
3149                if ($settings.text !== '') {
3150                    $wmWidth = data.$wmObject.width;
3151                    $wmHeight = data.$wmObject.height;
3152                }
3153                else {
3154                    $wmWidth = $settings.containerWidth;
3155                    $wmHeight = (jQuery('img#huge_it_watermark_img_sample').prop('naturalHeight') * $wmWidth) / jQuery('img#huge_it_watermark_img_sample').prop('naturalWidth');
3156                }
3157
3158                switch ($settings.position) {
3159                    case 'pos1':
3160                        $x = pos;
3161                        $y = pos;
3162                        break;
3163                    case 'pos2':
3164                        $x = $imgWidth / 2 - $wmWidth / 2;
3165                        $y = pos;
3166                        break;
3167                    case 'pos3':
3168                        $x = $imgWidth - $wmWidth - pos;
3169                        $y = pos;
3170                        break;
3171                    case 'pos4':
3172                        $x = pos;
3173                        $y = $imgHeight / 2 - $wmHeight / 2;
3174                        break;
3175                    case 'pos5':
3176                        $x = $imgWidth / 2 - $wmWidth / 2;
3177                        $y = $imgHeight / 2 - $wmHeight / 2;
3178                        break;
3179                    case 'pos6':
3180                        $x = $imgWidth - $wmWidth - pos;
3181                        $y = $imgHeight / 2 - $wmHeight / 2;
3182                        break;
3183                    case 'pos7':
3184                        $x = pos;
3185                        $y = $imgHeight - $wmHeight - pos;
3186                        break;
3187                    case 'pos8':
3188                        $x = $imgWidth / 2 - $wmWidth / 2;
3189                        $y = $imgHeight - $wmHeight - pos;
3190                        break;
3191                    case 'pos9':
3192                        $x = $imgWidth - $wmWidth - pos;
3193                        $y = $imgHeight - $wmHeight - pos;
3194                        break;
3195                    default:
3196                        $x = $imgWidth - $wmWidth - pos;
3197                        $y = $imgHeight - $wmHeight - pos;
3198                }
3199                context.drawImage(data.$wmObject, $x, $y, $wmWidth, $wmHeight);
3200            }
3201
3202            var dataURL = canvas.toDataURL('image/' + data.type);
3203
3204            if (typeof callback === 'function') {
3205
3206                if (data.$wmObject) {
3207                    callback(dataURL);
3208
3209                } else {
3210                    var $wmNew = new Image();
3211                    $wmNew.src = dataURL;
3212                    callback($wmNew);
3213                }
3214            }
3215
3216            canvas = null;
3217        };
3218
3219        img.src = data.imgurl;
3220    };
3221
3222    $.fn['watermark'] = function () {
3223        return this.each(function () {
3224            if (!$.data(this, 'watermark')) {
3225                $.data(this, 'watermark', new WaterMark(this));
3226            }
3227        });
3228    };
3229
3230})(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.