PageSourceSearch

https://galeriamuzalewska.pl/zoombox/zoombox.js

js galeriamuzalewska.pl collected 2026-10-02 23:59:24 UTC 169,231 bytes, 4,823 lines download raw bytes

1/*
2 * Author: Digital Zoom Studio
3 * Website: https://digitalzoomstudio.net/
4 * Portfolio: https://bit.ly/nM4R6u
5 * This is not free software.
6 * ZoomBox v2.00
7 */
8
9"use strict";
10
11
12Math.easeIn = function(t, b, c, d) {
13
14    return -c *(t/=d)*(t-2) + b;
15
16};
17
18function cloneObject(source) {
19    for (var i in source) {
20        if (typeof source[i] == 'source') {
21            this[i] = new cloneObject(source[i]);
22        }
23        else{
24            this[i] = source[i];
25        }
26    }
27}
28
29
30
31var _zoombox_maincon;
32window.zoombox_hardresize = false;
33window.zoombox_forwardanimation = false;
34window._zoombox_maincon = _zoombox_maincon;
35
36window.zoombox_default_opts = {
37    settings_paddingHorizontal: 'default'
38    ,settings_paddingVertical: 'default'
39    ,settings_resizemaincon: 'off'
40    ,design_animation: 'fromcenter'
41    ,design_skin: 'skin-gamma'
42    ,design_borderwidth: 'default'
43    ,settings_deeplinking: 'on'
44    ,settings_disableSocial: 'off'
45    ,settings_useImageTag: 'default' // -- use the img tag or div for displaying images
46    ,zoombox_audioplayersettings : {}
47    , settings_makeFunctional: false
48    ,settings_usearrows: 'on'
49    ,social_enableTwitterShare: 'on'
50    ,social_enableGooglePlusShare: 'on'
51    ,social_extraShareIcons: ''
52    ,videoplayer_settings : {}
53    ,audioplayer_settings : {}
54    ,settings_extraClasses: ''
55    ,settings_disablezoom: 'peritem'
56    ,settings_zoom_doNotGoBeyond1X: 'off'
57    ,settings_zoom_use_multi_dimension: 'off' // -- by default zoom is only vertical or horizontal, use this to allow full zoom
58    ,settings_zoom_disableMouse: 'off'
59    ,settings_enableSwipe: 'on'
60    ,settings_enableSwipeOnDesktop: 'off'
61    ,settings_galleryMenu: 'dock'
62    ,settings_transition: 'fromcenter'
63    ,settings_transition_gallery: 'slide'
64    ,settings_transition_out: 'slideup'
65    ,settings_transition_gallery_when_ready: 'on'
66    ,settings_force_delay_time_for_loaded: 0
67    ,settings_add_delay_time_for_gallery_transition: 0
68    ,settings_add_delay_time_for_transition_in: 0
69    ,settings_try_to_take_item_from_cache: 'on'
70    ,settings_fullsize: 'off' // -- cover the whole screen on / off
71    ,settings_holder_con_extra_classes: ''
72    ,settings_holder_extra_classes: ''
73    ,settings_callback_func_gotoItem : null
74
75    //,settings_force_delay_time_for_loaded: 10
76};
77
78
79
80window.zoombox_default_opts_string = JSON.stringify(window.zoombox_default_opts);
81
82//ZoomBox
83(function ($) {
84
85    function getSorted(selector, attrName) {
86        return $($(selector).toArray().sort(function(a, b){
87            var aVal = parseInt(a.getAttribute(attrName)),
88                bVal = parseInt(b.getAttribute(attrName));
89            return aVal - bVal;
90        }));
91    }
92
93
94    $.fn.outerHTML = function() {
95        return $(this).clone().wrap('<div></div>').parent().html();
96    };
97
98    var _conHolder
99        , _holder = null
100        , _theItem = null
101        , _theDivItem = null
102        ,_holderText = null
103        , toload
104        ,_holderBg
105        ,_bigimageCon
106        ,_bigimageThe
107        ,_gallerymenuCon
108        ,_conZoomboxArrows
109        ;
110    var maincon_orightml = '';
111    //window params
112    var _w;
113    var ww
114        , wh
115        , cw
116        , ch
117        , iw //== item width
118        , ih // == item height
119        , width_border = 30
120        ,bw //==big image width
121        ,bh
122        ,binw = 0 //bigimage natural width
123        ,binh = 0 //bigimage natural height
124        ,orig_bw
125        ,orig_bh
126        ,mouseX
127        ,mouseY
128        ,bi_viewIndexX = 0
129        ,bi_viewIndexY = 0
130        ,bigwidth = -1 // -- -1 = undefined
131        ,bigheight = -1
132        ,dims_scaling = 'proportional'
133        ,the_type = 'thumb'
134        ;
135    var settings_paddingHorizontal = "default"
136        ,settings_paddingVertical = "default"
137        ;
138    var gallerymenu_arr = []
139        ,gallerymenu_startindex = 0
140        ,gallerymenu_currindex = 0
141        ;
142    var busy = false;
143    var int_calculateDims;
144
145
146    var func_callback = null
147        ;
148
149    //==main options var
150    var o = {};
151    var loaded_opts = false
152        ,lastargs = null
153        ,lastlastargs = null
154        ;
155    var theurl = window.location.href;
156
157    var translate_skin_nebula_closebtn = 'CLOSE <span class="strong-x">X</span>';
158
159
160    var swipe_maintarget
161        ,swipe_maintargettotalwidth = 0
162        ,swipe_maintargettotalheight = 0
163        ,swipe_maintargettotalclipwidth = 0
164        ,swipe_maintargettotalclipheight = 0
165        ,swipe_maintargetoriginalposx = 0
166        ,swipe_maintargetoriginalposy = 0
167        ,swipe_maintargettargetposx = 0
168        ,swipe_maintargettargetposy = 0
169        ,swipe_originalposx
170        ,swipe_originalposy
171        ,swipe_touchdownposx
172        ,swipe_touchdownposy
173        ,swipe_touchupposx
174        ,swipe_touchupposy
175        ,swipe_dragging = false
176        ,dir_hor = false
177        ,dir_ver = false
178        ,has_zoom = true
179        ,had_zoom = false// == works with o.settings_zoom_doNotGoBeyond1X / if the item is already at 1x there is no need to zoom, so we just remove the has-zoom class in that case
180        ,animating_big_image = false
181        ,fullwidth = false
182        ,fullheight = false
183        ,sw_stop_enter_frame = false
184        ;
185
186
187    var item_took_from_cache = false;
188
189
190    var down_x = 0
191        ,up_x = 0
192        ,screen_mousex = 0
193        ,dragging = false
194        ,def_x = 0
195        ,targetPositionX = 0
196        ,_swiper = _conHolder
197        ,_swiper_init_position = 0 // -- the swipper initial position before dragging
198        ,currPageX = 0 // -- the current swiper position
199        ,viewIndexY = 0
200        ,viewIndexX = 0
201        ,target_swiper = null
202        ,paused_roll = false
203        ,scaleFactor = 0
204        ;
205
206
207    var duration_viy = 20
208        ,duration_vix = 20
209        ;
210
211    var target_viy = 0
212        ,target_vix = 0
213        ;
214
215    var begin_viy = 0
216        ,begin_vix = 0
217        ;
218
219    var finish_viy = 0
220        ,finish_vix = 0
221        ;
222
223    var change_viy = 0
224        ,change_vix = 0
225        ;
226
227
228    var inter_closezoombox = 0;
229
230    var def_opts_parse = {};
231
232
233    var _inline_content_orig_parent = null
234        , _inline_content_orig_prev = null
235        ,_inline_content_orig_parent_last = null
236        , _inline_content_orig_prev_last = null
237        ,last_zoombox_item_clicked = null
238        ;
239
240    var $zoombox_items_arr = [];
241
242    $.fn.zoomBox = function (argo) {
243
244
245
246        //var auxdef = JSON.parse(window.zoombox_default_opts_string);
247
248        //delete def_opts_parse;
249        def_opts_parse = {};
250
251
252
253        var auxb = $.parseJSON(window.zoombox_default_opts_string);
254
255
256
257        //console.log(auxb);
258
259
260
261        //def_opts_parse  = JSON.parse(window.zoombox_default_opts_string);
262        def_opts_parse  = $.extend(true, {},$.parseJSON(window.zoombox_default_opts_string));
263
264
265        for (var key in auxb) {
266            if (auxb.hasOwnProperty(key)) {
267                var obj = auxb[key];
268                def_opts_parse[key] = auxb[key];
269            }
270        }
271
272        //console.info('def options',def_opts_parse,argo);
273        //auxdef={};
274        //console.info('DEFAULT OPTIONS ', loaded_opts, def_opts_parse,window.zoombox_default_opts_string);
275
276        //console.log($.parseJSON(window.zoombox_default_opts_string))
277
278        var defaults = def_opts_parse;
279        //o = def_opts_parse;
280//var o = {};
281        //console.log(theurl);
282
283        //lets singleton the main options
284        if(!loaded_opts){
285            o = $.extend(def_opts_parse, argo);
286            loaded_opts = true;
287        }else{
288            o = $.extend(o, argo);
289        }
290
291        //console.log(maincon, busy);
292
293
294
295        if(typeof window.zoombox_settings !='undefined'){
296            if(typeof window.zoombox_settings.translate_skin_nebula_closebtn !='undefined'){
297                translate_skin_nebula_closebtn = window.zoombox_settings.translate_skin_nebula_closebtn;
298            }
299        }
300
301
302
303
304
305        $.fn.zoomBox.setOptions = function (argo) {
306            if(argo.design_skin!=undefined){
307                _zoombox_maincon.removeClass(o.design_skin);
308                _zoombox_maincon.addClass(argo.design_skin);
309            }
310            if(argo.settings_extraClasses!=undefined){
311                _zoombox_maincon.removeClass(o.settings_extraClasse
311s);
312                _zoombox_maincon.addClass(argo.settings_extraClasses);
313            }
314            o = $.extend(o, argo);
315        };
316
317        window.api_zoombox_setoptions = function (argo) {
318
319            var new_opts = {};
320
321            if(argo){
322                new_opts = $.extend(defaults, argo);
323            }
324
325            if(_zoombox_maincon==null){ return false; };
326
327            //console.info(new_opts);
328
329            if(new_opts.design_skin!=undefined){
330                _zoombox_maincon.removeClass('skin-darkfull skin-whitefull skin-default skin-gamma skin-nebula');
331                _zoombox_maincon.addClass(new_opts.design_skin);
332            }
333
334
335            if(new_opts.settings_transition!=undefined){
336                _zoombox_maincon.removeClass('transition-fromtop transition-fade');
337                _zoombox_maincon.addClass('transition-'+new_opts.settings_transition);
338            }
339
340            // -- tbc
341
342            if(new_opts.design_skin=='skin-darkfull'){
343                if(_zoombox_maincon.children('.close-btn').length==0){
344                    _zoombox_maincon.append('<div class="close-btn"></div>');
345                }
346                if(_zoombox_maincon.children('.title-con').length==0){
347                    _zoombox_maincon.append('<div class="title-con"></div>');
348                }
349                if(_zoombox_maincon.children('.info-btn').length==0){
350                    _zoombox_maincon.append('<div class="info-btn"></div>');
351                }
352                //_zoombox_maincon.append('<div class="close-btn"></div><div class="title-con"></div><div class="info-btn"></div>');
353            }
354            if(new_opts.settings_extraClasses!=undefined){
355                _zoombox_maincon.removeClass(o.settings_extraClasses);
356                _zoombox_maincon.addClass(new_opts.settings_extraClasses);
357            }
358
359            if(new_opts.settings_callback_func_gotoItem==null){
360                func_callback = null;
361
362            }else{
363
364                func_callback = new_opts.settings_callback_func_gotoItem;
365            }
366            if(new_opts.settings_fullsize!="on"){
367                _zoombox_maincon.removeClass('fullsize-on');
368
369            }else{
370
371                _zoombox_maincon.addClass('fullsize-on');
372            }
373            o = $.extend(o, new_opts);
374        };
375
376
377        //console.log(o, o.settings_callback_func_gotoItem);
378        if(o.settings_callback_func_gotoItem) {
379            func_callback = o.settings_callback_func_gotoItem;
380        };
381        window.api_zoombox_set_callback_func = function (argo) {
382            func_callback = argo;
383        };
384
385
386
387
388        setup_paddings();
389
390
391
392
393        $(this).data('zoombox_options', o);
394
395
396        //console.info(_zoombox_maincon, busy);
397
398        if (!(_zoombox_maincon) && busy == false) {
399            init();
400        }
401
402//        _zoombox_maincon = undefined;
403//        console.info(_zoombox_maincon, typeof _zoombox_maincon);
404
405
406        //===trying to singleton it
407        function init() {
408            // -- singleton
409            //console.info('--- init() zoombox', o);
410
411
412
413            var aux = '<div class="zoombox-maincon disabled"><div class="zoombox-bg" onclick=""></div><div class="gallery-menu-con"></div><div class="bigimage-con"></div>';
414
415            if(o.design_skin=='skin-darkfull'){
416                aux+='<div class="close-btn"></div><div class="title-con"></div><div class="info-btn"></div>';
417            }
418
419            if(o.settings_transition_gallery=='helper-rectangle'){
420                aux+='<div class="helper-rectangle"></div>';
421            }
422
423
424            //aux+='<div class="gallery-preloader"><div class="cube-preloader"></div></div>';
425            aux+='<div class="gallery-preloader"><div class="loader"></div></div>';
426            aux+='<div class="css-preloader"><div class="the-icon"></div></div></div>';
427
428            $('body').append(aux);
429            _zoombox_maincon = $('body').children('.zoombox-maincon');
430            _bigimageCon = _zoombox_maincon.children('.bigimage-con');
431            _gallerymenuCon = _zoombox_maincon.children('.gallery-menu-con');
432            if(String(_zoombox_maincon.attr('class')).indexOf('skin-')==-1){
433                _zoombox_maincon.addClass(o.design_skin);
434            }
435
436            maincon_orightml = _zoombox_maincon.html();
437
438
439            if(_zoombox_maincon.hasClass('skin-gamma')){
440                o.design_skin = 'skin-gamma';
441
442                if(isNaN(parseInt(o.design_borderwidth, 10))){
443                    o.design_borderwidth = 30;
444                }
445            }
446
447
448            if(_zoombox_maincon.hasClass('skin-nebula')){
449                o.design_skin = 'skin-nebula';
450
451                if(isNaN(parseInt(o.design_borderwidth, 10))){
452                    o.design_borderwidth = 0;
453                }
454
455
456                if(o.settings_useImageTag=='default'){
457                    o.settings_useImageTag = 'off';
458                }
459            }
460
461            //console.info(_zoombox_maincon.hasClass('skin-darkfull'), o.settings_useImageTag);
462            if(_zoombox_maincon.hasClass('skin-darkfull')){
463
464
465                if(o.settings_useImageTag=='default'){
466                    o.settings_useImageTag = 'off';
467                }
468            }
469
470
471
472
473
474
475            if(o.design_borderwidth=='default'){
476                o.design_borderwidth = 30;
477            }
478
479
480
481
482            if(isNaN(parseInt(o.design_borderwidth, 10))){
483                width_border = 30;
484            }else{
485                width_border = parseInt(o.design_borderwidth, 10);
486            }
487
488
489            if(o.settings_useImageTag=='default'){
490                o.settings_useImageTag = 'on';
491            }
492            if(o.settings_useImageTag == 'on'){
493            }
494
495            _zoombox_maincon.addClass(o.settings_extraClasses);
496            _zoombox_maincon.addClass('transition-'+ o.settings_transition);
497            _zoombox_maincon.addClass('transition-gallery-'+ o.settings_transition_gallery);
498            _zoombox_maincon.addClass('transition-out-'+ o.settings_transition_out);
499
500
501            if(o.settings_fullsize=='on'){
502                _zoombox_maincon.addClass('fullsize-'+'on');
503            }
504
505
506            _w = $(window);
507            busy = true;
508            setTimeout(function () {
509                busy = false;
510            }, 500);
511
512            ww = $(window).width();
513
514//            console.log(theurl, theurl.indexOf('zoombox='))
515            if(theurl.indexOf('zoombox=')>-1){
516//                console.log('testtt', get_query_arg(theurl, 'zoombox'));
517                if(get_query_arg(theurl, 'zoombox')){
518                    var tempNr = parseInt(get_query_arg(theurl, 'zoombox'),10);
519//                    console.info(String(tempNr), String(tempNr)=='NaN');
520                    if(String(tempNr)!='NaN'){
521                        if(tempNr>-1){
522                            goto_item($('.zoombox,.zoombox-delegated').eq(tempNr));
523                        }
524                    }else{
525
526                        var auxobj = $('#'+get_query_arg(theurl, 'zoombox'));
527                        goto_item(auxobj);
528                    }
529                }
530                //$('.zoombox').eq
531            }
532
533
534
535
536
537            _w.bind('resize', handleResize);
538            $(document).undelegate(".zoombox-bg", "click");
539            $(document).undelegate(".zoombox-maincon > .close-btn", "click", handle_mouse);
540            $(document).delegate(".zoombox-bg", "click", click_close);
541            $(document).delegate(".zoombox-gotoprev-galleryitem", "click", handle_mouse);
542            $(document).delegate(".zoombox-gotonext-galleryitem", "click", handle_mouse);
543            $(document).delegate(".zoombox-maincon > .close-btn", "click", handle_mouse);
544            $(document).delegate(".zoombox-maincon > .info-btn", "click", handle_mouse);
545            $(document).bind("keyup", handle_keyup);
546
547            handleResize();
548
549
550            window.dzszb_open = function (arg, argtype, otherargs) {
551                if (_zoombox_maincon == undefined) {
552                    alert('please init zoomBox first')
553                    return;
554                }
555                gotoItem(arg, argtype, otherargs);
556            };
557            window.dzszb_open_item = function (arg) {
558                if (_zoombox_maincon == undefined) {
559                    alert('please init zoomBox first')
560                    return;
561                }
562                goto_item(arg);
563            };
564            /*
565             */
566
567            //== for legacy, did not work :(
568            $.fn.zoomBox.open = function (arg, argtype, otherargs) {
569                if (_zoombox_maincon == undefined) {
570                    alert('please init zoomBox first')
571                    return;
572                }
573                gotoItem(arg, argtype, otherargs);
574            };
575
576            $.fn.zoomBox.close = function () {
577                if (_zoombox_maincon == undefined) {
578                    alert('please init zoomBox first')
579                    return;
580                }
581                click_close();
582            };
583
584            window.api_destroy_zoombox = destroy;
585
586
587            handle_frame();
588        }
589
590
591        function destroy_listeners(){
592
593            sw_stop_enter_frame = true;
594            _zoombox_maincon = null;
595            window._zoombox_maincon = null;
596
597            o = defaults;
598
599            _w.unbind('resize', handleResize);
600            $(document).undelegate(".zoombox-bg", "click", click_close);
601            $(document).undelegate(".zoombox-gotoprev-galleryitem", "click", handle_mouse);
602            $(document).undelegate(".zoombox-gotonext-galleryitem", "click", handle_mouse);
603            $(document).undelegate(".zoombox-maincon > .close-btn", "click", handle_mouse);
604            $(document).undelegate(".zoombox-maincon > .info-btn", "click", handle_mouse);
605            $(document).unbind("keyup", handle_keyup);
606
607            window.api_destroy_zoombox=null;
608            window.api_zoombox_setoptions = null;
609
610            busy = false;
611            loaded_opts = false;
612            gallerymenu_arr = [];
613
614            func_callback = null;
615        }
616
617
618        function destroy(){
619
620            _zoombox_maincon.remove();
621            destroy_listeners();
622
623        }
624
625        function handle_keyup(e){
626
627            //console.info(e);
628
629            if (e.which == 37) {
630                _conZoomboxArrows.children('.zb-arrow-left').trigger('click');
631                return false;
632            }
633
634            if (e.which == 39) {
635                _conZoomboxArrows.children('.zb-arrow-right').trigger('click');
636                return false;
637            }
638
639            if (e.which == 27) {
640                close_zoombox();
641                return false;
642            }
643        }
644
645        function handleResize(e, pargs) {
646            // --- if the resize has the same values no need for the resize function
647
648
649            var margs = {
650                init_calculateDims : true
651                ,resize_maincon:true
652                ,apply_settings_fullsize: true
653                ,zoombox_hard_resize : false
654            };
655
656
657            if(pargs){
658                margs = $.extend(margs,pargs);
659            }
660
661            //console.info(margs);
662
663            if(margs.zoombox_hard_resize==false && window.zoombox_hardresize==false && (ww == _w.width() && wh == _w.height())){
664                return;
665            }
666
667
668
669            ww = _w.width();
670            wh = _w.height();
671            //console.info(wh);
672
673            //console.info(o.settings_resizemaincon)
674
675
676            if(margs.resize_maincon){
677
678                if(o.settings_resizemaincon=='on'){
679                    _zoombox_maincon.css({ 'width': ww, 'height': wh });
680                }
681            }
682
683
684
685            if(margs.apply_settings_fullsize){
686
687                if(o.settings_fullsize=='on'){
688                    if(_theItem){
689                        _theItem.width(ww);
690                        _theItem.height(wh);
691
692                        //console.info(_theItem, _theItem.children('.info-con'));
693
694                        if(_theItem.children('.main-con').length>0){
695                            var _c = _theItem.children('.main-con').eq(0);
696
697                            var auxw = 0.4*ww;
698                            if(auxw>400){ auxw=400; }
699
700                            var auxw2 = ww-auxw;
701
702
703                            var _c_sliderCon = _c.children('.slider-con');
704
705
706                            if(ww<=1000){
707
708                                _c_sliderCon.css({
709                                    'left' : ''
710                                    ,'top' : ''
711                                    ,'width' : ''
712                                    ,'height' : ''
713                                })
714                                _c.children('.info-con').css('width','');
715                            }else{
716
717
718                                _c_sliderCon.outerWidth(auxw2);
719                                _c_sliderCon.outerHeight(wh);
720                                _c_sliderCon.css({
721                                    'left' : auxw+'px'
722                                    ,'top' : 0
723                                })
724                                _c.children('.info-con').outerWidth(auxw);
725                            }
726
727
728
729
730                            if(_c_sliderCon.attr('data-element-width') && _c_sliderCon.attr('data-element-height')){
731
732
733                                var new_iw = 0;
734                                var new_ih = 0;
735
736                                var aux_sep_w = 80;
737                                var aux_sep_h = 110;
738
739
740                                var aux_iw = parseInt(_c_sliderCon.attr('data-element-width'),10);
741                                var aux_ih = parseInt(_c_sliderCon.attr('data-element-height'),10);
742                                var aux_ir = aux_iw/aux_ih;
743
744                                var aux_sw = _c_sliderCon.outerWidth()-aux_sep_w*2;
745                                var aux_sh = _c_sliderCon.outerHeight()-aux_sep_h*2;
746                                var aux_sr = ww/wh;
747
748                                if(aux_sr > aux_ir){
749
750                                    new_iw = aux_iw*(aux_sh/aux_ih);
751                                    new_ih = aux_sh;
752
753                                }else{
754                                    new_iw = aux_sw;
755
756                                    new_ih = aux_ih * (aux_sw/aux_iw);
757                                }
758
759
760                                if(new_iw>aux_iw){
761                                    new_iw = aux_iw;
762                                    new_ih = new_iw * (aux_ih /aux_iw);
763                                }
764
765                                var _c_sliderCon_item = _c_sliderCon.find(' .advancedscroller, .divimage, .vplayer').eq(0);
766
767                                //console.info(_c_sliderCon_item, aux_sw, new_ih, aux_sh, new_ih);
768                                //console.info(aux_sw, new_iw);
769                                _c_sliderCon_item.css({
770                                    'position': 'absolute'
771
772
773                                    ,'width': new_iw+'px'
774                                    ,'height': new_ih+'px'
775                                    ,'top': (aux_sep_h+(aux_sh - new_ih)/2)+'px'
776                                    ,'left': (aux_sep_w+(aux_sw - new_iw)/2)+'px'
777                                })
778
779
780                                if(ww<=1000){
781
782                                    _c_sliderCon_item.css({
783                                        'left' : ''
784                                        ,'top' : ''
785                                        ,'width' : ''
786                                        ,'height' : ''
787                                        ,'position' : ''
788                                    })
789                                }
790
791
792                                if(_c_sliderCon_item.hasClass('advancedscroller')){
793                                    _c_sliderCon_item.get(0).api_force_resize();
794                                }
795                                if(_c_sliderCon_item.hasClass('vplayer')){
796
797
798
799
800                                    if(_c_sliderCon_item.get(0).api_handleResize){
801                                        _c_sliderCon_item.get(0).api_handleResize();
802                                    }
803                                }
804
805                            }else{
806
807                            }
808
809
810
811                        }
812                    }
813
814
815                    if(o.design_skin=='skin-whitefull' && _theItem) {
816                        _theItem.find('.zbox-responsive-media .divimage').css({
817
818                            'position': ''
819                            , 'width': ''
820                            , 'height': ''
821                            , 'top': ''
822                            , 'left': ''
823
824                        })
825
826                        if(_theItem.find('.zbox-responsive-media .vplayer').length>0){
827                            setTimeout(function(){
828                                var _c2 = _theItem.find('.zbox-responsive-media .vplayer');
829
830                                if(ww<1000){
831                                    if(_theItem.find('.slider-con').eq(0).attr('data-element-width')){
832                                        var auxw = Number(_theItem.find('.slider-con').eq(0).attr('data-element-width'));
833                                        var auxh = Number(_theItem.find('.slider-con').eq(0).attr('data-element-height'));
834
835                                        //console.info(auxw,auxh);
836
837                                        _c2.eq(0).height(ww*auxh/auxw);
838
839                                    }
840                                }
841
842
843                                if(_c2.get(0) && _c2.get(0).api_handleResize){
844
845
846                                    _c2.get(0).api_handleResize();
847                                }
848                            },40);
849                        }
850
851                        if(_theItem.find('.zbox-responsive-media .advancedscroller').length>0){
852                            setTimeout(function(){
853                                var _c2 = _theItem.find('.zbox-responsive-media .advancedscroller');
854
855                                if(_c2.get(0) && _c2.get(0).api_force_resize){
856
857
858                                    _c2.get(0).api_force_resize();
859                                }
860                            },40);
861                        }
862                    }
863                }
864            }
865
866
867            if(margs.init_calculateDims){
868
869                clearTimeout(int_calculateDims);
870                int_calculateDims = setTimeout(calculateDims, 600);
871            }
872
873
874
875            window.zoombox_hardresize = false;
876        }
877
878        function click_close(e) {
879            var _t = $(this);
880            //console.log(_t);
881            _zoombox_maincon.find('.zoombox-bg').eq(0).removeClass('pureblack');
882            close_zoombox();
883        }
884
885        window.api_close_zoombox = function(){
886            close_zoombox();
887        };
888
889        function close_zoombox(){
890
891            //console.info('close_zoombox()');
892
893
894            $('body').removeClass('zoombox-opened');
895
896            if(_conHolder!=undefined){
897
898                restart_video_players()
899
900
901                if(o.settings_transition_out=='slideup'){
902
903                    //console.info(_conHolder, _conHolder.css('top'));
904                    //_holder.animate({
905                    //    'top':'-100%'
906                    //},{
907                    //    duration: 700
908                    //    ,queue:false
909                    //})
910
911                    //console.info(_holder);
912                    //return false;
913
914                    if(ww<=1000){
915
916                        _holder.css({
917                            'opacity':0
918                        });
919
920                    }else{
921                        if(o.settings_fullsize=='on'){
922
923                            _holder.css({
924                                'top':('0px')
925                            })
926                        }
927
928                        setTimeout(function(){
929
930
931                            _holder.css({
932                                'top':('-'+wh+'px')
933                            })
934                        }, 50);
935                    }
936
937                }
938
939                if(o.settings_transition_out=='fade'){
940
941                    _conHolder.animate({
942                        'opacity':0
943                    },{
944                        duration: 500
945                        ,queue:false
946                    });
947                }
948            }
949
950
951            _zoombox_maincon.addClass('zoombox-closing');
952
953            _zoombox_maincon.children('.gallery-menu-con').fadeOut('slow');
954            _zoombox_maincon.children('.con-zoomboxArrows').fadeOut('slow');
955
956
957            _zoombox_maincon.children('.zoombox-bg').animate({
958                'opacity': 0
959            },{
960                queue:false
961                ,duration: 600
962            });
963
964
965
966            if(_holderBg!=undefined){
967
968                if(o.settings_transition=='fromcenter'){
969
970                    _holderBg.css({
971                        'width': 0
972                        ,'height': 0
973                        ,'margin-left': 0
974                        ,'margin-top': 0
975                    })
976                }
977            }
978
979
980            //console.log(the_type,lastargs);
981
982            if(the_type=='image'){
983                /*
984                 _theItem.addClass('no-animation');
985                 _theItem.css({
986                 'transform-origin' : 'center center'
987                 })
988                 setTimeout(function(){
989
990                 _theItem.removeClass('no-animation');
991                 _theItem.css({
992                 'transform' : 'scale(0)'
993                 ,'opacity' : '0'
994                 })
995                 },30)
996                 */
997                //console.log(_holder);
998
999            }
1000            //console.log(_holderCon);
1001            if(_conHolder!=undefined){
1002                if(o.settings_transition=='fromcenter') {
1003                    //_conHolder.css({
1004                    //    'opacity': 0,
1005                    //    'transform': 'scale(0.3)'
1006                    //})
1007                }
1008            }
1009
1010
1011            //console.info(o.settings_transition_out);
1012            if(_theItem){
1013
1014
1015                if(o.settings_transition_out=='fade'){
1016
1017                    //_theItem.css('opacity',0);
1018                }
1019            }
1020
1021
1022
1023            if(_gallerymenuCon.html()!=''){
1024                //_gallerymenuCon.children().remove();
1025                gallerymenu_arr = [];
1026            }
1027
1028            if(lastargs && lastargs.inline_content_move=='on'){
1029
1030                setTimeout(function(){
1031
1032                    if(_inline_content_orig_prev){
1033
1034                        _inline_content_orig_prev.after(lastargs.$targetdiv);
1035
1036                    }
1037                    if(_inline_content_orig_parent){
1038
1039                        _inline_content_orig_parent.prepend(lastargs.$targetdiv);
1040
1041                    }
1042                    _inline_content_orig_prev = null;
1043                    _inline_content_orig_parent = null;
1044                },500)
1045            }
1046
1047            //console.info(_zoombox_maincon.hasClass('noanim'));
1048            if(_zoombox_maincon.hasClass('noanim')){
1049                _conHolder.hide();
1050                _zoombox_maincon.children('.zoombox-bg').hide();
1051                _zoombox_maincon.children('.gallery-menu-con').hide();
1052                _zoombox_maincon.children('.con-zoomboxArrows').hide();
1053
1054                disable_zoombox();
1055            }else{
1056
1057
1058                setTimeout(function () {
1059                    disable_zoombox();
1060                }, 1000);
1061            }
1062
1063
1064            if(inter_closezoombox){
1065                clearTimeout(inter_closezoombox);
1066            }
1067
1068            if(o.settings_deeplinking=='on' && has_history_api()==true){
1069                var newurl = add_query_arg(theurl, 'zoombox', "NaN");
1070                theurl = newurl;
1071                history.pushState({}, "", newurl);
1072            }
1073        }
1074
1075        function disable_zoombox(){
1076            console.info('disable_zoombox()');
1077
1078            _zoombox_maincon.html(maincon_orightml);
1079            _zoombox_maincon.addClass('disabled');
1080            busy = false;
1081            _zoombox_maincon.removeClass('zoombox-closing');
1082
1083
1084
1085            _zoombox_maincon.removeClass('holder-loaded-firsttime');
1086        }
1087
1088
1089
1090        function click_imageitem(e){
1091
1092            var _t = $(this);
1093//            console.info(_t);
1094
1095
1096            if(_bigimageThe!=undefined || _t.parent().hasClass('has-zoom')==false){
1097                return;
1098            }
1099            _bigimageCon.append('<div class="the-bg"></div>');
1100            _bigimageCon.append(_t.clone());
1101            _bigimageThe = _bigimageCon.children('img').eq(0);
1102
1103            animating_big_image=true;
1104            //console.info(animating_big_image);
1105
1106            _bigimageThe.bind('touchstart', handle_touchStart);
1107            _bigimageThe.bind('touchmove', handle_touchMove);
1108            _bigimageThe.bind('touchend', handle_touchEnd);
1109
1110
1111            orig_bw = _bigimageThe.width();
1112            orig_bh = _bigimageThe.height();
1113            _bigimageThe.css('margin-left', orig_bw*(-0.5));
1114            _bigimageThe.css('margin-top', orig_bh*(-0.5));
1115
1116            setTimeout(function(){
1117                //console.log(_bigimageThe.width());
1118                _bigimageThe.css('opacity',1);
1119                _bigimageThe.css('margin-left', 0);
1120                _bigimageThe.css('margin-top', 0);
1121                if(o.settings_zoom_disableMouse=='on'){
1122
1123                    _bigimageThe.css('left', 0);
1124                    _bigimageThe.css('top', 0);
1125                }else{
1126
1127                    _bigimageThe.css('left', 0);
1128                    _bigimageThe.css('top', 0);
1129                }
1130
1131
1132
1133                _bigimageThe.unbind('mousemove');
1134                _bigimageThe.bind('mousemove',bigimage_handle_mouse);
1135
1136
1137                _bigimageThe.unbind('click');
1138                _bigimageThe.bind('click',bigimage_handle_mouse);
1139                _bigimageCon.addClass('active');
1140
1141                if(ww<481){
1142                    $('html,body').animate({scrollTop: 0}, 500);
1143                    _zoombox_maincon.find('.zoombox-bg').eq(0).addClass('pureblack');
1144                }
1145
1146                calculateDims();
1147
1148            },500);
1149        }
1150        function handle_touchStart(e){
1151            //console.info('touchstart');
1152            swipe_maintarget = _bigimageThe;
1153            swipe_maintargettotalwidth = ww;
1154            swipe_maintargettotalclipwidth = bw;// should be bigger then totalwidth
1155            swipe_maintargettotalheight = wh;
1156            swipe_maintargettotalclipheight = bh;
1157            swipe_maintargetoriginalposx = parseInt(swipe_maintarget.css('left'), 10);
1158            swipe_maintargetoriginalposy = parseInt(swipe_maintarget.css('top'), 10);
1159            swipe_touchdownposx = e.originalEvent.touches[0].pageX;
1160            swipe_touchdownposy = e.originalEvent.touches[0].pageY;
1161            swipe_dragging = true;
1162        }
1163        function handle_touchMove(e){
1164
1165            if(swipe_dragging==false){
1166                return;
1167            }else{
1168                if(dir_hor){
1169                    //console.log(swipe_maintargettotalwidth, swipe_maintargettotalclipwidth, swipe_maintargettotalheight, swipe_maintargettotalclipheight);
1170                    swipe_touchupposx = e.originalEvent.touches[0].pageX;
1171                    //console.info(swipe_maintargetoriginalposy, swipe_touchupposy, swipe_touchdownposy)
1172                    swipe_maintargettargetposx = swipe_maintargetoriginalposx + (swipe_touchupposx - swipe_touchdownposx);
1173                    if(swipe_maintargettargetposx>0){
1174                        swipe_maintargettargetposx/=2;
1175                    }
1176                    if(swipe_maintargettargetposx<-swipe_maintargettotalclipwidth+swipe_maintargettotalwidth){
1177                        swipe_maintargettargetposx = swipe_maintargettargetposx-((swipe_maintargettargetposx+swipe_maintargettotalclipwidth-swipe_maintargettotalwidth)/2);
1178                    }
1179                    //console.log(swipe_maintargettargetposx);
1180
1181                    swipe_maintarget.css('left', swipe_maintargettargetposx);
1182
1183                    if(swipe_maintargettargetposx>0){
1184                        swipe_maintargettargetposx = 0;
1185                    }
1186                    if(swipe_maintargettargetposx<-swipe_maintargettotalclipwidth+swipe_maintargettotal
1186width){
1187                        swipe_maintargettargetposx = swipe_maintargettargetposx-(swipe_maintargettargetposx+swipe_maintargettotalclipwidth-swipe_maintargettotalwidth);
1188                    }
1189                }
1190                if(dir_ver){
1191                    swipe_touchupposy = e.originalEvent.touches[0].pageY;
1192                    //console.info(swipe_maintargetoriginalposy, swipe_touchupposy, swipe_touchdownposy)
1193                    swipe_maintargettargetposy = swipe_maintargetoriginalposy + (swipe_touchupposy - swipe_touchdownposy);
1194                    if(swipe_maintargettargetposy>0){
1195                        swipe_maintargettargetposy/=2;
1196                    }
1197                    if(swipe_maintargettargetposy<-swipe_maintargettotalclipheight+swipe_maintargettotalheight){
1198                        swipe_maintargettargetposy = swipe_maintargettargetposy-((swipe_maintargettargetposy+swipe_maintargettotalclipheight-swipe_maintargettotalheight)/2);
1199                    }
1200                    //console.log(swipe_maintargettargetposy);
1201
1202                    swipe_maintarget.css('top', swipe_maintargettargetposy);
1203
1204                    if(swipe_maintargettargetposy>0){
1205                        swipe_maintargettargetposy = 0;
1206                    }
1207                    if(swipe_maintargettargetposy<-swipe_maintargettotalclipheight+swipe_maintargettotalheight){
1208                        swipe_maintargettargetposy = swipe_maintargettargetposy-(swipe_maintargettargetposy+swipe_maintargettotalclipheight-swipe_maintargettotalheight);
1209                    }
1210                }
1211            }
1212            return false;
1213        }
1214
1215
1216        function handle_mouse(e){
1217            var _t = $(this);
1218
1219            if(e.type=='click'){
1220
1221                if(_t.hasClass('zoombox-gotoprev-galleryitem')){
1222
1223                    goto_prev_galleryitem();
1224                }
1225                if(_t.hasClass('zoombox-gotonext-galleryitem')){
1226
1227                    goto_next_galleryitem();
1228                }
1229                if(_t.hasClass('close-btn')){
1230
1231                    close_zoombox();
1232                }
1233                if(_t.hasClass('info-btn')){
1234
1235                    if(_t.hasClass('active')){
1236
1237                        _t.removeClass('active');
1238                        _zoombox_maincon.find('.holder-text').removeClass('active');
1239                    }else{
1240
1241                        _t.addClass('active');
1242                        _zoombox_maincon.find('.holder-text').addClass('active');
1243                    }
1244
1245                }
1246            }
1247        }
1248
1249        function handle_touchEnd(e){
1250            swipe_dragging = false;
1251
1252            swipe_maintarget.css('left', swipe_maintargettargetposx);
1253            swipe_maintarget.css('top', swipe_maintargettargetposy);
1254            var aux = 0;
1255            if(dir_hor){
1256                aux = swipe_maintargettargetposx / -(swipe_maintargettotalclipwidth - swipe_maintargettotalwidth);
1257                //console.log(aux, swipe_maintargettargetposx);
1258                //updateX(aux);
1259            }
1260            if(dir_ver){
1261                aux = swipe_maintargettargetposy / -(swipe_maintargettotalclipheight - swipe_maintargettotalheight);
1262                //console.log(aux);
1263                //updateY(aux);
1264            }
1265        }
1266        function bigimage_handle_mouse(e){
1267            mouseX = e.clientX;
1268            mouseY = e.clientY;
1269            if(e.type=='mousemove'){
1270                if(_bigimageThe!=undefined){
1271                    if(bh>wh){
1272                        viewIndexY = (mouseY / wh) * (wh - bh);
1273                        //console.log(viewIndexY, (mouseY / wh), mouseY, e.clientY,wh, wh, bh);
1274                        if(viewIndexY < (wh - bh)){
1275                            viewIndexY = (wh - bh);
1276                        }
1277
1278
1279
1280                        if(o.settings_zoom_disableMouse=='on'){
1281                            viewIndexY = wh/2 - bh/2;
1282                        }
1283
1284                    }else{
1285                        viewIndexY = 0;
1286
1287                    }
1288
1289                    if(bw>ww){
1290                        viewIndexX = (mouseX / ww) * (ww - bw);
1291                        //console.log(viewIndexY);
1292                        if(viewIndexX < (ww - bw)){
1293                            viewIndexX = (ww - bw);
1294                        }
1295
1296                        if(o.settings_zoom_disableMouse=='on'){
1297                            viewIndexX = ww/2 - bw/2;
1298                        }
1299
1300                    }else{
1301                        viewIndexX = 0;
1302
1303                    }
1304
1305
1306                    if(is_ie8()){
1307                        _bigimageThe.css('top', viewIndexY);
1308                        _bigimageThe.css('left', viewIndexX);
1309                    }else{
1310
1311                        finish_viy = viewIndexY;
1312                        finish_vix = viewIndexX;
1313                    }
1314                }
1315            }
1316            if(e.type=='click'){
1317                /*
1318                 _bigimageThe.css('width', orig_bw);
1319                 _bigimageThe.css('height', orig_bh);
1320                 _bigimageThe.css('margin-left', orig_bw*(-0.5));
1321                 _bigimageThe.css('margin-top', orig_bh*(-0.5));
1322                 _bigimageThe.css('left', '50%');
1323                 _bigimageThe.css('top', '50%');
1324                 _bigimageThe.css('opacity', '0');
1325                 */
1326
1327                _bigimageThe.css({
1328                    'opacity' : 0
1329                    ,'transform' : 'scale(0.5)'
1330                    ,'-webkit-transform' : 'scale(0.5)'
1331                })
1332
1333                _bigimageCon.removeClass('active');
1334                setTimeout(function(){
1335                    _zoombox_maincon.find('.zoombox-bg').eq(0).removeClass('pureblack');
1336                    _bigimageCon.html('');
1337                    animating_big_image = false;
1338                    _bigimageThe = undefined;
1339                },700);
1340            }
1341        }
1342
1343        function handle_frame(){
1344
1345            if(is_ie8()||is_ios()||is_android()||animating_big_image==false){
1346
1347
1348            }else{
1349
1350                begin_viy = target_viy;
1351                change_viy = finish_viy - begin_viy;
1352
1353
1354                target_viy = Number(Math.easeIn(1, begin_viy, change_viy, duration_viy).toFixed(4));;
1355
1356                begin_vix = target_vix;
1357                change_vix = finish_vix - begin_vix;
1358
1359
1360                target_vix = Number(Math.easeIn(1, begin_vix, change_vix, duration_vix).toFixed(4));;
1361
1362
1363                _bigimageThe.css('transform', 'translate3d('+target_vix+'px,'+target_viy+'px,0)');
1364
1365            }
1366
1367            if(sw_stop_enter_frame){
1368                return false;
1369            }
1370
1371            requestAnimFrame(handle_frame);
1372        }
1373        function click_item(e) {
1374
1375
1376//            console.info('click_item');
1377            var _t = $(this);
1378            goto_item(_t, e);
1379
1380            return false;
1381
1382        }
1383        function goto_gallery(arg){
1384//            console.log(arg, );
1385
1386
1387
1388
1389
1390
1391
1392
1393            window.zoombox_forwardanimation = true;
1394
1395            var args = {
1396                'clicked_from_gallery' : true
1397                ,'animation_forward' : true
1398            };
1399
1400
1401            //console.info(gallerymenu_currindex);
1402
1403
1404            if(arg<gallerymenu_currindex){
1405                args.animation_forward=false;
1406            }
1407
1408
1409            if(lastargs && lastargs.inline_content_move=='on'){
1410
1411                _inline_content_orig_prev_last = _inline_content_orig_prev;
1412                _inline_content_orig_parent_last = _inline_content_orig_parent;
1413
1414
1415                lastlastargs = $.extend({}, lastargs);
1416
1417
1418                setTimeout(function(){
1419
1420
1421                    if(_inline_content_orig_prev_last){
1422
1423                        _inline_content_orig_prev_last.after(lastlastargs.$targetdiv);
1424
1425                    }
1426                    if(_inline_content_orig_parent_last){
1427
1428                        _inline_content_orig_parent_last.prepend(lastlastargs.$targetdiv);
1429
1430                    }
1431                    _inline_content_orig_prev_last = null;
1432                    _inline_content_orig_parent_last = null;
1433                },500)
1434            }
1435
1436
1437            goto_item(gallerymenu_arr[arg],null,args);
1438
1439
1440
1441            setTimeout(calculateDims, 700)
1442        }
1443
1444        function goto_item(arg, e,pargs){
1445
1446            //console.info('goto_item', arg,pargs);
1447            // -- arg = object
1448            var _t = arg;
1449            var args = {};
1450            var arg = '';
1451            var auxtype = 'detect';
1452
1453
1454
1455
1456            var margs = {
1457
1458                'clicked_from_gallery' : false
1459                ,'larger_desc' : ''
1460            };
1461
1462            if(pargs){
1463                margs = $.extend(margs,pargs);
1464            }
1465
1466
1467
1468            if(margs.clicked_from_gallery && _zoombox_maincon.hasClass('skin-whitefull')){
1469                //return false;
1470            }
1471
1472            bigwidth = undefined; bigheight = undefined;
1473
1474
1475            // === we reinit these vars because they are deleted on lightbox close
1476            //console.info(_zoombox_maincon);
1477            _bigimageCon = _zoombox_maincon.children('.bigimage-con').eq(0);
1478            _gallerymenuCon = _zoombox_maincon.find('.gallery-menu-con').eq(0);
1479
1480            if  (_t[0]!=undefined && _t[0].nodeName == "A") {
1481                _t.attr('data-src', _t.attr('href'));
1482            }
1483
1484            //console.info()
1485
1486            if (_t.attr('data-src') == undefined) {
1487                if (_t.attr('data-sourcemp4') != undefined) {
1488                    arg = _t.attr('data-sourcemp4');
1489                }
1490            } else {
1491                //console.log(arg, args);
1492                arg = _t.attr('data-src');
1493            }
1494
1495            if (typeof _t.attr('data-type') == "undefined" || _t.attr('data-type')=='') {
1496                //args.type = 'image';
1497                auxtype = 'detect';
1498            } else {
1499                //args.type = _t.attr('data-type');
1500                auxtype = _t.attr('data-type');
1501            }
1502
1503
1504            if(auxtype=='detect'){
1505                if (arg.indexOf('.jpg') > -1 || arg.indexOf('.gif') > -1 || arg.indexOf('.jpeg') > -1 || arg.indexOf('.png') > -1) {
1506                    auxtype = 'image';
1507                }
1508
1509                if (arg.indexOf('youtube.com/watch?') > -1) {
1510                    auxtype = 'video';
1511                    _t.attr('data-videotype', 'youtube');
1512                }
1513                if (arg.indexOf('vimeo.com/') > -1) {
1514                    auxtype = 'video';
1515                    _t.attr('data-videotype', 'vimeo');
1516                }
1517                if (arg.indexOf('dailymotion.com/video') > -1) {
1518                    auxtype = 'dailymotion';
1519                }
1520                if (arg.indexOf('soundcloud.com/') > -1) {
1521                    auxtype = 'soundcloud';
1522                }
1523                if (arg.indexOf('.html') > -1) {
1524                    auxtype = 'iframe';
1525                }
1526
1527
1528                if (arg.indexOf('.mp4') > -1 || arg.indexOf('.m4v') > -1) {
1529                    auxtype = 'video';
1530                }
1531                if (arg.indexOf('.mp3') > -1) {
1532                    auxtype = 'audio';
1533                }
1534                if (arg.indexOf('#') == 0) {
1535                    auxtype = 'inlinecontent';
1536                }
1537
1538                if (_t.find('ul.scroller-items').length>0) {
1539                    auxtype = 'slider';
1540                }
1541            }
1542
1543            //https://www?v=ylcPqmZ4ESw
1544
1545//            console.log(_t, _t.attr('data-videotype'), auxtype, arg);
1546
1547            if (typeof _t.attr('data-videotype') == "undefined") {
1548                margs.video_type = 'normal';
1549                //auxtype='detect';
1550            } else {
1551                margs.video_type = _t.attr('data-videotype');
1552            }
1553
1554//            console.log(_t, _t.attr('data-type'), _t.attr('data-videotype'), auxtype, arg, margs.video_type);
1555
1556            if (auxtype == 'youtube') {
1557//                console.info($.fn.vPlayer)
1558                if(typeof $.fn.vPlayer!='undefined'){
1559                    auxtype = 'video';
1560                    margs.video_type = 'youtube';
1561                }
1562            }
1563            if (auxtype == 'detect') {
1564                auxtype = 'image';
1565            }
1566            the_type = auxtype;
1567
1568            if (_t.attr('data-sourceogg') != undefined) {
1569                margs.video_sourceogg = _t.attr('data-sourceogg');
1570            }
1571            if (_t.attr('data-sourcewebm') != undefined) {
1572                margs.video_sourcewebm = _t.attr('data-sourcewebm');
1573            }
1574            if (_t.attr('data-width') != undefined) {
1575                margs.width = _t.attr('data-width');
1576            }
1577            if (_t.attr('data-height') != undefined) {
1578                margs.height = _t.attr('data-height');
1579            }
1580
1581            if (_t.attr('data-coverimage') != undefined) {
1582                margs.media_coverimage = _t.attr('data-coverimage');
1583            }
1584            if (_t.attr('data-disablezoom') != undefined) {
1585                margs.item_disablezoom = _t.attr('data-disablezoom');
1586            }
1587
1588            if(o.design_skin == 'skin-nebula' && _t.find('.zoombox-larger-description').length>0){
1589                margs.title = _t.find('.zoombox-larger-description').eq(0).html();
1590            }else{
1591                if (typeof _t.attr('title') != "undefined" && _t.attr('title') != '') {
1592                    margs.title = _t.attr('title');
1593                }
1594                if (_t.attr('data-lightbox-title')) {
1595                    margs.title = _t.attr('data-lightbox-title');
1596                }
1597            }
1598
1599
1600
1601            // -- lets seeeee if we have a gallery hier
1602            //console.log(_t, _t.attr('data-biggallery'),gallerymenu_arr.length, gallerymenu_arr);
1603
1604
1605            if(_t.attr('data-biggallery')!=undefined && _t.attr('data-biggallery')!='' && gallerymenu_arr.length==0){
1606
1607                if(o.settings_galleryMenu=='dock'){
1608                    if(o.settings_paddingVertical<300){
1609                        //o.settings_paddingVertical = 300;
1610                        settings_paddingVertical = 300;
1611                        setTimeout(calculateDims,700);
1612                    }
1613                    var aux = '<div class="dzsdock" id=""><div class="items" style="opacity:0;">';
1614                    $('.zoombox[data-biggallery="'+_t.attr('data-biggallery')+'"]').each(function(){
1615                        var _cach = $(this);
1616                        //console.log(_cach,_cach.attr('data-biggallerythumbnail'));
1617                        //console.info(_cach, _cach.hasClass('hidden'));
1618
1619
1620                        if(_cach.hasClass('hidden') && !(_cach.attr('data-biggallerythumbnail')) && _cach.find('img').length==0 && _cach.find('.imgtobg').length==0 && !(_cach.css('background-image') || _cach.css('background-image')!='')){
1621                            return;
1622                        }
1623
1624                        //console.info(_cach.css('background-image'));
1625                        if(_cach.attr('data-biggallerythumbnail')){
1626                        }else{
1627
1628                            //console.log(_cach);
1629                            if(_cach.find('img').length>0){
1630                                _cach.attr('data-biggallerythumbnail', _cach.find('img').eq(0).attr('src'));
1631                            }else{
1632
1633                                if(_cach.find('.imgtobg').length>0){
1634
1635                                    var aux2 = _cach.find('.imgtobg').eq(0).css('background-image');
1636                                    aux2 = aux2.replace('url(', '');
1637                                    aux2 = aux2.replace(')', '');
1638                                    aux2 = aux2.replace("'", '');
1639                                    aux2 = aux2.replace('"', '');
1640                                    ////console.info(aux2);
1641                                    _cach.attr('data-biggallerythumbnail', aux2);
1642                                }else{
1643
1644                                    if(_cach.css('background-image')){
1645
1646                                        var aux2 = _cach.css('background-image');
1647                                        aux2 = aux2.replace('url(', '');
1648                                        aux2 = aux2.replace(')', '');
1649                                        aux2 = aux2.replace("'", '');
1650                                        aux2 = aux2.replace('"', '');
1651                                        _cach.attr('data-biggallerythumbnail', aux2);
1652
1653                                    }
1654
1655                                }
1656                            }
1657                            //console.log(_cach, _cach.find('.imgtobg'));
1658                        }
1659
1660                        aux+='<span><img src="'+_cach.attr('data-biggallerythumbnail')+'"/>';
1661                        if(typeof(_cach.attr('href')) != 'undefined'){
1662                            if(_cach.attr('href').indexOf('youtube.com/watch')>-1){
1663                                aux+='<span class="hero-icon icon-video"></span>';
1664                            }
1665                            if(_cach.attr('href').indexOf('vimeo.com/')>-1){
1666                                aux+='<span class="hero-icon icon-video"></span>';
1667                            }
1668                            if(_cach.attr('href').indexOf('.mp4')>-1){
1669                                aux+='<span class="hero-icon icon-video"></span>';
1670                            }
1671                            if(_cach.attr('href').indexOf('dailymotion.com/')>-1){
1672                                aux+='<span class="hero-icon icon-video"></span>';
1673                            }
1674                        }
1675
1676                        aux+='</span>';
1677
1678
1679                    });
1680                    aux+='</div></div>';
1681                    //console.log(gallerymenu_arr, gallerymenu_arr.length, aux);
1682                    _gallerymenuCon.html(aux);
1683                    //console.log(gallerymenu_arr, gallerymenu_arr.length, aux, _gallerymenuCon);
1684                    _gallerymenuCon.children('.dzsdock').dzsdock({
1685                        settings_callbackOnSelect: goto_gallery
1686                        ,settings_activeclass: 'activecss'
1687                        ,settings_startactive: gallerymenu_startindex
1688                    });
1689                }
1690
1691
1692                var auxi =0;
1693
1694                //console.info(gallerymenu_arr,$('.zoombox[data-biggallery="'+_t.attr('data-biggallery')+'"]'));
1695
1696
1697                var $zoombox_gallery_arr = $('.zoombox[data-biggallery="'+_t.attr('data-biggallery')+'"],.zoombox-delegated[data-biggallery="'+_t.attr('data-biggallery')+'"]');
1698
1699                //$zoombox_gallery_arr=[];
1700
1701                //console.info(arg, margs, _t);
1702
1703
1704                if(_t.attr('data-zoombox-sort')){
1705                    $zoombox_gallery_arr = getSorted('.zoombox[data-biggallery="'+_t.attr('data-biggallery')+'"],.zoombox-delegated[data-biggallery="'+_t.attr('data-biggallery')+'"]', 'data-zoombox-sort');
1706                }
1707
1708
1709                //console.info('gallery arr is --> ',$zoombox_gallery_arr);
1710
1711                $zoombox_gallery_arr.each(function(){
1712
1713                    var _cach = $(this);
1714
1715
1716
1717                    if(_cach.hasClass('hidden') && _cach.attr('data-biggallerythumbnail')=='' && _cach.find('img').length==0 && _cach.find('.imgtobg').length==0){
1718                        return;
1719                    }
1720
1721
1722                    gallerymenu_arr.push(_cach);
1723//                    console.log(_cach, _t, _cach==_t);
1724                    if(_cach[0] == _t[0]){
1725                        gallerymenu_startindex = auxi;
1726                    }
1727                    gallerymenu_currindex = gallerymenu_startindex;
1728
1729                    //console.info(gallerymenu_currindex)
1730
1731                    auxi++;
1732                });
1733
1734
1735                //console.info(gallerymenu_arr);
1736
1737
1738            }
1739
1740
1741
1742            //console.log(arg, auxtype, margs);
1743            margs.e = e;
1744            margs.item = _t;
1745
1746            fullwidth = false; fullheight = false;
1747
1748            if(_t.attr('data-bigwidth')){
1749
1750                margs.bigwidth = String(_t.attr('data-bigwidth')).replace('{{ww}}', ww);
1751                if(String(_t.attr('data-bigwidth'))=='{{ww}}'){
1752
1753                    fullwidth=true;
1754                }
1755                //margs.bigwidth = _t.attr('data-bigwidth');
1756            }
1757            if(_t.attr('data-bigheight')){
1758                //console.info(_t.attr('data-bigheight'), String(_t.attr('data-bigheight')),wh);
1759                if(!wh){
1760                    wh = $(window).height();
1761                }
1762                margs.bigheight = String(_t.attr('data-bigheight')).replace('{{wh}}', wh);
1763                if(String(_t.attr('data-bigwidth'))=='{{ww}}'){
1764                    fullheight=true;
1765                }
1766                //margs.bigheight = _t.attr('data-bigheight');
1767            }
1768            if(_t && _t.attr('data-inline_content_move') && margs){
1769                margs.inline_content_move = String(_t.attr('data-inline_content_move'));
1770            }
1771
1772            //console.log(margs);
1773
1774            gotoItem(arg, auxtype, margs);
1775        }
1776
1777        // ------- start gotoItem function - actually open the zoombox
1778        function gotoItem(arg, argtype, otherargs) {
1779            //console.log('gotoItem()',arg,argtype,otherargs);
1780            /// -- arg = the source path
1781            //  -- actually open the zoombox
1782            //console.info(argtype);
1783            if (argtype == undefined) {
1784                argtype = 'image';
1785            }
1786
1787            if (is_ie8()) {
1788
1789                _bigimageCon.css('display', 'none`');
1790            }
1791
1792
1793            //===define the event
1794            var e;
1795            if (otherargs != undefined && otherargs.e) {
1796                e = otherargs.e;
1797            }
1798            if (e != undefined && e.preventDefault != undefined) {
1799                e.preventDefault();
1800            }
1801            //console.log(arg, argtype, otherargs);
1802
1803            if (argtype == 'detect') {
1804                //to be completed
1805            }
1806
1807            var defaults = {
1808                video_sourceogg: '',
1809                video_title: '',
1810                video_type: 'normal',
1811                video_previewimg: '',
1812                bigwidth: '-1',
1813                bigheight: '-1',
1814                video_description: '',
1815                item: null,
1816                extra_classes: '',
1817                forcenodeeplink: "off",
1818                title: '',
1819                inline_content_move: 'off',
1820                animation_for_pastHolder_goForward: false
1821            };
1822
1823
1824            // -- video_width is bigwidth
1825            otherargs = $.extend(defaults, otherargs);
1826
1827            otherargs.bigwidth = parseInt(otherargs.bigwidth, 10);
1828            otherargs.bigheight = parseInt(otherargs.bigheight, 10);
1829            lastargs = otherargs;
1830            //console.info(lastargs.$targetdiv, argtype, arg)
1831            //return false;
1832
1833            //console.info(lastargs);
1834
1835
1836            last_zoombox_item_clicked = otherargs.item;
1837
1838            //console.info(otherargs);
1839
1840            if (argtype == 'inlinecontent') {
1841                lastargs.$targetdiv = $(arg).eq(0);
1842            }
1843
1844
1845            var holder_extra_css = '';
1846            var holder_con_extra_css = '';
1847
1848
1849            var str_comefromleft = '';
1850
1851
1852            //console.info('YESYES',_zoombox_maincon.children('.scroller').length);
1853            if (_zoombox_maincon.children('.scroller').length > 0) {
1854                //console.log(_zoombox_maincon.children('.scroller').eq(0));
1855                if (_zoombox_maincon.get(0) && _zoombox_maincon.get(0).api_destroy){
1856
1857                    console.info('CALL DESTROY IN SCROLLER');
1858                    _zoombox_maincon.get(0).api_destroy();
1859                }
1860            }
1861            if(_zoombox_maincon.children('.currHolder').length>0) {
1862                restart_video_players();
1863                _zoombox_maincon.children('.currHolder').addClass('pastHolder').removeClass('currHolder');
1864            }else{
1865
1866            }
1867
1868
1869
1870            // -- moving transitioning gallery class here to see what happens
1871            if(lastargs.clicked_from_gallery){
1872
1873                _zoombox_maincon.addClass('preparing-for-transitioning-gallery');
1874            }
1875            _zoombox_maincon.removeClass('disabled');
1876
1877
1878
1879
1880
1881            if(o.settings_deeplinking=='on' && has_history_api()==true && otherargs.forcenodeeplink!='on'){
1882                //console.log(otherargs.item);
1883
1884                $zoombox_items_arr = $('.zoombox,.zoombox-delegated')
1885                if(otherargs.item && otherargs.item.attr('data-zoombox-sort')){
1886                    //$zoombox_gallery_arr = getSorted('.zoombox,.zoombox-delegated', 'data-zoombox-sort');
1887                }
1888
1889                var ind = $zoombox_items_arr.index(otherargs.item);
1890                if(typeof($(otherargs.item).attr('id'))!='undefined'){
1891                    ind = $(otherargs.item).attr('id');
1892                }
1893
1894
1895
1896                theurl = window.location.href;
1897                var newurl = add_query_arg(theurl, 'zoombox', ind);
1898                if(newurl.indexOf(' ')>-1){
1899                    newurl = newurl.replace(' ', '%20');
1900                }
1901                theurl = newurl;
1902                //console.info(theurl);
1903                history.pushState({}, "", newurl);
1904            }
1905
1906            var aux = '';
1907            //console.log(otherargs.item, gallerymenu_arr);
1908
1909            if(o.settings_usearrows=='on' && gallerymenu_arr.length > 0){
1910
1911                if(otherargs!=undefined && otherargs.item!=undefined){
1912                    for(var i=0;i<gallerymenu_arr.length;i++){
1913                        if(gallerymenu_arr[i][0] == otherargs.item[0]){
1914                            gallerymenu_currindex = i ;
1915                        }
1916
1917                    }
1918                }
1919                //console.log(gallerymenu_currindex);
1920                aux = '<div class="con-zoomboxArrows">';
1921                if(gallerymenu_currindex>
19210){
1922                    aux+='<div class="zb-arrow-left"></div>';
1923                }
1924                if(gallerymenu_currindex<gallerymenu_arr.length-1){
1925                    aux+='<div class="zb-arrow-right">';
1926
1927
1928
1929                    aux+='</div>';
1930                }
1931                aux+='</div>';
1932                if(_conZoomboxArrows!=undefined){
1933                    _conZoomboxArrows.remove();
1934                }
1935
1936                _zoombox_maincon.children().eq(0).after(aux);
1937
1938                _conZoomboxArrows = _zoombox_maincon.find('.con-zoomboxArrows').eq(0);
1939
1940                _conZoomboxArrows.children('.zb-arrow-left').bind('click', function(){
1941                    //console.log('ceva');
1942                    goto_prev_galleryitem();
1943                })
1944                _conZoomboxArrows.children('.zb-arrow-right').bind('click', function(){
1945                    //console.log('ceva');
1946                    goto_next_galleryitem();
1947                })
1948
1949
1950            }else{
1951                _zoombox_maincon.children('.con-zoomboxArrows').remove();
1952            }
1953
1954            //console.info(otherargs);
1955
1956            if(otherargs.clicked_from_gallery){
1957
1958
1959                if(o.settings_transition_gallery=='slide'){
1960
1961                    if(otherargs.animation_forward){
1962
1963                        if(o.settings_fullsize=='on'){
1964
1965                            holder_con_extra_css+=' left: 100%;';
1966                        }else{
1967
1968                            holder_con_extra_css+=' left: 150%;';
1969                        }
1970                    }else{
1971
1972                        if(o.settings_fullsize=='on'){
1973
1974                            holder_con_extra_css+=' left: -100%;';
1975                        }else{
1976
1977                            holder_con_extra_css+=' left: -150%;';
1978                        }
1979                    }
1980
1981
1982                }
1983            }else{
1984
1985                if(o.settings_transition=='fromtop'){
1986                    holder_extra_css='top: -100%';
1987                }
1988            }
1989
1990            //console.info(holder_con_extra_css);
1991
1992            //console.info(o, o.settings_holder_con_extra_classes);
1993            aux = '<div class="holder-con currHolder '+otherargs.extra_classes+ o.settings_holder_con_extra_classes+'" style="'+holder_con_extra_css+'"><div class="holder-bg"></div><div class="holder-text">';
1994
1995            //console.info(aux);
1996
1997
1998            if(o.design_skin=='skin-darkfull'){
1999                if(otherargs.item.children('.zoombox-larger-description').length>0){
2000                    aux+=otherargs.item.children('.zoombox-larger-description').eq(0).html();
2001                    _zoombox_maincon.children('.info-btn').removeClass('disabled active');
2002                }else{
2003
2004                    _zoombox_maincon.children('.info-btn').addClass('disabled');
2005                }
2006
2007            }
2008            //console.info(otherargs.item);
2009
2010
2011            //console.info('ceva', holder_extra_css, o.settings_transition);
2012
2013            aux+='</div><div class="holder '+ o.settings_holder_extra_classes+'" style="'+holder_extra_css+'">';
2014
2015
2016            aux+='</div>';
2017
2018            var socialS = '<div class="con-dropdowner social-options-con"><div class="auxpadder"></div><div class="social-btn"></div><div class="dropdowner forright">';
2019
2020
2021            socialS+='<iframe src="//www.facebook.com/plugins/like.php?href='+encodeURIComponent(theurl)+'&amp;send=false&amp;layout=standard&amp;width=300&amp;show_faces=false&amp;font=arial&amp;colorscheme=light&amp;action=like&amp;height=35&amp;appId=151389461684900" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:35px;" allowTransparency="true"></iframe>';
2022
2023            /*
2024             ==some code that does not work at the momment
2025             socialS+='<a href="https://twitter.com/share" style="display:inline-block; width:120px;"class="twitter-share-button" data-via="ZoomItFlash">Tweet</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?"http":"h   ttps";if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document, "script", "twitter-wjs");</script>';
2026
2027             if(window.gapi!=undefined){
2028             socialS+='<g:plusone size="medium"></g:plusone>';
2029             //console.log('ceva');
2030             }
2031             //socialS+='<div class="fb-comments" data-href="'+theurl+'" data-width="300" data-num-posts="10" style="height: 300px;
2031 overflow-y: scroll;"></div>';
2032             */
2033
2034            if(o.social_enableTwitterShare=='on'){
2035                socialS+='<a target="_blank" href="https://twitter.com/share?url='+encodeURIComponent(theurl)+'%2Fpages%2Ftweet-button" class="lightboxanchor"><div class="lightboxicon-twitter"></div></a>';
2036            }
2037            if(o.social_enableGooglePlusShare=='on'){
2038                socialS+='<a target="_blank" href="https://plus.google.com/share?url='+encodeURIComponent(theurl)+'" class="lightboxanchor"><div class="lightboxicon-googleplus"></div></a>';
2039            }
2040            if(o.social_extraShareIcons!=''){
2041                var auxs = o.social_extraShareIcons;
2042                auxs = auxs.replace('{{currurl}}', encodeURIComponent(theurl));
2043                socialS+= auxs;
2044            }
2045            socialS+='<br/>';
2046
2047
2048
2049
2050            //console.info(theurl);
2051            //console.info(window.FB);
2052            if(window.FB!=undefined){
2053                socialS+='<br/><fb:comments href="'+theurl+'" width="300" num_posts="10" style="max-height:300px; overflow-y: scroll;"></fb:comments>';
2054            }
2055            socialS+='</div></div>';
2056            if(window.FB!=undefined){
2057                socialS+='<script>FB.XFBML.parse();</script>';
2058            }
2059
2060            if(o.settings_disableSocial==undefined || o.settings_disableSocial!='on'){
2061                aux+=socialS;
2062            }
2063
2064            var aux_close_btn = '<div class="close-btn">';
2065            if(o.design_skin=='skin-nebula'){
2066                aux_close_btn+=translate_skin_nebula_closebtn;
2067            }
2068            aux_close_btn+='</div>';
2069            aux+=aux_close_btn+'</div>';
2070            _zoombox_maincon.children().eq(0).after(aux);
2071
2072
2073
2074            _conHolder = _zoombox_maincon.children('.currHolder');
2075            //console.info(_conHolder);
2076            _holderBg = _conHolder.children('.holder-bg');
2077            //console.info(_holderBg);
2078            _holder = _conHolder.find('.holder').eq(0);
2079            _conHolder.children('.close-btn').unbind('click', click_close);
2080            _conHolder.children('.close-btn').bind('click', click_close);
2081            _zoombox_maincon.undelegate('.btn-close-zoombox','click', click_close);
2082            _zoombox_maincon.delegate('.btn-close-zoombox','click', click_close);
2083            //console.log(argtype, otherargs, _conHolder);
2084
2085
2086            _holder.addClass('type-' + argtype);
2087
2088            //==== animation start
2089            //setTimeout(function(){
2090            //    if(otherargs.clicked_from_gallery && o.settings_transition_gallery=='slide'){
2091            //        //console.info('hier',_conHolder);
2092            //        _conHolder.animate({
2093            //            //'left': '50%'
2094            //        },{
2095            //            queue:false
2096            //            ,duration: 500
2097            //        });
2098            //
2099            //
2100            //
2101            //        if(_zoombox_maincon.hasClass('skin-whitefull')){
2102            //            //console.info('yes');
2103            //
2104            //            _conHolder.animate({
2105            //                'left': '0%'
2106            //            }, { queue: false, duration: 2500});
2107            //        }
2108            //    };
2109            //},10)
2110            if(o.design_animation=='fromtop'){
2111                _holder.css({
2112                    'top': '-100%'
2113                });
2114            };
2115
2116
2117            if(o.design_animation=='noanim'){
2118                _zoombox_maincon.addClass('noanim');
2119            }else{
2120                _zoombox_maincon.removeClass('noanim');
2121
2122            }
2123
2124
2125            has_zoom = true;
2126
2127            if(argtype=='slider' &&typeof window.dzsas_init == 'undefined'){
2128                argtype='image';
2129            }
2130
2131//            console.info(argtype);
2132
2133            if (argtype == 'image') {
2134
2135
2136
2137                var aux = '';
2138                aux = '<img class="the-item" src="' + arg + '"';
2139                if(o.settings_useImageTag=='off'){
2140                    aux+=' style="display:none;"'
2141                }
2142                aux+='/>';
2143                _holder.append(aux);
2144                if(o.settings_useImageTag=='off'){
2145                    _holder.append('<div class="the-item the-div-image-item" style="background-image: url('+arg+');"></div>');
2146                    _theDivItem = _holder.children('div.the-item').eq(0);
2147                }
2148                _theItem = _holder.children('img.the-item').last();
2149                toload = _holder.children('img').get(0);
2150//                console.log(_theItem, _theItem.width(), _theItem.attr('style'), _holder, toload);
2151
2152                if (toload.complete == true && toload.naturalWidth != 0) {
2153                    itemLoaded(otherargs);
2154                } else {
2155
2156                    //console.info('call itemLoaded from load event on image', otherargs)
2157                    $(toload).bind('load', itemLoaded);
2158                }
2159
2160                if(o.settings_disablezoom=='peritem'){
2161                    if(otherargs.item_disablezoom == 'on'){
2162                        has_zoom=false;
2163                    }else{
2164                        has_zoom=true;
2165                    }
2166                }else{
2167                    if(o.settings_disablezoom=='on'){
2168                        has_zoom=false;
2169                    }
2170                }
2171
2172                if(o.settings_useImageTag == 'off'){
2173                    has_zoom=false;
2174                }
2175
2176//                console.info('haszoom', has_zoom);
2177                if(has_zoom){
2178                    _theItem.bind('click', click_imageitem);
2179                    _theItem.parent().addClass('has-zoom');
2180                }else{
2181                    _theItem.parent().removeClass('has-zoom');
2182                }
2183
2184
2185            }
2186
2187            if (argtype == 'slider') {
2188
2189
2190
2191                var aux = '';
2192                aux = '<div class="advancedscroller the-item skin-avanti-inset" style="width:100%; height: 503px"><ul class="items">';
2193
2194                aux+=otherargs.item.find('.scroller-items').eq(0).html();
2195
2196                aux+='</ul></div>';
2197                _holder.append(aux);
2198
2199
2200//                console.info(arg, otherargs.item, aux);
2201//                return;
2202                _theItem = _holder.children('div.the-item').last();
2203
2204                window.dzsas_init(_theItem, {
2205                    settings_mode: "onlyoneitem"
2206                    ,design_arrowsize: "0"
2207                    ,settings_swipe: "on"
2208                    ,settings_swipeOnDesktopsToo: "on"
2209                    ,settings_slideshow: "on"
2210                    ,settings_slideshowTime: "300"
2211                    ,settings_autoHeight:"off"
2212                    ,settings_transition:"fade"
2213                    ,settings_centeritems:false
2214                })
2215//                console.log(_theItem, _theItem.width(), _theItem.attr('style'), _holder, toload);
2216
2217                setTimeout(itemLoaded, 1000, otherargs);
2218
2219
2220                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigwidth')==undefined){
2221                    bigwidth = 800;
2222                }
2223                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigheight')==undefined){
2224                    bigheight = 500;
2225                }
2226
2227            }
2228            if (argtype == 'notification') {
2229
2230                _holder.append('<div class="the-item type-notification"></div>');
2231                _theItem = _holder.children().eq(1);
2232                _theItem.append('<div class="the-sizer">' + arg + '</div>');
2233
2234
2235                if (otherargs.width == undefined || otherargs.width == 0) {
2236                    otherargs.width = _theItem.outerWidth(false);
2237                    if (_theItem.children().length == 1) {
2238                        //console.log(_theItem.children().eq(0),_theItem.children().eq(0).outerWidth(false))
2239                        otherargs.width = _theItem.children().eq(0).outerWidth(false);
2240                    }
2241                }
2242                if (otherargs.height == undefined || otherargs.height == 0) {
2243                    otherargs.height = _theItem.outerHeight(false);
2244                    if (_theItem.children().length == 1) {
2245                        otherargs.height = _theItem.children().eq(0).outerHeight(false);
2246                    }
2247                }
2248
2249
2250                //console.log(_theItem, otherargs.width, otherargs.height)
2251                if (otherargs.width != undefined && otherargs.width != 0) {
2252                    _theItem.css({
2253                        'width': 1000, 'height': otherargs.height
2254                    })
2255                    bigwidth = otherargs.width;
2256                    bigheight = otherargs.height;
2257                }
2258                setTimeout(itemLoaded, 1000, otherargs);
2259                inter_closezoombox = setTimeout(close_zoombox, 5000);
2260            }
2261
2262            if (argtype == 'inlinecontent') {
2263
2264                if(otherargs.inline_content_move=='on'){
2265                    if($(arg).prev().length>0){
2266                        _inline_content_orig_prev = $(arg).prev();
2267                    }else{
2268
2269                        _inline_content_orig_parent = $(arg).parent();
2270                    }
2271                }
2272
2273                //console.info(_inline_content_orig_prev, _inline_content_orig_parent, $(arg));
2274
2275
2276                if(!otherargs.item || !otherargs.item.attr('data-ajaxhref')){
2277
2278                    //console.info('yes?');
2279                    _holder.append('<div class="the-item type-inlinecontent"></div>');
2280                }
2281                _theItem = _holder.children('.the-item').eq(0);
2282
2283
2284                //console.info(_holder, _holder.children(),  _holder.children('.the-item'), 'theItem - ',  _theItem);
2285
2286
2287
2288                if(otherargs && otherargs.inline_content_move=='on'){
2289                    _theItem.append(otherargs.$targetdiv);
2290                }else{
2291                    _theItem.append($(arg).clone());
2292                }
2293
2294                //console.info(arg, $(arg));
2295
2296
2297                //console.info(_theItem);
2298
2299                if(_theItem.children().eq(0).css('display')=='none'){
2300                    _theItem.children().eq(0).css('display','block');
2301                    _theItem.children().eq(0).removeClass('hidden');
2302                }
2303
2304                //_theItem.children().eq(0).width(800);
2305
2306                if (otherargs.width == undefined || otherargs.width == 0) {
2307                    otherargs.width = _theItem.outerWidth(false);
2308                    if (_theItem.children().length == 1) {
2309                        otherargs.width = _theItem.children().eq(0).outerWidth(false);
2310                    }
2311                }
2312                //console.info( _theItem.children().eq(0), _theItem.children().eq(0).outerWidth(false))
2313                if (otherargs.height == undefined || otherargs.height == 0) {
2314                    otherargs.height = _theItem.outerHeight(false);
2315                    if (_theItem.children().length == 1) {
2316                        otherargs.height = _theItem.children().eq(0).outerHeight(false);
2317                    }
2318                }
2319                //console.log(_theItem.children().eq(0), _theItem.children().eq(0).outerHeight(false), otherargs.width, otherargs.height, bigwidth, bigheight);
2320
2321                if (otherargs.width != undefined && otherargs.width != 0) {
2322                    _theItem.css({
2323                        'width': otherargs.width, 'height': otherargs.height
2324                    })
2325                }
2326
2327
2328
2329
2330                if(otherargs == undefined || otherargs.item == undefined || otherargs.bigwidth<1){
2331                    bigwidth = 800;
2332                }
2333
2334                if(otherargs.bigwidth>0){
2335                    bigwidth = otherargs.bigwidth;
2336                }
2337                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigheight')==undefined){
2338                    bigheight = 500;
2339                    if(o.design_skin=='skin-nebula'){
2340                        bigheight=650;
2341                    }
2342                }
2343
2344                if(otherargs.bigheight>0){
2345                    bigheight = otherargs.bigheight;
2346                }
2347
2348                //console.info(bigwidth,bigheight);
2349
2350
2351
2352                window.dzszb_execute_target = _theItem;
2353
2354
2355
2356
2357                if(_theItem.find('.zbox-responsive-media').length>0){
2358                    var _c = _theItem.find('.zbox-responsive-media').eq(0);
2359
2360
2361                    if(_c.children().length==0){
2362
2363                        if(_theItem.find('.slider-con').length>0){
2364                            _c.append(_theItem.find('.slider-con').eq(0).html());
2365
2366                            //console.info(_theItem.find('.slider-con').eq(0).html());
2367
2368                            if(_c.children('.advancedscroller').length>0){
2369                                _c.children('.arrow-left-for-skin-qcre').remove();
2370                                _c.children('.arrow-right-for-skin-qcre').remove();
2371
2372                                _c.children('.advancedscroller').removeClass('skin-nonav').addClass('skin-qcre');
2373
2374                                dzsas_init(_c.children('.advancedscroller'), { settings_mode: "onlyoneitem",design_arrowsize: "0" ,settings_swipe: "on" ,settings_autoHeight: "on",settings_autoHeight_proportional: "on",settings_swipeOnDesktopsToo: "on" ,settings_slideshow: "on" ,settings_slideshowTime: "150" });
2375                            }
2376                        }
2377                    }
2378                }
2379
2380                _theItem.find('.toexecute').each(function(){
2381                    var _t2 = $(this);
2382                    if(_t2.hasClass('executed')==false){
2383                        window.meta_execute_target = _t2;
2384                        eval(_t2.text());
2385                        _t2.addClass('executed');
2386                    }
2387                });
2388
2389                //console.log(otherargs.width, otherargs.height, bigwidth, bigheight);
2390
2391
2392
2393
2394
2395                if(otherargs.item && otherargs.item.attr('data-ajaxhref')){
2396
2397
2398                    if(otherargs.item.data('dzszbx_ajaxdata')){
2399
2400                        process_result(otherargs.item.data('dzszbx_ajaxdata'));
2401                    }else{
2402                        //console.info('fromaajax');
2403                        $.ajax({
2404                            url: otherargs.item.attr('data-ajaxhref'),
2405                            success: function (result) {
2406                                //if(window.console){ console.log(result) };
2407                                process_result(result);
2408
2409                                otherargs.item.data('dzszbx_ajaxdata', result);
2410                            }
2411                        })
2412                    }
2413
2414
2415
2416
2417                }else{
2418
2419
2420                    //console.info('content move -- off');
2421
2422                    setTimeout(function(){
2423                        //console.info(_holder.find('.vplayer').get(0));
2424
2425
2426                        if(o.videoplayer_settings.zoombox_video_autoplay=='on'){
2427                            //console.info('ceva');
2428                            if(_holder.find('.slider-con').length>0 && _holder.find('.slider-con').eq(0).children('.vplayer').length>0){
2429
2430                                _holder.find('.slider-con > .vplayer').get(0).api_playMovie();
2431                            }
2432                        }
2433
2434
2435                        //console.info('what', _holder.find('.vplayer').get(0).api_seek_to_perc);
2436
2437
2438                    }, 1500);
2439
2440
2441
2442
2443                    if(_holder.find('.slider-con').length>0 && _holder.find('.slider-con').eq(0).children('.advancedscroller').length>0){
2444
2445                        //console.info(_holder.find('.slider-con > .advancedscroller').get(0))
2446
2447                        if( _holder.find('.slider-con > .advancedscroller').get(0) && _holder.find('.slider-con > .advancedscroller').get(0).api_goto_page){
2448
2449                            _holder.find('.slider-con > .advancedscroller').get(0).api_goto_page(0);
2450                        }
2451                    }
2452
2453
2454                    if(_holder.find('.slider-con').length>0 && _holder.find('.slider-con').eq(0).children('.vplayer').length>0){
2455
2456                        if(_holder.find('.slider-con > .vplayer').get(0) && _holder.find('.slider-con > .vplayer').get(0).api_playMovie) {
2457                            _holder.find('.slider-con > .vplayer').get(0).api_playMovie();
2458                        }
2459
2460                        if( _holder.find('.slider-con > .vplayer').get(0).api_seek_to_perc){
2461
2462                            _holder.find('.slider-con > .vplayer').get(0).api_seek_to_perc(0);
2463                            if(o.videoplayer_settings.zoombox_video_autoplay!='on'){
2464
2465                                if(_holder.find('.slider-con > .vplayer').get(0) && _holder.find('.slider-con > .vplayer').get(0).api_pauseMovie){
2466                                    _holder.find('.slider-con > .vplayer').get(0).api_pauseMovie(0);
2467                                    _holder.find('.slider-con > .vplayer').get(0).api_reinit_cover_image();
2468                                }
2469
2470                            }
2471                        }
2472                    }
2473
2474                    //console.info('itemLoaded');
2475
2476
2477
2478                    if(o.settings_transition=='fromcenter'){
2479
2480                        setTimeout(itemLoaded, 1000,otherargs);
2481                    }else{
2482                        if(o.settings_transition=='fromtop'){
2483
2484                            setTimeout(itemLoaded, 10,otherargs);
2485                        }else{
2486
2487                            if(o.settings_transition=='fade'){
2488
2489                                setTimeout(itemLoaded, 1000,otherargs);
2490                            }
2491                        }
2492                    }
2493
2494                }
2495
2496            }
2497
2498            if (argtype == 'ajax') {
2499                $.ajax({
2500                    url: arg,
2501                    success: function (result) {
2502                        //if(window.console){ console.log(result) };
2503                        _holder.append('<div class="the-item ajax-content">' + result + '</div>');
2504                        _theItem = _holder.children().eq(1);
2505
2506                        //console.log(_theItem.children().eq(0).width())
2507                        if (otherargs.width == undefined || otherargs.width == 0) {
2508                            otherargs.width = _theItem.outerWidth(false);
2509                            if (_theItem.children().length == 1) {
2510                                otherargs.width = _theItem.children().eq(0).outerWidth(false);
2511                            }
2512                        }
2513                        if (otherargs.height == undefined || otherargs.height == 0) {
2514                            otherargs.height = _theItem.outerHeight(false);
2515                            if (_theItem.children().length == 1) {
2516                                otherargs.height = _theItem.children().eq(0).outerHeight(false);
2517                            }
2518                        }
2519                        //console.log(otherargs.width, otherargs.height)
2520                        if (otherargs.width != undefined && otherargs.width != 0) {
2521                            _theItem.css({
2522                                'width': otherargs.width, 'height': otherargs.height
2523                            })
2524                        }
2525                        setTimeout(itemLoaded, 1000, otherargs);
2526                    }
2527                })
2528
2529            }
2530            //console.log(arg,argtype);
2531            if (argtype == 'youtube') {
2532
2533                //console.log()
2534                //console.log(arg, argtype, otherargs);
2535                if(arg.indexOf('youtube.com')>-1){
2536                    arg = jQuery.fn.urlParam(arg, "v");
2537                }
2538
2539                //console.log(arg, argtype, otherargs);
2540                var style_w = '';
2541                var style_h = '';
2542
2543                //console.log(otherargs);
2544                if (otherargs.width == undefined || otherargs.width == 0) {
2545                    otherargs.width = 800;
2546                }
2547                if (otherargs.height == undefined || otherargs.height == 0) {
2548                    otherargs.height = 500;
2549                }
2550
2551
2552                if (otherargs.width > 0) {
2553                    style_w = 'width:' + otherargs.width + 'px;';
2554                }
2555                if (otherargs.height > 0) {
2556                    style_h = 'height:' + otherargs.height + 'px;';
2557                }
2558
2559                _holder.append('<iframe class="the-item" src="https://www.youtube.com/embed/' + arg + '?autoplay=1" style="border:0;' + style_w + style_h + '" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>');
2560                _theItem = _holder.children().eq(1);
2561
2562
2563                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigwidth')==undefined){
2564                    bigwidth = 800;
2565                }
2566                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigheight')==undefined){
2567                    bigheight = 500;
2568                }
2569
2570                setTimeout(itemLoaded, 1000, otherargs);
2571
2572            }
2573            if (argtype == 'dailymotion') {
2574                var aux = arg.split('_');
2575                //console.log(aux);
2576                var aux2 = String(aux[0]).split('/');
2577                var theid = aux2[aux2.length-1];
2578                //console.log(aux2, theid);
2579                var style_w = '';
2580                var style_h = '';
2581
2582                //console.log(otherargs);
2583                if (otherargs.width == undefined || otherargs.width == 0) {
2584                    otherargs.width = 800;
2585                }
2586                if (otherargs.height == undefined || otherargs.height == 0) {
2587                    otherargs.height = 500;
2588                }
2589
2590                _holder.append('<iframe class="the-item" src="https://www.dailymotion.com/embed/video/' + theid + '?autoplay=1" style="border:0;' + style_w + style_h + '" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>');
2591                _theItem = _holder.children().eq(1);
2592
2593                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigwidth')==undefined){
2594                    bigwidth = 800;
2595                }
2596                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigheight')==undefined){
2597                    bigheight = 500;
2598                }
2599
2600                setTimeout(itemLoaded, 1000, otherargs);
2601            }
2602            if (argtype == 'soundcloud') {
2603
2604                //console.log(otherargs);
2605                if (otherargs.width == undefined || otherargs.width == 0) {
2606                    otherargs.width = 800;
2607                }
2608                if (otherargs.height == undefined || otherargs.height == 0) {
2609                    otherargs.height = 166;
2610                }
2611                _holder.append('<iframe class="the-item" src="https://w.soundcloud.com/player/?url=' + encodeURIComponent(arg) + '?autoplay=1" style="border:0;' + style_w + style_h + '" scrolling="no" frameborder="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>');
2612                _theItem = _holder.children().eq(1);
2613
2614                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigwidth')==undefined){
2615                    bigwidth = 800;
2616                }
2617                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigheight')==undefined){
2618                    bigheight = 166;
2619                }
2620
2621                setTimeout(itemLoaded, 1000, otherargs);
2622            }
2623            if (argtype == 'vimeo') {
2624
2625                //console.log(arg, argtype, otherargs);
2626                //console.log()
2627                var aux = arg.split('vimeo.com/');
2628                arg = aux[1];
2629                var style_w = '';
2630                var style_h = '';
2631
2632                //console.log(otherargs);
2633                if (otherargs.width == undefined || otherargs.width == 0) {
2634                    otherargs.width = 1024;
2635                }
2636                if (otherargs.height == undefined || otherargs.height == 0) {
2637                    otherargs.height = 768;
2638                }
2639
2640
2641                if (otherargs.width > 0) {
2642                    style_w = 'width:' + otherargs.width + 'px;';
2643                }
2644                if (otherargs.height > 0) {
2645                    style_h = 'height:' + otherargs.height + 'px;';
2646                }
2647
2648
2649                var str_autoplay = '0';
2650
2651                if(o.videoplayer_settings && o.videoplayer_settings.zoombox_video_auto
2651play=='on'){
2652                    str_autoplay='1';
2653                }
2654
2655
2656                _holder.append('<iframe class="the-item" src="https://player.vimeo.com/video/' + arg + '?autoplay='+str_autoplay+'" style="border:0;"  webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>');
2657                _theItem = _holder.children().eq(1);
2658
2659
2660                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigwidth')==undefined){
2661                    bigwidth = 800;
2662                }
2663                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigheight')==undefined){
2664                    bigheight = 500;
2665                }
2666
2667                setTimeout(itemLoaded, 1000, otherargs);
2668
2669            }
2670
2671            if (argtype == 'iframe') {
2672                var style_w = '';
2673                var style_h = '';
2674                if (otherargs.width > 0) {
2675                    style_w = 'width:' + otherargs.width + 'px;';
2676                }
2677                if (otherargs.height > 0) {
2678                    style_h = 'height:' + otherargs.height + 'px;';
2679                }
2680
2681                //console.info(otherargs);
2682
2683
2684                if(otherargs == undefined || otherargs.item == undefined || otherargs.bigwidth<1){
2685                    bigwidth = 800;
2686                }
2687
2688                if(otherargs.bigwidth>0){
2689                    bigwidth = otherargs.bigwidth;
2690                }
2691                if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigheight')==undefined){
2692                    bigheight = 500;
2693                    if(o.design_skin=='skin-nebula'){
2694                        bigheight=650;
2695                    }
2696                }
2697
2698                if(otherargs.bigheight>0){
2699                    bigheight = otherargs.bigheight;
2700                }
2701
2702                //console.log(bigwidth);
2703
2704                _holder.append('<iframe class="the-item" src="' + arg + '" style="border:0;' + style_w + style_h + '"/>');
2705                _theItem = _holder.children().eq(1);
2706
2707
2708                if(o.settings_useImageTag=='off'){
2709                    _theDivItem = _theItem;
2710                    _theDivItem.addClass('the-div-image-item');
2711                }
2712
2713                if(_zoombox_maincon.hasClass('no-loading')){
2714                    itemLoaded(otherargs);
2715                }else{
2716                    setTimeout(itemLoaded, 1000, otherargs);
2717                }
2718
2719
2720            }
2721
2722            //===type video
2723            if (argtype == 'video') {
2724                if(typeof(window.dzszvp_init)!='undefined'){
2725
2726                    if(otherargs.bigwidth==-1){
2727                        bigwidth = 800;
2728                    }
2729                    if(otherargs.bigheight==-1){
2730                        bigheight = 500;
2731                    }
2732
2733//                    console.info(bigwidth, bigheight);
2734                    var aux = '<div class="the-item"><div class="zoomvideoplayer"';
2735                    aux += ' data-source="' + arg + '"';
2736                    if (otherargs.video_sourceogg != '') {
2737                        aux += ' data-sourceogg="' + otherargs.video_sourceogg + '"';
2738                    }
2739                    if (otherargs.video_previewimg != '') {
2740                        aux += ' data-cover="' + otherargs.video_previewimg + '"';
2741                    }
2742                    aux += ' data-type="' + otherargs.video_type + '"';
2743                    aux += ' style="height: 100%;"';
2744                    aux += '>';
2745
2746
2747
2748                    aux += '</div>';
2749                    /*
2750                     aux += '<script>jQuery(document).ready(function($){';
2751                     aux += 'var videoplayersettingsholder={ responsive:"on", autoplay: "on", design_skin: "' + o.design_skin + '"}; ';
2752                     aux += '$(".the-item .vplayer-tobe").vPlayer(videoplayersettingsholder);';
2753                     aux += '});</script>';
2754                     */
2755                    var videoplayersettingsholder={ autoplay: "off" };
2756
2757
2758
2759
2760                    videoplayersettingsholder = $.extend(videoplayersettingsholder, o.videoplayer_settings);
2761
2762                    if(window.dzszvg_swfpath){
2763                        videoplayersettingsholder.url_playerlight = window.dzszvg_swfpath;
2764                    }
2765
2766                    _holder.append(aux);
2767                    _holder.find('.zoomvideoplayer').eq(0).zoomvideoplayer(videoplayersettingsholder);
2768                    _theItem = _holder.children().eq(1).children().eq(0);
2769                    toload = _theItem.get(0);
2770
2771
2772                    if( bigwidth==-1 && (otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigwidth')==undefined ) ){
2773                        bigwidth = 800;
2774                    }
2775                    if( bigheight==-1 && (otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigheight')==undefined) ){
2776                        bigheight = 500;
2777                    }
2778
2779                    setTimeout(itemLoaded, 1000, otherargs);
2780
2781                    // -- we wait 2200 ms for playing the video so the transition has time to complete
2782                    setTimeout(function(){
2783                        if(_holder.find('.zoomvideoplayer').get(0) && _holder.find('.zoomvideoplayer').get(0).api_play_media){
2784                            _holder.find('.zoomvideoplayer').get(0).api_play_media();
2785                        }
2786                    }, 2200)
2787                }else{
2788                    if ($.fn.vPlayer != undefined) {
2789
2790                        if(otherargs.bigwidth==-1){
2791                            bigwidth = 800;
2792                        }
2793                        if(otherargs.bigheight==-1){
2794                            bigheight = 500;
2795                        }
2796
2797//                    console.info(bigwidth, bigheight);
2798                        var aux = '<div class="the-item"><div class="vplayer-tobe "';
2799                        if (otherargs.video_title != '') {
2800                            aux += ' data-videoTitle="' + otherargs.video_title + '"';
2801                        }
2802                        aux += ' data-sourcemp4="' + arg + '"';
2803                        if (otherargs.video_sourceogg != '') {
2804                            aux += ' data-sourceogg="' + otherargs.video_sourceogg + '"';
2805                        }
2806                        if (otherargs.video_previewimg != '') {
2807                            aux += ' data-img="' + otherargs.video_previewimg + '"';
2808                        }
2809                        aux += ' data-type="' + otherargs.video_type + '"';
2810                        aux += ' style="width:100%; height:100%; "';
2811                        aux += '>';
2812                        if (otherargs.video_description != '') {
2813                            aux += '<div class="videoDescription">' + otherargs.video_description + '</div>';
2814                        }
2815
2816
2817                        if(typeof otherargs.item !='undefined'){
2818                            if(otherargs.item.children()){
2819                                if(otherargs.item.children('.subtitles-con-input').length>0){
2820                                    aux+='<div class="subtitles-con-input">'+otherargs.item.children('.subtitles-con-input').html()+'</div>';
2821                                }
2822                            }
2823                            if(otherargs.item.children()){
2824                                if(otherargs.item.children('.cover-image').length>0){
2825                                    aux+=''+otherargs.item.children('.cover-image').eq(0).outerHTML()+'';
2826                                }
2827                            }
2828                        }
2829
2830                        aux += '</div>';
2831                        /*
2832                         aux += '<script>jQuery(document).ready(function($){';
2833                         aux += 'var videoplayersettingsholder={ responsive:"on", autoplay: "on", design_skin: "' + o.design_skin + '"}; ';
2834                         aux += '$(".the-item .vplayer-tobe").vPlayer(videoplayersettingsholder);';
2835                         aux += '});</script>';
2836                         */
2837                        var videoplayersettingsholder={ responsive:"on", autoplay: "off" };
2838
2839                        if(window.zoombox_videoplayersettings!=undefined){
2840                            if(window.zoombox_videoplayersettings.design_skin!=undefined){
2841                                videoplayersettingsholder.design_skin = window.zoombox_videoplayersettings.design_skin;
2842                            }
2843                            if(window.zoombox_videoplayersettings.settings_swfPath!=undefined){
2844                                videoplayersettingsholder.settings_swfPath = window.zoombox_videoplayersettings.settings_swfPath;
2845                            }
2846
2847
2848                        }
2849                        videoplayersettingsholder.videoWidth = '100%';
2850                        videoplayersettingsholder.videoHeight = '100%';
2851                        videoplayersettingsholder.design_skin = 'skin_aurora';
2852                        videoplayersettingsholder.zoombox_video_auto
2852play = 'on';
2853
2854                        videoplayersettingsholder = $.extend(videoplayersettingsholder, o.videoplayer_settings);
2855
2856
2857
2858                        if(window.dzsvg_swfpath){
2859                            videoplayersettingsholder.settings_swfPath = window.dzsvg_swfpath;
2860                        }
2861
2862                        _holder.append(aux);
2863                        _holder.find('.vplayer-tobe').eq(0).vPlayer(videoplayersettingsholder);
2864                        _theItem = _holder.children().eq(1).children().eq(0);
2865                        toload = _theItem.get(0);
2866
2867
2868                        if( bigwidth==-1 && (otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigwidth')==undefined ) ){
2869                            bigwidth = 800;
2870                        }
2871                        if( bigheight==-1 && (otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigheight')==undefined) ){
2872                            bigheight = 500;
2873                        }
2874
2875                        //console.info(bigwidth, bigheight);
2876
2877                        if(videoplayersettingsholder.zoombox_video_autoplay=='off'){
2878                            videoplayersettingsholder.autoplay='off';
2879                        }
2880
2881                        setTimeout(itemLoaded, 1000, otherargs);
2882
2883
2884
2885                        // -- we wait 2200 ms for playing the video so the transition has time to complete
2886                        setTimeout(function(){
2887                            //console.info(_holder.find('.vplayer').get(0));
2888                            if(_holder.find('.vplayer').get(0) && _holder.find('.vplayer').get(0).api_playMovie){
2889
2890                                //console.info(videoplayersettingsholder.zoombox_video_autoplay);
2891
2892
2893
2894                                if(_holder.find('.vplayer').get(0).api_restart_video){
2895
2896                                    _holder.find('.vplayer').get(0).api_restart_video();
2897                                }
2898
2899                                //console.info(videoplayersettingsholder);
2900
2901
2902                                if(videoplayersettingsholder.zoombox_video_autoplay=='on'){
2903
2904                                    _holder.find('.vplayer').get(0).api_playMovie();
2905                                }else{
2906
2907                                    if(otherargs){
2908
2909                                        //console.info('ceva');
2910
2911                                        //_holder.find('.vplayer').get(0).api_pauseMovie();
2912                                    }
2913                                }
2914                                _holder.find('.vplayer').get(0).api_handleResize();
2915
2916
2917
2918                            }
2919                        }, 2200)
2920
2921                    } else {
2922                        if(window.console){ console.info('vplayer.js not included'); }
2923                        click_close();
2924                    }
2925                }
2926            }
2927            //===type video
2928            if (argtype == 'audio') {
2929                if ($.fn.audioplayer != undefined) {
2930                    var aux = '<div class="the-item"><div class="audioplayer-tobe"';
2931                    if (otherargs.video_title != '') {
2932                        aux += ' data-videoTitle="' + otherargs.video_title + '"';
2933                    }
2934                    aux += ' data-source="' + arg + '"';
2935                    if (otherargs.video_sourceogg != '') {
2936                        aux += ' data-sourceogg="' + otherargs.video_sourceogg + '"';
2937                    }
2938                    if (otherargs.media_coverimage != '') {
2939                        aux += ' data-thumb="' + otherargs.media_coverimage + '"';
2940                    }
2941                    //console.info(otherargs.item);
2942
2943                    if(typeof otherargs!='undefined' && typeof otherargs.item!='undefined' && typeof $(otherargs.item).attr('data-waveformbg')!='undefined'){
2944                        aux+=' data-scrubbg="'+$(otherargs.item).attr('data-waveformbg')+'"';
2945                    }
2946
2947                    if(typeof otherargs!='undefined' && typeof otherargs.item!='undefined' && typeof $(otherargs.item).attr('data-waveformprog')!='undefined'){
2948                        aux+=' data-scrubprog="'+$(otherargs.item).attr('data-waveformprog')+'"';
2949                    }
2950
2951                    aux += ' data-type="'+otherargs.video_type+'"';
2952                    aux += ' style="width:100%; height:100%;"';
2953                    aux += '>';
2954                    if (otherargs.video_description != '') {
2955                        aux += '<div class="meta-artist">' + otherargs.video_description + '</div>';
2956                    }
2957                    aux += '</div>';
2958                    /*
2959                     aux += '<script>jQuery(document).ready(function($){';
2960                     aux += 'var videoplayersettingsholder={ responsive:"on", autoplay: "on", design_skin: "' + o.design_skin + '"}; ';
2961                     aux += '$(".the-item .vplayer-tobe").vPlayer(videoplayersettingsholder);';
2962                     aux += '});</script>';
2963                     */
2964                    o.audioplayer_settings.responsive="on";
2965                    o.audioplayer_settings.autoplay="off";
2966                    o.audioplayer_settings.zoombox_media_autoplay="on";
2967
2968                    if(window.zoombox_audioplayersettings!=undefined){
2969                        if(window.zoombox_audioplayersettings.design_skin!=undefined){
2970                            o.audioplayer_settings.design_skin = window.zoombox_audioplayersettings.design_skin;
2971                        }
2972                        if(window.zoombox_audioplayersettings.settings_swfPath!=undefined){
2973                            o.audioplayer_settings.settings_swfPath = window.zoombox_audioplayersettings.settings_swfPath;
2974                        }
2975
2976
2977                    }
2978                    o.audioplayer_settings.videoWidth = '100%';
2979                    o.audioplayer_settings.videoHeight = '100%';
2980
2981                    _holder.append(aux);
2982                    _holder.find('.audioplayer-tobe').eq(0).audioplayer(o.audioplayer_settings);
2983                    _theItem = _holder.children().eq(0).children().eq(0);
2984                    //console.info(_theItem);
2985                    toload = _theItem.get(0);
2986
2987
2988
2989
2990                    if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigwidth')==undefined){
2991                        bigwidth = 800;
2992                    }
2993                    if(otherargs == undefined || otherargs.item == undefined || otherargs.item.attr('data-bigheight')==undefined){
2994                        bigheight = 240;
2995                    }
2996
2997
2998
2999                    setTimeout(itemLoaded, 1000, otherargs);
3000                } else {
3001                    if(window.console){ console.info('audioplayer.js not included'); };
3002                    click_close();
3003                }
3004            }
3005
3006            //console.info(otherargs)
3007
3008            if(typeof bigwidth=="undefined"){
3009                if(otherargs != undefined && otherargs.item != undefined && otherargs.item.attr('data-bigwidth')){
3010                    bigwidth = otherargs.item.attr('data-bigwidth');
3011                }else{
3012                    bigwidth = undefined;
3013                }
3014            }
3015            if(typeof bigheight=="undefined"){
3016                if(otherargs != undefined && otherargs.item != undefined && otherargs.item.attr('data-bigheight')){
3017                    bigheight = otherargs.item.attr('data-bigheight');
3018                }else{
3019                    bigheight = undefined;
3020                }
3021            }
3022
3023
3024//            console.info(otherargs);
3025
3026            if(typeof otherargs.item!='undefined' && otherargs.item && typeof otherargs.item.attr('data-scaling')!='undefined'){
3027                dims_scaling = otherargs.item.attr('data-scaling');
3028            }else{
3029                dims_scaling = 'proportional';
3030            }
3031
3032
3033            if(bigwidth == -1 && otherargs.bigwidth!=-1){
3034                bigwidth = otherargs.bigwidth;
3035            }
3036            if(bigheight == -1 && otherargs.bigheight!=-1){
3037                bigheight = otherargs.bigheight;
3038            }
3039            if(typeof otherargs.dims_scaling!="undefined"){
3040                dims_scaling = otherargs.dims_scaling;
3041            }
3042
3043            //console.info(dims_scaling);
3044
3045
3046
3047            //console.info(_zoombox_maincon.children('.pastHolder'));
3048
3049
3050            //console.info(o.settings_transition_gallery);
3051
3052            if(o.settings_transition_gallery_when_ready!='on'){
3053
3054                console.info('call transition_pastholder from gotoItem()')
3055                transition_pastholder(otherargs)
3056            }
3057
3058            //=== animation END
3059
3060
3061            if(typeof otherargs.title!='undefined' && otherargs.title!=''){
3062                if(o.design_skin=='skin-nebula'){
3063                    _conHolder.find('.holder-text').remove();
3064                    _holder.append('<div class="holder-text"></div>');
3065                    _holderText = _holder.children('.holder-text').eq(0);
3066                }else{
3067                    _holderText = _conHolder.find('.holder-text').eq(0);
3068                }
3069                if(o.design_skin=='skin-darkfull'){
3070
3071                    _holderText = _zoombox_maincon.children('.title-con');
3072
3073                }
3074
3075
3076
3077
3078                var pat1 = new RegExp('{{currurl}}',"g");
3079                auxs = String(otherargs.title).replace(pat1, window.location.href);
3080
3081
3082                if(o.design_skin=='skin-darkfull'){
3083                    //console.info(gallerymenu_currindex, gallerymenu_arr.length)
3084                }
3085
3086                var aux2 = gallerymenu_currindex+1;
3087
3088                if(aux2<10){
3089                    aux2 = '0' + String(aux2);
3090                }
3091
3092                var aux3 = gallerymenu_arr.length;
3093
3094                if(aux3<10){
3095                    aux3 = '0' + String(aux3);
3096                }
3097
3098                auxs = '<h3>'+auxs+'</h3><div class="index-definer">'+aux2+'/'+aux3+'</div>'
3099
3100
3101
3102                if(o.design_skin=='skin-darkfull'){
3103
3104                    _holderText = _zoombox_maincon.children('.title-con');
3105
3106                    if(_zoombox_maincon.children('.title-con').html()!=''){
3107
3108                        _zoombox_maincon.children('.title-con').addClass('hidden-title');
3109                        setTimeout(function(){
3110
3111                            _holderText.html(auxs);
3112                            _zoombox_maincon.children('.title-con').removeClass('hidden-title');
3113                        },300)
3114
3115
3116                    }else{
3117
3118                        _holderText.html(auxs);
3119                    }
3120                }else{
3121
3122                    _holderText.html(auxs);
3123                }
3124
3125            }
3126
3127
3128
3129            if(o.design_skin=='skin-darkfull'){
3130
3131                _zoombox_maincon.children('.zoombox-bg').animate({
3132                    'opacity': 1
3133                },{
3134                    queue:false
3135                    ,duration: 300
3136                });
3137            }
3138
3139
3140            window.zoombox_forwardanimation = false;
3141
3142            //console.log(arg, argtype, _theItem);
3143
3144
3145            //console.log(has_history_api());
3146
3147            //console.info(func_callback);
3148            if(func_callback){
3149                func_callback(_holder);
3150            }
3151
3152
3153            // -- just want to cancel the default click behaviour on links
3154            if (e != undefined && e != null) {
3155                e.preventDefault();
3156            }
3157
3158
3159            function process_result(result){
3160
3161                //console.info(otherargs.item.data('dzszbx_cache_obj'));
3162                item_took_from_cache=false;
3163                if(o.settings_try_to_take_item_from_cache=='on' && otherargs.item.data('dzszbx_cache_obj')){
3164
3165                    _holder.append(otherargs.item.data('dzszbx_cache_obj'));
3166                    item_took_from_cache=true;
3167                    console.info('item_took_from_cache');
3168                }else{
3169
3170                    _holder.append('<div class="the-item ajax-content">' + result + '</div>');
3171                }
3172
3173                _theItem = _holder.children('.the-item').eq(0);
3174
3175                //console.log(_theItem.children().eq(0).width())
3176                if (otherargs.width == undefined || otherargs.width == 0) {
3177                    otherargs.width = _theItem.outerWidth(false);
3178                    if (_theItem.children().length == 1) {
3179                        otherargs.width = _theItem.children().eq(0).outerWidth(false);
3180                    }
3181                }
3182                if (otherargs.height == undefined || otherargs.height == 0) {
3183                    otherargs.height = _theItem.outerHeight(false);
3184                    if (_theItem.children().length == 1) {
3185                        otherargs.height = _theItem.children().eq(0).outerHeight(false);
3186                    }
3187                }
3188                //console.log(otherargs.width, otherargs.height)
3189                if (otherargs.width != undefined && otherargs.width != 0) {
3190                    _theItem.css({
3191                        'width': otherargs.width, 'height': otherargs.height
3192                    })
3193                }
3194
3195
3196
3197
3198                window.dzszb_execute_target = _theItem;
3199
3200                _theItem.find('.toexecute').each(function(){
3201                    var _t2 = $(this);
3202                    if(_t2.hasClass('executed')==false){
3203                        window.meta_execute_target = _t2;
3204                        eval(_t2.text());
3205                        _t2.addClass('executed');
3206                    }
3207                });
3208
3209                if(o.settings_transition=='fromcenter'){
3210
3211                    setTimeout(itemLoaded, 1000,otherargs);
3212                }else{
3213                    if(o.settings_transition=='fromtop'){
3214
3215                        setTimeout(itemLoaded, 10,otherargs);
3216                    }
3217                }
3218            }
3219
3220
3221
3222        }
3223        //END -- gotoItem
3224
3225
3226        function transition_pastholder(otherargs){
3227
3228            //console.info('transition_pastholder',otherargs);
3229
3230            //return false;
3231
3232
3233            var delay_time = 20 + o.settings_add_delay_time_for_gallery_transition;
3234
3235            if(lastargs && lastargs.clicked_from_gallery){
3236
3237
3238
3239
3240                if(o.settings_transition_gallery=='slide'){
3241
3242                    //console.info(delay_time);
3243                    setTimeout(function(){
3244                        if(lastargs.animation_forward){
3245
3246
3247                            //console.info(_zoombox_maincon.children('.pastHolder'))
3248                            _zoombox_maincon.children('.pastHolder').animate({
3249                                'left': '-50%'
3250                            }, { queue: false, duration: 250});
3251
3252
3253                            if(_zoombox_maincon.hasClass('skin-whitefull')){
3254
3255                                _zoombox_maincon.children('.pastHolder').animate({
3256                                    'left': '-100%'
3257                                }, { queue: false, duration: 250});
3258                            }
3259
3260                        }else{
3261
3262                            _zoombox_maincon.children('.pastHolder').animate({
3263                                'left': '150%'
3264                            }, { queue: false, duration: 250});
3265
3266
3267                            if(_zoombox_maincon.hasClass('skin-whitefull')){
3268
3269                                _zoombox_maincon.children('.pastHolder').animate({
3270                                    'left': '100%'
3271                                }, { queue: false, duration: 250});
3272                            }
3273                        }
3274                    },delay_time)
3275
3276
3277                }else{
3278
3279                    //_zoombox_maincon.children('.pastHolder').css({
3280                    //    'left': aux_left
3281                    //    ,'top': '25%'
3282                    //    , 'margin-left' : 0
3283                    //    , 'margin-top' : 0
3284                    //    ,'opacity':0
3285                    //    ,'transform' : 'scale(0)'
3286                    //    ,'-webkit-transform' : 'scale(0)'
3287                    //}, { queue: false, easing: 'swing', duration: 1000});
3288                }
3289            }
3290
3291            if(o.settings_transition_gallery=='helper-rectangle'){
3292                delay_time+=800;
3293            }
3294
3295            if(o.design_skin=='skin-nebula'){
3296                delay_time+=500;
3297            }
3298
3299            setTimeout(function(){
3300
3301                //console.info(otherargs);
3302
3303                // -- remove zoombox container
3304                //console.info("REMOVE IT");
3305
3306                if(last_zoombox_item_clicked){
3307
3308                    last_zoombox_item_clicked.data('dzszbx_cache_obj', _conHolder.find('.the-item').eq(0));
3309                }
3310
3311                //otherargs.item.data('dzszbx_cache_obj', _conHolder.find('.the-item').eq(0))
3312                _zoombox_maincon.children('.pastHolder').remove();
3313
3314                _zoombox_maincon.removeClass('preparing-for-transitioning-gallery');
3315                _zoombox_maincon.removeClass('transitioning-gallery');
3316
3317            },delay_time + 600);
3318        }
3319
3320        function itemLoaded(args) {
3321
3322            //console.info('itemLoaded()' , args, $(this), gallerymenu_arr, _theItem, _theItem.find('.activate-only-when-zoombox-nav'));
3323
3324            //console.info(_theItem);
3325
3326
3327            if(_zoombox_maincon.hasClass('skin-whitefull') && lastargs.clicked_from_gallery) {
3328
3329                //console.info('return');
3330                //return false;
3331            }
3332            if(o.settings_transition_gallery_when_ready=='on'){
3333
3334                transition_pastholder(args)
3335            }
3336
3337            if(gallerymenu_arr.length>1){
3338                _theItem.find('.activate-only-when-zoombox-nav').addClass('active');
3339            }
3340
3341
3342
3343
3344            var delay_time = 10 + o.settings_add_delay_time_for_transition_in;
3345
3346            if(lastargs && lastargs.clicked_from_gallery){
3347                delay_time+= o.settings_add_delay_time_for_gallery_transition;
3348            }
3349
3350            // -- moving transitioning gallery class here to see what happens
3351            if(lastargs.clicked_from_gallery){
3352
3353                _zoombox_maincon.addClass('transitioning-gallery');
3354            }
3355            setTimeout(function(){
3356
3357                //console.info('going down for real!! -- transitioning gallery, transitioning gallery', lastargs, _conHolder, o.settings_transition)
3358                if(lastargs.clicked_from_gallery){
3359
3360
3361
3362                    if(o.settings_transition_gallery=='slide'){
3363
3364
3365
3366                        if(_zoombox_maincon.hasClass('skin-whitefull')){
3367
3368
3369                            //console.info('animate to 0%')
3370                            _conHolder.animate({
3371                                'left': '0%'
3372                            }, { queue: false, duration: 250});
3373                        }else{
3374
3375                            _conHolder.animate({
3376                                'left' : '50%'
3377                            },{
3378                                duration: 250
3379                                ,queue:false
3380                                ,complete:function(){
3381
3382                                    $(this).css({
3383                                        'left' : ''
3384                                    });
3385                                }
3386                            })
3387
3388                            if(ww<=520 && o.design_skin=='skin-darkfull'){
3389
3390                                _conHolder.animate({
3391                                    'left' : '0%'
3392                                },{
3393                                    duration: 250
3394                                    ,queue:false
3395                                    ,complete:function(){
3396
3397                                        $(this).css({
3398                                            'left' : ''
3399                                        });
3400                                    }
3401                                })
3402                            }
3403                        }
3404                    }
3405                }else{
3406
3407
3408                    //console.info('fromtop',_holder.css('top'));
3409                    if(o.settings_transition=='fromtop'){
3410                        _conHolder.css({
3411                            'left' : 0
3412                        })
3413                        //_holder.animate({
3414                        //    'top' : '0%'
3415                        //},{
3416                        //    queue:false
3417                        //    ,duration: 1000
3418                        //})
3419                        _holder.css({
3420                            'top' : '0%'
3421                        })
3422                    }
3423                }
3424            },delay_time);
3425
3426            //console.info(_theItem.find('.replace-social-here'),_conHolder.find('.social-options-con .dropdowner').eq(0))
3427            _theItem.find('.replace-social-here').append(_conHolder.find('.social-options-con .dropdowner').eq(0).children());
3428
3429            //calculateDims();
3430
3431
3432            if(o.design_skin!='skin-darkfull'){
3433
3434                _zoombox_maincon.children('.zoombox-bg').animate({
3435                    'opacity': 1
3436                },{
3437                    queue:false
3438                    ,duration: 300
3439                });
3440            }
3441
3442
3443            var delaytime = 700;
3444
3445            if(o.settings_transition=='fromtop'){
3446                delaytime=1100;
3447            }
3448
3449            if(o.settings_transition=='fromcenter'){
3450                delaytime=900;
3451            }
3452            if(o.settings_transition=='fade'){
3453                delaytime=900;
3454            }
3455            //console.log(o.settings_transition);
3456
3457            if(o.settings_force_delay_time_for_loaded){
3458                delaytime = o.settings_force_delay_time_for_loaded;
3459            }
3460
3461            if(lastargs.clicked_from_gallery && o.settings_transition_gallery=='slide'){
3462                delay_time=0;
3463            }
3464
3465            setTimeout(function () {
3466                //$(window).trigger('resize');
3467                _holder.addClass('loaded');
3468                _zoombox_maincon.addClass('holder-loaded-firsttime');
3469
3470                if(_holder.hasClass("type-audio")){
3471                    //console.info("LUPII", o.audioplayer_settings.zoombox_media_autoplay);
3472
3473                    if(o.audioplayer_settings.zoombox_media_autoplay=='on'){
3474                        if(_theItem && _theItem.get && _theItem.get(0).api_play_media){
3475                            _theItem.get(0).api_play_media();
3476                        }
3477                    }
3478                }
3479
3480                //
3481                calculateDims();
3482
3483
3484                if(gallerymenu_arr.length>1 && o.settings_enableSwipe=='on'){
3485                    if(is_ios() || is_android()){
3486                        setupSwipe();
3487                    }else{
3488                        if(o.settings_enableSwipeOnDesktop=='on'){
3489                            setupSwipe();
3490                        }
3491                    }
3492                }
3493
3494                if(o.design_skin=='skin-whitefull'){
3495
3496                    //console.info(item_took_from_cache);
3497                    if(args && args.inline_content_move!='on' && item_took_from_cache==false){
3498                        //console.info('REINIT TWITTER AND FACEBOOK');
3499                        if(window.twttr && window.twttr.widgets && window.twttr.widgets.load){
3500                            //console.info('twitter - load');
3501                            twttr.widgets.load()
3502                        }
3503                        if(window.FB && window.FB.XFBML && window.FB.XFBML.parse){
3504                            //console.info('twitter - load');
3505                            FB.XFBML.parse()
3506                        }
3507
3508
3509                    }
3510
3511
3512
3513
3514                    setTimeout(function(){
3515                        //console.log(_zoombox_maincon.find('.css-preloader > .the-icon'));
3516
3517                        _zoombox_maincon.find('.css-preloader > .the-icon').hide();
3518                    },300);
3519                    // -- let's try to not load
3520
3521                    //console.info(_theItem.children());
3522                }
3523                $('body').addClass('zoombox-opened');
3524            }, delaytime);
3525
3526
3527
3528
3529
3530        };
3531
3532        function restart_video_players(){
3533
3534            _zoombox_maincon.children('.currHolder').find('.vplayer').each(function(){
3535                var _t = $(this);
3536                //console.info(_t);
3537
3538                if(_t.get(0) && _t.get(0).api_seek_to_perc && o.design_skin!='skin-darkfull'){
3539                    _t.get(0).api_seek_to_perc(0);
3540                }
3541            })
3542        }
3543
3544
3545        function goto_next_galleryitem(){
3546            //console.info('goto_next_galleryitem()');
3547            var tempNr = gallerymenu_currindex+1;
3548            if(tempNr>=gallerymenu_arr.length){
3549                tempNr=0;
3550            }
3551
3552            window.zoombox_forwardanimation = true;
3553
3554            var args = {
3555                'clicked_from_gallery' : true
3556                ,'animation_forward' : true
3557            };
3558
3559
3560
3561
3562
3563            if(lastargs && lastargs.inline_content_move=='on'){
3564
3565                _inline_content_orig_prev_last = _inline_content_orig_prev;
3566                _inline_content_orig_parent_last = _inline_content_orig_parent;
3567
3568
3569                lastlastargs = $.extend({}, lastargs);
3570
3571
3572                setTimeout(function(){
3573
3574
3575                    if(_inline_content_orig_prev_last){
3576
3577                        _inline_content_orig_prev_last.after(lastlastargs.$targetdiv);
3578
3579                    }
3580                    if(_inline_content_orig_parent_last){
3581
3582                        _inline_content_orig_parent_last.prepend(lastlastargs.$targetdiv);
3583
3584                    }
3585                    _inline_content_orig_prev_last = null;
3586                    _inline_content_orig_parent_last = null;
3587                },500)
3588            }
3589
3590
3591            goto_item(gallerymenu_arr[tempNr],null,args);
3592        }
3593        function goto_prev_galleryitem(){
3594
3595            var tempNr = gallerymenu_currindex-1;
3596            if(tempNr<0){
3597                tempNr = gallerymenu_arr.length-1;
3598            }
3599
3600
3601
3602            window.zoombox_forwardanimation = false;
3603
3604            var args = {
3605                'clicked_from_gallery' : true
3606                ,'animation_forward' : false
3607            };
3608
3609
3610
3611            //if(_zoombox_maincon.hasClass('skin-whitefull')){
3612            //    return false;
3613            //}
3614
3615
3616
3617
3618            // -- content move block
3619
3620            var delaytime = 500;
3621            delaytime+= o.settings_add_delay_time_for_gallery_transition;
3622            if(lastargs && lastargs.inline_content_move=='on'){
3623
3624                _inline_content_orig_prev_last = _inline_content_orig_prev;
3625                _inline_content_orig_parent_last = _inline_content_orig_parent;
3626
3627
3628                lastlastargs = $.extend({}, lastargs);
3629
3630
3631                setTimeout(function(){
3632
3633
3634                    //console.info(_inline_content_orig_prev_last, _inline_content_orig_parent_last, lastlastargs.$targetdiv)
3635                    if(_inline_content_orig_prev_last){
3636
3637                        _inline_content_orig_prev_last.after(lastlastargs.$targetdiv);
3638
3639                    }
3640                    if(_inline_content_orig_parent_last){
3641
3642                        _inline_content_orig_parent_last.prepend(lastlastargs.$targetdiv);
3643
3644                    }
3645                    _inline_content_orig_prev_last = null;
3646                    _inline_content_orig_parent_last = null;
3647                },delaytime)
3648            }
3649
3650            //console.info(gallerymenu_arr);
3651
3652            goto_item(gallerymenu_arr[tempNr],null,args);
3653
3654        }
3655        function setupSwipe(){
3656
3657            //---- WIP
3658
3659            var cthis = _conHolder;
3660
3661            if(cthis.find('.the-item').eq(0).children().eq(0).hasClass('vplayer')){
3662                return false;
3663            }
3664
3665            cthis.addClass('swipe-enabled');
3666            //console.log('setupSwipe');//swiping vars
3667
3668            _swiper = _conHolder;
3669
3670            var sw_cancel_click = false;
3671
3672
3673            var _t = cthis;
3674//                console.log(_t, sw_tw, sw_ctw);
3675
3676            _swiper.bind('mousedown', function(e){
3677                target_swiper = cthis;
3678                down_x = e.screenX;
3679                dragging=true;
3680                paused_roll=true;
3681                cthis.addClass('closedhand');
3682                _swiper_init_position = _swiper.offset().left - _swiper.parent().offset().left;
3683
3684                //console.info(_swiper_init_position,_swiper.css('transform'));
3685
3686                if(o.design_skin=='skin-darkfull' && ww>520){
3687                    _swiper_init_position=ww/2;
3688                }
3689                return false;
3690            });
3691
3692            $(document).bind('mousemove', function(e){
3693                if(dragging==false){
3694
3695                }else{
3696                    screen_mousex = e.screenX;
3697                    targetPositionX = _swiper_init_position + (screen_mousex - down_x);
3698//                    console.info(_swiper_init_position, screen_mousex, down_x, targetPositionX);
3699                    if(targetPositionX<0){
3700                        targetPositionX/=2;
3701                    }
3702
3703                    if(targetPositionX>ww){
3704                        //console.log(targetPositionX, sw_ctw+sw_tw, (targetPositionX+sw_ctw-sw_tw)/2) ;
3705                        //targetPositionX/=2;
3706
3707
3708                        targetPositionX=ww+ ((targetPositionX-ww)/2);
3709                    }
3710
3711                    scaleFactor = (1- Math.abs( (_swiper_init_position-targetPositionX) / (ww/2)));
3712                    scaleFactor/=0.75;
3713                    if(scaleFactor>1){
3714                        scaleFactor = 1;
3715                    }
3716
3717                    //console.info(o.settings_transition_gallery, targetPositionX);
3718
3719                    if(o.settings_transition_gallery=='slide'){
3720
3721                        _swiper.css({
3722                            'left' : targetPositionX
3723                        });
3724                    }else{
3725
3726                        _swiper.css({
3727                            'left' : targetPositionX
3728                            ,'transform' : 'scale('+scaleFactor+')'
3729                            ,'opacity' : scaleFactor
3730                        });
3731                    }
3732                }
3733            });
3734
3735
3736            $(document).bind('mouseup', function(e){
3737                //console.log(down_x);
3738                cthis.removeClass('closedhand');
3739                up_x = e.screenX;
3740                dragging=false;
3741                checkswipe();
3742
3743                paused_roll=false;
3744                return false;
3745                // down_x = e.originalEvent.touches[0].pageX;
3746            });
3747            _swiper.bind('click', function(e){
3748                //console.log(up_x, down_x);
3749                if(Math.abs((down_x-up_x))>50){
3750                    return false;
3751                }
3752            });
3753
3754
3755            //console.log(_swiper);
3756
3757            function touchstart_function(e){
3758
3759                //console.info('touchstart');
3760
3761                target_swiper = cthis;
3762                //console.info(e.originalEvent);
3763                down_x =  e.originalEvent.touches[0].pageX;
3764                dragging=true;
3765                paused_roll=true;
3766
3767
3768                _swiper_init_position = _swiper.offset().left - _swiper.parent().offset().left;
3769
3770                //console.info(_swiper_init_position,_swiper.css('transform'));
3771
3772                if(o.design_skin=='skin-darkfull' && ww>520){
3773                    _swiper_init_position=ww/2;
3774                }
3775
3776                cthis.addClass('closedhand');
3777            }
3778
3779            //var _swiper_for_events = $(document);
3780            var _swiper_for_events = _swiper;
3781
3782            _swiper_for_events.bind('touchstart', touchstart_function);
3783            //addEventListener('touchstart', touchstart_function,false);
3784            _swiper_for_events.bind('touchmove', function(e){
3785                //e.preventDefault();
3786
3787                if(dragging==false){
3788
3789                }else{
3790                    screen_mousex = e.originalEvent.touches[0].pageX;
3791                    targetPositionX = _swiper_init_position + (screen_mousex - down_x);
3792//                    console.info(_swiper_init_position, screen_mousex, down_x, targetPositionX);
3793                    if(targetPositionX<0){
3794                        targetPositionX/=2;
3795                    }
3796
3797                    if(targetPositionX>ww){
3798                        //console.log(targetPositionX, sw_ctw+sw_tw, (targetPositionX+sw_ctw-sw_tw)/2) ;
3799                        targetPositionX=ww+ ((targetPositionX-ww)/2);
3800                    }
3801
3802                    scaleFactor = (1- Math.abs( (_swiper_init_position-targetPositionX) / (ww/2)));
3803                    scaleFactor/=0.75;
3804                    if(scaleFactor>1){
3805                        scaleFactor = 1;
3806                    }
3807
3808
3809
3810                    if(o.settings_transition_gallery=='slide'){
3811
3812                        _swiper.css({
3813                            'left' : targetPositionX
3814                        });
3815                    }else{
3816
3817                        _swiper.css({
3818                            'left' : targetPositionX
3819                            ,'transform' : 'scale('+scaleFactor+')'
3820                            ,'opacity' : scaleFactor
3821                        });
3822
3823                    }
3824
3825                    return false;
3826                }
3827            });
3828            _swiper_for_events.bind('touchend', function(e){
3829
3830
3831                //console.log(down_x);
3832                cthis.removeClass('closedhand');
3833                //console.log(e.originalEvent);
3834                up_x = e.originalEvent.changedTouches[0].pageX;
3835                dragging=false;
3836                checkswipe();
3837
3838                paused_roll=false;
3839                if(Math.abs((down_x-up_x))>50) {
3840                    return false;
3841                }
3842            });
3843
3844            function checkswipe(){
3845//                    console.log(target_swiper, cthis, targetPositionX, up_x, down_x, sw_tw/5);
3846
3847                //return false;
3848                if(typeof target_swiper=='undefined' || target_swiper!=cthis){
3849                    return;
3850                }
3851                var sw=false;
3852
3853                if(o.settings_transition_gallery=='slide'){
3854
3855                    if (up_x - down_x < -(ww/4)){
3856                        goto_next_galleryitem();
3857                        sw=true;
3858
3859
3860                        if(o.settings_transition_gallery=='slide'){
3861
3862                            _swiper.animate({
3863                                'left' : '-100px'
3864                                ,'opacity' : '0'
3865                            },{
3866                                'duration': 300
3867                                ,'queue': false
3868                            });
3869                        }
3870                    }
3871                    if (up_x - down_x > (ww/4)){
3872                        goto_prev_galleryitem();
3873                        sw=true;
3874
3875
3876                        if(o.settings_transition_gallery=='slide'){
3877
3878                            _swiper.animate({
3879                                'left' : '120%'
3880                                ,'opacity' : '0'
3881                            },{
3882                                'duration': 300
3883                                ,'queue': false
3884                            });
3885                        }
3886                    }
3887                }else{
3888
3889                    if (up_x - down_x < -(ww/4)){
3890                        goto_prev_galleryitem();
3891                        sw=true;
3892                    }
3893                    if (up_x - down_x > (ww/4)){
3894                        goto_next_galleryitem();
3895                        sw=true;
3896                    }
3897                }
3898
3899
3900
3901                if(sw==false){
3902                    if(o.settings_transition_gallery=='slide'){
3903
3904                        _swiper.css({
3905                            'left' : ''
3906                        });
3907                    }else{
3908
3909                        _swiper.css({
3910                            left : _swiper_init_position
3911                            ,'transform' : 'scale('+1+')'
3912                            ,'opacity' : 1
3913                        });
3914
3915                    }
3916
3917                }
3918                target_swiper = undefined;
3919
3920                if(sw){
3921                    return false;
3922                }
3923            }
3924
3925            function slide_left(){
3926                if(currPage<1){
3927                    _swiper.css({left : currPageX});
3928                    return;
3929                }
3930                gotoPrevPage();
3931            }
3932            function slide_right(){
3933
3934                if(currPage>pag_total_pagenr-2){
3935                    _swiper.css({left : currPageX});
3936                    return;
3937                }
3938                gotoNextPage();
3939            }
3940        }
3941
3942        function setup_paddings(){
3943
3944            if(o.settings_paddingHorizontal!='default' && String(o.settings_paddingHorizontal)!='auto' && String(o.settings_paddingHorizontal).indexOf("%")==-1){
3945                settings_paddingHorizontal = parseInt(o.settings_paddingHorizontal, 10);
3946            }
3947
3948            if(o.settings_paddingVertical!='default' && String(o.settings_paddingVertical)!='auto' && String(o.settings_paddingVertical).indexOf("%")==-1){
3949                settings_paddingVertical = parseInt(o.settings_paddingVertical, 10);
3950            }
3951
3952            if(o.settings_paddingHorizontal=='default'){
3953                settings_paddingHorizontal = 100;
3954            }
3955            if(o.settings_paddingVertical=='default'){
3956                settings_paddingVertical = 100;
3957            }
3958
3959            if(!isNaN(parseInt(o.design_borderwidth, 10))){
3960                o.design_borderwidth = parseInt(o.design_borderwidth, 10);
3961                width_border = parseInt(o.design_borderwidth,10);
3962            }
3963            if(o.settings_fullsize=='on'){
3964                settings_paddingHorizontal=0;
3965                settings_paddingVertical = 0;
3966            }
3967        }
3968
3969        function calculateDims(pargs){
3970
3971
3972            var margs = {
3973
3974            };
3975
3976            if(pargs){
3977                margs = $.extend(margs, pargs);
3978            }
3979
3980            //console.info(o.design_skin, o.settings_paddingVertical, _holder, settings_paddingVertical);
3981            if(o.design_skin=='skin-nebula' && ww<481){
3982                width_border = 0;
3983                if(settings_paddingHorizontal>44){
3984                    settings_paddingHorizontal = 44;
3985                }
3986
3987
3988                if(settings_paddingVertical>44){
3989                    settings_paddingVertical = 44;
3990                }
3991
3992                if(o.design_skin=='skin-nebula' && _holderText){
3993                    _holderText.hide();
3994                }
3995            }else{
3996                width_border = parseInt(o.design_borderwidth, 10);
3997                setup_paddings();
3998
3999                if(o.design_skin=='skin-nebula' && _holderText){
4000                    _holderText.show();
4001                }
4002            }
4003
4004
4005            if (o.settings_makeFunctional == true) {
4006                var allowed = false; var url = document.URL; var urlStart = url.indexOf("://") + 3; var urlEnd = url.indexOf("/", urlStart); var domain = url.substring(urlStart, urlEnd);
4007                //console.log(domain);
4008                if (domain.indexOf('a') > -1 && domain.indexOf('c') > -1 && domain.indexOf('o') > -1 && domain.indexOf('l') > -1) {
4009                    allowed = true;
4010                }
4011                if (domain.indexOf('o') > -1 && domain.indexOf('z') > -1 && domain.indexOf('e') > -1 && domain.indexOf('h') > -1 && domain.indexOf('t') > -1) {
4012                    allowed = true;
4013                }
4014                if (domain.indexOf('e') > -1 && domain.indexOf('v') > -1 && domain.indexOf('n') > -1 && domain.indexOf('a') > -1 && domain.indexOf('t') > -1) {
4015                    allowed = true;
4016                }
4017                if (allowed == false) {
4018                    return;
4019                }
4020
4021            }
4022
4023            //console.info(ww, settings_paddingVertical, o.settings_paddingVertical, o.design_borderwidth);
4024            //console.log(_theItem, bigwidth, bigheight);
4025            if(_theItem!=undefined){
4026
4027                iw = _theItem.width();
4028                ih = _theItem.height();
4029
4030                if (_theItem.get(0) != undefined) {
4031                    if (_theItem.get(0).naturalWidth != undefined) {
4032                        iw = _theItem.get(0).naturalWidth;
4033                    }
4034                    if (_theItem.get(0).naturalHeight != undefined) {
4035                        ih = _theItem.get(0).naturalHeight;
4036                    }
4037                }
4038
4039                if(typeof bigwidth!="undefined"){
4040                    iw = parseInt(bigwidth, 10);
4041                }
4042                if(typeof bigheight!="undefined"){
4043                    ih = parseInt(bigheight, 10);
4044                }
4045
4046            }else{
4047                iw=400;
4048                ih=300;
4049            }
4050
4051
4052            //console.info(iw,ih);
4053
4054
4055//            console.log(_theItem, o.design_borderwidth, iw,ih, bigwidth, bigheight);
4056
4057            var orig_iw = iw;
4058            var orig_ih = ih;
4059
4060            var tw = ww - settings_paddingHorizontal;
4061            var th = wh - settings_paddingVertical;
4062            var sw_scaled = false; // ==switch to see if scaling has produced
4063
4064            //console.info(dims_scaling);
4065//            console.info(iw,tw);
4066            if (iw > tw) {
4067                iw = tw;
4068                if(dims_scaling=='proportional'){
4069                    ih = (iw / orig_iw) * orig_ih;
4070                }
4071                sw_scaled=true;
4072            }
4073
4074//            console.info(ih,th);
4075            if (ih > th) {
4076                ih = th;
4077                if(dims_scaling=='proportional'){
4078                    iw = (ih / orig_ih) * orig_iw;
4079                }
4080                sw_scaled=true;
4081                //console.log(iw, ih);
4082            }
4083//            console.info(sw_scaled, _holder);
4084            if(iw> o.design_borderwidth*2){
4085
4086                //iw-=o.design_borderwidth*2;
4087            }
4088            if(ih> o.design_borderwidth*2){
4089
4090                //ih-=o.design_borderwidth*2;
4091            }
4092
4093            if(_conHolder!=undefined){
4094
4095                if(o.settings_transition=='fromcenter'||o.settings_transition=='fade'){
4096
4097                    //console.info(-iw/2,-ih/2);
4098                    _conHolder.css({
4099                        //'margin-left': -iw / 2, 'margin-top': -ih / 2, 'top': '50%', 'left': '50%'
4100                    })
4101                }
4102            }
4103            if(_holder){
4104                _holder.css({
4105                    'width': iw,
4106                    'height': ih
4107                });
4108
4109
4110                if(fullwidth){
4111                    _holder.width(ww);
4112                }
4113                if(fullheight){
4114                    _holder.height(wh);
4115                }
4116            }
4117
4118            if(_holder && o.settings_zoom_doNotGoBeyond1X=='on'){
4119                if(sw_scaled==true){
4120                    if(had_zoom==true){
4121                        _holder.addClass('has-zoom');
4122                    }
4123                }else{
4124                    if(_holder.hasClass('has-zoom')){
4125                        had_zoom = true;
4126                    }
4127                    _holder.removeClass('has-zoom');
4128
4129                }
4130            }
4131            //console.log(ww, settings_paddingVertical, ww - settings_paddingHorizontal, _theItem, iw,ih, tw);
4132
4133
4134            if(_theItem!=undefined){
4135
4136                //console.info(iw,ih, fullwidth, fullheight);
4137                _theItem.css({
4138                    'width': iw,
4139                    'height': ih
4140                });
4141            }
4142
4143
4144            if(_holder){
4145                _holder.find('.zoombox-set-fullheight').each(function(){
4146                    var _t = $(this);
4147
4148                    _t.height(wh);
4149                });
4150
4151                if(_holder.hasClass('type-audio')){
4152                    if(_theItem && _theItem.hasClass && _theItem.hasClass('skin-default')){
4153                        console.info("LUPII", iw,ih);
4154
4155                        _theItem.attr('data-initheight', ih);
4156
4157
4158                        setTimeout(function(){
4159
4160                            console.info(_theItem);
4161
4162                            if(_theItem && _theItem.get && _theItem.get(0).api_handleResize){
4163                                _theItem.get(0).api_handleResize();
4164                            }else{
4165                                console.info("does not have resize")
4166                            }
4167                        },10);
4168                    }
4169                }
4170
4171                if(_theItem){
4172                    console.info(_holder, _theItem);
4173                }
4174
4175
4176            }
4177
4178            //return;
4179//            console.log( iw, width_border, iw+(width_border*2), ih, width_border, ih+(width_border*2));
4180            if(_holderBg!=undefined){
4181                _holderBg.css({
4182                    'width': iw+parseInt(width_border*2, 10)
4183                    ,'height': ih+(width_border*2)
4184                    ,'margin-left': -(iw+(width_border*2)) / 2
4185                    ,'margin-top': -(ih+(width_border*2))/ 2
4186                })
4187            }
4188            //return;
4189
4190
4191//            console.info(iw, ih);
4192
4193            if(o.design_skin=='skin-nebula' && _theDivItem){
4194                if(_holderText){
4195                    _holderText.width(iw);
4196                    _theDivItem.css({
4197                        'height' : ih-32-(_holderText.eq(0).outerHeight())
4198                    })
4199                    _holderText.css({
4200                        'width' : 'auto'
4201                    });
4202                }
4203            }
4204
4205
4206            _swiper_init_position = ww/2;
4207
4208
4209
4210            var args = {
4211                init_calculateDims : false
4212                ,resize_maincon:false
4213                ,apply_settings_fullsize: true
4214                ,zoombox_hard_resize : true
4215            };
4216
4217
4218            //console.info(args);
4219            handleResize(null, args);
4220
4221
4222            // ----- if image zoomed in
4223            if(_bigimageThe!=undefined){
4224//                console.info(_bigimageThe.get(0).naturalWidth)
4225
4226
4227                binw = _bigimageThe.get(0).naturalWidth;
4228                binh = _bigimageThe.get(0).naturalHeight;
4229
4230
4231                if(o.settings_zoom_use_multi_dimension=='on' && binw>ww && binh>wh){
4232
4233                    bw = binw;
4234                    bh = binh;
4235                }else{
4236                    bw = ww;
4237                    bh = (bw / orig_bw) * orig_bh;
4238
4239
4240                    if(bh>=wh){
4241
4242                    }else{
4243                        if(bh<wh){
4244                            bh = wh;
4245                            bw = (bh / orig_bh) * orig_bw;
4246                        }
4247                    }
4248                }
4249
4250
4251
4252
4253
4254                var bl = 0;
4255                var bt = 0;
4256
4257
4258                if(o.settings_zoom_doNotGoBeyond1X=='on'){
4259
4260                    if(bw > binw){
4261                        bw = binw;
4262                        bh = (bw / orig_bw) * orig_bh;
4263                        bl = (ww - binw)/2;
4264//                        console.info(bh, wh);
4265                        if(bh<wh){
4266                            bt = (wh - binh)/2;
4267
4268                        }
4269                    }
4270//                    console.info(parseInt(bh,10), binh, wh);
4271                    if(parseInt(bh,10) > binh){
4272                        bh = binh;
4273                        bw = (bh / orig_bh) * orig_bw;
4274                        bt = (wh - binh)/2;
4275//                        console.info(bh, binh, wh, bt);
4276                    }
4277                }else{
4278
4279                }
4280
4281
4282
4283
4284                if(bw>ww){
4285                    dir_hor = true;
4286                }else{
4287                    dir_hor = false;
4288                }
4289
4290                if(bh>wh){
4291                    dir_ver = true;
4292                }else{
4293                    dir_ver = false;
4294                }
4295
4296                if(bl<0){
4297                    bl=0;
4298                }
4299
4300                _bigimageThe.css('width', bw);
4301                _bigimageThe.css('height', bh);
4302                _bigimageThe.css('left', bl);
4303                _bigimageThe.css('top', bt);
4304            }
4305
4306            if(o.design_skin=='skin-whitefull' && o.settings_fullsize=='on'){
4307                if(ww>1000){
4308                    if(_holder){
4309                        _holder.css({
4310                            'top' : ''
4311                        })
4312                    }
4313
4314
4315                }else{
4316                }
4317            }
4318        }
4319
4320
4321
4322
4323
4324
4325        this.each(function () {
4326            var cthis = $(this);
4327            var type = 'image';
4328
4329
4330            //console.log(cthis, type);
4331            //if(cthi)
4332
4333            readyInit();
4334            function readyInit() {
4335                if (cthis.get(0) == $('body').get(0)) {
4336                    return;
4337                }
4338                cthis.unbind('click');
4339                cthis.bind('click', click_item);
4340            }
4341            return this;
4342        }); // end each
4343
4344    }
4345
4346
4347    window.init_zoombox = function(args){
4348        //console.info($('.zoombox'), window._zoombox_maincon,window.init_zoombox_settings);
4349
4350        if(typeof args=='undefined'){
4351            if(typeof window.init_zoombox_settings!='undefined'){
4352                args = window.init_zoombox_settings;
4353            }
4354        }
4355
4356        //console.info($('.zoombox'));
4357        //console.info('COMING YOUR WAY', $('.zoombox'), window._zoombox_maincon);
4358        if(window._zoombox_maincon!=undefined){
4359
4360            $('.zoombox').zoomBox(args);
4361            return false;
4362
4363        }else{
4364
4365            $('.zoombox').zoomBox(args);
4366            $(document).undelegate('.zoombox-delegated','click');
4367            $(document).delegate('.zoombox-delegated','click', function(){
4368                window.dzszb_open_item($(this));
4369
4370                return false;
4371            });
4372            return false;
4373        }
4374
4375    };
4376})(jQuery);
4377
4378jQuery.fn.urlParam = function (arg, name) {
4379    var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(arg);
4380    return (results !== null) ? results[1] : 0;
4381}
4382
4383function is_ios() {
4384    return ((navigator.platform.indexOf("iPhone") != -1) || (navigator.platform.indexOf("iPod") != -1) || (navigator.platform.indexOf("iPad") != -1)
4385    );
4386}
4387
4388
4389jQuery(document).ready(function($){
4390    init_zoombox();
4391})
4392
4393function is_android() {
4394    //return true;
4395    var ua = navigator.userAgent.toLowerCase();
4396    return (ua.indexOf("android") > -1);
4397}
4398
4399function is_ie() {
4400    if (navigator.appVersion.indexOf("MSIE") != -1) {
4401        return true;
4402    }
4403    ;
4404    return false;
4405};
4406function is_firefox() {
4407    if (navigator.userAgent.indexOf("Firefox") != -1) {
4408        return true;
4409    }
4410    ;
4411    return false;
4412};
4413function is_opera() {
4414    if (navigator.userAgent.indexOf("Opera") != -1) {
4415        return true;
4416    }
4417    ;
4418    return false;
4419};
4420function is_chrome() {
4421    return navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
4422};
4423function is_safari() {
4424    return navigator.userAgent.toLowerCase().indexOf('safari') > -1;
4425};
4426function version_ie() {
4427    return parseFloat(navigator.appVersion.split("MSIE")[1]);
4428};
4429function version_firefox() {
4430    if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
4431        var aversion = new Number(RegExp.$1);
4432        return(aversion);
4433    }
4434    ;
4435};
4436function version_opera() {
4437    if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)) {
4438        var aversion = new Number(RegExp.$1);
4439        return(aversion);
4440    }
4441    ;
4442};
4443function is_ie8() {
4444    if (is_ie() && version_ie() < 9) {
4445        return true;
4446    }
4447    return false;
4448}
4449function is_ie9() {
4450    if(is_ie() && version_ie() == 9) {
4451        return true;
4452    }
4453    return false;
4454}
4455
4456
4457
4458
4459
4460/*
4461 * Author: Digital Zoom Studio
4462 * Product: DZS Dock
4463 * Website: https://digitalzoomstudio.net/
4464 * Portfolio: https://bit.ly/nM4R6u
4465 *
4466 * Version: 0.50
4467 */
4468
4469(function($) {
4470    $.fn.dzsdock = function(o) {
4471        var defaults = {
4472            settings_slideshowTime: '5' //in seconds
4473            , settings_autoHeight: 'on'
4474            , settings_skin: 'skin-default'
4475            , settings_preloadall: 'on'
4476            , design_normalwidth: '100'
4477            , design_maxmultiply: '1.3'
4478            , design_dockrange: '150'
4479            , settings_callbackOnSelect: ''
4480            , settings_activeclass: 'active'
4481            , settings_startactive: ''
4482
4483        }
4484        o = $.extend(defaults, o);
4485
4486        o.design_maxmultiply = parseFloat(o.design_maxmultiply);
4487        o.design_dockrange = parseInt(o.design_dockrange, 10);
4488        o.design_normalwidth = parseInt(o.design_normalwidth, 10);
4489        o.settings_startactive = parseInt(o.settings_startactive, 10);
4490
4491        //console.info(o.design_normalwidth);
4492
4493        this.each(function() {
4494            var cthis = $(this);
4495            var cchildren = cthis.children();
4496            var nr_children = cthis.children('.items').children().length
4497                ,nr_loaded = 0
4498                ;
4499            var currNr = -1;
4500            var busy = true;
4501            var i = 0;
4502            var ww
4503                , wh
4504                , tw
4505                , th
4506                ;
4507            var busy = false;
4508
4509            var totalw = 0
4510                ,clipw = 0
4511                ,mouseX=0
4512                ,mousey=0
4513                ,viewIndexX = 0
4514                ;
4515            var _items
4516                ;
4517            var int_calculate;
4518            var is_already_inited="off";
4519
4520            init();
4521            function init(){
4522                if(cthis.attr('class').indexOf("skin-")==-1){
4523                    cthis.addClass(o.settings_skin);
4524                }
4525                if(cthis.hasClass('skin-default')){
4526                    o.settings_skin = 'skin-default';
4527                }
4528
4529                if(cthis.children('.dzsdock-clip').length==0){
4530                    cthis.children('.items').wrap('<div class="dzsdock-clip"></div>')
4531                }
4532                _items = cthis.find('.items').eq(0);
4533
4534                if(!isNaN(o.design_normalwidth)){
4535                    o.settings_preloadall = 'off';
4536
4537                    _items.children().each(function(){
4538                        var _t = jQuery(this);
4539                        _t.data('originalw', o.design_normalwidth);
4540
4541                        if(_t.hasClass('active')){
4542                            _t.css('width', o.design_maxmultiply * parseInt(_t.data('originalw'), 10));
4543                        }else{
4544                            _t.css('width', _t.data('originalw'));
4545                        }
4546                    });
4547                }
4548
4549
4550
4551
4552                if(o.settings_preloadall=='on'){
4553                    //console.log(cthis.find('.items').eq(0).children());
4554                    _items.children().each(function(){
4555                        var _t = $(this);
4556                        if(_t.get(0)!=undefined && _t.get(0).nodeName=="IMG"){
4557                            //console.log(_t.attr('data-thumbnail'))
4558                            var auxImage = new Image();
4559                            auxImage.src=_t.attr('src');
4560                            auxImage.onload=imageLoaded;
4561                            totalw+=7;
4562                        }else{
4563                            imageLoaded();
4564                        }
4565
4566                    })
4567                    //===failsafe
4568                    setTimeout(handle_loaded, 7500);
4569
4570                }else{
4571                    setTimeout(handle_loaded, 1000);
4572                }
4573
4574            }
4575            function imageLoaded(e){
4576                nr_loaded++;
4577                //console.log(this, this.naturalWidth, this.naturalHeight, this.complete, nr_loaded, nr_children);
4578                if(nr_loaded>=nr_children){
4579                    //==leave some time for the width to be set in the items
4580                    setTimeout(handle_loaded, 1000);
4581                    //handle_loaded();
4582                }
4583            }
4584            function handle_loaded() {
4585                if(is_already_inited=='on'){
4586                    return;
4587                }
4588                if(_items.css('opacity')==0){
4589                    _items.css('opacity',1);
4590                }
4591
4592                _items.children().each(function(){
4593                    var _t = $(this);
4594                    //console.log(_t.data('originalw'));
4595                    if(_t.data('originalw')==undefined){
4596                        _t.data('originalw', parseInt(_t.outerWidth(false),10));
4597                    }
4598
4599                    //`console.log(_t.data('originalw'));
4600                    totalw+=_t.outerWidth(true);
4601                });
4602                //totalw+=10;
4603                totalw+=(o.design_maxmultiply * 2 - 2) * o.design_normalwidth;
4604                //console.info(totalw);
4605
4606                if(!isNaN(o.settings_startactive)){
4607                    _items.children().eq(o.settings_startactive).addClass(o.settings_activeclass)
4608                }
4609
4610                _items.css('width', 10000);
4611
4612
4613                cthis.bind('mousemove', handle_mousemove);
4614                cthis.bind('mouseleave', handle_mouseleave);
4615
4616
4617                _items.children().bind('click', click_item);
4618
4619
4620                $(window).bind('resize', handleResize);
4621                handleResize();
4622                //setTimeout(handleResize, 1000);
4623                is_already_inited = 'on';
4624            }
4625            function click_item(e){
4626
4627                //==click item for dzs dock
4628                var _t = $(this);
4629                var ind = _t.parent().children().index(_t);
4630                //console.info(ind);
4631
4632                //console.log(_t, _t.hasClass(o.settings_activeclass));
4633                if(_t.hasClass(o.settings_activeclass)){
4634                    return;
4635                }
4636
4637                if(o.settings_callbackOnSelect!=''){
4638                    o.settings_callbackOnSelect(ind);
4639                }
4640
4641                _t.parent().children().removeClass(o.settings_activeclass);
4642                _t.addClass(o.settings_activeclass);
4643
4644                //return false;
4645            }
4646
4647            function handle_mousemove(e){
4648                mouseX = e.pageX - cthis.offset().left;
4649                clearTimeout(int_calculate);
4650                int_calculate = setTimeout(calculate_items, 5);
4651            }
4652            function calculate_items(args){
4653                clipw = cthis.find('.dzsdock-clip').eq(0).width();
4654                //console.info(clipw);
4655                _items.children().each(function(){
4656                    var _t = $(this);
4657                    var tx = _t.offset().left + _t.outerWidth(false) * 0.5;
4658                    //console.info(_t, Math.floor(mouseX - tx), _t.outerWidth(false) * 0.5)
4659
4660                    if(_t.hasClass('active')){
4661                        _t.css('width', o.design_maxmultiply * parseInt(_t.data('originalw'), 10));
4662                    }else{
4663                        if((args!=undefined && args.mouseisout==true) || (Math.floor(Math.abs(mouseX - tx)) > o.design_dockrange )){
4664
4665                            if(parseInt(_t.css('width'),10)!=_t.data('originalw')){
4666                                _t.css('width', _t.data('originalw'));
4667                            }
4668                        }else{
4669                            //console.log(_t, tx);
4670                            var aux = (1- (Math.floor(Math.abs(mouseX - tx))) / o.design_dockrange);
4671
4672                            //console.info(_t, ';;;;',  (Math.floor(Math.abs(mouseX - tx))), ';;;;', aux);
4673                            var auxw = aux * (parseInt(_t.data('originalw'), 10)* o.design_maxmultiply - parseInt(_t.data('originalw'), 10)) + parseInt(_t.data('originalw'), 10);
4674                            //console.log(_t, (_t.data('originalw')), auxw);
4675                            if(auxw > o.design_maxmultiply * parseInt(_t.data('originalw'), 10)){
4676                                auxw = o.design_maxmultiply * parseInt(_t.data('originalw'), 10);
4677                            }
4678                            _t.css('width', auxw);
4679                            if(_t.get(0)!=undefined && _t.get(0).nodeName=="IMG"){
4680                                //totalw+=15 * o.design_maxmultiply;
4681                            }
4682
4683                        }
4684                    }
4685
4686                    //totalw+=_t.outerWidth(true);
4687                });
4688
4689                if(args!=undefined && args.donotmove==true){
4690
4691                }else{
4692                    //console.log(totalw, clipw);
4693                    if(totalw > clipw){
4694                        var aux = mouseX / clipw;
4695                        //console.info(aux);
4696                        viewIndexX= -(aux*(totalw-clipw));
4697                        //console.info(viewIndexX);
4698                        _items.css('left', parseInt(viewIndexX,10));
4699                    }
4700
4701                }
4702                if(totalw < clipw){
4703                    _items.css('left', (clipw - totalw) / 2);
4704                }
4705                //totalw+=100;
4706                //totalw+=(o.design_maxmultiply * 2 - 2) * o.design_normalwidth;
4707
4708                //console.info(totalw);
4709                //_items.css('width', totalw);
4710                _items.css('width', 10000);
4711                //console.info(mouseX);
4712            }
4713            function handle_mouseleave(e){
4714                mouseX = 10000;
4715                calculate_items({donotmove:true});
4716            }
4717            function handleResize() {
4718                ww = $(window).width();
4719
4720                calculate_items({donotmove:true, mouseisout: true});
4721            }
4722            return this;
4723        })
4724    }
4725})(jQuery);
4726
4727
4728window.requestAnimFrame = (function(){
4729    return  window.requestAnimationFrame       ||
4730        window.webkitRequestAnimationFrame ||
4731        window.mozRequestAnimationFrame    ||
4732        function( callback ){
4733            window.setTimeout(callback, 1000 / 60);
4734        };
4735})();
4736
4737
4738function get_query_arg(purl, key){
4739
4740    if(purl.indexOf(key+'=')>-1){
4741        //faconsole.log('testtt');
4742        var regexS = "[?&]"+key + "=.+";
4743        var regex = new RegExp(regexS);
4744        var regtest = regex.exec(purl);
4745        //console.info(regtest);
4746
4747        if(regtest != null){
4748            var splitterS = regtest[0];
4749            if(splitterS.indexOf('&')>-1){
4750                var aux = splitterS.split('&');
4751                splitterS = aux[1];
4752            }
4753            //console.log(splitterS);
4754            var splitter = splitterS.split('=');
4755            //console.log(splitter[1]);
4756            //var tempNr = ;
4757            if(splitter[1]){
4758
4759                splitter[1] = String(splitter[1]).replace('#','');
4760                return splitter[1];
4761            }
4762
4763
4764        }
4765        //$('.zoombox').eq
4766    }
4767
4768    return '';}
4769
4770
4771function add_query_arg(purl, key,value){
4772    key = encodeURIComponent(key); value = encodeURIComponent(value);
4773
4774    //if(window.console) { console.info(key, value); };
4775
4776    var s = purl;
4777    var pair = key+"="+value;
4778
4779    var r = new RegExp("(&|\\?)"+key+"=[^\&]*");
4780
4781
4782    //console.info(pair);
4783
4784    s = s.replace(r,"$1"+pair);
4785    //console.log(s, pair);
4786    var addition = '';
4787    if(s.indexOf(key + '=')>-1){
4788
4789
4790    }else{
4791        if(s.indexOf('?')>-1){
4792            addition = '&'+pair;
4793        }else{
4794            addition='?'+pair;
4795        }
4796        s+=addition;
4797    }
4798
4799    //if value NaN we remove this field from the url
4800    if(value=='NaN'){
4801        var regex_attr = new RegExp('[\?|\&]'+key+'='+value);
4802        s=s.replace(regex_attr, '');
4803    }
4804
4805
4806    //if(!RegExp.$1) {s += (s.length>0 ? '&' : '?') + kvp;};
4807
4808    return s;
4809}
4810function has_history_api() {
4811    return !!(window.history && history.pushState);
4812}
4813jQuery(document).ready(function($){
4814
4815    $('.effect-icona').each(function(){
4816        var _t = $(this);
4817        _t.append('<div class="zoomcon-enlarge"></div>')
4818    })
4819    $('.effect-icona-playbtn').each(function(){
4820        var _t = $(this);
4821        _t.append('<div class="zoomcon-enlarge"></div>')
4822    })
4823})

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.