PageSourceSearch

https://macovex.pt/catalog/view/theme/journal3/lib/masterslider/masterslider.js?v=7c1b5835

js macovex.pt collected 2026-10-04 13:28:23 UTC 311,235 bytes, 10,074 lines download raw bytes

1/*! 
2 * Master Slider – Responsive Touch Swipe Slider
3 * Copyright © 2021 All Rights Reserved. 
4 *
5 * @author Averta [www.averta.net]
6 * @version 2.81.8
7 * @date Feb 2021
8 */
9
10
11/* ================== bin-debug/js/pro/tools/base.js =================== */
12window.averta = {};
13
14;
15(function($) {
16
17    //"use strict";
18
19    window.package = function(name) {
20        if (!window[name]) window[name] = {};
21    };
22
23    var extend = function(target, object) {
24        for (var key in object) target[key] = object[key];
25    };
26
27    Function.prototype.extend = function(superclass) {
28        if (typeof superclass.prototype.constructor === "function") {
29            extend(this.prototype, superclass.prototype);
30            this.prototype.constructor = this;
31        } else {
32            this.prototype.extend(superclass);
33            this.prototype.constructor = this;
34        }
35    };
36
37    // Converts JS prefix to CSS prefix
38    var trans = {
39        'Moz': '-moz-',
40        'Webkit': '-webkit-',
41        'Khtml': '-khtml-',
42        'O': '-o-',
43        'ms': '-ms-',
44        'Icab': '-icab-'
45    };
46
47    window._mobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
48    window._touch = 'ontouchstart' in document;
49    $(document).ready(function() {
50        window._jcsspfx = getVendorPrefix(); // JS CSS VendorPrefix
51        window._csspfx = trans[window._jcsspfx]; // CSS VendorPrefix
52        window._cssanim = supportsTransitions();
53        window._css3d = supports3DTransforms();
54        window._css2d = supportsTransforms();
55    });
56
57
58    // Thanks to LEA VEROU
59    // http://lea.verou.me/2009/02/find-the-vendor-prefix-of-the-current-browser/
60    function getVendorPrefix() {
61
62        if ('result' in arguments.callee) return arguments.callee.result;
63
64        var regex = /^(Moz|Khtml|O|ms|Icab)(?=[A-Z])/;
65        var webKitOnly = /^(Webkit|webkit)(?=[A-Z])/;
66        var someScript = document.getElementsByTagName('script')[0];
67
68        for (var prop in someScript.style) {
69            if (webKitOnly.test(prop)) {
70                return arguments.callee.result = prop.match(webKitOnly)[0];
71            }
72        }
73
74        for (var prop in someScript.style) {
75            if (regex.test(prop)) {
76                return arguments.callee.result = prop.match(regex)[0];
77            }
78        }
79
80        if ('WebkitOpacity' in someScript.style) return arguments.callee.result = 'Webkit';
81        if ('KhtmlOpacity' in someScript.style) return arguments.callee.result = 'Khtml';
82
83        return arguments.callee.result = '';
84    }
85
86
87    // Thanks to Steven Benner.
88    // http://stevenbenner.com/2010/03/javascript-regex-trick-parse-a-query-string-into-an-object/
89    window.parseQueryString = function(url) {
90        var queryString = {};
91        url.replace(
92            new RegExp("([^?=&]+)(=([^&]*))?", "g"),
93            function($0, $1, $2, $3) { queryString[$1] = $3; }
94        );
95
96        return queryString;
97    };
98
99    function checkStyleValue(prop) {
100        var b = document.body || document.documentElement;
101        var s = b.style;
102        var p = prop;
103        if (typeof s[p] == 'string') { return true; }
104
105        // Tests for vendor specific prop
106        v = ['Moz', 'Webkit', 'Khtml', 'O', 'ms'],
107            p = p.charAt(0).toUpperCase() + p.substr(1);
108        for (var i = 0; i < v.length; i++) {
109            if (typeof s[v[i] + p] == 'string') { return true; }
110        }
111        return false;
112    }
113
114    function supportsTransitions() {
115        return checkStyleValue('transition');
116    }
117
118    function supportsTransforms() {
119        return checkStyleValue('transform');
120    }
121
122    function supports3DTransforms() {
123        if (!supportsTransforms()) return false;
124        var el = document.createElement('i'),
125            has3d,
126            transforms = {
127                'WebkitTransform': '-webkit-transform',
128                'OTransform': '-o-transform',
129                'MSTransform': '-ms-transform',
130                'msTransform': '-ms-transform',
131                'MozTransform': '-moz-transform',
132                'Transform': 'transform',
133                'transform': 'transform'
134            };
135
136        el.style.display = 'block';
137
138        // Add it to the body to get the computed style
139        document.body.insertBefore(el, null);
140
141        for (var t in transforms) {
142            if (el.style[t] !== undefined) {
143                el.style[t] = 'translate3d(1px,1px,1px)';
144                has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
145            }
146        }
147
148        document.body.removeChild(el);
149
150        return (has3d != null && has3d.length > 0 && has3d !== "none");
151    }
152
153    /**
154     * Provides requestAnimationFrame in a cross browser way.
155     * @author paulirish / http://paulirish.com/
156     */
157    var fps60 = 50 / 3;
158
159    if (!window.requestAnimationFrame) {
160
161        window.requestAnimationFrame = (function() {
162
163            return window.webkitRequestAnimationFrame ||
164                window.mozRequestAnimationFrame ||
165                window.oRequestAnimationFrame ||
166                window.msRequestAnimationFrame ||
167                function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
168
169                    window.setTimeout(callback, fps60);
170
171                };
172
173        })();
174
175    }
176
177    if (!window.getComputedStyle) {
178        window.getComputedStyle = function(el, pseudo) {
179            this.el = el;
180            this.getPropertyValue = function(prop) {
181                var re = /(\-([a-z]){1})/g;
182                if (prop == 'float') prop = 'styleFloat';
183                if (re.test(prop)) {
184                    prop = prop.replace(re, function() {
185                        return arguments[2].toUpperCase();
186                    });
187                }
188                return el.currentStyle[prop] ? el.currentStyle[prop] : null;
189            };
190            return el.currentStyle;
191        };
192    }
193
194    // IE8 Array indexOf fix
195    if (!Array.prototype.indexOf) {
196        Array.prototype.indexOf = function(elt /*, from*/ ) {
197            var len = this.length >>> 0;
198
199            var from = Number(arguments[1]) || 0;
200            from = (from < 0) ?
201                Math.ceil(from) :
202                Math.floor(from);
203            if (from < 0)
204                from += len;
205
206            for (; from < len; from++) {
207                if (from in this &&
208                    this[from] === elt)
209                    return from;
210            }
211            return -1;
212        };
213    }
214
215
216    /**
217     * check ie browser
218     * @param  {Number | string}  version
219     * @return {Boolean}
220     */
221    window.isMSIE = function(version) {
222        if (!window.MSBrowserInfo.msie) {
223            return false;
224        } else if (!version) {
225            return true;
226        }
227        var ieVer = window.MSBrowserInfo.version.slice(0, window.MSBrowserInfo.version.indexOf('.'));
228        if (typeof version === 'string') {
229            if (version.indexOf('<') !== -1 || version.indexOf('>') !== -1) {
230                return eval(ieVer + version);
231            } else {
232                return eval(version + '==' + ieVer);
233            }
234        } else {
235            return version == ieVer;
236        }
237    }
238
239    $.removeDataAttrs = function($target, exclude) {
240        var i,
241            attrName,
242            dataAttrsToDelete = [],
243            dataAttrs = $target[0].attributes,
244            dataAttrsLen = dataAttrs.length;
245
246        exclude = exclude || [];
247
248        // loop through attributes and make a list of those
249        // that begin with 'data-'
250        for (i = 0; i < dataAttrsLen; i++) {
251            attrName = dataAttrs[i].name;
252            if ('data-' === attrName.substring(0, 5) && exclude.indexOf(attrName) === -1) {
253                // Why don't you just delete the attributes here?
254                // Deleting an attribute changes the indices of the
255                // others wreaking havoc on the loop we are inside
256                // b/c dataAttrs is a NamedNodeMap (not an array or obj)
257                dataAttrsToDelete.push(dataAttrs[i].name);
258            }
259        }
260        // delete each of the attributes we found above
261        // i.e. those that start with "data-"
262        $.each(dataAttrsToDelete, function(index, attrName) {
263            $target.removeAttr(attrName);
264        })
265    };
266
267    if (jQuery) {
268        $.jqLoadFix = function() {
269            if (this.complete) {
270                var that = this;
271                setTimeout(function() { $(that).trigger('load'); }, 1);
272            }
273        };
274
275        jQuery.uaMatch = jQuery.uaMatch || function(ua) {
276            ua = ua.toLowerCase();
277
278            var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
279                /(webkit)[ \/]([\w.]+)/.exec(ua) ||
280                /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
281                /(msie) ([\w.]+)/.exec(ua) ||
282                ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || [];
283
284            return {
285                browser: match[1] || "",
286                version: match[2] || "0"
287            };
288        };
289
290        // Don't clobber any existing jQuery.browser in case it's different
291        //if ( !jQuery.browser ) {
292        matched = jQuery.uaMatch(navigator.userAgent);
293        browser = {};
294
295        if (matched.browser) {
296            browser[matched.browser] = true;
297            browser.version = matched.version;
298        }
299
300        // Chrome is Webkit, but Webkit is also Safari.
301        if (browser.chrome) {
302            browser.webkit = true;
303        } else if (browser.webkit) {
304            browser.safari = true;
305        }
306
307        // hofix for IE11 detection
308        var isIE11 = !!navigator.userAgent.match(/Trident\/7\./);
309        if (isIE11) {
310            browser.msie = "true";
311            delete browser.mozilla;
312        }
313
314        window.MSBrowserInfo = browser;
315
316        //}
317
318        $.fn.preloadImg = function(src, _event) {
319            this.each(function() {
320                var $this = $(this);
321                var self = this;
322                var img = new Image();
323                img.onload = function(event) {
324                    if (event == null) event = {}; // IE8
325                    $this.attr('src', src);
326                    event.width = img.width;
327                    event.height = img.height;
328                    $this.data('width', img.width);
329                    $this.data('height', img.height);
330                    setTimeout(function() { _event.call(self, event); }, 50);
331                    img = null;
332                };
333                img.src = src;
334            });
335            return this;
336        };
337    }
338})(jQuery);
339
340/* ================== bin-debug/js/pro/tools/EventDispatcher.js =================== */
341;
342(function() {
343
344    "use strict";
345
346    averta.EventDispatcher = function() {
347        this.listeners = {};
348    };
349
350    averta.EventDispatcher.extend = function(_proto) {
351        var instance = new averta.EventDispatcher();
352        for (var key in instance)
353            if (key != 'constructor') _proto[key] = averta.EventDispatcher.prototype[key];
354    };
355
356    averta.EventDispatcher.prototype = {
357
358        constructor: averta.EventDispatcher,
359
360        addEventListener: function(event, listener, ref) {
361            if (!this.listeners[event]) this.listeners[event] = [];
362            this.listeners[event].push({ listener: listener, ref: ref });
363
364        },
365
366        removeEventListener: function(event, listener, ref) {
367            if (this.listeners[event]) {
368
369                for (var i = 0; i < this.listeners[event].length; ++i) {
370
371                    if (listener === this.listeners[event][i].listener && ref === this.listeners[event][i].ref) {
372                        this.listeners[event].splice(i--, 1);
373                    }
374                }
375
376                if (this.listeners[event].length === 0) {
377                    this.listeners[event] = null;
378                }
379            }
380        },
381
382        dispatchEvent: function(event) {
383            event.target = this;
384            if (this.listeners[event.type]) {
385                for (var i = 0, l = this.listeners[event.type].length; i < l; ++i) {
386                    this.listeners[event.type][i].listener.call(this.listeners[event.type][i].ref, event);
387                }
388            }
389        }
390    };
391
392})();
393
394/* ================== bin-debug/js/pro/tools/TouchSwipe.js =================== */
395;
396(function($) {
397
398    "use strict";
399
400    var isTouch = 'ontouchstart' in document,
401        isPointer = window.navigator.pointerEnabled,
402        isMSPoiner = !isPointer && window.navigator.msPointerEnabled,
403        usePointer = isPointer || isMSPoiner,
404        // Events
405        ev_start = (isPointer ? 'pointerdown ' : '') + (isMSPoiner ? 'MSPointerDown ' : '') + (isTouch ? 'touchstart ' : '') + 'mousedown',
406        ev_move = (isPointer ? 'pointermove ' : '') + (isMSPoiner ? 'MSPointerMove ' : '') + (isTouch ? 'touchmove ' : '') + 'mousemove',
407        ev_end = (isPointer ? 'pointerup ' : '') + (isMSPoiner ? 'MSPointerUp ' : '') + (isTouch ? 'touchend ' : '') + 'mouseup',
408        ev_cancel = (isPointer ? 'pointercancel ' : '') + (isMSPoiner ? 'MSPointerCancel ' : '') + 'touchcancel';
409
410
411    averta.TouchSwipe = function($element) {
412        this.$element = $element;
413        this.enabled = true;
414
415        $element.bind(ev_start, { target: this }, this.__touchStart);
416
417        $element[0].swipe = this;
418
419        this.onSwipe = null;
420        this.swipeType = 'horizontal';
421        this.noSwipeSelector = 'input, textarea, button, .no-swipe, .ms-no-swipe';
422
423        this.lastStatus = {};
424
425    };
426
427    var p = averta.TouchSwipe.prototype;
428
429    /*-------------- METHODS --------------*/
430
431    p.getDirection = function(new_x, new_y) {
432        switch (this.swipeType) {
433            case 'horizontal':
434                return new_x <= this.start_x ? 'left' : 'right';
435                break;
436            case 'vertical':
437                return new_y <= this.start_y ? 'up' : 'down';
438                break;
439            case 'all':
440                if (Math.abs(new_x - this.start_x) > Math.abs(new_y - this.start_y))
441                    return new_x <= this.start_x ? 'left' : 'right';
442                else
443                    return new_y <= this.start_y ? 'up' : 'down';
444                break;
445        }
446    };
447
448    p.priventDefultEvent = function(new_x, new_y) {
449        //if(this.priventEvt != null) return this.priventEvt;
450        var dx = Math.abs(new_x - this.start_x);
451        var dy = Math.abs(new_y - this.start_y);
452
453        var horiz = dx > dy;
454
455        return (this.swipeType === 'horizontal' && horiz) ||
456            (this.swipeType === 'vertical' && !horiz);
457
458        //return this.priventEvt;
459    };
460
461    p.createStatusObject = function(evt) {
462        var status_data = {},
463            temp_x, temp_y;
464
465        temp_x = this.lastStatus.distanceX || 0;
466        temp_y = this.lastStatus.distanceY || 0;
467
468        status_data.distanceX = evt.pageX - this.start_x;
469        status_data.distanceY = evt.pageY - this.start_y;
470        status_data.moveX = status_data.distanceX - temp_x;
471        status_data.moveY = status_data.distanceY - temp_y;
472
473        status_data.distance = parseInt(Math.sqrt(Math.pow(status_data.distanceX, 2) + Math.pow(status_data.distanceY, 2)));
474
475        status_data.duration = new Date().getTime() - this.start_time;
476        status_data.direction = this.getDirection(evt.pageX, evt.pageY);
477
478        return status_data;
479    };
480
481
482    p.__reset = function(event, jqevt) {
483        this.reset = false;
484        this.lastStatus = {};
485        this.start_time = new Date().getTime();
486
487        var point = this.__getPoint(event, jqevt);
488        this.start_x = point.pageX;
489        this.start_y = point.pageY;
490    };
491
492    p.__touchStart = function(event) {
493
494        var swipe = event.data.target;
495        var jqevt = event;
496        if (!swipe.enabled) return;
497
498        if ($(event.target).closest(swipe.noSwipeSelector, swipe.$element).length > 0) {
499            return;
500        }
501
502        event = event.originalEvent;
503
504        if (usePointer) {
505            $(this).css('-ms-touch-action', swipe.swipeType === 'horizontal' ? 'pan-y' : 'pan-x');
506        }
507
508        if (!swipe.onSwipe) {
509            $.error('Swipe listener is undefined');
510            return;
511        }
512
513        // don't catch the touch start again, also don't go further if the delay between touchstart and mousedown is small
514        // if ( swipe.touchStarted ) {
515        if (swipe.touchStarted || isTouch && swipe.start_time && event.type === 'mousedown' && new Date().getTime() - swipe.start_time < 600) {
516            return;
517        }
518
519        var point = swipe.__getPoint(event, jqevt);
520        swipe.start_x = point.pageX;
521        swipe.start_y = point.pageY;
522
523        swipe.start_time = new Date().getTime();
524
525        $(document).bind(ev_end, { target: swipe }, swipe.__touchEnd).
526        bind(ev_move, { target: swipe }, swipe.__touchMove).
527        bind(ev_cancel, { target: swipe }, swipe.__touchCancel);
528
529        var status = swipe.createStatusObject(point);
530        status.phase = 'start';
531
532        swipe.onSwipe.call(null, status);
533
534        if (!isTouch)
535            jqevt.preventDefault();
536
537        swipe.lastStatus = status;
538        swipe.touchStarted = true;
539    };
540
541    p.__touchMove = function(event) {
542        var swipe = event.data.target;
543        var jqevt = event;
544        event = event.originalEvent;
545
546        if (!swipe.touchStarted) return;
547
548        clearTimeout(swipe.timo);
549        swipe.timo = setTimeout(function() { swipe.__reset(event, jqevt); }, 60);
550
551        var point = swipe.__getPoint(event, jqevt);
552
553        var status = swipe.createStatusObject(point);
554
555        if (swipe.priventDefultEvent(point.pageX, point.pageY))
556            jqevt.preventDefault();
557
558        status.phase = 'move';
559
560        //if(swipe.lastStatus.direction !== status.direction) swipe.__reset(event , jqevt);
561
562        swipe.lastStatus = status;
563
564        swipe.onSwipe.call(null, status);
565    };
566
567    p.__touchEnd = function(event) {
568
569        var swipe = event.data.target;
570        var jqevt = event;
571        event = event.originalEvent;
572
573        clearTimeout(swipe.timo);
574
575        var status = swipe.lastStatus;
576
577        if (!isTouch)
578            jqevt.preventDefault();
579
580        status.phase = 'end';
581
582        swipe.touchStarted = false;
583        swipe.priventEvt = null;
584
585        $(document).unbind(ev_end, swipe.__touchEnd).
586        unbind(ev_move, swipe.__touchMove).
587        unbind(ev_cancel, swipe.__touchCancel);
588
589        status.speed = status.distance / status.duration;
590
591        swipe.onSwipe.call(null, status);
592
593    };
594
595    p.__touchCancel = function(event) {
596        var swipe = event.data.target;
597        swipe.__touchEnd(event);
598    };
599
600    p.__getPoint = function(event, jqEvent) {
601        if (isTouch && event.type.indexOf('mouse') === -1) {
602            return event.touches[0];
603        } else if (usePointer) {
604            return event;
605        } else {
606            return jqEvent;
607        }
608    };
609
610    p.enable = function() {
611        if (this.enabled) return;
612        this.enabled = true;
613    };
614
615    p.disable = function() {
616        if (!this.enabled) return;
617        this.enabled = false;
618    };
619
620})(jQuery);
621
622/* ================== bin-debug/js/pro/tools/Timer.js =================== */
623/**
624 * 	Ticker Class
625 * 	Author: Averta Ltd
626 */
627
628;
629(function() {
630    "use strict";
631
632    averta.Ticker = function() {};
633
634    var st = averta.Ticker,
635        list = [],
636        len = 0,
637        __stopped = true;
638
639    st.add = function(listener, ref) {
640        list.push([listener, ref]);
641
642        if (list.length === 1) st.start();
643        len = list.length;
644        return len;
645    };
646
647    st.remove = function(listener, ref) {
648        for (var i = 0, l = list.length; i < l; ++i) {
649            if (list[i] && list[i][0] === listener && list[i][1] === ref) {
650                list.splice(i, 1);
651            }
652        }
653
654        len = list.length;
655
656        if (len === 0) {
657            st.stop();
658        }
659    };
660
661    st.start = function() {
662        if (!__stopped) return;
663        __stopped = false;
664        __tick();
665    };
666
667    st.stop = function() {
668        __stopped = true;
669    };
670
671    var __tick = function() {
672        if (st.__stopped) return;
673        var item;
674        for (var i = 0; i !== len; i++) {
675            item = list[i];
676            item[0].call(item[1]);
677        }
678
679        requestAnimationFrame(__tick);
680    };
681
682})();
683
684/**
685 * 	Timer Class
686 * 	Author: Averta Ltd
687 */
688;
689(function() {
690    "use strict";
691
692    if (!Date.now) {
693        Date.now = function() {
694            return new Date().getTime();
695        };
696    }
697
698    averta.Timer = function(delay, autoStart) {
699        this.delay = delay;
700        this.currentCount = 0;
701        this.paused = false;
702        this.onTimer = null;
703        this.refrence = null;
704
705        if (autoStart) this.start();
706
707    };
708
709    averta.Timer.prototype = {
710
711        constructor: averta.Timer,
712
713        start: function() {
714            this.paused = false;
715            this.lastTime = Date.now();
716            averta.Ticker.add(this.update, this);
717        },
718
719        stop: function() {
720            this.paused = true;
721            averta.Ticker.remove(this.update, this);
722        },
723
724        reset: function() {
725            this.currentCount = 0;
726            this.paused = true;
727            this.lastTime = Date.now();
728        },
729
730        update: function() {
731            if (this.paused || Date.now() - this.lastTime < this.delay) return;
732            this.currentCount++;
733            this.lastTime = Date.now();
734            if (this.onTimer)
735                this.onTimer.call(this.refrence, this.getTime());
736
737        },
738
739        getTime: function() {
740            return this.delay * this.currentCount;
741        }
742
743    };
744})();
745
746/* ================== bin-debug/js/pro/tools/CSSTweener.js =================== */
747;
748(function() {
749
750    "use strict";
751
752    var evt = null;
753
754    window.CSSTween = function(element, duration, delay, ease) {
755
756        this.$element = element;
757        this.duration = duration || 1000;
758        this.delay = delay || 0;
759        this.ease = ease || 'linear';
760
761        /*if(!evt){
762        	if(window._jcsspfx === 'O')
763        		evt = 'otransitionend';
764        	else if(window._jcsspfx == 'Webkit')
765        		evt = 'webkitTransitionEnd';
766        	else
767        		evt = 'transitionend' ;
768        }*/
769
770    };
771
772    var p = CSSTween.prototype;
773
774    /*-------------- METHODS --------------*/
775
776    p.to = function(callback, target) {
777        this.to_cb = callback;
778        this.to_cb_target = target;
779
780        return this;
781    };
782
783    p.from = function(callback, target) {
784        this.fr_cb = callback;
785        this.fr_cb_target = target;
786
787        return this;
788    };
789
790    p.onComplete = function(callback, target) {
791        this.oc_fb = callback;
792        this.oc_fb_target = target;
793
794        return this;
795    };
796
797    p.chain = function(csstween) {
798        this.chained_tween = csstween;
799        return this;
800    };
801
802    p.reset = function() {
803        //element.removeEventListener(evt , this.onTransComplete , true);
804        clearTimeout(this.start_to);
805        clearTimeout(this.end_to);
806    };
807
808    p.start = function() {
809        var element = this.$element[0];
810
811        clearTimeout(this.start_to);
812        clearTimeout(this.end_to);
813
814        this.fresh = true;
815
816        if (this.fr_cb) {
817            element.style[window._jcsspfx + 'TransitionDuration'] = '0ms';
818            this.fr_cb.call(this.fr_cb_target);
819        }
820
821        var that = this;
822
823        this.onTransComplete = function(event) {
824
825            if (!that.fresh) return;
826
827            //that.$element[0].removeEventListener(evt , this.onTransComplete, true);
828            //event.stopPropagation();
829
830
831            that.reset();
832
833            element.style[window._jcsspfx + 'TransitionDuration'] = '';
834            element.style[window._jcsspfx + 'TransitionProperty'] = '';
835            element.style[window._jcsspfx + 'TransitionTimingFunction'] = '';
836            element.style[window._jcsspfx + 'TransitionDelay'] = '';
837
838            that.fresh = false;
839            if (that.chained_tween) that.chained_tween.start();
840            if (that.oc_fb) that.oc_fb.call(that.oc_fb_target);
841
842        };
843
844        this.start_to = setTimeout(function() {
845            if (!that.$element) return;
846            element.style[window._jcsspfx + 'TransitionDuration'] = that.duration + 'ms';
847            element.style[window._jcsspfx + 'TransitionProperty'] = that.transProperty || 'all';
848
849            if (that.delay > 0) element.style[window._jcsspfx + 'TransitionDelay'] = that.delay + 'ms';
850            else element.style[window._jcsspfx + 'TransitionDelay'] = '';
851
852            element.style[window._jcsspfx + 'TransitionTimingFunction'] = that.ease;
853
854            if (that.to_cb) that.to_cb.call(that.to_cb_target);
855
856            //that.$element[0].addEventListener(evt , that.onTransComplete , true );
857
858            that.end_to = setTimeout(function() { that.onTransComplete(); }, that.duration + (that.delay || 0));
859        }, 1);
860
861        return this;
862    };
863
864})();
865
866/**
867 *	Cross Tween Class
868 */
869;
870(function() {
871
872    "use strict";
873
874    var _cssanim = null;
875    window.CTween = {};
876
877    function transPos(element, properties) {
878        if (properties.x !== undefined || properties.y !== undefined) {
879            if (_cssanim) {
880                var trans = window._jcsspfx + "Transform";
881                if (properties.x !== undefined) {
882                    properties[trans] = (properties[trans] || '') + ' translateX(' + properties.x + 'px)';
883                    delete properties.x;
884                }
885
886                if (properties.y !== undefined) {
887                    properties[trans] = (properties[trans] || '') + ' translateY(' + properties.y + 'px)';
888                    delete properties.y;
889                }
890            } else {
891                if (properties.x !== undefined) {
892                    var posx = element.css('right') !== 'auto' ? 'right' : 'left';
893                    //if(!element[0].bx) element[0].bx = parseInt(element.css(posx));
894                    properties[posx] = /*element[0].bx + */ properties.x + 'px';
895                    delete properties.x;
896                }
897
898                if (properties.y !== undefined) {
899                    var posy = element.css('bottom') !== 'auto' ? 'bottom' : 'top';
900                    //if(!element[0].by) element[0].by = parseInt(element.css(posy));
901                    properties[posy] = /*element[0].by + */ properties.y + 'px';
902                    delete properties.y;
903                }
904            }
905        }
906        return properties;
907    }
908
909    CTween.setPos = function(element, pos) {
910        element.css(transPos(element, pos));
911    };
912
913    CTween.animate = function(element, duration, properties, options) {
914        if (_cssanim == null) _cssanim = window._cssanim;
915
916        options = options || {};
917
918        transPos(element, properties);
919
920        if (_cssanim) {
921            var tween = new CSSTween(element, duration, options.delay, EaseDic[options.ease]);
922            if (options.transProperty) {
923                tween.transProperty = options.transProperty;
924            }
925            tween.to(function() { element.css(properties); });
926            if (options.complete) tween.onComplete(options.complete, options.target);
927            tween.start();
928            tween.stop = tween.reset;
929            return tween;
930        }
931
932        var onCl;
933
934        if (options.delay) element.delay(options.delay);
935        if (options.complete)
936            onCl = function() {
937                options.complete.call(options.target);
938            };
939
940        element.stop(true).animate(properties, duration, options.ease || 'linear', onCl);
941
942        return element;
943    };
944
945    CTween.fadeOut = function(target, duration, remove) {
946        var options = {};
947        if (remove === true) {
948            options.complete = function() { target.remove(); };
949        } else if (remove === 2) {
950            options.complete = function() { target.css('display', 'none'); };
951        }
952
953        CTween.animate(target, duration || 1000, { opacity: 0 }, options);
954    };
955
956    CTween.fadeIn = function(target, duration, reset) {
957        if (reset !== false) {
958            target.css('opacity', 0).css('display', '');
959        }
960
961        CTween.animate(target, duration || 1000, { opacity: 1 });
962    };
963
964})();
965
966;
967(function() {
968
969    // Thanks to matthewlein
970    // https://github.com/matthewlein/Ceaser
971
972    window.EaseDic = {
973        'linear': 'linear',
974        'ease': 'ease',
975        'easeIn': 'ease-in',
976        'easeOut': 'ease-out',
977        'easeInOut': 'ease-in-out',
978
979        'easeInCubic': 'cubic-bezier(.55,.055,.675,.19)',
980        'easeOutCubic': 'cubic-bezier(.215,.61,.355,1)',
981        'easeInOutCubic': 'cubic-bezier(.645,.045,.355,1)',
982        'easeInCirc': 'cubic-bezier(.6,.04,.98,.335)',
983        'easeOutCirc': 'cubic-bezier(.075,.82,.165,1)',
984        'easeInOutCirc': 'cubic-bezier(.785,.135,.15,.86)',
985        'easeInExpo': 'cubic-bezier(.95,.05,.795,.035)',
986        'easeOutExpo': 'cubic-bezier(.19,1,.22,1)',
987        'easeInOutExpo': 'cubic-bezier(1,0,0,1)',
988        'easeInQuad': 'cubic-bezier(.55,.085,.68,.53)',
989        'easeOutQuad': 'cubic-bezier(.25,.46,.45,.94)',
990        'easeInOutQuad': 'cubic-bezier(.455,.03,.515,.955)',
991        'easeInQuart': 'cubic-bezier(.895,.03,.685,.22)',
992        'easeOutQuart': 'cubic-bezier(.165,.84,.44,1)',
993        'easeInOutQuart': 'cubic-bezier(.77,0,.175,1)',
994        'easeInQuint': 'cubic-bezier(.755,.05,.855,.06)',
995        'easeOutQuint': 'cubic-bezier(.23,1,.32,1)',
996        'easeInOutQuint': 'cubic-bezier(.86,0,.07,1)',
997        'easeInSine': 'cubic-bezier(.47,0,.745,.715)',
998        'easeOutSine': 'cubic-bezier(.39,.575,.565,1)',
999        'easeInOutSine': 'cubic-bezier(.445,.05,.55,.95)',
1000        'easeInBack': 'cubic-bezier(.6,-.28,.735,.045)',
1001        'easeOutBack': 'cubic-bezier(.175, .885,.32,1.275)',
1002        'easeInOutBack': 'cubic-bezier(.68,-.55,.265,1.55)'
1003    };
1004})();
1005
1006/* ================== bin-debug/js/pro/tools/Aligner.js =================== */
1007;
1008(function() {
1009
1010    "use strict";
1011
1012    window.MSAligner = function(type, $container, $img) {
1013
1014        this.$container = $container;
1015        this.$img = $img;
1016
1017        this.type = type || 'stretch'; // fill , fit , stretch , tile , center
1018
1019        this.widthOnly = false;
1020        this.heightOnly = false;
1021    };
1022
1023    var p = MSAligner.prototype;
1024
1025    /*-------------- METHODS --------------*/
1026
1027    p.init = function(w, h) {
1028
1029        this.baseWidth = w;
1030        this.baseHeight = h;
1031        this.imgRatio = w / h;
1032        this.imgRatio2 = h / w;
1033
1034        switch (this.type) {
1035            case 'tile':
1036                this.$container.css('background-image', 'url(' + this.$img.attr('src') + ')');
1037                this.$img.remove();
1038                break;
1039            case 'center':
1040                this.$container.css('background-image', 'url(' + this.$img.attr('src') + ')');
1041                this.$container.css({
1042                    backgroundPosition: 'center center',
1043                    backgroundRepeat: 'no-repeat'
1044                });
1045                this.$img.remove();
1046                break;
1047            case 'stretch':
1048                this.$img.css({
1049                    width: '100%',
1050                    height: '100%'
1051                });
1052                break;
1053            case 'fill':
1054            case 'fit':
1055                this.needAlign = true;
1056                this.align();
1057                break;
1058        }
1059
1060    };
1061
1062    p.align = function() {
1063        if (!this.needAlign) return;
1064
1065        var cont_w = this.$container[0].offsetWidth;
1066        var cont_h = this.$container[0].offsetHeight;
1067
1068        var contRatio = cont_w / cont_h;
1069
1070        if (this.type == 'fill') {
1071            if (this.imgRatio < contRatio) {
1072                this.$img.width(cont_w);
1073                this.$img.height(cont_w * this.imgRatio2);
1074            } else {
1075                this.$img.height(cont_h);
1076                this.$img.width(cont_h * this.imgRatio);
1077            }
1078
1079        } else if (this.type == 'fit') {
1080
1081            if (this.imgRatio < contRatio) {
1082                this.$img.height(cont_h);
1083                this.$img.width(cont_h * this.imgRatio);
1084            } else {
1085                this.$img.width(cont_w);
1086                this.$img.height(cont_w * this.imgRatio2);
1087            }
1088        }
1089
1090        this.setMargin();
1091
1092    };
1093
1094    p.setMargin = function() {
1095
1096        var cont_w = this.$container[0].offsetWidth;
1097        var cont_h = this.$container[0].offsetHeight;
1098
1099        this.$img.css('margin-top', (cont_h - this.$img[0].offsetHeight) / 2 + 'px');
1100        this.$img.css('margin-left', (cont_w - this.$img[0].offsetWidth) / 2 + 'px');
1101    }
1102
1103})();
1104
1105/* ================== bin-debug/js/pro/tools/pointer-events-polyfill.js =================== */
1106/**
1107 * CSS pointer-events polyfill
1108 * Adds support for `pointer-events: none;` for browsers not supporting this property
1109 * Requires jQuery@~1.9
1110 *
1111 * @copyright Sebastian Langer 2016
1112 * @license MIT
1113 * @author Sebastian Langer <[email protected]>
1114 */
1115(function($) {
1116    /**
1117     * Polyfill main-method
1118     * @param  {object} userOptions override default options
1119     */
1120    var Polyfill = function(userOptions) {
1121        this.options = $.extend({}, Polyfill.defaultOptions, userOptions);
1122
1123        this.isEnabled = false;
1124
1125        if (this.options.forcePolyfill || !this.supportsPointerEvents()) {
1126            this.registerEvents();
1127            this.isEnabled = true;
1128        }
1129    };
1130
1131    Polyfill.defaultOptions = {
1132        forcePolyfill: false,
1133        selector: '*',
1134        listenOn: ['click', 'dblclick', 'mousedown', 'mouseup'],
1135        pointerEventsNoneClass: null,
1136        pointerEventsAllClass: null,
1137        eventNamespace: 'pointer-events-polyfill'
1138    };
1139
1140    /**
1141     * registers events needed for the polyfill to work properly
1142     */
1143    Polyfill.prototype.registerEvents = function() {
1144        $(document).on(this.getEventNames(), this.options.selector, $.proxy(this.onElementClick, this));
1145    };
1146
1147    /**
1148     * get all events as a jquery-compatible event string
1149     * @return {String} namespaced jquery-events
1150     */
1151    Polyfill.prototype.getEventNames = function() {
1152        var eventNamespace = this.options.eventNamespace ? '.' + this.options.eventNamespace : '';
1153        return this.options.listenOn.join(eventNamespace + ' ') + eventNamespace;
1154    };
1155
1156    /**
1157     * detects support for css pointer-events
1158     * stolen from modernizr - https://github.com/Modernizr/Modernizr/blob/1f8af59/feature-detects/css/pointerevents.js
1159     * @return {boolean} indicates support
1160     */
1161    Polyfill.prototype.supportsPointerEvents = function() {
1162        var style = document.createElement('a').style;
1163        style.cssText = 'pointer-events:auto';
1164        return style.pointerEvents === 'auto';
1165    };
1166
1167    /**
1168     * recursively checks parent nodes if they have a pointer-events css-property
1169     * @param  {jQuery} $el element to test
1170     * @return {boolean}    indicates click-through-ability of the given element
1171     */
1172    Polyfill.prototype.isClickThrough = function($el) {
1173        var elPointerEventsCss = $el.css('pointer-events');
1174        if ($el.length === 0 || elPointerEventsCss === 'all' || $el.is(':root') || $el.hasClass(this.options.pointerEventsAllClass)) {
1175            return false;
1176        }
1177        if (elPointerEventsCss === 'none' || $el.hasClass(this.options.pointerEventsNoneClass) || this.isClickThrough($el.parent())) {
1178            return true;
1179        }
1180        return false;
1181    };
1182
1183    /**
1184     * proxies click-through to underlying element if necessary
1185     * @param  {Event} e click-event
1186     * @return {boolean} preventDefault
1187     */
1188    Polyfill.prototype.onElementClick = function(e) {
1189        var $elOrg = $(e.target);
1190
1191        if (!this.isClickThrough($elOrg)) {
1192            return true;
1193        }
1194
1195        // retrieve element below the clicked one
1196        $elOrg.hide();
1197        var elBelow = document.elementFromPoint(e.clientX, e.clientY);
1198
1199        // trigger the original element on the one below
1200        e.target = elBelow;
1201        $(elBelow).trigger(e);
1202
1203        // open links
1204        if (elBelow.tagName === 'A') {
1205            // middle click (sometimes the browser blocks it as popup)
1206            if (e.which === 2) {
1207                window.open(elBelow.getAttribute('href'), '_blank');
1208            } else {
1209                elBelow.click();
1210            }
1211        }
1212
1213        // restore clicked element
1214        $elOrg.show();
1215
1216        return false;
1217    };
1218
1219    /**
1220     * destroys the plugin - removes listeners and data
1221     */
1222    Polyfill.prototype.destroy = function() {
1223        $(document).off(this.getEventNames());
1224        this.isEnabled = false;
1225    };
1226
1227    /**
1228     * make polyfill available globally
1229     * @param  {object} userOptions override default options
1230     * @return {Polyfill}           polyfill-object
1231     */
1232    window.pointerEventsPolyfill = function(userOptions) {
1233        return new Polyfill(userOptions);
1234    };
1235})(jQuery);
1236
1237/* ================== bin-debug/js/pro/controls/controller.js =================== */
1238/**
1239 *  Touch List Control
1240 * 	version 1.1.2
1241 * 	
1242 * 	Copyright (C) 2014, Averta Ltd. All rights reserved. 	 	
1243 */
1244
1245;
1246(function() {
1247
1248    "use strict";
1249
1250    var _options = {
1251        bouncing: true,
1252        snapping: false,
1253        snapsize: null,
1254        friction: 0.05,
1255        outFriction: 0.05,
1256        outAcceleration: 0.09,
1257        minValidDist: 0.3,
1258        snappingMinSpeed: 2,
1259        paging: false,
1260        endless: false,
1261        maxSpeed: 160
1262    };
1263
1264
1265    var Controller = function(min, max, options) {
1266
1267        if (max === null || min === null) {
1268            throw new Error('Max and Min values are required.');
1269        }
1270
1271        this.options = options || {};
1272
1273        for (var key in _options) {
1274            if (!(key in this.options))
1275                this.options[key] = _options[key];
1276        }
1277
1278        this._max_value = max;
1279        this._min_value = min;
1280
1281        this.value = min;
1282        this.end_loc = min;
1283
1284        this.current_snap = this.getSnapNum(min);
1285
1286        this.__extrStep = 0;
1287        this.__extraMove = 0;
1288
1289        this.__animID = -1;
1290
1291    };
1292
1293    var p = Controller.prototype;
1294
1295    /*
1296    ---------------------------------------------------
1297    	PUBLIC METHODS
1298    ----------------------------------------------------
1299    */
1300
1301
1302    p.changeTo = function(value, animate, speed, snap_num, dispatch) {
1303        this.stopped = false;
1304        this._internalStop();
1305        value = this._checkLimits(value);
1306        speed = Math.abs(speed || 0);
1307
1308        if (this.options.snapping) {
1309            snap_num = snap_num || this.getSnapNum(value);
1310            if (dispatch !== false) this._callsnapChange(snap_num);
1311            this.current_snap = snap_num;
1312        }
1313
1314        if (animate) {
1315            this.animating = true;
1316
1317            var self = this,
1318                active_id = ++self.__animID,
1319                amplitude = value - self.value,
1320                timeStep = 0,
1321                targetPosition = value,
1322                animFrict = 1 - self.options.friction,
1323                timeconst = animFrict + (speed - 20) * animFrict * 1.3 / self.options.maxSpeed;
1324
1325            var tick = function() {
1326
1327                if (active_id !== self.__animID) return;
1328
1329                var dis = value - self.value;
1330
1331                if (Math.abs(dis) > self.options.minValidDist && self.animating) {
1332                    window.requestAnimationFrame(tick);
1333                } else {
1334
1335                    if (self.animating) {
1336                        self.value = value;
1337                        self._callrenderer();
1338                    }
1339
1340                    self.animating = false;
1341
1342                    if (active_id !== self.__animID) {
1343                        self.__animID = -1;
1344                    }
1345
1346                    self._callonComplete('anim');
1347
1348                    return;
1349                }
1350
1351                //self.value += dis * timeconst
1352                self.value = targetPosition - amplitude * Math.exp(- ++timeStep * timeconst);
1353
1354                self._callrenderer();
1355            };
1356
1357            tick();
1358
1359            return;
1360        }
1361
1362        this.value = value;
1363        this._callrenderer();
1364    };
1365
1366    p.drag = function(move) {
1367
1368        if (this.start_drag) {
1369            this.drag_start_loc = this.value;
1370            this.start_drag = false;
1371        }
1372
1373        this.animating = false;
1374        this._deceleration = false;
1375
1376        this.value -= move;
1377
1378        if (!this.options.endless && (this.value > this._max_value || this.value < 0)) {
1379            if (this.options.bouncing) {
1380                this.__isout = true;
1381                this.value += move * 0.6;
1382            } else if (this.value > this._max_value) {
1383                this.value = this._max_value;
1384            } else {
1385                this.value = 0;
1386            }
1387        } else if (!this.options.endless && this.options.bouncing) {
1388            this.__isout = false;
1389        }
1390
1391        this._callrenderer();
1392
1393    };
1394
1395    p.push = function(speed) {
1396        this.stopped = false;
1397        if (this.options.snapping && Math.abs(speed) <= this.options.snappingMinSpeed) {
1398            this.cancel();
1399            return;
1400        }
1401
1402        this.__speed = speed;
1403        this.__startSpeed = speed;
1404
1405        this.end_loc = this._calculateEnd();
1406
1407        if (this.options.snapping) {
1408
1409            var snap_loc = this.getSnapNum(this.value),
1410                end_snap = this.getSnapNum(this.end_loc);
1411
1412            if (this.options.paging) {
1413                snap_loc = this.getSnapNum(this.drag_start_loc);
1414
1415                this.__isout = false;
1416                if (speed > 0) {
1417                    this.gotoSnap(snap_loc + 1, true, speed);
1418                } else {
1419                    this.gotoSnap(snap_loc - 1, true, speed);
1420                }
1421                return;
1422            } else if (snap_loc === end_snap) {
1423                this.cancel();
1424                return;
1425            }
1426
1427            this._callsnapChange(end_snap);
1428            this.current_snap = end_snap;
1429
1430        }
1431
1432        this.animating = false;
1433
1434        this.__needsSnap = this.options.endless || (this.end_loc > this._min_value && this.end_loc < this._max_value);
1435
1436        if (this.options.snapping && this.__needsSnap)
1437            this.__extraMove = this._calculateExtraMove(this.end_loc);
1438
1439
1440        this._startDecelaration();
1441    };
1442
1443    p.bounce = function(speed) {
1444        if (this.animating) return;
1445        this.stopped = false;
1446        this.animating = false;
1447
1448        this.__speed = speed;
1449        this.__startSpeed = speed;
1450
1451        this.end_loc = this._calculateEnd();
1452
1453        //if(this.options.paging){}
1454
1455        this._startDecelaration();
1456    };
1457
1458    p.stop = function() {
1459        this.stopped = true;
1460        this._internalStop();
1461    };
1462
1463    p.cancel = function() {
1464        this.start_drag = true; // reset flag for next drag
1465        if (this.__isout) {
1466            this.__speed = 0.0004;
1467            this._startDecelaration();
1468        } else if (this.options.snapping) {
1469            this.gotoSnap(this.getSnapNum(this.value), true);
1470        }
1471
1472    };
1473
1474    p.renderCallback = function(listener, ref) {
1475        this.__renderHook = { fun: listener, ref: ref };
1476    };
1477
1478    p.snappingCallback = function(listener, ref) {
1479        this.__snapHook = { fun: listener, ref: ref };
1480    };
1481
1482    p.snapCompleteCallback = function(listener, ref) {
1483        this.__compHook = { fun: listener, ref: ref };
1484    };
1485
1486    p.getSnapNum = function(value) {
1487        return Math.floor((value + this.options.snapsize / 2) / this.options.snapsize);
1488    };
1489
1490    p.nextSnap = function() {
1491        this._internalStop();
1492
1493        var curr_snap = this.getSnapNum(this.value);
1494
1495        if (!this.options.endless && (curr_snap + 1) * this.options.snapsize > this._max_value) {
1496            this.__speed = 8;
1497            this.__needsSnap = false;
1498            this._startDecelaration();
1499        } else {
1500            this.gotoSnap(curr_snap + 1, true);
1501        }
1502
1503    };
1504
1505    p.prevSnap = function() {
1506        this._internalStop();
1507
1508        var curr_snap = this.getSnapNum(this.value);
1509
1510        if (!this.options.endless && (curr_snap - 1) * this.options.snapsize < this._min_value) {
1511            this.__speed = -8;
1512            this.__needsSnap = false;
1513            this._startDecelaration();
1514        } else {
1515            this.gotoSnap(curr_snap - 1, true);
1516        }
1517
1518    };
1519
1520    p.gotoSnap = function(snap_num, animate, speed) {
1521        this.changeTo(snap_num * this.options.snapsize, animate, speed, snap_num);
1522    };
1523
1524    p.destroy = function() {
1525        this._internalStop();
1526        this.__renderHook = null;
1527        this.__snapHook = null;
1528        this.__compHook = null;
1529    };
1530
1531    /*
1532    ---------------------------------------------------
1533    	PRIVATE METHODS
1534    ----------------------------------------------------
1535    */
1536
1537    p._internalStop = function() {
1538        this.start_drag = true; // reset flag for next drag
1539        this.animating = false;
1540        this._deceleration = false;
1541        this.__extrStep = 0;
1542    };
1543
1544    p._calculateExtraMove = function(value) {
1545        var m = value % this.options.snapsize;
1546        return m < this.options.snapsize / 2 ? -m : this.options.snapsize - m;
1547    };
1548
1549    p._calculateEnd = function(step) {
1550        var temp_speed = this.__speed;
1551        var temp_value = this.value;
1552        var i = 0;
1553        while (Math.abs(temp_speed) > this.options.minValidDist) {
1554            temp_value += temp_speed;
1555            temp_speed *= this.options.friction;
1556            i++;
1557        }
1558        if (step) return i;
1559        return temp_value;
1560    };
1561
1562    p._checkLimits = function(value) {
1563        if (this.options.endless) return value;
1564        if (value < this._min_value) return this._min_value;
1565        if (value > this._max_value) return this._max_value;
1566        return value;
1567    };
1568
1569    p._callrenderer = function() {
1570        if (this.__renderHook) this.__renderHook.fun.call(this.__renderHook.ref, this, this.value);
1571    };
1572
1573    p._callsnapChange = function(targetSnap) {
1574        if (!this.__snapHook || targetSnap === this.current_snap) return;
1575        this.__snapHook.fun.call(this.__snapHook.ref, this, targetSnap, targetSnap - this.current_snap);
1576    };
1577
1578    p._callonComplete = function(type) {
1579        if (this.__compHook && !this.stopped) {
1580            this.__compHook.fun.call(this.__compHook.ref, this, this.current_snap, type);
1581        }
1582
1583    };
1584
1585    p._computeDeceleration = function() {
1586
1587        if (this.options.snapping && this.__needsSnap) {
1588            var xtr_move = (this.__startSpeed - this.__speed) / this.__startSpeed * this.__extraMove;
1589            this.value += this.__speed + xtr_move - this.__extrStep;
1590            this.__extrStep = xtr_move;
1591        } else {
1592            this.value += this.__speed;
1593        }
1594
1595        this.__speed *= this.options.friction; //* 10;
1596
1597        if (!this.options.endless && !this.options.bouncing) {
1598            if (this.value <= this._min_value) {
1599                this.value = this._min_value;
1600                this.__speed = 0;
1601            } else if (this.value >= this._max_value) {
1602                this.value = this._max_value;
1603                this.__speed = 0;
1604            }
1605        }
1606
1607        this._callrenderer();
1608
1609        if (!this.options.endless && this.options.bouncing) {
1610
1611            var out_value = 0;
1612
1613            if (this.value < this._min_value) {
1614                out_value = this._min_value - this.value;
1615            } else if (this.value > this._max_value) {
1616                out_value = this._max_value - this.value;
1617            }
1618
1619            this.__isout = Math.abs(out_value) >= this.options.minValidDist;
1620
1621            if (this.__isout) {
1622                if (this.__speed * out_value <= 0) {
1623                    this.__speed += out_value * this.options.outFriction;
1624                } else {
1625                    this.__speed = out_value * this.options.outAcceleration;
1626                }
1627            }
1628        }
1629    };
1630
1631    p._startDecelaration = function() {
1632        if (this._deceleration) return;
1633        this._deceleration = true;
1634
1635        var self = this;
1636
1637        var tick = function() {
1638
1639            if (!self._deceleration) return;
1640
1641            self._computeDeceleration();
1642
1643            if (Math.abs(self.__speed) > self.options.minValidDist || self.__isout) {
1644                window.requestAnimationFrame(tick);
1645            } else {
1646                self._deceleration = false;
1647                self.__isout = false;
1648
1649                if (self.__needsSnap && self.options.snapping && !self.options.paging) {
1650                    self.value = self._checkLimits(self.end_loc + self.__extraMove);
1651                } else {
1652                    self.value = Math.round(self.value);
1653                }
1654
1655                self._callrenderer();
1656                self._callonComplete('decel');
1657            }
1658        };
1659
1660        tick();
1661    };
1662
1663    window.Controller = Controller;
1664
1665})();
1666
1667/* ================== bin-debug/js/pro/layers/LayerController.js =================== */
1668/**
1669 * Master Slider Layer Controller
1670 * @author averta
1671 * @package Master Slider jQuery PRO
1672 * @since 2.11.1
1673 */
1674;
1675(function(window, document, $) {
1676
1677    /**
1678     * Layer Controller constructor
1679     * @param {MSSlide} slide layer controller's slide.
1680     */
1681    window.MSLayerController = function(slide) {
1682        this.slide = slide;
1683        this.slider = slide.slider;
1684        this.layers = [];
1685        this.layersCount = 0;
1686        this.preloadCount = 0;
1687        this.$layers = $('<div></div>').addClass('ms-slide-layers');
1688        this.$staticLayers = $('<div></div>').addClass('ms-static-layers');
1689        this.$fixedLayers = $('<div></div>').addClass('ms-fixed-layers');
1690        this.$animLayers = $('<div></div>').addClass('ms-anim-layers');
1691
1692    };
1693
1694    var p = MSLayerController.prototype;
1695
1696
1697    /*-----------------------------------------*\
1698    	Public Methods
1699    \*-----------------------------------------*/
1700
1701    /**
1702     * Adds new layer to the controller and slide
1703     * @param {MSLayerElement} layer
1704     */
1705    p.addLayer = function(layer) {
1706        layer.slide = this.slide;
1707        layer.controller = this;
1708
1709        // append layer element to the layers container based on `data-position` attribute.
1710        switch (layer.$element.data('position')) {
1711            case 'static':
1712                this.hasStaticLayer = true;
1713                layer.$element.appendTo(this.$staticLayers);
1714                break;
1715            case 'fixed':
1716                this.hasFixedLayer = true;
1717                layer.$element.appendTo(this.$fixedLayers);
1718                break;
1719            default:
1720                layer.$element.appendTo(this.$animLayers);
1721                break;
1722        }
1723
1724        layer.create();
1725        this.layers.push(layer);
1726        this.layersCount++;
1727
1728        // @since 1.7.0
1729        if (layer.parallax) {
1730            this.hasParallaxLayer = true;
1731        }
1732
1733        if (layer.needPreload) {
1734            this.preloadCount++;
1735        }
1736    };
1737
1738    /**
1739     * add layers over slide
1740     * it calls after addLayer
1741     */
1742    p.create = function() {
1743        this.slide.$element.append(this.$layers);
1744        this.$layers.append(this.$animLayers);
1745
1746        if (this.hasStaticLayer) {
1747            this.$layers.append(this.$staticLayers);
1748        }
1749
1750        if (this.slider.options.layersMode == 'center') {
1751            this.$layers.css('max-width', this.slider.options.width + 'px');
1752
1753            if (this.hasFixedLayer) {
1754                this.$fixedLayers.css('max-width', this.slider.options.width + 'px');
1755            }
1756        }
1757    };
1758
1759    /**
1760     * load layers that requires preloading
1761     * @param {Function} callback onload callback function
1762     */
1763    p.loadLayers = function(callback) {
1764        this._onReadyCallback = callback;
1765
1766        if (this.preloadCount === 0) {
1767            this._onlayersReady();
1768            return;
1769        }
1770
1771        for (var i = 0; i !== this.layersCount; ++i) {
1772            if (this.layers[i].needPreload) {
1773                this.layers[i].loadImage();
1774            }
1775        }
1776    };
1777
1778    /**
1779     * prepare layers to show over slide, this method will be called via `prepareToSelect` method of slide.
1780     */
1781    p.prepareToShow = function() {
1782        if (this.hasParallaxLayer) {
1783            this._enableParallaxEffect();
1784        }
1785
1786        if (this.hasFixedLayer) {
1787            this.$fixedLayers.prependTo(this.slide.view.$element);
1788        }
1789    };
1790
1791    /**
1792     * show layers over slide
1793     */
1794    p.showLayers = function() {
1795        if (this.layersHideTween) {
1796            this.layersHideTween.stop(true);
1797        }
1798
1799        if (this.fixedLayersHideTween) {
1800            this.fixedLayersHideTween.stop(true);
1801        }
1802
1803        this._resetLayers();
1804        this.$animLayers.css('opacity', '').css('display', '');
1805
1806        if (this.hasFixedLayer) {
1807            this.$fixedLayers.css('opacity', '').css('display', '');
1808        }
1809
1810        if (this.ready) {
1811            this._initLayers();
1812            this._locateLayers();
1813            this._startLayers();
1814        }
1815    };
1816
1817    /**
1818     * hideLayers this method will be called via slide class.
1819     */
1820    p.hideLayers = function() {
1821
1822        if (this.slide.selected || this.slider.options.instantStartLayers) {
1823            var that = this;
1824            that.layersHideTween = CTween.animate(this.$animLayers, 500, { opacity: 0 }, {
1825                complete: function() {
1826                    that._resetLayers();
1827                }
1828            });
1829
1830            if (this.hasFixedLayer) {
1831                this.fixedLayersHideTween = CTween.animate(this.$fixedLayers, 500, { opacity: 0 }, {
1832                    complete: function() {
1833                        that.$fixedLayers.detach();
1834                    }
1835                });
1836            }
1837
1838            // disables parallax effect
1839            // @since 1.6.0
1840            if (this.hasParallaxLayer) {
1841                this._disableParallaxEffect();
1842            }
1843        }
1844    };
1845
1846    /**
1847     * hide layers from slide
1848     */
1849    p.animHideLayers = function() {
1850        if (!this.ready) {
1851            return;
1852        }
1853
1854        for (var i = 0; i !== this.layersCount; ++i) {
1855            this.layers[i].hide();
1856        }
1857    };
1858
1859    /**
1860     * calculate new size of layers containers and locate layers
1861     * @param {Number} width  slider width
1862     * @param {Number} height slider height
1863     * @param {Boolean} hard  whether call init layers.
1864     */
1865    p.setSize = function(width, height, hard) {
1866
1867        if (this.ready && (this.slide.selected || this.hasStaticLayer)) {
1868            if (hard) {
1869                this._initLayers(true);
1870            }
1871            this._locateLayers(!this.slide.selected);
1872        }
1873
1874        if (this.slider.options.autoHeight) {
1875            this.updateHeight();
1876        }
1877
1878        if (this.slider.options.layersMode == 'center') {
1879            var left = Math.max(0, (width - this.slider.options.width) / 2) + 'px';
1880            this.$layers[0].style.left = left;
1881            this.$fixedLayers[0].style.left = left;
1882        }
1883
1884    };
1885
1886    /**
1887     * updates layers container height
1888     */
1889    p.updateHeight = function() {
1890        // var h = this.slide.getHeight() + 'px';
1891        // this.$layers[0].style.height = h;
1892        // this.$fixedLayers[0].style.height = h;
1893    };
1894
1895    /**
1896     * This method will be called by the last layer after loading all of layers.
1897     */
1898    p._onlayersReady = function() {
1899        this.ready = true;
1900
1901        if (this.hasStaticLayer && !this.slide.isSleeping) {
1902            this._initLayers(false, true);
1903        }
1904
1905        this._onReadyCallback.call(this.slide);
1906    };
1907
1908    /**
1909     * this method will be called by slide when it starts sleeping
1910     */
1911    p.onSlideSleep = function() {
1912
1913    };
1914
1915    /**
1916     * this method will be called by slide after waking up
1917     */
1918    p.onSlideWakeup = function() {
1919        if (this.hasStaticLayer && this.ready) {
1920            this._initLayers(false, true);
1921        }
1922    };
1923
1924    /**
1925     * get the layer object by the id attribute
1926     */
1927    p.getLayerById = function(layerId) {
1928        if (!layerId) {
1929            return null;
1930        }
1931
1932        for (var i = 0; i < this.layersCount; ++i) {
1933            if (this.layers[i].id === layerId) {
1934                return this.layers[i];
1935            }
1936        }
1937
1938        return null;
1939    };
1940
1941    /**
1942     * destroy layer controller and stop layer animations
1943     */
1944    p.destroy = function() {
1945        if (this.slide.selected && this.hasParallaxLayer) {
1946            this._disableParallaxEffect();
1947        }
1948
1949        for (var i = 0; i < this.layersCount; ++i) {
1950            this.layers[i].$element.stop(true).remove();
1951        }
1952
1953        this.$layers.remove();
1954        this.$staticLayers.remove();
1955        this.$fixedLayers.remove();
1956        this.$animLayers.remove();
1957    };
1958
1959
1960    /*-----------------------------------------*\
1961    	Private Methods
1962    \*-----------------------------------------*/
1963
1964    /**
1965     * start layer effect
1966     */
1967    p._startLayers = function() {
1968        for (var i = 0; i !== this.layersCount; ++i) {
1969            var layer = this.layers[i];
1970            if (!layer.waitForAction) {
1971                layer.start();
1972            }
1973        }
1974    };
1975
1976    /**
1977     * call init method of all layers
1978     * @param  {Boolean} force
1979     */
1980    p._initLayers = function(force, onlyStatics) {
1981
1982        if (this.init && !force || this.slider.init_safemode) {
1983            return;
1984        }
1985
1986        this.init = onlyStatics !== true;
1987
1988        var i = 0;
1989        if (onlyStatics && !this.staticsInit) { // init only static layers
1990            this.staticsInit = true;
1991            for (; i !== this.layersCount; ++i) {
1992                if (this.layers[i].staticLayer) {
1993                    this.layers[i].init();
1994                }
1995            }
1996        } else if (this.staticsInit && !force) { // statics are already initiated, init dynamics
1997            for (; i !== this.layersCount; ++i) {
1998                if (!this.layers[i].staticLayer) {
1999                    this.layers[i].init();
2000                }
2001            }
2002        } else { // init all
2003            for (; i !== this.layersCount; ++i) {
2004                this.layers[i].init();
2005            }
2006        }
2007    };
2008
2009    /**
2010     * locate layers over slide
2011     */
2012    p._locateLayers = function(onlyStatics) {
2013        var i = 0;
2014        if (onlyStatics) {
2015            for (; i !== this.layersCount; ++i) {
2016                if (this.layers[i].staticLayer) {
2017                    this.layers[i].locate();
2018                }
2019            }
2020        } else {
2021            for (; i !== this.layersCount; ++i) {
2022                this.layers[i].locate();
2023            }
2024        }
2025    };
2026
2027    /**
2028     * rest layers
2029     */
2030    p._resetLayers = function() {
2031        this.$animLayers.css('display', 'none').css('opacity', 1);
2032        for (var i = 0; i !== this.layersCount; ++i) {
2033            this.layers[i].reset();
2034        }
2035    };
2036
2037    /**
2038     * moves layers based on x and y
2039     * @param  {Number} x
2040     * @param  {Number} y
2041     * @param  {Boolean} fast whether animate or not
2042     */
2043    p._applyParallax = function(x, y, fast) {
2044        for (var i = 0; i !== this.layersCount; ++i) {
2045            if (this.layers[i].parallax != null) {
2046                this.layers[i].moveParallax(x, y, fast);
2047            }
2048        }
2049    };
2050
2051    /**
2052     * enable parallax moving layers
2053     */
2054    p._enableParallaxEffect = function() {
2055        if (this.slider.options.parallaxMode === 'swipe') {
2056            this.slide.view.addEventListener(MSViewEvents.SCROLL, this._swipeParallaxMove, this);
2057        } else {
2058            this.slide.$element.on('mousemove', { that: this }, this._mouseParallaxMove)
2059                .on('mouseleave', { that: this }, this._resetParalax);
2060            /**
2061             * Calculates new position of parallax based on device orintation gamma and beta
2062             * @param  {Event} e
2063             * @since 1.6.0
2064             */
2065            /*if( window._mobile && window.DeviceOrientationEvent ){
2066
2067            	var that = this;
2068            	this.orientationParallaxMove = function(e){
2069            		var beta = Math.round(e.beta),
2070            			gamma = Math.round(e.gamma);
2071
2072            		that._applyParallax(beta * that.__width / 360 , -gamma * that.__height / 360);
2073            	};
2074
2075            	window.addEventListener('deviceorientation', this.orientationParallaxMove, false);
2076            }*/
2077        }
2078    };
2079
2080    /**
2081     * disable parallax effect
2082     */
2083    p._disableParallaxEffect = function() {
2084        if (this.slider.options.parallaxMode === 'swipe') {
2085            this.slide.view.removeEventListener(MSViewEvents.SCROLL, this._swipeParallaxMove, this);
2086        } else {
2087            this.slide.$element.off('mousemove', this._mouseParallaxMove)
2088                .off('mouseleave', this._resetParalax);
2089
2090            /*if( window._mobile && window.DeviceOrientationEvent ){
2091            	window.removeEventListener('deviceorientation', this.orientationParallaxMove);
2092            }*/
2093        }
2094    };
2095
2096    /**
2097     * reset layers parallax position to 0, 0
2098     */
2099    p._resetParalax = function(e) {
2100        var that = e.data.that;
2101        that._applyParallax(0, 0);
2102    };
2103
2104    /**
2105     * Calculates new mouse position over slide and moves layers
2106     * @since 1.6.0
2107     */
2108    p._mouseParallaxMove = function(e) {
2109        var that = e.data.that,
2110            os = that.slide.$element.offset(),
2111            slider = that.slider;
2112
2113        if (slider.options.parallaxMode !== 'mouse:y-only') {
2114            var x = e.pageX - os.left - that.slide.__width / 2;
2115        } else {
2116            var x = 0;
2117        }
2118
2119        if (slider.options.parallaxMode !== 'mouse:x-only') {
2120            var y = e.pageY - os.top - that.slide.__height / 2;
2121        } else {
2122            var y = 0;
2123        }
2124
2125        that._applyParallax(-x, -y);
2126    };
2127
2128
2129    /**
2130     * Calculates new position of parallax based on slide position
2131     * @param  {Event} e
2132     * @since 1.6.0
2133     */
2134    p._swipeParallaxMove = function(e) {
2135        var value = this.slide.position - this.slide.view.__contPos;
2136
2137        if (this.slider.options.dir === 'v') {
2138            this._applyParallax(0, value, true);
2139        } else {
2140            this._applyParallax(value, 0, true);
2141        }
2142    };
2143
2144
2145})(window, document, jQuery);
2146
2147/* ================== bin-debug/js/pro/layers/OverlayLayerController.js =================== */
2148/**
2149 * Overlaye layer controller extends layer controller
2150 * @since 2.50.0
2151 */
2152;
2153(function($, window, document, undefined) {
2154    "use strict";
2155
2156
2157    window.MSOverlayLayerController = function(slide) {
2158        MSLayerController.apply(this, arguments);
2159    }
2160
2161    /* ------------------------------------------------------------------------------ */
2162    MSOverlayLayerController.extend(MSLayerController);
2163    var p = MSOverlayLayerController.prototype;
2164    var _super = MSLayerController.prototype;
2165    /* ------------------------------------------------------------------------------ */
2166
2167    /**
2168     * @override
2169     */
2170    p.addLayer = function(layer) {
2171        var showOnSlides = layer.$element.data('show-on'),
2172            hideOnSlides = layer.$element.data('hide-on');
2173
2174        if (hideOnSlides) {
2175            layer.hideOnSlides = hideOnSlides.replace(/\s+/g, '').split(',');
2176        }
2177
2178        if (showOnSlides) {
2179            layer.showOnSlides = showOnSlides.replace(/\s+/g, '').split(',');
2180        }
2181
2182        _super.addLayer.apply(this, arguments);
2183    };
2184
2185    /**
2186     * @override
2187     */
2188    p.create = function() {
2189        _super.create.apply(this, arguments);
2190        this.slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.checkLayers.bind(this));
2191    };
2192
2193    p.checkLayers = function() {
2194        if (!this.ready) {
2195            return;
2196        }
2197
2198        for (var i = 0; i !== this.layersCount; ++i) {
2199            var layer = this.layers[i];
2200            if (!layer.waitForAction) {
2201                if (this._checkForShow(layer)) {
2202                    layer.start();
2203                } else {
2204                    layer.hide();
2205                }
2206            }
2207        }
2208    };
2209
2210    /**
2211     * enable parallax effect, overlay layars doesn't support swipe parallax
2212     */
2213    p._enableParallaxEffect = function() {
2214        this.slider.view.$element.on('mousemove', { that: this }, this._mouseParallaxMove)
2215            .on('mouseleave', { that: this }, this._resetParalax);
2216    };
2217
2218    /**
2219     * disable parallax effect
2220     * overlay layers doesn't support swipe parallax
2221     */
2222    p._disableParallaxEffect = function() {
2223        this.slider.view.$element.off('mousemove', this._mouseParallaxMove)
2224            .off('mouseleave', this._resetParalax);
2225    };
2226
2227    /* ------------------------------------------------------------------------------ */
2228    /**
2229     * start layer effect
2230     */
2231    p._startLayers = function() {
2232        for (var i = 0; i !== this.layersCount; ++i) {
2233            var layer = this.layers[i];
2234
2235            if (this._checkForShow(layer) && !layer.waitForAction) {
2236                layer.start();
2237            }
2238        }
2239    };
2240
2241    p._checkForShow = function(layer) {
2242        var slideId = this.slider.api.currentSlide.id,
2243            layerHideOn = layer.hideOnSlides,
2244            layerShowOn = layer.showOnSlides;
2245
2246        if (layerShowOn) {
2247            return !!slideId && layerShowOn.indexOf(slideId) !== -1;
2248        }
2249
2250        return !slideId || !layerHideOn || (layerHideOn.length && layerHideOn.indexOf(slideId) === -1);
2251    };
2252
2253})(jQuery, window, document);
2254
2255/* ================== bin-debug/js/pro/layers/OverlayLayers.js =================== */
2256/**
2257 * Master Slider overlay layers
2258 *
2259 */
2260;
2261(function($, window, document, undefined) {
2262    "use strict";
2263
2264    window.MSOverlayLayers = function(slider) {
2265        this.slider = slider;
2266    };
2267
2268    /* ------------------------------------------------------------------------------ */
2269    var p = MSOverlayLayers.prototype;
2270
2271    p.setupLayerController = function() {
2272        this.layerController = new MSOverlayLayerController(this);
2273        this.slider.api.addEventListener(MSSliderEvent.RESIZE, this.setSize.bind(this));
2274        this.slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.setSize.bind(this));
2275        this.setSize();
2276    };
2277
2278    p.setSize = function() {
2279        this.__width = this.$element.width();
2280        this.__height = this.$element.height();
2281
2282        this.layerController.setSize(this.__width, this.__height);
2283    };
2284
2285    p.create = function() {
2286        this.layerController.create();
2287        this.layerController.loadLayers(this._onLayersLoad);
2288        this.layerController.prepareToShow();
2289
2290        if (window.pointerEventsPolyfill) {
2291            window.pointerEventsPolyfill({ selector: '#' + this.slider.$element.attr('id') + ' ' + '.ms-overlay-layers', forcePolyfill: false });
2292        }
2293    };
2294
2295    p.getHeight = function() {
2296        return this.slider.api.currentSlide.getHeight();
2297    };
2298
2299    p.destroy = function() {
2300        this.layerController.destroy();
2301    };
2302
2303    /* ------------------------------------------------------------------------------ */
2304
2305    p._onLayersLoad = function() {
2306        this.ready = true;
2307        this.selected = true;
2308        this.layersLoaded = true;
2309        this.setSize();
2310        this.layerController.showLayers();
2311    };
2312
2313})(jQuery, window, document);
2314
2315/* ================== bin-debug/js/pro/layers/LayerEffects.js =================== */
2316;
2317(function($) {
2318
2319    window.MSLayerEffects = {};
2320
2321    var installed,
2322        _fade = { opacity: 0 };
2323
2324    MSLayerEffects.setup = function() {
2325
2326        if (installed) return;
2327        installed = true;
2328
2329        var st = MSLayerEffects,
2330            transform_css = window._jcsspfx + 'Transform',
2331            transform_orig_css = window._jcsspfx + 'TransformOrigin',
2332            o = window.MSBrowserInfo.opera; // Opera sucks :|
2333        _2d = window._css2d && window._cssanim && !o;
2334
2335        st.defaultValues = { left: 0, top: 0, opacity: (isMSIE('<=9') ? 1 : ''), right: 0, bottom: 0 };
2336        st.defaultValues[transform_css] = '';
2337        //st.defaultValues[transform_orig_css] = '';
2338        st.rf = 1;
2339
2340        st.presetEffParams = {
2341            random: '30|300',
2342            long: 300,
2343            short: 30,
2344            'false': false,
2345            'true': true,
2346            tl: 'top left',
2347            bl: 'bottom left',
2348            tr: 'top right',
2349            br: 'bottom right',
2350            rt: 'top right',
2351            lb: 'bottom left',
2352            lt: 'top left',
2353            rb: 'bottom right',
2354            t: 'top',
2355            b: 'bottom',
2356            r: 'right',
2357            l: 'left',
2358            c: 'center'
2359        };
2360
2361
2362        /*
2363         ----------------------------------------
2364         				2D Effects
2365         ----------------------------------------
2366         */
2367
2368        st.fade = function() {
2369            return _fade;
2370        };
2371
2372        st.left = (_2d) ? function(dist, fade) {
2373            var r = fade === false ? {} : { opacity: 0 };
2374            r[transform_css] = 'translateX(' + -dist * st.rf + 'px)';
2375            return r;
2376        } : function(dist, fade) {
2377            var r = fade === false ? {} : { opacity: 0 };
2378            r.left = -dist * st.rf + 'px';
2379            return r;
2380        };
2381
2382        st.right = (_2d) ? function(dist, fade) {
2383            var r = fade === false ? {} : { opacity: 0 };
2384            r[transform_css] = 'translateX(' + dist * st.rf + 'px)';
2385            return r;
2386        } : function(dist, fade) {
2387            var r = fade === false ? {} : { opacity: 0 };
2388            r.left = dist * st.rf + 'px';
2389            return r;
2390        };
2391
2392        st.top = (_2d) ? function(dist, fade) {
2393            var r = fade === false ? {} : { opacity: 0 };
2394            r[transform_css] = 'translateY(' + -dist * st.rf + 'px)';
2395            return r;
2396        } : function(dist, fade) {
2397            var r = fade === false ? {} : { opacity: 0 };
2398            r.top = -dist * st.rf + 'px';
2399            return r;
2400        };
2401
2402        st.bottom = (_2d) ? function(dist, fade) {
2403            var r = fade === false ? {} : { opacity: 0 };
2404            r[transform_css] = 'translateY(' + dist * st.rf + 'px)';
2405            return r;
2406        } : function(dist, fade) {
2407            var r = fade === false ? {} : { opacity: 0 };
2408            r.top = dist * st.rf + 'px';
2409            return r;
2410        };
2411
2412        st.from = (_2d) ? function(leftdis, topdis, fade) {
2413            var r = fade === false ? {} : { opacity: 0 };
2414            r[transform_css] = 'translateX(' + leftdis * st.rf + 'px) translateY(' + topdis * st.rf + 'px)';
2415            return r;
2416        } : function(leftdis, topdis, fade) {
2417            var r = fade === false ? {} : { opacity: 0 };
2418            r.top = topdis * st.rf + 'px';
2419            r.left = leftdis * st.rf + 'px';
2420            return r;
2421        };
2422
2423
2424        // --------------------------------------------------------------------
2425
2426        st.rotate = (_2d) ? function(deg, orig) {
2427            var r = { opacity: 0 };
2428            r[transform_css] = ' rotate(' + deg + 'deg)';
2429            if (orig) r[transform_orig_css] = orig;
2430            return r;
2431        } : function(deg, orig) {
2432            return _fade;
2433        };
2434
2435        st.rotateleft = (_2d) ? function(deg, dist, orig, fade) {
2436            var r = st.left(dist, fade);
2437            r[transform_css] += ' rotate(' + deg + 'deg)';
2438            if (orig) r[transform_orig_css] = orig;
2439            return r;
2440        } : function(deg, dist, orig, fade) {
2441            return st.left(dist, fade);
2442        };
2443
2444        st.rotateright = (_2d) ? function(deg, dist, orig, fade) {
2445            var r = st.right(dist, fade);
2446            r[transform_css] += ' rotate(' + deg + 'deg)';
2447            if (orig) r[transform_orig_css] = orig;
2448            return r;
2449        } : function(deg, dist, orig, fade) {
2450            return st.right(dist, fade);
2451        };
2452
2453        st.rotatetop = (_2d) ? function(deg, dist, orig, fade) {
2454            var r = st.top(dist, fade);
2455            r[transform_css] += ' rotate(' + deg + 'deg)';
2456            if (orig) r[transform_orig_css] = orig;
2457            return r;
2458        } : function(deg, dist, orig, fade) {
2459            return st.top(dist, fade);
2460        };
2461
2462        st.rotatebottom = (_2d) ? function(deg, dist, orig, fade) {
2463            var r = st.bottom(dist, fade);
2464            r[transform_css] += ' rotate(' + deg + 'deg)';
2465            if (orig) r[transform_orig_css] = orig;
2466            return r;
2467        } : function(deg, dist, orig, fade) {
2468            return st.bottom(dist, fade);
2469        };
2470
2471        st.rotatefrom = (_2d) ? function(deg, leftdis, topdis, orig, fade) {
2472            var r = st.from(leftdis, topdis, fade);
2473            r[transform_css] += ' rotate(' + deg + 'deg)';
2474            if (orig) r[transform_orig_css] = orig;
2475            return r;
2476        } : function(deg, leftdis, topdis, orig, fade) {
2477            return st.from(leftdis, topdis, fade);
2478        };
2479
2480        st.skewleft = (_2d) ? function(deg, dist, fade) {
2481            var r = st.left(dist, fade);
2482            r[transform_css] += ' skewX(' + deg + 'deg)';
2483            return r;
2484        } : function(deg, dist, fade) {
2485            return st.left(dist, fade);
2486        };
2487
2488        st.skewright = (_2d) ? function(deg, dist, fade) {
2489            var r = st.right(dist, fade);
2490            r[transform_css] += ' skewX(' + -deg + 'deg)';
2491            return r;
2492        } : function(deg, dist, fade) {
2493            return st.right(dist, fade);
2494        };
2495
2496        st.skewtop = (_2d) ? function(deg, dist, fade) {
2497            var r = st.top(dist, fade);
2498            r[transform_css] += ' skewY(' + deg + 'deg)';
2499            return r;
2500        } : function(deg, dist, fade) {
2501            return st.top(dist, fade);
2502        };
2503
2504        st.skewbottom = (_2d) ? function(deg, dist, fade) {
2505            var r = st.bottom(dist, fade);
2506            r[transform_css] += ' skewY(' + -deg + 'deg)';
2507            return r;
2508        } : function(deg, dist, fade) {
2509            return st.bottom(dist, fade);
2510        };
2511
2512
2513        st.scale = (_2d) ? function(x, y, orig, fade) {
2514            var r = fade === false ? {} : { opacity: 0 };
2515            r[transform_css] = ' scaleX(' + x + ') scaleY(' + y + ')';
2516            if (orig) r[transform_orig_css] = orig;
2517            return r;
2518        } : function(x, y, orig, fade) {
2519            return fade === false ? {} : { opacity: 0 };
2520        };
2521
2522        st.scaleleft = (_2d) ? function(x, y, dist, orig, fade) {
2523            var r = st.left(dist, fade);
2524            r[transform_css] = ' scaleX(' + x + ') scaleY(' + y + ')';
2525            if (orig) r[transform_orig_css] = orig;
2526            return r;
2527        } : function(x, y, dist, orig, fade) {
2528            return st.left(dist, fade);
2529        };
2530
2531        st.scaleright = (_2d) ? function(x, y, dist, orig, fade) {
2532            var r = st.right(dist, fade);
2533            r[transform_css] = ' scaleX(' + x + ') scaleY(' + y + ')';
2534            if (orig) r[transform_orig_css] = orig;
2535            return r;
2536        } : function(x, y, dist, orig, fade) {
2537            return st.right(dist, fade);
2538        };
2539
2540        st.scaletop = (_2d) ? function(x, y, dist, orig, fade) {
2541            var r = st.top(dist, fade);
2542            r[transform_css] = ' scaleX(' + x + ') scaleY(' + y + ')';
2543            if (orig) r[transform_orig_css] = orig;
2544            return r;
2545        } : function(x, y, dist, orig, fade) {
2546            return st.top(dist, fade);
2547        };
2548
2549        st.scalebottom = (_2d) ? function(x, y, dist, orig, fade) {
2550            var r = st.bottom(dist, fade);
2551            r[transform_css] = ' scaleX(' + x + ') scaleY(' + y + ')';
2552            if (orig) r[transform_orig_css] = orig;
2553            return r;
2554        } : function(x, y, dist, orig, fade) {
2555            return st.bottom(dist, fade);
2556        };
2557
2558        st.scalefrom = (_2d) ? function(x, y, leftdis, topdis, orig, fade) {
2559            var r = st.from(leftdis, topdis, fade);
2560            r[transform_css] += ' scaleX(' + x + ') scaleY(' + y + ')';
2561            if (orig) r[transform_orig_css] = orig;
2562            return r;
2563        } : function(x, y, leftdis, topdis, orig, fade) {
2564            return st.from(leftdis, topdis, fade);
2565        };
2566
2567        st.rotatescale = (_2d) ? function(deg, x, y, orig, fade) {
2568            var r = st.scale(x, y, orig, fade);
2569            r[transform_css] += ' rotate(' + deg + 'deg)';
2570            if (orig) r[transform_orig_css] = orig;
2571            return r;
2572        } : function(deg, x, y, orig, fade) {
2573            return st.scale(x, y, orig, fade);
2574        };
2575
2576
2577        /*
2578         ----------------------------------------
2579         				3D Effects
2580         ----------------------------------------
2581         */
2582
2583        st.front = (window._css3d) ? function(dist, fade) {
2584            var r = fade === false ? {} : { opacity: 0 };
2585            r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + dist + 'px ) rotate(0.001deg)';
2586            return r;
2587        } : function(dist) {
2588            return _fade;
2589        };
2590
2591        st.back = (window._css3d) ? function(dist, fade) {
2592            var r = fade === false ? {} : { opacity: 0 };
2593            r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + -dist + 'px ) rotate(0.001deg)';
2594            return r;
2595        } : function(dist) {
2596            return _fade;
2597        };
2598
2599        st.rotatefront = (window._css3d) ? function(deg, dist, orig, fade) {
2600            var r = fade === false ? {} : { opacity: 0 };
2601            r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + dist + 'px ) rotate(' + (deg || 0.001) + 'deg)';
2602            if (orig) r[transform_orig_css] = orig;
2603            return r;
2604        } : function(deg, dist, orig, fade) {
2605            return _fade;
2606        };
2607
2608        st.rotateback = (window._css3d) ? function(deg, dist, orig, fade) {
2609            var r = fade === false ? {} : { opacity: 0 };
2610            r[transform_css] = 'perspective(2000px) translate3d(0 , 0 ,' + -dist + 'px ) rotate(' + (deg || 0.001) + 'deg)';
2611            if (orig) r[transform_orig_css] = orig;
2612            return r;
2613        } : function(deg, dist, orig, fade) {
2614            return _fade;
2615        };
2616
2617        st.rotate3dleft = (window._css3d) ? function(x, y, z, dist, orig, fade) {
2618            var r = st.left(dist, fade);
2619            r[transform_css] += (x ? ' rotateX(' + x + 'deg)' : ' ') + (y ? ' rotateY(' + y + 'deg)' : '') + (z ? ' rotateZ(' + z + 'deg)' : '');
2620            if (orig) r[transform_orig_css] = orig;
2621            return r;
2622
2623        } : function(x, y, z, dist, orig, fade) {
2624            return st.left(dist, fade);;
2625        };
2626
2627        st.rotate3dright = (window._css3d) ? function(x, y, z, dist, orig, fade) {
2628            var r = st.right(dist, fade);
2629            r[transform_css] += (x ? ' rotateX(' + x + 'deg)' : ' ') + (y ? ' rotateY(' + y + 'deg)' : '') + (z ? ' rotateZ(' + z + 'deg)' : '');
2630            if (orig) r[transform_orig_css] = orig;
2631            return r;
2632        } : function(x, y, z, dist, orig, fade) {
2633            return st.right(dist, fade);;
2634        };
2635
2636        st.rotate3dtop = (window._css3d) ? function(x, y, z, dist, orig, fade) {
2637            var r = st.top(dist, fade);
2638            r[transform_css] += (x ? ' rotateX(' + x + 'deg)' : ' ') + (y ? ' rotateY(' + y + 'deg)' : '') + (z ? ' rotateZ(' + z + 'deg)' : '');
2639            if (orig) r[transform_orig_css] = orig;
2640            return r;
2641        } : function(x, y, z, dist, orig, fade) {
2642            return st.top(dist, fade);;
2643        };
2644
2645        st.rotate3dbottom = (window._css3d) ? function(x, y, z, dist, orig, fade) {
2646            var r = st.bottom(dist, fade);
2647            r[transform_css] += (x ? ' rotateX(' + x + 'deg)' : ' ') + (y ? ' rotateY(' + y + 'deg)' : '') + (z ? ' rotateZ(' + z + 'deg)' : '');
2648            if (orig) r[transform_orig_css] = orig;
2649            return r;
2650        } : function(x, y, z, dist, orig, fade) {
2651            return st.bottom(dist, fade);
2652        };
2653
2654        st.rotate3dfront = (window._css3d) ? function(x, y, z, dist, orig, fade) {
2655            var r = st.front(dist, fade);
2656            r[transform_css] += (x ? ' rotateX(' + x + 'deg)' : ' ') + (y ? ' rotateY(' + y + 'deg)' : '') + (z ? ' rotateZ(' + z + 'deg)' : '');
2657            if (orig) r[transform_orig_css] = orig;
2658            return r;
2659        } : function(x, y, z, dist, orig, fade) {
2660            return st.front(dist, fade);
2661        };
2662
2663        st.rotate3dback = (window._css3d) ? function(x, y, z, dist, orig, fade) {
2664            var r = st.back(dist, fade);
2665            r[transform_css] += (x ? ' rotateX(' + x + 'deg)' : ' ') + (y ? ' rotateY(' + y + 'deg)' : '') + (z ? ' rotateZ(' + z + 'deg)' : '');
2666            if (orig) r[transform_orig_css] = orig;
2667            return r;
2668        } : function(x, y, z, dist, orig, fade) {
2669            return st.back(dist, fade);
2670        };
2671
2672        // transform effect
2673        st.t = (window._css3d) ? function(fade, tx, ty, tz, r, rx, ry, rz, scx, scy, skx, sky, ox, oy, oz) {
2674            var _r = fade === false ? {} : { opacity: 0 };
2675            var transform = 'perspective(2000px) ';
2676
2677            tx !== 'n' && (transform += 'translateX(' + tx * st.rf + 'px) ');
2678            ty !== 'n' && 
2678(transform += 'translateY(' + ty * st.rf + 'px) ');
2679            tz !== 'n' && (transform += 'translateZ(' + tz * st.rf + 'px) ');
2680            r !== 'n' && (transform += 'rotate(' + r + 'deg) ');
2681            rx !== 'n' && (transform += 'rotateX(' + rx + 'deg) ');
2682            ry !== 'n' && (transform += 'rotateY(' + ry + 'deg) ');
2683            rz !== 'n' && (transform += 'rotateZ(' + rz + 'deg) ');
2684            skx !== 'n' && (transform += 'skewX(' + skx + 'deg) ');
2685            sky !== 'n' && (transform += 'skewY(' + sky + 'deg) ');
2686            scx !== 'n' && (transform += 'scaleX(' + scx + ') ');
2687            scy !== 'n' && (transform += 'scaleY(' + scy + ')');
2688
2689            _r[transform_css] = transform;
2690
2691            var trans_origin = '';
2692
2693            trans_origin += (ox !== 'n' ? ox + '% ' : '50% ');
2694            trans_origin += (oy !== 'n' ? oy + '% ' : '50% ');
2695            trans_origin += (oz !== 'n' ? oz + 'px' : '');
2696
2697            _r[transform_orig_css] = trans_origin;
2698
2699            return _r;
2700
2701        } : function(fade, tx, ty, tz, r, rx, ry, rz, scx, scy, skx, sky, ox, oy, oz) {
2702
2703            var r = fade === false ? {} : { opacity: 0 };
2704            tx !== 'n' && (r.left = tx * st.rf + 'px');
2705            ty !== 'n' && (r.top = ty * st.rf + 'px');
2706            return r;
2707        }
2708    };
2709})(jQuery);
2710
2711/* ================== bin-debug/js/pro/layers/LayerElement.js =================== */
2712/**
2713 * Master Slider Layer Element
2714 * @author Averta
2715 * @package Master Slider jQuery
2716 */
2717
2718;
2719(function($) {
2720
2721    /**
2722     * master slider layer element constructor
2723     */
2724    window.MSLayerElement = function() {
2725
2726        // default layer start animation
2727        this.start_anim = {
2728            name: 'fade',
2729            duration: 1000,
2730            ease: 'linear',
2731            delay: 0
2732        };
2733
2734        // default layer end animation
2735        this.end_anim = {
2736            duration: 1000,
2737            ease: 'linear'
2738        };
2739
2740        // default layer type
2741        this.type = 'text'; // video , image
2742
2743        //this.swipe 		= true;
2744        this.resizable = true;
2745        this.minWidth = -1;
2746        this.isVisible = true;
2747
2748        // list of styles which should stores initial values and changes based on screen size for resizable layers
2749        this.__cssConfig = [
2750            'margin-top', 'padding-top',
2751            'margin-bottom', 'padding-left',
2752            'margin-right', 'padding-right',
2753            'margin-left', 'padding-bottom',
2754
2755
2756            'font-size', 'line-height',
2757            /*'height'		, */
2758            'width',
2759            'left', 'right',
2760            'top', 'bottom'
2761        ];
2762
2763        this.baseStyle = {};
2764    };
2765
2766    var p = MSLayerElement.prototype;
2767
2768    /*--------------------------------------------------*\
2769    	Public Methods
2770    \*--------------------------------------------------*/
2771
2772    /**
2773     * determine start animation for the layer
2774     * @param {Objec} anim
2775     */
2776    p.setStartAnim = function(anim) {
2777        $.extend(this.start_anim, anim);
2778        $.extend(this.start_anim, this._parseEff(this.start_anim.name));
2779        this.$element.css('visibility', 'hidden');
2780    };
2781
2782    /**
2783     * determine end/hide animation for the layer
2784     * @param {Object} anim
2785     */
2786    p.setEndAnim = function(anim) {
2787        $.extend(this.end_anim, anim);
2788    };
2789
2790    /**
2791     * create layer object from layer element
2792     */
2793    p.create = function() {
2794        this.$element.css('display', 'none');
2795
2796        // resizable layer
2797        this.resizable = this.$element.data('resize') !== false;
2798
2799        // fixed positioning
2800        this.fixed = this.$element.data('fixed') === true;
2801
2802        // hide under parameter
2803        if (this.$element.data('widthlimit') !== undefined) {
2804            this.minWidth = this.$element.data('widthlimit');
2805        }
2806
2807        if (!this.end_anim.name) {
2808            this.end_anim.name = this.start_anim.name;
2809        }
2810
2811        if (this.end_anim.time) {
2812            this.autoHide = true; //this.end_anim.delay = this.slide.delay * 1000 - this.end_anim.duration;
2813        }
2814
2815        // is this layer static?
2816        this.staticLayer = this.$element.data('position') === 'static';
2817        this.fixedLayer = this.$element.data('position') === 'fixed';
2818        this.layersCont = this.controller.$layers;
2819
2820
2821        // make it visible if it's static
2822        if (this.staticLayer) {
2823            this.$element.css('display', '')
2824                .css('visibility', '');
2825        }
2826
2827        // create action event
2828        // @since v1.7.2
2829        if (this.$element.data('action') !== undefined) {
2830            var slideController = this.slide.slider.slideController;
2831            this.$element.on(this.$element.data('action-event') || 'click', function(event) {
2832                slideController.runAction($(this).data('action'));
2833                event.preventDefault();
2834            }).addClass('ms-action-layer');
2835        }
2836
2837        $.extend(this.end_anim, this._parseEff(this.end_anim.name));
2838        this.slider = this.slide.slider;
2839
2840        // masked layer
2841        if (this.masked) {
2842            this.$mask = $('<div></div>').addClass('ms-layer-mask');
2843
2844            if (this.link) {
2845                this.link.wrap(this.$mask);
2846                this.$mask = this.link.parent();
2847            } else {
2848                this.$element.wrap(this.$mask);
2849                this.$mask = this.$element.parent();
2850            }
2851
2852            if (this.maskWidth) {
2853                this.$mask.width(this.maskWidth);
2854            }
2855
2856            if (this.maskHeight) {
2857                this.$mask.height(this.maskHeight);
2858
2859                // add height to css check
2860                if (this.__cssConfig.indexOf('height') === -1) {
2861                    this.__cssConfig.push('height');
2862                }
2863            }
2864        }
2865
2866        this.layerOrigin = this.$element.data('origin');
2867
2868        if (this.slide.slider.options.responsive) {
2869            var el = this.$element;
2870            this.origin = [el.data('phone-origin'), el.data('tablet-origin'), el.data('origin')];
2871            this.offsetX = [el.data('phone-offset-x'), el.data('tablet-offset-x'), el.data('offset-x')];
2872            this.offsetY = [el.data('phone-offset-y'), el.data('tablet-offset-y'), el.data('offset-y')];
2873            this.relativeScale = el.data('relative-size');
2874            this.hideOn = (el.data('hide-on') || '').split(',');
2875        } else {
2876            // new alignment method
2877            // @since v1.6.1
2878            var layerOrigin = this.layerOrigin;
2879
2880            if (layerOrigin) {
2881
2882                var vOrigin = layerOrigin.charAt(0),
2883                    hOrigin = layerOrigin.charAt(1),
2884                    offsetX = this.$element.data('offset-x'),
2885                    offsetY = this.$element.data('offset-y'),
2886                    layerEle = this.masked ? this.$mask[0] : this.$element[0];
2887
2888                if (offsetY === undefined) {
2889                    offsetY = 0;
2890                }
2891
2892                switch (vOrigin) {
2893                    case 't':
2894                        layerEle.style.top = offsetY + 'px';
2895                        break;
2896                    case 'b':
2897                        layerEle.style.bottom = offsetY + 'px';
2898                        break;
2899                    case 'm':
2900                        layerEle.style.top = offsetY + 'px';
2901                        this.middleAlign = true;
2902                }
2903
2904                if (offsetX === undefined) {
2905                    offsetX = 0;
2906                }
2907
2908
2909                switch (hOrigin) {
2910                    case 'l':
2911                        layerEle.style.left = offsetX + 'px';
2912                        break;
2913                    case 'r':
2914                        layerEle.style.right = offsetX + 'px';
2915                        break;
2916                    case 'c':
2917                        layerEle.style.left = offsetX + 'px';
2918                        this.centerAlign = true;
2919                }
2920            }
2921        }
2922
2923
2924        // parallax effect
2925        // @since v1.6.0
2926        this.parallax = this.$element.data('parallax')
2927        if (this.parallax != null) {
2928            this.parallax /= 100;
2929            this.$parallaxElement = $('<div></div>').addClass('ms-parallax-layer');
2930
2931            if (this.masked) {
2932                this.$mask.wrap(this.$parallaxElement);
2933                this.$parallaxElement = this.$mask.parent();
2934            } else if (this.link) { // only for image layer
2935                this.link.wrap(this.$parallaxElement);
2936                this.$parallaxElement = this.link.parent();
2937            } else {
2938                this.$element.wrap(this.$parallaxElement);
2939                this.$parallaxElement = this.$element.parent();
2940            }
2941
2942            this._lastParaX = 0;
2943            this._lastParaY = 0;
2944            this._paraX = 0;
2945            this._paraY = 0;
2946
2947
2948            // add bottom 0 to the parallax element if layer origin specified to the bottom
2949            this.alignedToBot = this.layerOrigin && this.layerOrigin.indexOf('b') !== -1;
2950
2951            if (this.alignedToBot) {
2952                this.$parallaxElement.css('bottom', 0);
2953            }
2954
2955            if (window._css3d) {
2956                this.parallaxRender = this._parallaxCSS3DRenderer;
2957            } else if (window._css2d) {
2958                this.parallaxRender = this._parallaxCSS2DRenderer;
2959            } else {
2960                this.parallaxRender = this._parallax2DRenderer;
2961            }
2962
2963            if (this.slider.options.parallaxMode !== 'swipe') { // mouse mode
2964                averta.Ticker.add(this.parallaxRender, this);
2965            }
2966        }
2967
2968        // remove all data- attributes excluding data-src
2969        $.removeDataAttrs(this.$element, ['data-src']);
2970    };
2971
2972    /**
2973     * initialize layer
2974     */
2975    p.init = function() {
2976        //if(this.initialized) return;
2977        this.initialized = true;
2978
2979        var value;
2980
2981        this.$element.css('visibility', '');
2982        // store initial layer styles
2983        for (var i = 0, l = this.__cssConfig.length; i < l; i++) {
2984            var key = this.__cssConfig[i];
2985            if (this._isPosition(key) && this.masked) {
2986                value = this.$mask.css(key);
2987            }
2987 else if (this.type === 'text' && key === 'width' && !this.masked && !this.maskWidth) { // in some browsers using computed style for width in text layer causes unexpected word wrapping
2988                value = this.$element[0].style.width;
2989            } else {
2990
2991                value = this.$element.css(key);
2992                var isSize = key === 'width' || key === 'height';
2993
2994                if (isSize && this.masked) {
2995                    if (this.maskWidth && key === 'width') {
2996                        value = this.maskWidth + 'px';
2997                    } else if (this.maskHeight && key === 'height') {
2998                        value = this.maskHeight + 'px';
2999                    }
3000                }
3001
3002                // fix for Google Chrome in ios, sometimes image layers over first slide not showing correctly.
3003                if (isSize && value === '0px') {
3004                    value = this.$element.data(key) + 'px';
3005                }
3006            }
3007
3008            // skip unnecessary positioning styles
3009            if (this.layerOrigin && (
3010                    (key === 'top' && this.layerOrigin.indexOf('t') === -1 && this.layerOrigin.indexOf('m') === -1) ||
3011                    (key === 'bottom' && this.layerOrigin.indexOf('b') === -1) ||
3012                    (key === 'left' && this.layerOrigin.indexOf('l') === -1 && this.layerOrigin.indexOf('c') === -1) ||
3013                    (key === 'right' && this.layerOrigin.indexOf('r') === -1))) {
3014                continue;
3015            }
3016
3017            if (value != 'auto' && value != "" && value != "normal") {
3018                this.baseStyle[key] = parseInt(value);
3019            }
3020        }
3021
3022        // @since v1.6.0
3023        if (this.middleAlign) {
3024            this.baseHeight = this.$element.outerHeight(false); //this.$element.height();
3025        }
3026
3027        if (this.centerAlign) {
3028            // in some browsers using computed style for width in text layer causes unexpected word wrapping
3029            //if ( this.type === 'text' ){
3030            //  this.baseWidth = parseInt(this.$element[0].style.width);
3031            //} else {
3032            this.baseWidth = this.$element.outerWidth(false);
3033            //}
3034        }
3035
3036    };
3037
3038    /**
3039     * Updates the layer position based on current breakpoint
3040     */
3041    p.updatePosition = function() {
3042        var bp = this.slide.slider.getActiveBreakpoint();
3043        if (this.lastBp !== bp) {
3044            this.lastBp = bp;
3045            this.layerOrigin = this.slide.slider.getResponsiveValue(this.origin);
3046
3047            if (this.layerOrigin) {
3048
3049                var vOrigin = this.layerOrigin.charAt(0),
3050                    hOrigin = this.layerOrigin.charAt(1),
3051                    offsetX = this.slide.slider.getResponsiveValue(this.offsetX),
3052                    offsetY = this.slide.slider.getResponsiveValue(this.offsetY),
3053                    layerEle = this.masked ? this.$mask[0] : this.$element[0];
3054
3055                this.middleAlign = false;
3056                this.centerAlign = false;
3057                this.baseStyle.top = undefined;
3058                this.baseStyle.left = undefined;
3059                this.baseStyle.right = undefined;
3060                this.baseStyle.bottom = undefined;
3061                layerEle.style.top = '';
3062                layerEle.style.left = '';
3063                layerEle.style.right = '';
3064                layerEle.style.bottom = '';
3065
3066                if (offsetY === undefined) {
3067                    offsetY = 0;
3068                }
3069
3070
3071                switch (vOrigin) {
3072                    case 't':
3073                        layerEle.style.top = offsetY + 'px';
3074                        this.baseStyle.top = offsetY;
3075                        break;
3076                    case 'b':
3077                        layerEle.style.bottom = offsetY + 'px';
3078                        this.baseStyle.bottom = offsetY;
3079                        break;
3080                    case 'm':
3081                        layerEle.style.top = offsetY + 'px';
3082                        this.baseStyle.top = offsetY;
3083                        this.middleAlign = true;
3084                }
3085
3086
3087                if (offsetX === undefined) {
3088                    offsetX = 0;
3089                }
3090
3091
3092                switch (hOrigin) {
3093                    case 'l':
3094                        layerEle.style.left = offsetX + 'px';
3095                        this.baseStyle.left = offsetX;
3096                        break;
3097                    case 'r':
3098                        layerEle.style.right = offsetX + 'px';
3099                        this.baseStyle.right = offsetX;
3100                        break;
3101                    case 'c':
3102                        layerEle.style.left = offsetX + 'px';
3103                        this.baseStyle.left = offsetX;
3104                        this.centerAlign = true;
3105                }
3106            }
3107
3108        }
3109    };
3110
3111    /**
3112     * locate layer over slider
3113     */
3114    p.locate = function() {
3115
3116        // is slide ready?
3117        if (!this.slide.ready || !this.initialized) {
3118            return;
3119        }
3120
3121        if (this.slide.slider.options.responsive) {
3122            this.updatePosition();
3123        }
3124
3125        var width = parseFloat(this.layersCont.css('width')),
3126            height = parseFloat(this.layersCont.css('height')),
3127            factor, isPosition, isSize;
3128
3129        if (!this.staticLayer && this.$element.css('display') === 'none' && this.isVisible) {
3130            this.$element.css('display', '')
3131                .css('visibility', 'hidden');
3132        }
3133
3134        if (this.staticLayer) {
3135            this.$element.addClass('ms-hover-active');
3136        }
3137
3138        if (this.slide.slider.options.responsive && this.relativeScale) {
3139            factor = this.resizeFactor = width / this.slide.slider.getBreakp
3139ointReferenceSize() // this.slide.slider.options.width;
3140        } else {
3141            factor = this.resizeFactor = width / this.slide.slider.options.width;
3142        }
3143
3144        var $layerEle = this.masked ? this.$mask : this.$element;
3145
3146        // updated @since v1.6.1
3147        for (var key in this.baseStyle) {
3148
3149            isPosition = this._isPosition(key);
3150            isSize = key === 'width' || key === 'height';
3151
3152            //switch resize/position factor
3153            if (this.fixed && isPosition) {
3154                factor = 1;
3155            } else {
3156                factor = this.resizeFactor;
3157            }
3158
3159            if ((!this.resizable && !isPosition) || this.baseStyle[key] === undefined) {
3160                continue;
3161            }
3162
3163            if (key === 'top' && this.middleAlign) {
3164                $layerEle[0].style.top = '0px';
3165                this.baseHeight = $layerEle.outerHeight(false);
3166                $layerEle[0].style.top = this.baseStyle['top'] * factor + (height - this.baseHeight) / 2 + 'px';
3167            } else if (key === 'left' && this.centerAlign) {
3168                $layerEle[0].style.left = '0px';
3169                this.baseWidth = $layerEle.outerWidth(false);
3170                $layerEle[0].style.left = this.baseStyle['left'] * factor + (width - this.baseWidth) / 2 + 'px';
3171            } else if (isPosition && this.masked) {
3172                $layerEle[0].style[key] = this.baseStyle[key] * factor + 'px';
3173            } else if (isSize && ((key === 'width' && this.maskWidth) || (key === 'height' && this.maskHeight))) {
3174                $layerEle[0].style[key] = this.baseStyle[key] * factor + 'px';
3175            } else {
3176                this.$element.css(key, this.baseStyle[key] * factor + 'px');
3177            }
3178        }
3179
3180
3181        this.visible(this.minWidth < width);
3182        if (this.minWidth < width && this.slide.slider.options.responsive) {
3183            this.visible(this.hideOn.indexOf(this.slide.slider.getActiveBreakpoint()) === -1);
3184        }
3185    };
3186
3187    /**
3188     * start layer animation
3189     */
3190    p.start = function() {
3191
3192        // is it already showing or is it a static layer?
3193        if (this.isShowing || this.staticLayer) {
3194            return;
3195        }
3196
3197        this.isShowing = true;
3198        this.$element.removeClass('ms-hover-active');
3199
3200        var key, base;
3201
3202        // reads css value form LayerEffects
3203        MSLayerEffects.rf = this.resizeFactor;
3204        var effect_css = MSLayerEffects[this.start_anim.eff_name].apply(null, this._parseEffParams(this.start_anim.eff_params));
3205
3206        // checkes effect css and defines TO css values
3207        var start_css_eff = {};
3208
3209        // set from position
3210        for (key in effect_css) {
3211
3212            // check the position key (top, left, right or bottom) for animatin
3213            // It mostly will be used in old browsers
3214            // In effect left:100, layer base style right:300 -> effect changes to right:100
3215            if (this._checkPosKey(key, effect_css)) {
3216                continue;
3217            }
3218
3219            // set default value from Layer Effects Class
3220            if (MSLayerEffects.defaultValues[key] != null) {
3221                start_css_eff[key] = MSLayerEffects.defaultValues[key];
3222            }
3223
3224            if (key in this.baseStyle) {
3225                base = this.baseStyle[key];
3226
3227                // updated @since v1.6.1
3228                if (this.middleAlign && key === 'top') {
3229                    base += (parseInt(this.layersCont.height()) - this.$element.outerHeight(false)) / 2;
3230                }
3231
3232                if (this.centerAlign && key === 'left') {
3233                    base += (parseInt(this.layersCont.width()) - this.$element.outerWidth(false)) / 2;
3234                }
3235                //----------------------
3236
3237                effect_css[key] = base + parseFloat(effect_css[key]) + 'px';
3238                start_css_eff[key] = base + 'px';
3239            }
3240
3241            this.$element.css(key, effect_css[key]);
3242        }
3243
3244        var that = this;
3245
3246        clearTimeout(this.to);
3247        clearTimeout(this.clHide);
3248        this.to = setTimeout(function() {
3249            //that.locate();
3250            that.$element.css('visibility', '');
3251            that._playAnimation(that.start_anim, start_css_eff);
3252        }, that.start_anim.delay || 0.01);
3253
3254
3255        this.clTo = setTimeout(function() {
3256            that.show_cl = true;
3257            that.$element.addClass('ms-hover-active');
3258        }, (this.start_anim.delay || 0.01) + this.start_anim.duration + 1);
3259
3260        if (this.autoHide) {
3261            clearTimeout(this.hto);
3262            this.hto = setTimeout(function() { that.hide(); }, that.end_anim.time);
3263        }
3264
3265    };
3266
3267    /**
3268     * starts hide animation
3269     */
3270    p.hide = function() {
3271
3272        // static layers doesn't support animations
3273        if (this.staticLayer) {
3274            return;
3275        }
3276
3277        this.$element.removeClass('ms-hover-active');
3278
3279        this.isShowing = false;
3280
3281        // reads css value form LayerEffects
3282        var effect_css = MSLayerEffects[this.end_anim.eff_name].apply(null, this._parseEffParams(this.end_anim.eff_params));
3283
3284        for (key in effect_css) {
3285
3286            if (this._checkPosKey(key, effect_css)) continue;
3287
3288            if (key === window._jcsspfx + 'TransformOrigin') {
3289                this.$element.css(key, effect_css[key]);
3290            }
3291
3292            if (key in this.baseStyle) {
3293                effect_css[key] = this.baseStyle[key] + parseFloat(effect_css[key]) + 'px';
3294            }
3295
3296        }
3297
3298        this._playAnimation(this.end_anim, effect_css);
3299
3300        clearTimeout(this.clHide);
3301
3302        if (effect_css.opacity === 0) {
3303            this.clHide = setTimeout(function() { this.$element.css('visibility', 'hidden'); }.bind(this), this.end_anim.duration + 1);
3304        }
3305
3306        clearTimeout(this.to);
3307        clearTimeout(this.hto);
3308        clearTimeout(this.clTo);
3309    };
3310
3311    /**
3312     * reset layer
3313     */
3314    p.reset = function() {
3315        if (this.staticLayer) {
3316            return;
3317        }
3318
3319        this.isShowing = false;
3320        //this.$element.css(window._csspfx + 'animation-name', ''	);
3321        this.$element[0].style.display = 'none';
3322        this.$element.css('opacity', '');
3323        this.$element[0].style['transitionDuration'] = '';
3324
3325        if (this.show_tween)
3326            this.show_tween.stop(true);
3327
3328        clearTimeout(this.to);
3329        clearTimeout(this.hto);
3330    };
3331
3332    /**
3333     * destroy layer
3334     */
3335    p.destroy = function() {
3336        this.reset();
3337        this.$element.remove();
3338    };
3339
3340    /**
3341     * change the visibility status
3342     * @param  {Boolean} value
3343     */
3344    p.visible = function(value) {
3345        if (this.isVisible == value) return;
3346
3347        this.isVisible = value;
3348
3349        this.$element.css('display', (value ? '' : 'none'));
3350    };
3351
3352    /**
3353     * Change the detestation of parallax position
3354     * @param  {Number} x
3355     * @param  {Number} y
3356     * @since  1.6.0
3357     */
3358    p.moveParallax = function(x, y, fast) {
3359        this._paraX = x;
3360        this._paraY = y;
3361        if (fast) {
3362            this._lastParaX = x;
3363            this._lastParaY = y;
3364            this.parallaxRender();
3365        }
3366    };
3367
3368    /*------------------------------------*\
3369    	Private Methods
3370    \*------------------------------------*/
3371
3372    /**
3373     * play layer animation
3374     * @param  {Obeject} animation layer animation object
3375     * @param  {Object} css       animation css object
3376     */
3377    p._playAnimation = function(animation, css) {
3378        var options = {};
3379
3380        if (animation.ease) {
3381            options.ease = animation.ease;
3382        }
3383
3384        options.transProperty = window._csspfx + 'transform,opacity';
3385
3386        if (this.show_tween) {
3387            this.show_tween.stop(true);
3388        }
3389
3390        this.show_tween = CTween.animate(this.$element, animation.duration, css, options);
3391    };
3392
3393    /**
3394     * generate random value
3395     * @param  {String} value the pattern value min|max
3396     * @return {Number}
3397     */
3398    p._randomParam = function(value) {
3399        var min = Number(value.slice(0, value.indexOf('|')));
3400        var max = Number(value.slice(value.indexOf('|') + 1));
3401
3402        return min + Math.random() * (max - min);
3403    };
3404
3405    /**
3406     * parse effect function
3407     * @param  {String} eff_name effect function
3408     * @return {Object}
3409     */
3410    p._parseEff = function(eff_name) {
3411
3412        var eff_params = [];
3413
3414        if (eff_name.indexOf('(') !== -1) {
3415            var temp = eff_name.slice(0, eff_name.indexOf('(')).toLowerCase();
3416            var value;
3417
3418            eff_params = eff_name.slice(eff_name.indexOf('(') + 1, -1).replace(/\"|\'|\s/g, '').split(',');
3419            eff_name = temp;
3420
3421            for (var i = 0, l = eff_params.length; i < l; ++i) {
3422                value = eff_params[i];
3423
3424                if (value in MSLayerEffects.presetEffParams) {
3425                    value = MSLayerEffects.presetEffParams[value];
3426                }
3427
3428                eff_params[i] = value;
3429            }
3430        }
3431
3432        return { eff_name: eff_name, eff_params: eff_params };
3433    };
3434
3435    /**
3436     * parse effect function parameters
3437     * @param  {Aarray} params effect parameters
3438     * @return {Array}
3439     */
3440    p._parseEffParams = function(params) {
3441        var eff_params = [];
3442        for (var i = 0, l = params.length; i < l; ++i) {
3443            var value = params[i];
3444            if (typeof value === 'string' && value.indexOf('|') !== -1) value = this._randomParam(value);
3445
3446            eff_params[i] = value;
3447        }
3448
3449        return eff_params;
3450    };
3451
3452    /**
3453     * calculates layer position based on initial positioning style and layer effect
3454     * @param  {string} key   positioning key
3455     * @param  {Object} style style object
3456     * @return {Boolean}
3457     */
3458    p._checkPosKey = function(key, style) {
3459        if (key === 'left' && !(key in this.baseStyle) && 'right' in this.baseStyle) {
3460            style.right = -parseInt(style.left) + 'px';
3461            delete style.left;
3462            return true;
3463        }
3464
3465        if (key === 'top' && !(key in this.baseStyle) && 'bottom' in this.baseStyle) {
3466            style.bottom = -parseInt(style.top) + 'px';
3467            delete style.top;
3468            return true;
3469        }
3470
3471        return false;
3472    };
3473
3474    /**
3475     * checks for position key
3476     * @param  {String}  key
3477     * @return {Boolean}     [description]
3478     */
3479    p._isPosition = function(key) {
3480        return key === 'top' || key === 'left' || key === 'bottom' || key === 'right';
3481    };
3482
3483    /**
3484     * calculate parallax position
3485     */
3486    p._parallaxCalc = function() {
3487        var x_def = this._paraX - this._lastParaX,
3488            y_def = this._paraY - this._lastParaY;
3489
3490        this._lastParaX += x_def / 12;
3491        this._lastParaY += y_def / 12;
3492
3493        if (Math.abs(x_def) < 0.019) {
3494            this._lastParaX = this._paraX;
3495        }
3496
3497        if (Math.abs(y_def) < 0.019) {
3498            this._lastParaY = this._paraY;
3499        }
3500
3501    }
3502
3503    /**
3504     * Parallax move ticker function
3505     */
3506    p._parallaxCSS3DRenderer = function() {
3507        this._parallaxCalc();
3508        this.$parallaxElement[0].style[window._jcsspfx + 'Transform'] = 'translateX(' + this._lastParaX * this.parallax + 'px) translateY(' + this._lastParaY * this.parallax + 'px) translateZ(0)';
3509    };
3510
3511    /**
3512     * parallax move ticker for CSS2 browsers
3513     * @return {[type]} [description]
3514     */
3515    p._parallaxCSS2DRenderer = function() {
3516        this._parallaxCalc();
3517        this.$parallaxElement[0].style[window._jcsspfx + 'Transform'] = 'translateX(' + this._lastParaX * this.parallax + 'px) translateY(' + this._lastParaY * this.parallax + 'px)';
3518    };
3519
3520    /**
3521     * parallax move ticker for zombie browsers
3522     */
3523    p._parallax2DRenderer = function() {
3524        this._parallaxCalc();
3525
3526        // change bottom instead of top if layer aligned to the bottom (origin)
3527        if (this.alignedToBot) {
3528            this.$parallaxElement[0].style.bottom = this._lastParaY * this.parallax + 'px';
3529        } else {
3530            this.$parallaxElement[0].style.top = this._lastParaY * this.parallax + 'px';
3531        }
3532
3533        this.$parallaxElement[0].style.left = this._lastParaX * this.parallax + 'px';
3534    };
3535
3536})(jQuery);
3537
3538/* ================== bin-debug/js/pro/layers/ImageLayerElement.js =================== */
3539;
3540(function($) {
3541
3542    window.MSImageLayerElement = function() {
3543        MSLayerElement.call(this);
3544        this.needPreload = true;
3545
3546        this.__cssConfig = [
3547            'width', 'height',
3548            'margin-top', 'padding-top',
3549            'margin-bottom', 'padding-left',
3550            'margin-right', 'padding-right',
3551            'margin-left', 'padding-bottom',
3552
3553            'left', 'right',
3554            'top', 'bottom'
3555        ];
3556
3557        this.type = 'image';
3558    };
3559
3560    MSImageLayerElement.extend(MSLayerElement);
3561
3562    var p = MSImageLayerElement.prototype;
3563    var _super = MSLayerElement.prototype;
3564
3565    /*-------------- METHODS --------------*/
3566
3567    p.create = function() {
3568
3569        if (this.link) {
3570            var p = this.$element.parent();
3571            p.append(this.link);
3572            this.link.append(this.$element);
3573            this.link.removeClass('ms-layer');
3574            this.$element.addClass('ms-layer');
3575            p = null;
3576        }
3577
3578        _super.create.call(this);
3579
3580        if (this.$element.data('src') != undefined) {
3581            this.img_src = this.$element.data('src');
3582            this.$element.removeAttr('data-src');
3583        } else {
3584            var that = this;
3585            this.$element.on('load', function(event) {
3586                that.controller.preloadCount--;
3587                if (that.controller.preloadCount === 0)
3588                    that.controller._onlayersReady();
3589            }).each($.jqLoadFix);
3590        }
3591
3592        if (window.MSBrowserInfo.msie)
3593            this.$element.on('dragstart', function(event) { event.preventDefault(); }); // disable native dragging
3594    };
3595
3596    p.loadImage = function() {
3597        var that = this;
3598
3599        this.$element.preloadImg(this.img_src, function(event) {
3600            //this.$element.width(event.width).height(event.height);
3601            that.controller.preloadCount--;
3602            if (that.controller.preloadCount === 0) that.controller._onlayersReady();
3603        });
3604    };
3605
3606})(jQuery);
3607
3608/* ================== bin-debug/js/pro/layers/VideoLayerElement.js =================== */
3609;
3610(function($) {
3611
3612    window.MSVideoLayerElement = function() {
3613        MSLayerElement.call(this);
3614
3615        this.__cssConfig.push(
3616            'height'
3617        );
3618
3619        this.type = 'video';
3620    };
3621
3622    MSVideoLayerElement.extend(MSLayerElement);
3623
3624    var p = MSVideoLayerElement.prototype;
3625    var _super = MSLayerElement.prototype;
3626
3627    /*-------------- METHODS --------------*/
3628    p.__playVideo = function() {
3629        if (this.img) CTween.fadeOut(this.img, 500, 2);
3630        CTween.fadeOut(this.video_btn, 500, 2);
3631        this.video_frame.attr('src', 'about:blank').css('display', 'block');
3632        if (this.video_url.indexOf('?') == -1) this.video_url += '?';
3633        this.video_frame.attr('src', this.video_url + '&autoplay=1');
3634    };
3635
3636    p.start = function() {
3637        _super.start.call(this);
3638
3639        if (this.$element.data('autoplay')) {
3640            this.__playVideo();
3641        }
3642    };
3643
3644    p.reset = function() {
3645        _super.reset.call(this);
3646
3647        if (this.needPreload || this.$element.data('btn')) {
3648            this.video_btn.css('opacity', 1).css('display', 'block');
3649            this.video_frame.attr('src', 'about:blank').css('display', 'none');
3650        }
3651
3652        if (this.needPreload) {
3653            this.img.css('opacity', 1).css('display', 'block');
3654            return;
3655        }
3656
3657        this.video_frame.attr('src', this.video_url);
3658    };
3659
3660    p.create = function() {
3661        _super.create.call(this);
3662
3663        this.video_frame = this.$element.find('iframe').css({ width: '100%', height: '100%' });
3664        this.video_url = this.video_frame.attr('src');
3665
3666        var has_img = this.$element.has('img').length != 0;
3667
3668        if (!has_img && !this.$element.data('btn')) return;
3669
3670        this.video_frame.attr('src', 'about:blank').css('display', 'none');
3671
3672        var that = this;
3673
3674        this.video_btn = $('<div></div>').appendTo(this.$element).addClass('ms-video-btn').click(function() {
3675            that.__playVideo();
3676        });
3677
3678        //this.video_frame.attr('src' , 'about:blank');
3679
3680        if (!has_img) return;
3681
3682        this.needPreload = true;
3683        this.img = this.$element.find('img:first').addClass('ms-video-img');
3684
3685        if (this.img.data('src') !== undefined) {
3686            this.img_src = this.img.data('src');
3687            this.img.removeAttr('data-src');
3688        } else {
3689            var that = this;
3690            this.img.attr('src', this.img_src).on('load', function(event) {
3691                that.controller.preloadCount--;
3692                if (that.controller.preloadCount === 0)
3693                    that.controller._onlayersReady();
3694            }).each($.jqLoadFix);
3695        }
3696
3697        if (window.MSBrowserInfo.msie)
3698            this.img.on('dragstart', function(event) { event.preventDefault(); }); // disables native dragging
3699    };
3700
3701    p.loadImage = function() {
3702        var that = this;
3703        this.img.preloadImg(this.img_src, function(event) {
3704            that.controller.preloadCount--;
3705            if (that.controller.preloadCount === 0) that.controller._onlayersReady();
3706        });
3707    };
3708
3709})(jQuery);
3710
3711/* ================== bin-debug/js/pro/layers/HotspotLayer.js =================== */
3712;
3713(function($) {
3714
3715    "use strict";
3716
3717    window.MSHotspotLayer = function() {
3718        MSLayerElement.call(this);
3719
3720        this.__cssConfig = [
3721            'margin-top', 'padding-top',
3722            'margin-bottom', 'padding-left',
3723            'margin-right', 'padding-right',
3724            'margin-left', 'padding-bottom',
3725
3726            'left', 'right',
3727            'top', 'bottom'
3728        ];
3729
3730
3731        this.ease = 'Expo';
3732        this.hide_start = true;
3733        this.type = 'hotspot';
3734    };
3735
3736    MSHotspotLayer.extend(MSLayerElement);
3737
3738    var p = MSHotspotLayer.prototype;
3739    var _super = MSLayerElement.prototype;
3740
3741    /*-------------- METHODS --------------*/
3742
3743    p._showTT = function() {
3744        if (!this.show_cl) return;
3745
3746        clearTimeout(this.hto);
3747        if (this._tween) this._tween.stop(true);
3748
3749        if (this.hide_start) {
3750            this.align = this._orgAlign;
3751            this._locateTT();
3752
3753            this.tt.css({ display: 'block' });
3754            this._tween = CTween.animate(this.tt, 900, this.to, { ease: 'easeOut' + this.ease });
3755            this.hide_start = false;
3756        }
3757
3758    };
3759
3760    p._hideTT = function() {
3761        if (!this.show_cl) return;
3762        if (this._tween) this._tween.stop(true);
3763
3764        var that = this;
3765
3766        clearTimeout(this.hto);
3767        this.hto = setTimeout(function() {
3768            that.hide_start = true;
3769            that._tween = CTween.animate(that.tt, 900, that.from, { ease: 'easeOut' + that.ease, complete: function() { that.tt.css('display', 'none'); } });
3770        }, 200);
3771    };
3772
3773    p._updateClassName = function(name) {
3774        if (this._lastClass) this.tt.removeClass(this._lastClass);
3775        this.tt.addClass(name);
3776        this._lastClass = name;
3777    }
3778
3779    p._alignPolicy = function() {
3780        var h = this.tt.outerHeight(false),
3781            w = Math.max(this.tt.outerWidth(false), parseInt(this.tt.css('max-width'))),
3782            ww = window.innerWidth,
3783            wh = window.innerHeight;
3784
3785        switch (this.align) {
3786            case 'top':
3787                if (this.base_t < 0)
3788                    return 'bottom';
3789                break;
3790            case 'right':
3791                if (this.base_l + w > ww || this.base_t < 0)
3792                    return 'bottom';
3793                break;
3794            case 'left':
3795                if (this.base_l < 0 || this.base_t < 0)
3796                    return 'bottom';
3797                break;
3798        }
3799
3800        return null;
3801    };
3802
3803    p._locateTT = function() {
3804        var os = this.$element.offset(),
3805            os2 = this.slide.slider.$element.offset();
3806
3807        var dist = 50,
3808            space = 15 //* this.factor;
3809
3810        this.pos_x = os.left - os2.left - this.slide.slider.$element.scrollLeft();
3811        this.pos_y = os.top - os2.top - this.slide.slider.$element.scrollTop();
3812
3813        this.from = { opacity: 0 };
3814        this.to = { opacity: 1 };
3815
3816        this._updateClassName('ms-tooltip-' + this.align);
3817        this.tt_arrow.css('margin-left', '');
3818
3819        var arrow_w = 15, //parseInt(this.tt_arrow.css('border-left')) + parseInt(this.tt_arrow.css('border-right')),
3820            arrow_h = 15; //parseInt(this.tt_arrow.css('border-top'))  + parseInt(this.tt_arrow.css('border-bottom'));
3821
3822        //console.log(arrow_h,arrow_w);
3823        //
3824        switch (this.align) {
3825            case 'top':
3826                var w = Math.min(this.tt.outerWidth(false), parseInt(this.tt.css('max-width')));
3827                this.base_t = this.pos_y - this.tt.outerHeight(false) - arrow_h - space;
3828                this.base_l = this.pos_x - w / 2;
3829
3830                if (this.base_l + w > window.innerWidth) {
3831                    this.tt_arrow.css('margin-left', -arrow_w / 2 + this.base_l + w - window.innerWidth + 'px');
3832                    this.base_l = window.innerWidth - w;
3833                }
3834
3835                if (this.base_l < 0) {
3836                    this.base_l = 0;
3837                    this.tt_arrow.css('margin-left', -arrow_w / 2 + this.pos_x - this.tt.outerWidth(false) / 2 + 'px');
3838                }
3839
3840                if (window._css3d) {
3841                    this.from[window._jcsspfx + 'Transform'] = 'translateY(-' + dist + 'px)';
3842                    this.to[window._jcsspfx + 'Transform'] = '';
3843                } else {
3844                    this.from.top = (this.base_t - dist) + 'px';
3845                    this.to.top = this.base_t + 'px';
3846                }
3847
3848                break;
3849            case 'bottom':
3850                var w = Math.min(this.tt.outerWidth(false), parseInt(this.tt.css('max-width')));
3851
3852                this.base_t = this.pos_y + arrow_h + space;
3853                this.base_l = this.pos_x - w / 2;
3854
3855                if (this.base_l + w > window.innerWidth) {
3856                    this.tt_arrow.css('margin-left', -arrow_w / 2 + this.base_l + w - window.innerWidth + 'px');
3857                    this.base_l = window.innerWidth - w;
3858                }
3859
3860                if (this.base_l < 0) {
3861                    this.base_l = 0;
3862                    this.tt_arrow.css('margin-left', -arrow_w / 2 + this.pos_x - this.tt.outerWidth(false) / 2 + 'px');
3863                }
3864
3865                if (window._css3d) {
3866                    this.from[window._jcsspfx + 'Transform'] = 'translateY(' + dist + 'px)';
3867                    this.to[window._jcsspfx + 'Transform'] = '';
3868                } else {
3869                    this.from.top = (this.base_t + dist) + 'px';
3870                    this.to.top = this.base_t + 'px';
3871                }
3872
3873                break;
3874
3875            case 'right':
3876                this.base_l = this.pos_x + arrow_w + space;
3877                this.base_t = this.pos_y - this.tt.outerHeight(false) / 2;
3878
3879                if (window._css3d) {
3880                    this.from[window._jcsspfx + 'Transform'] = 'translateX(' + dist + 'px)';
3881                    this.to[window._jcsspfx + 'Transform'] = '';
3882                } else {
3883                    this.from.left = (this.base_l + dist) + 'px';
3884                    this.to.left = this.base_l + 'px';
3885                }
3886
3887                break;
3888            case 'left':
3889                this.base_l = this.pos_x - arrow_w - this.tt.outerWidth(false) - space;
3890                this.base_t = this.pos_y - this.tt.outerHeight(false) / 2;
3891
3892                if (window._css3d) {
3893                    this.from[window._jcsspfx + 'Transform'] = 'translateX(-' + dist + 'px)';
3894                    this.to[window._jcsspfx + 'Transform'] = '';
3895                } else {
3896                    this.from.left = (this.base_l - dist) + 'px';
3897                    this.to.left = this.base_l + 'px';
3898                }
3899
3900                break;
3901        }
3902
3903
3904
3905        var policyAlign = this._alignPolicy();
3906        if (policyAlign !== null) {
3907            this.align = policyAlign;
3908            this._locateTT();
3909            return;
3910        }
3911
3912        this.tt.css('top', parseInt(this.base_t) + 'px').
3913        css('left', parseInt(this.base_l) + 'px');
3914
3915        this.tt.css(this.from);
3916
3917    };
3918
3919    p.start = function() {
3920        _super.start.call(this);
3921        this.tt.appendTo(this.slide.slider.$element);
3922        //this._locateTT();
3923        this.tt.css('display', 'none');
3924    };
3925
3926    p.reset = function() {
3927        _super.reset.call(this);
3928        this.tt.detach();
3929    };
3930
3931    /**
3932     * locate hotspot over slide
3933     * @override LayerElement.locate
3934     * @since 2.2.0
3935     */
3936    /*	p.locate = function(){
3937    		_super.locate.call(this);
3938
3939    		if ( this.relativeToBG ) {
3940    			console.log(this.baseOffsetX , this.slide.$bg_img.width()  , this.slide.bgWidth)
3941    			this.$element[0].style.left = this.baseOffsetX * this.slide.$bg_img.width()  / this.slide.bgWidth + 'px';
3942    			this.$element[0].style.top  = this.baseOffsetY * this.slide.$bg_img.height() / this.slide.bgHeight + 'px';
3943    		} 
3944
3945    	};
3946    */
3947    p.create = function() {
3948        var that = this;
3949
3950        //@since 2.2.0
3951        //chnage offset progin to top left
3952        /*	this.relativeToBG = this.$element.data('relative') && (this.slide.fillMode === 'fill' || this.slide.fillMode === 'fit');
3953        	if ( this.relativeToBG ) {
3954
3955        		var origin = this.$element.data('origin'),
3956        			osy = this.$element.data('offset-y'), 
3957        			osx = this.$element.data('offset-x');
3958
3959        		if ( origin ) {
3960        			if ( origin.charAt(0) === 'b' ){
3961        				osy = this.slide.slider.options.height - this.$element.data('offset-y');
3962        				this.$element.data('offset-y',  osy);
3963        			}
3964
3965        			if ( origin.charAt(1) === 'r' ){
3966        				osx = this.slide.slider.options.width - this.$element.data('offset-x');
3967        				this.$element.data('offset-x', osx);
3968        			}
3969
3970        		}
3971
3972        		this.$element.data('origin', 'tl');
3973
3974        		this.baseOffsetX = osx;
3975        		this.baseOffsetY = osy;
3976        	}*/
3977
3978
3979        this._orgAlign = this.align = this.$element.data('align') !== undefined ? this.$element.data('align') : 'top';
3980
3981        this.data = this.$element.html();
3982
3983        this.$element.html('').on('mouseenter', function() { that._showTT(); }).on('mouseleave', function() { that._hideTT(); });
3984
3985        this.point = $('<div><div class="ms-point-center"></div><div class="ms-point-border"></div></div>')
3986            .addClass('ms-tooltip-point')
3987            .appendTo(this.$element);
3988
3989        var link = this.$element.data('link'),
3990            target = this.$element.data('target');
3991
3992        if (link) {
3993            this.point.on('click', function() { window.open(link, target || '_self'); });
3994        }
3995
3996        this.tt = $('<div></div>')
3997            .addClass('ms-tooltip')
3998            //.addClass('ms-tooltip-'+this.align)
3999            .css('display', 'hidden')
4000            .css('opacity', 0);
4001
4002        // @since v1.6.1
4003        if (this.$element.data('width') !== undefined) {
4004            this.tt.css('width', this.$element.data('width'))
4005                .css('max-width', this.$element.data('width'));
4006        }
4007
4008        this.tt_arrow = $('<div></div>')
4009            .addClass('ms-tooltip-arrow')
4010            .appendTo(this.tt);
4011
4012        this._updateClassName('ms-tooltip-' + this.align);
4013
4014        this.ttcont = $('<div></div>')
4015            .addClass('ms-tooltip-cont')
4016            .html(this.data)
4017            .appendTo(this.tt)
4018
4019
4020        if (this.$element.data('stay-hover') === true) {
4021            this.tt.on('mouseenter', function() {
4022                if (that.hide_start) {
4023                    return
4024                }
4025                clearTimeout(that.hto);
4026                that._tween.stop(true);
4027                that._showTT();
4028            }).on('mouseleave', function() {
4029                that._hideTT();
4030            });
4031        }
4032
4033        _super.create.call(this);
4034    };
4035
4036})(jQuery);
4037
4038/* ================== bin-debug/js/pro/layers/ButtonLayer.js =================== */
4039/**
4040 * Master Slider Button Layer
4041 * @author Averta
4042 * @since 1.7.2
4043 * @extends {MSLayerElement}
4044 */
4045(function($) {
4046
4047    window.MSButtonLayer = function() {
4048        MSLayerElement.call(this);
4049
4050        this.type = 'button';
4051    };
4052
4053    MSButtonLayer.extend(MSLayerElement);
4054
4055    var p = MSButtonLayer.prototype;
4056    var _super = MSLayerElement.prototype;
4057
4058    var positionKies = ['top', 'left', 'bottom', 'right'];
4059
4060    /*-------------- METHODS --------------*/
4061
4062    p.create = function() {
4063        _super.create.call(this);
4064        this.$element.wrap('<div class="ms-btn-container"></div>').css('position', 'relative');
4065        this.$container = this.$element.parent();
4066    };
4067
4068    p.locate = function() {
4069        _super.locate.call(this);
4070        var key, tempValue;
4071
4072        for (var i = 0; i < 4; i++) {
4073            key = positionKies[i];
4074            if (key in this.baseStyle && this.baseStyle[key] !== undefined) {
4075                tempValue = this.$element.css(key);
4076                this.$element.css(key, '');
4077                this.$container.css(key, tempValue);
4078            }
4079        }
4080
4081        this.$container.width(this.$element.outerWidth(true))
4082            .height(this.$element.outerHeight(true));
4083    };
4084
4085})(jQuery);
4086
4087/* ================== bin-debug/js/pro/controls/SliderEvent.js =================== */
4088window.MSSliderEvent = function(type) {
4089    this.type = type;
4090};
4091
4092MSSliderEvent.CHANGE_START = 'ms_changestart';
4093MSSliderEvent.CHANGE_END = 'ms_changeend';
4094MSSliderEvent.WAITING = 'ms_waiting';
4095MSSliderEvent.AUTOPLAY_CHANGE = 'ms_autoplaychange';
4096MSSliderEvent.VIDEO_PLAY = 'ms_videoPlay';
4097MSSliderEvent.VIDEO_CLOSE = 'ms_videoclose';
4098MSSliderEvent.INIT = 'ms_init';
4099MSSliderEvent.HARD_UPDATE = 'ms_hard_update';
4100MSSliderEvent.RESIZE = 'ms_resize';
4101MSSliderEvent.RESERVED_SPACE_CHANGE = 'ms_rsc'; // internal use
4102MSSliderEvent.DESTROY = 'ms_destroy';
4103
4104/* ================== bin-debug/js/pro/controls/Slide.js =================== */
4105/**
4106 * Master Slider Slide Class
4107 * @author averta
4108 * @package Master Slider jQuery
4109 */
4110;
4111(function(window, document, $) {
4112
4113    "use strict";
4114
4115    window.MSSlide = function() {
4116
4117        this.$element = null;
4118        this.$loading = $('<div></div>').addClass('ms-slide-loading');
4119
4120        this.view = null;
4121        this.index = -1;
4122
4123        this.__width = 0;
4124        this.__height = 0;
4125
4126        this.fillMode = 'fill'; // fill , fit , stretch , tile , center
4127
4128        this.selected = false;
4129        this.pselected = false;
4130        this.autoAppend = true;
4131        this.isSleeping = true;
4132
4133        this.moz = window.MSBrowserInfo.mozilla;
4134    };
4135
4136    var p = MSSlide.prototype;
4137
4138    /**
4139     * on swipe start handler
4140     */
4141    p.onSwipeStart = function() {
4142        //this.$layers.css(window._csspfx + 'transition-duration' , '0ms');
4143        if (this.link) {
4144            this.linkdis = true;
4145        }
4146
4147        if (this.video) {
4148            this.videodis = true;
4149        }
4150    };
4151
4152    /**
4153     * on swipe move handler
4154     */
4155    p.onSwipeMove = function(e) {
4156        var move = Math.max(Math.abs(e.data.distanceX), Math.abs(e.data.distanceY));
4157        this.swipeMoved = move > 4;
4158    };
4159
4160    /**
4161     * on swipe cancel handler
4162     */
4163    p.onSwipeCancel = function(e) {
4164        if (this.swipeMoved) {
4165            this.swipeMoved = false;
4166            return;
4167        }
4168
4169        if (this.link) {
4170            this.linkdis = false;
4171        }
4172
4173        if (this.video) {
4174            this.videodis = false;
4175        }
4176        //this.$layers.css(window._csspfx + 'transition-duration' , this.view.__slideDuration + 'ms');
4177    };
4178
4179    /**
4180     * setup layer controller for the slide
4181     * @since 2.11.0
4182     */
4183    p.setupLayerController = function() {
4184        this.hasLayers = true;
4185        this.layerController = new MSLayerController(this);
4186    };
4187    /**
4188     * this method called after loading all assets related to this slide
4189     */
4190    p.assetsLoaded = function() {
4191        this.ready = true;
4192        this.slider.api._startTimer();
4193
4194        if (this.selected || (this.pselected && this.slider.options.instantStartLayers)) {
4195
4196            if (this.hasLayers) {
4197                this.layerController.showLayers();
4198            }
4199
4200            if (this.vinit) {
4201                this.bgvideo.play();
4202                if (!this.autoPauseBgVid) {
4203                    this.bgvideo.currentTime = 0;
4204                }
4205            }
4206
4207        }
4208        if (!this.isSleeping) {
4209            this.setupBG();
4210        }
4211
4212        CTween.fadeOut(this.$loading, 300, true);
4213
4214        //sequence loading
4215        if ((this.slider.options.preload === 0 || this.slider.options.preload === 'all') && this.index < this.view.slideList.length - 1) {
4216            this.view.slideList[this.index + 1].loadImages();
4217        } else if (this.slider.options.preload === 'all' && this.index === this.view.slideList.length - 1) {
4218            this.slider._removeLoading();
4219        }
4220
4221    };
4222
4223    /**
4224     * adds backgroun image to the slider
4225     * @param {Element} img slide image element
4226     */
4227    p.setBG = function(img) {
4228        this.hasBG = true;
4229        var that = this;
4230
4231        this.$imgcont = $('<div></div>').addClass('ms-slide-bgcont');
4232
4233        this.$element.append(this.$loading)
4234            .append(this.$imgcont);
4235
4236        this.$bg_img = $(img).css('visibility', 'hidden');
4237        this.$imgcont.append(this.$bg_img);
4238
4239        this.bgAligner = new MSAligner(that.fillMode, that.$imgcont, that.$bg_img);
4240        this.bgAligner.widthOnly = this.slider.options.autoHeight;
4241
4242        if (that.slider.options.autoHeight && (that.pselected || that.selected)) {
4243            that.slider.setHeight(that.slider.options.height);
4244        }
4245
4246        if (this.$bg_img.data('src') !== undefined) {
4247            this.bg_src = this.$bg_img.data('src');
4248            this.$bg_img.removeAttr('data-src');
4249        } else {
4250            this.$bg_img.one('load', function(event) { that._onBGLoad(event); })
4251                .each($.jqLoadFix);
4252        }
4253
4254    };
4255
4256    /**
4257     * align and resize backgrund image over slide
4258     */
4259    p.setupBG = function() {
4260
4261        //if(this.isSettedup) return;
4262        //this.isSettedup = true;
4263
4264        if (!this.initBG && this.bgLoaded) {
4265            this.initBG = true;
4266            this.$bg_img.css('visibility', '');
4267            this.bgWidth = this.bgNatrualWidth || this.$bg_img.width();
4268            this.bgHeight = this.bgNatrualHeight || this.$bg_img.height();
4269
4270            CTween.fadeIn(this.$imgcont, 300);
4271
4272            if (this.slider.options.autoHeight) {
4273                this.$imgcont.height(this.bgHeight * this.ratio);
4274            }
4275
4276            this.bgAligner.init(this.bgWidth, this.bgHeight);
4277            this.setSize(this.__width, this.__height);
4278
4279            if (this.slider.options.autoHeight && (this.pselected || this.selected))
4280                this.slider.setHeight(this.getHeight());
4281        }
4282
4283    };
4284
4285
4286
4287    /**
4288     * start loading images
4289     */
4290    p.loadImages = function() {
4291        if (this.ls) {
4292            return;
4293        }
4294
4295        this.ls = true;
4296
4297        if (this.bgvideo) {
4298            this.bgvideo.load();
4299        }
4300        if (this.hasBG && this.bg_src) {
4301            var that = this;
4302            this.$bg_img.preloadImg(this.bg_src, function(event) { that._onBGLoad(event); });
4303        }
4304
4305        if (this.hasLayers) {
4306            this.layerController.loadLayers(this._onLayersLoad);
4307        }
4308        // There is nothing to preload? so slide is ready to show.
4309        if (!this.hasBG && !this.hasLayers) {
4310            this.assetsLoaded();
4311        }
4312
4313    };
4314
4315    /**
4316     * layerController on assets load callback
4317     */
4318    p._onLayersLoad = function() {
4319        this.layersLoaded = true;
4320        if (!this.hasBG || this.bgLoaded) {
4321            this.assetsLoaded();
4322        }
4323    };
4324    /**
4325     * on background image loaded
4326     * @param  {Event} event
4327     */
4328    p._onBGLoad = function(event) {
4329        this.bgNatrualWidth = event.width;
4330        this.bgNatrualHeight = event.height;
4331
4332        this.bgLoaded = true;
4333
4334        if (window.MSBrowserInfo.msie) {
4335            this.$bg_img.on('dragstart', function(event) { event.preventDefault(); }); // disables native dragging
4336        }
4337
4338        if (!this.hasLayers || this.layerController.ready) {
4339            this.assetsLoaded();
4340        }
4341    };
4342
4343    /* -----------------------------------------------------*/
4344
4345    /**
4346     * add video background to the slide
4347     * @param {jQuery Element} $video
4348     */
4349    p.setBGVideo = function($video) {
4350
4351        if (!$video[0].play) {
4352            return;
4353        }
4354
4355        // disables video in mobile devices
4356        if (window._mobile && !this.slider.options.mobileBGVideo) {
4357            $video.remove();
4358            return;
4359        }
4360
4361        this.bgvideo = $video[0];
4362        var that = this;
4363
4364        $video.addClass('ms-slide-bgvideo');
4365
4366        // if ( $video.data('loop') !== false ) {
4367        //     this.bgvideo.addEventListener('ended' , function(){
4368        //         //that.bgvideo.currentTime = -1;
4369        //         that.bgvideo.play();
4370        //     });
4371        // }
4372
4373        if ($video.data('loop') !== false) {
4374            this.bgvideo.loop = true;
4375        }
4376
4377        if ($video.data('mute') !== false) {
4378            this.bgvideo.muted = true;
4379        }
4380
4381        if ($video.data('autopause') === true) {
4382            this.autoPauseBgVid = true;
4383        }
4384
4385        this.bgvideo.setAttribute('playsinline', '');
4386
4387        this.bgvideo_fillmode = $video.data('fill-mode') || 'fill'; // fill , fit , none
4388
4389        if (this.bgvideo_fillmode !== 'none') {
4390            this.bgVideoAligner = new MSAligner(this.bgvideo_fillmode, this.$element, $video);
4391
4392            this.bgvideo.addEventListener('loadedmetadata', function() {
4393                if (that.vinit) return;
4394
4395                that.vinit = true;
4396                that.video_aspect = that.bgVideoAligner.baseHeight / that.bgVideoAligner.baseWidth;
4397                that.bgVideoAligner.init(that.bgvideo.videoWidth, that.bgvideo.videoHeight);
4398                that._alignBGVideo();
4399                CTween.fadeIn($(that.bgvideo), 200);
4400
4401                if (that.selected) {
4402                    that.bgvideo.play();
4403                }
4404            });
4405        }
4406
4407        $video.css('opacity', 0);
4408
4409        this.$bgvideocont = $('<div></div>').addClass('ms-slide-bgvideocont').append($video);
4410
4411        if (this.hasBG) {
4412            this.$imgcont.before(this.$bgvideocont);
4413        } else {
4414            this.$bgvideocont.appendTo(this.$element);
4415        }
4416    };
4417
4418    /**
4419     * align video in slide
4420     */
4421    p._alignBGVideo = function() {
4422        if (!this.bgvideo_fillmode || this.bgvideo_fillmode === 'none') {
4423            return;
4424        }
4425        this.bgVideoAligner.align();
4426    };
4427
4428    /* -----------------------------------------------------*/
4429
4430    /**
4431     * resize slide
4432     * @param {Number} width
4433     * @param {Number} height
4434     * @param {Boolean} hard   after resizing reinitializes layers
4435     */
4436    p.setSize = function(width, height, hard) {
4437
4438        this.__width = width;
4439
4440        if (this.slider.options.autoHeight) {
4441            if (this.bgLoaded) {
4442                this.ratio = this.__width / this.bgWidth;
4443                height = Math.floor(this.ratio * this.bgHeight);
4444                this.$imgcont.height(height);
4445            } else {
4446                this.ratio = width / this.slider.options.width;
4447                height = this.slider.options.height * this.ratio;
4448            }
4449        }
4450
4451        this.__height = height;
4452        this.$element.width(width).height(height);
4453
4454        if (this.hasBG && this.bgLoaded) this.bgAligner.align();
4455
4456        this._alignBGVideo();
4457
4458        if (this.hasLayers) {
4459            this.layerController.setSize(width, height, hard);
4460        }
4461    };
4462
4463    /**
4464     * calculates slide height
4465     * @return {Number} slide height
4466     */
4467    p.getHeight = function() {
4468
4469        if (this.hasBG && this.bgLoaded) {
4470            return this.bgHeight * this.ratio;
4471        }
4472
4473        return Math.max(this.$element[0].clientHeight, this.slider.options.height * this.ratio);
4474    };
4475
4476    /* -----------------------------------------------------*/
4477    // YouTube and Vimeo videos
4478
4479    /**
4480     * playe embeded video
4481     */
4482    p.__playVideo = function() {
4483
4484        if (this.vplayed || this.videodis) {
4485            return;
4486        }
4487
4488        this.vplayed = true;
4489
4490        if (!this.slider.api.paused) {
4491            this.slider.api.pause();
4492            this.roc = true; // resume on close;
4493        }
4494
4495        this.vcbtn.css('display', '');
4496        CTween.fadeOut(this.vpbtn, 500, false);
4497        CTween.fadeIn(this.vcbtn, 500);
4498        CTween.fadeIn(this.vframe, 500);
4499        this.vframe.css('display', 'block').attr('src', this.video + '&autoplay=1');
4500        this.view.$element.addClass('ms-def-cursor');
4501
4502        // remove perspective style from view if it's Firefox.
4503        // it fixes video fullscreen issue in Firefox
4504        if (this.moz) {
4505            this.view.$element.css('perspective', 'none');
4506        }
4507
4508        // if swipe navigation enabled
4509        if (this.view.swipeControl) {
4510            this.view.swipeControl.disable();
4511        }
4512
4513        this.slider.slideController.dispatchEvent(new MSSliderEvent(MSSli
4513derEvent.VIDEO_PLAY));
4514    };
4515
4516    /**
4517     * close embeded video
4518     */
4519    p.__closeVideo = function() {
4520
4521        if (!this.vplayed) {
4522            return;
4523        }
4524
4525        this.vplayed = false;
4526
4527        if (this.roc) {
4528            this.slider.api.resume();
4529        }
4530
4531        var that = this;
4532
4533        CTween.fadeIn(this.vpbtn, 500);
4534        CTween.animate(this.vcbtn, 500, { opacity: 0 }, { complete: function() { that.vcbtn.css('display', 'none'); } });
4535        CTween.animate(this.vframe, 500, { opacity: 0 }, { complete: function() { that.vframe.attr('src', 'about:blank').css('display', 'none'); } });
4536
4537        //  video fullscreen issue in Firefox
4538        if (this.moz) {
4539            this.view.$element.css('perspective', '');
4540        }
4541
4542        // if swipe navigation enabled
4543        if (this.view.swipeControl) {
4544            this.view.swipeControl.enable();
4545        }
4546
4547        this.view.$element.removeClass('ms-def-cursor');
4548        this.slider.slideController.dispatchEvent(new MSSliderEvent(MSSliderEvent.VIDEO_CLOSE));
4549    };
4550
4551    /* -----------------------------------------------------*/
4552
4553    /**
4554     * create slide - it adds requierd elements over slide
4555     */
4556    p.create = function() {
4557        var that = this;
4558
4559        if (this.hasLayers) {
4560            this.layerController.create();
4561        }
4562        if (this.link) {
4563            this.link.addClass('ms-slide-link').html('').click(function(e) {
4564                if (that.linkdis) {
4565                    e.preventDefault();
4566                }
4567            });
4568
4569            // this.$element.css('cursor' , 'pointer')
4570            //           .click(function(){ if(!that.linkdis) window.open(that.link , that.link_targ || '_self'); });
4571        }
4572
4573        if (this.video) {
4574
4575            if (this.video.indexOf('?') === -1) {
4576                this.video += '?';
4577            }
4578
4579            this.vframe = $('<iframe></iframe>')
4580                .addClass('ms-slide-video')
4581                .css({ width: '100%', height: '100%', display: 'none' })
4582                .attr('src', 'about:blank')
4583                .attr('allowfullscreen', 'true')
4584                .appendTo(this.$element);
4585
4586            this.vpbtn = $('<div></div>')
4587                .addClass('ms-slide-vpbtn')
4588                .click(function() { that.__playVideo(); })
4589                .appendTo(this.$element);
4590
4591            this.vcbtn = $('<div></div>')
4592                .addClass('ms-slide-vcbtn')
4593                .click(function() { that.__closeVideo(); })
4594                .appendTo(this.$element)
4595                .css('display', 'none');
4596
4597            if (window._touch) {
4598                this.vcbtn.removeClass('ms-slide-vcbtn')
4599                    .addClass('ms-slide-vcbtn-mobile')
4600                    .append('<div class="ms-vcbtn-txt">Close video</div>')
4601                    .appendTo(this.view.$element.parent());
4602            }
4603        }
4604
4605        if (!this.slider.options.autoHeight && this.hasBG) {
4606            this.$imgcont.css('height', '100%');
4607
4608            if (this.fillMode === 'center' || this.fillMode === 'stretch') {
4609                this.fillMode = 'fill';
4610            }
4611        }
4612
4613        if (this.slider.options.autoHeight) {
4614            this.$element.addClass('ms-slide-auto-height');
4615        }
4616
4617        this.sleep(true);
4618    };
4619
4620    /**
4621     * destory the slide
4622     */
4623    p.destroy = function() {
4624        if (this.hasLayers) {
4625            this.layerController.destroy();
4626            this.layerController = null;
4627        }
4628        this.$element.remove();
4629        this.$element = null;
4630    };
4631
4632    /**
4633     * everything require to do before selecting slide
4634     */
4635    p.prepareToSelect = function() {
4636
4637        if (this.pselected || this.selected) {
4638            return;
4639        }
4640
4641        this.pselected = true;
4642
4643        if (this.link || this.video) {
4644            this.view.addEventListener(MSViewEvents.SWIPE_START, this.onSwipeStart, this);
4645            this.view.addEventListener(MSViewEvents.SWIPE_MOVE, this.onSwipeMove, this);
4646            this.view.addEventListener(MSViewEvents.SWIPE_CANCEL, this.onSwipeCancel, this);
4647            this.linkdis = false;
4648            this.swipeMoved = false;
4649        }
4650
4651        this.loadImages();
4652
4653        if (this.hasLayers) {
4654            this.layerController.prepareToShow();
4655        }
4656
4657        if (this.ready) {
4658            if (this.bgvideo) {
4659                this.bgvideo.play();
4660            }
4661
4662            if (this.hasLayers && this.slider.options.instantStartLayers) {
4663                this.layerController.showLayers();
4664            }
4665        }
4666        if (this.moz) {
4667            this.$element.css('margin-top', '');
4668        }
4669
4670
4671    };
4672
4673    /*p.prepareToUnselect = function(){
4674        if(!this.pselected || !this.selected) return;
4675
4676        this.pselected = false;
4677
4678    };*/
4679
4680    /**
4681     * select slide
4682     */
4683    p.select = function() {
4684        if (this.selected) {
4685            return;
4686        }
4687
4688        this.selected = true;
4689        this.pselected = false;
4690        this.$element.addClass('ms-sl-selected');
4691
4692        if (this.hasLayers) {
4693
4694            if (this.slider.options.autoHeight) {
4695                this.layerController.updateHeight();
4696            }
4697
4698            if (!this.slider.options.instantStartLayers) {
4699                this.layerController.showLayers();
4700            }
4701
4702            //this.view.addEventListener(MSViewEvents.SCROLL        , this.updateLayers  , this)
4703        }
4704
4705
4706        if (this.ready && this.bgvideo) {
4707            this.bgvideo.play();
4708        }
4709        // @since 1.8.0
4710        // Autoplay iframe video
4711        if (this.videoAutoPlay) {
4712            this.videodis = false;
4713            this.vpbtn.trigger('click');
4714        }
4715
4716    };
4717
4718    /**
4719     * remove selected status
4720     */
4721    p.unselect = function() {
4722        this.pselected = false;
4723
4724        if (this.moz) {
4725            this.$element.css('margin-top', '0.1px');
4726        }
4727
4728        if (this.link || this.video) {
4729            this.view.removeEventListener(MSViewEvents.SWIPE_START, this.onSwipeStart, this);
4730            this.view.removeEventListener(MSViewEvents.SWIPE_MOVE, this.onSwipeMove, this);
4731            this.view.removeEventListener(MSViewEvents.SWIPE_CANCEL, this.onSwipeCancel, this);
4732        }
4733
4734        if (this.bgvideo) {
4735            this.bgvideo.pause();
4736            if (!this.autoPauseBgVid && this.vinit)
4737                this.bgvideo.currentTime = 0;
4738        }
4739
4740        // hide layers
4741        if (this.hasLayers) {
4742            this.layerController.hideLayers();
4743        }
4744        if (!this.selected) {
4745            return;
4746        }
4747
4748        this.selected = false;
4749
4750        this.$element.removeClass('ms-sl-selected');
4751        if (this.video && this.vplayed) {
4752            this.__closeVideo();
4753            this.roc = false;
4754        }
4755
4756    };
4757
4758    /**
4759     * remove slide from DOM
4760     */
4761    p.sleep = function(force) {
4762        if (this.isSleeping && !force) {
4763            return;
4764        }
4765
4766        this.isSleeping = true;
4767
4768        if (this.autoAppend) {
4769            this.$element.detach();
4770        }
4771
4772        if (this.hasLayers) {
4773            this.layerController.onSlideSleep();
4774        }
4775    };
4776
4777    /**
4778     * add slide to the DOM
4779     */
4780    p.wakeup = function() {
4781        if (!this.isSleeping) {
4782            return;
4783        }
4784
4785        this.isSleeping = false;
4786
4787        if (this.autoAppend) {
4788            this.view.$slideCont.append(this.$element);
4789        }
4790
4791        if (this.moz) {
4792            this.$element.css('margin-top', '0.1px');
4793        }
4794
4795        this.setupBG();
4796
4797        // aling bg
4798        if (this.hasBG) {
4799            this.bgAligner.align();
4800        }
4801
4802        if (this.hasLayers) {
4803            this.layerController.onSlideWakeup();
4804        }
4805    };
4806
4807})(window, document, jQuery);
4808
4809/* ================== bin-debug/js/pro/controls/SlideController.js =================== */
4810;
4811(function($) {
4812
4813    "use strict";
4814
4815    var SliderViewList = {};
4816
4817    window.MSSlideController = function(slider) {
4818
4819        this._delayProgress = 0;
4820
4821        this._timer = new averta.Timer(100);
4822        this._timer.onTimer = this.onTimer;
4823        this._timer.refrence = this;
4824
4825        this.currentSlide = null;
4826
4827        this.slider = slider;
4828        this.so = slider.options;
4829
4830        averta.EventDispatcher.call(this);
4831
4832    };
4833
4834    MSSlideController.registerView = function(name, _class) {
4835        if (name in SliderViewList) {
4836            throw new Error(name + ', is already registered.');
4837            return;
4838        }
4839
4840        SliderViewList[name] = _class;
4841    };
4842
4843    MSSlideController.SliderControlList = {};
4844    MSSlideController.registerControl = function(name, _class) {
4845        if (name in MSSlideController.SliderControlList) {
4846            throw new Error(name + ', is already registered.');
4847            return;
4848        }
4849
4850        MSSlideController.SliderControlList[name] = _class;
4851    };
4852
4853    var p = MSSlideController.prototype;
4854
4855    /*-------------- METHODS --------------*/
4856
4857
4858    p.setupView = function() {
4859
4860        var that = this;
4861        this.resize_listener = function() { that.__resize(); };
4862
4863        // in @version 1.5.7 it will be added in Masterslider.js _setupSliderLayout function
4864        //$(window).bind('resize', this.resize_listener);
4865
4866        //if(this.so.smoothHeight) this.so.autoHeight = true;
4867
4868        var viewOptions = {
4869            spacing: this.so.space,
4870            mouseSwipe: this.so.mouse,
4871            loop: this.so.loop,
4872            autoHeight: this.so.autoHeight,
4873            swipe: this.so.swipe,
4874            speed: this.so.speed,
4875            dir: this.so.dir,
4876            viewNum: this.so.inView,
4877            critMargin: this.so.critMargin
4878        };
4879
4880        if (this.so.viewOptions)
4881            $.extend(viewOptions, this.so.viewOptions);
4882
4883        if (this.so.autoHeight) this.so.heightLimit = false;
4884
4885        //this.view.slideDuration = this.so.duration;
4886
4887        var viewClass = SliderViewList[this.slider.options.view] || MSBasicView;
4888        if (viewClass._3dreq && (!window._css3d || window.MSBrowserInfo.msie)) viewClass = viewClass._fallback || MSBasicView;
4889
4890        this.view = new viewClass(viewOptions);
4891
4892        if (this.so.overPause) {
4893            var that = this;
4894            this.slider.$element.mouseenter(function() {
4895                that.is_over = true;
4896                that._stopTimer();
4897            }).mouseleave(function() {
4898                that.is_over = false;
4899                that._startTimer();
4900            });
4901        }
4902    };
4903
4904    p.onChangeStart = function() {
4905
4906        this.change_started = true;
4907
4908        if (this.currentSlide) this.currentSlide.unselect();
4909        this.currentSlide = this.view.currentSlide;
4910        this.currentSlide.prepareToSelect();
4911        //this.__appendSlides();
4912        if (this.so.endPause && this.currentSlide.index === this.slider.slides.length - 1) {
4913            this.pause();
4914            //this._timer.reset();
4915            this.skipTimer();
4916        }
4917
4918        if (this.so.autoHeight) {
4919            this.slider.setHeight(this.currentSlide.getHeight());
4920        }
4921
4922        if (this.so.deepLink) {
4923            this.__updateWindowHash();
4924        }
4925
4926        this.dispatchEvent(new MSSliderEvent(MSSliderEvent.CHANGE_START));
4927    };
4928
4929    p.onChangeEnd = function() {
4930        //if(!this.currentSlide.selected)
4931        //	this._timer.reset();
4932        this.change_started = false;
4933
4934        this._startTimer();
4935        this.currentSlide.select();
4936
4937        if (this.so.preload > 1) {
4938            var loc, i, l = this.so.preload - 1,
4939                slide;
4940
4941            // next slides
4942            for (i = 1; i <= l; ++i) {
4943                loc = this.view.index + i;
4944
4945                if (loc >= this.view.slideList.length) {
4946                    if (this.so.loop) {
4947                        loc = loc - this.view.slideList.length;
4948                    } else {
4949                        i = l;
4950                        continue;
4951                    }
4952                }
4953
4954                slide = this.view.slideList[loc];
4955                if (slide) {
4956                    slide.loadImages();
4957                }
4958
4959            }
4960
4961            // previous slides
4962            if (l > this.view.slideList.length / 2)
4963                l = Math.floor(this.view.slideList.length / 2);
4964
4965            for (i = 1; i <= l; ++i) {
4966
4967                loc = this.view.index - i;
4968
4969                if (loc < 0) {
4970                    if (this.so.loop) {
4971                        loc = this.view.slideList.length + loc;
4972                    } else {
4973                        i = l;
4974                        continue;
4975                    }
4976                }
4977
4978                slide = this.view.slideList[loc];
4979                if (slide) {
4980                    slide.loadImages();
4981                }
4982
4983            }
4984        }
4985
4986        this.dispatchEvent(new MSSliderEvent(MSSliderEvent.CHANGE_END));
4987
4988    };
4989
4990    p.onSwipeStart = function() {
4991        //this._timer.reset();
4992        this.skipTimer();
4993    };
4994
4995    p.skipTimer = function() {
4996        this._timer.reset();
4997        this._delayProgress = 0;
4998        this.dispatchEvent(new MSSliderEvent(MSSliderEvent.WAITING));
4999    };
5000
5001    p.onTimer = function(time) {
5002
5003        if (this._timer.getTime() >= this.view.currentSlide.delay * 1000) {
5004            //this._timer.reset();
5005            this.skipTimer();
5006            this.view.next();
5007            this.hideCalled = false;
5008        }
5009        this._delayProgress = this._timer.getTime() / (this.view.currentSlide.delay * 10);
5010
5011        if (this.so.hideLayers && !this.hideCalled && this.view.currentSlide.delay * 1000 - this._timer.getTime() <= 300) {
5012            var currentSlide = this.view.currentSlide;
5013            if (currentSlide.hasLayers) {
5014                currentSlide.layerController.animHideLayers();
5015            }
5016            this.hideCalled = true;
5017        }
5018
5019        this.dispatchEvent(new MSSliderEvent(MSSliderEvent.WAITING));
5020    };
5021
5022    p._stopTimer = function() {
5023        if (this._timer)
5024            this._timer.stop();
5025    };
5026
5027    p._startTimer = function() {
5028        if (!this.paused && !this.is_over && this.currentSlide && this.currentSlide.ready && !this.change_started)
5029            this._timer.start();
5030    };
5031
5032    p.__appendSlides = function() {
5033        var slide, loc, i = 0,
5034            l = this.view.slideList.length - 1;
5035
5036        // detach all
5037        for (i; i < l; ++i) {
5038            slide = this.view.slideList[i];
5039            if (!slide.detached) {
5040                slide.$element.detach();
5041                slide.detached = true;
5042            }
5043        }
5044
5045        // append current slide
5046        this.view.appendSlide(this.view.slideList[this.view.index]);
5047
5048        l = 3;
5049
5050        // next slides
5051        for (i = 1; i <= l; ++i) {
5052            loc = this.view.index + i;
5053
5054            if (loc >= this.view.slideList.length) {
5055                if (this.so.loop) {
5056                    loc = loc - this.view.slideList.length;
5057                } else {
5058                    i = l;
5059                    continue;
5060                }
5061            }
5062
5063            slide = this.view.slideList[loc];
5064            slide.detached = false;
5065            this.view.appendSlide(slide);
5066
5067        }
5068
5069        // previous slides
5070        if (l > this.view.slideList.length / 2)
5071            l = Math.floor(this.view.slideList.length / 2);
5072
5073        for (i = 1; i <= l; ++i) {
5074
5075            loc = this.view.index - i;
5076
5077            if (loc < 0) {
5078                if (this.so.loop) {
5079                    loc = this.view.slideList.length + loc;
5080                } else {
5081                    i = l;
5082                    continue;
5083                }
5084            }
5085
5086            slide = this.view.slideList[loc];
5087            slide.detached = false;
5088            this.view.appendSlide(slide);
5089        }
5090
5091    }
5092
5093    p.__resize = function(hard) {
5094        if (!this.created) return;
5095
5096        this.width = this.slider.$element[0].clientWidth || this.so.width;
5097
5098        if (!this.so.fullwidth) {
5099            this.width = Math.min(this.width, this.so.width);
5100            //this.view.$element.css('left' , (this.slider.$element[0].clientWidth - this.width) / 2 + 'px');
5101        }
5102
5103        if (this.so.fullheight) {
5104            this.so.heightLimit = false;
5105            this.so.autoHeight = false;
5106            this.height = this.slider.$element[0].clientHeight;
5107        } else if (this.so.responsive) {
5108            this.slider.aspect = this.slider.getResponsiveValue(this.slider.responsiveAspect);
5109            this.height = this.width / this.slider.aspect;
5110        } else {
5111            this.height = this.width / this.slider.aspect;
5112        }
5113        if (this.so.autoHeight) {
5114            this.currentSlide.setSize(this.width, null, hard);
5115            this.view.setSize(this.width, this.currentSlide.getHeight(), hard);
5116        } else {
5117            this.view.setSize(this.width, (Math.max(this.so.minHeight, (this.so.heightLimit ? Math.min(this.height, this.so.height) : this.height))), hard);
5118        }
5119
5120        if (this.slider.$controlsCont) {
5121            if (this.so.centerControls && this.so.fullwidth) {
5122                this.view.$element.css('left', Math.min(0, -(this.slider.$element[0].clientWidth - this.so.width) / 2) + 'px');
5123            }
5124        }
5125
5126        this.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESIZE));
5127    };
5128
5129    p.__dispatchInit = function() {
5130        this.dispatchEvent(new MSSliderEvent(MSSliderEvent.INIT));
5131    };
5132
5133    /**
5134     * used by deep link feature, uptades window hash value on slide changes
5135     * @since 2.1.0
5136     */
5137    p.__updateWindowHash = function() {
5138        var hash = window.location.hash,
5139            dl = this.so.deepLink,
5140            dlt = this.so.deepLinkType,
5141            eq = dlt === 'path' ? '\/' : '=',
5142            sep = dlt === 'path' ? '\/' : '&',
5143            sliderHash = dl + eq + (this.view.index + 1),
5144            regTest = new RegExp(dl + eq + '[0-9]+', 'g');
5145
5146        if (hash === '') {
5147            window.location.hash = sep + sliderHash;
5148        } else if (regTest.test(hash)) {
5149            window.location.hash = hash.replace(regTest, sliderHash);
5150        } else {
5151            window.location.hash = hash + sep + sliderHash;
5152        }
5153    };
5154
5155    p.__curentSlideInHash = function() {
5156        var hash = window.location.hash,
5157            dl = this.so.deepLink,
5158            dlt = this.so.deepLinkType,
5159            eq = dlt === 'path' ? '\/' : '=',
5160            regTest = new RegExp(dl + eq + '[0-9]+', 'g');
5161
5162        if (regTest.test(hash)) {
5163            var index = Number(hash.match(regTest)[0].match(/[0-9]+/g).pop());
5164            if (!isNaN(index)) {
5165                return index - 1;
5166            }
5167        }
5168
5169        return -1;
5170    };
5171
5172    p.__onHashChanged = function() {
5173        var index = this.__curentSlideInHash();
5174        if (index !== -1) {
5175            this.gotoSlide(index);
5176        }
5177    };
5178
5179    p.__findLayerById = function(layerId) {
5180
5181        if (!this.currentSlide) {
5182            return null;
5183        }
5184        var layer;
5185
5186        if (this.currentSlide.layerController) {
5187            layer = this.currentSlide.layerController.getLayerById(layerId);
5188        }
5189
5190        if (!layer && this.slider.overlayLayers) {
5191            return this.slider.overlayLayers.layerController.getLayerById(layerId);
5192        }
5193
5194        return layer;
5195    };
5196
5197    p.setup = function() {
5198
5199        this.created = true;
5200        this.paused = !this.so.autoplay;
5201
5202        //this.slider.$element.append(this.view.$element);
5203        this.view.addEventListener(MSViewEvents.CHANGE_START, this.onChangeStart, this);
5204        this.view.addEventListener(MSViewEvents.CHANGE_END, this.onChangeEnd, this);
5205        this.view.addEventListener(MSViewEvents.SWIPE_START, this.onSwipeStart, this);
5206
5207        //this.currentSlide = this.view.slides[this.so.start - 1];
5208        this.currentSlide = this.view.slideList[this.so.start - 1];
5209        this.__resize();
5210
5211        var slideInHash = this.__curentSlideInHash(),
5212            startSlide = slideInHash !== -1 ? slideInHash : this.so.start - 1;
5213        this.view.create(startSlide);
5214
5215        if (this.so.preload === 0) {
5216            this.view.slideList[0].loadImages();
5217        }
5218
5219        this.scroller = this.view.controller;
5220
5221        if (this.so.wheel) {
5222            var that = this;
5223            var last_time = new Date().getTime();
5224            this.wheellistener = function(event) {
5225
5226                var e = window.event || event.orginalEvent || event;
5227                e.preventDefault();
5228
5229                var current_time = new Date().getTime();
5230                if (current_time - last_time < 400) return;
5231                last_time = current_time;
5232
5233                var delta = Math.abs(e.detail || e.wheelDelta);
5234
5235                if (window.MSBrowserInfo.mozilla) {
5236                    delta *= 100;
5237                }
5238
5239                var scrollThreshold = 15;
5240
5241                // --- Scrolling up ---
5242                if (e.detail < 0 || e.wheelDelta > 0) {
5243                    if (delta >= scrollThreshold) {
5244                        that.previous(true);
5245                    }
5246                }
5247                // --- Scrolling down ---
5248                else {
5249                    if (delta >= scrollThreshold) {
5250                        that.next(true);
5251                    }
5252                }
5253
5254                return false;
5255            };
5256
5257            if (window.MSBrowserInfo.mozilla) this.slider.$element[0].addEventListener('DOMMouseScroll', this.wheellistener);
5258            else this.slider.$element.bind('mousewheel', this.wheellistener);
5259        }
5260
5261        // if(this.so.wheel){
5262        // 	var that = this;
5263        // 	var last_time = new Date().getTime();
5264        // 	this.wheellistener = function(event){
5265        // 		var current_time = new Date().getTime();
5266        // 		if(current_time - last_time < 550) return;
5267        // 		last_time = current_time;
5268        // 		var e = window.event || event.orginalEvent || event;
5269        // 		var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
5270        // 		if(delta < 0)		that.next();
5271        // 		else if(delta > 0)	that.previous();
5272        // 		return false;
5273        // 	};
5274
5275        // 	if(window.MSBrowserInfo.mozilla) this.slider.$element[0].addEventListener('DOMMouseScroll' , this.wheellistener);
5276        // 	else this.slider.$element.bind('mousewheel', this.wheellistener);
5277        // }
5278
5279        if (this.slider.$element[0].clientWidth === 0)
5280            this.slider.init_safemode = true;
5281
5282        this.__resize();
5283
5284        var that = this;
5285        if (this.so.deepLink) {
5286            $(window).on('hashchange', function() {
5287                that.__onHashChanged();
5288            });
5289        }
5290    };
5291
5292    p.index = function() {
5293        return this.view.index;
5294    };
5295
5296    p.count = function() {
5297        return this.view.slidesCount;
5298    };
5299
5300    p.next = function(checkLoop) {
5301        this.skipTimer();
5302        this.view.next(checkLoop);
5303    };
5304
5305    p.previous = function(checkLoop) {
5306        this.skipTimer();
5307        this.view.previous(checkLoop);
5308    };
5309
5310    p.gotoSlide = function(index) {
5311        index = Math.min(index, this.count() - 1);
5312        this.skipTimer();
5313        this.view.gotoSlide(index);
5314    };
5315
5316    p.destroy = function(reset) {
5317        this.dispatchEvent(new MSSliderEvent(MSSliderEvent.DESTROY));
5318        this.slider.destroy(reset);
5319    };
5320
5321    p._destroy = function() {
5322        this._timer.reset();
5323        this._timer = null;
5324
5325        $(window).unbind('resize', this.resize_listener);
5326        this.view.destroy();
5327        this.view = null;
5328
5329        if (this.so.wheel) {
5330            if (window.MSBrowserInfo.mozilla) this.slider.$element[0].removeEventListener('DOMMouseScroll', this.wheellistener);
5331            else this.slider.$element.unbind('mousewheel', this.wheellistener);
5332            this.wheellistener = null;
5333        }
5334
5335        this.so = null;
5336    };
5337
5338    /**
5339     * run layer actions like next, previous,...
5340     * @param  {String} action
5341     * @since v1.7.2
5342     */
5343    p.runAction = function(action) {
5344        var actionParams = [];
5345
5346        if (action.indexOf('(') !== -1) {
5347            var temp = action.slice(0, action.indexOf('('));
5348            actionParams = action.slice(action.indexOf('(') + 1, -1).replace(/\"|\'|\s/g, '').split(',');
5349            action = temp;
5350        }
5351
5352        if (action in this) {
5353            this[action].apply(this, actionParams);
5354        } else if (console) {
5355            console.log('Master Slider Error: Action "' + action + '" not found.');
5356        }
5357    };
5358
5359    p.update = function(hard) {
5360        if (this.slider.init_safemode && hard)
5361            this.slider.init_safemode = false;
5362        this.__resize(hard);
5363
5364        if (hard) {
5365            this.dispatchEvent(new MSSliderEvent(MSSliderEvent.HARD_UPDATE));
5366        }
5367
5368    };
5369
5370    p.locate = function() {
5371        this.__resize();
5372    };
5373
5374    p.resume = function() {
5375        if (!this.paused) return;
5376        this.paused = false;
5377        this._startTimer();
5378    };
5379
5380    p.pause = function() {
5381        if (this.paused) return;
5382        this.paused = true;
5383        this._stopTimer();
5384    };
5385
5386    p.currentTime = function() {
5387        return this._delayProgress;
5388    };
5389
5390
5391    p.showLayer = function(layerId, delay) {
5392        var layer = this.__findLayerById(layerId);
5393        if (layer) {
5394            if (!delay) {
5395                layer.start();
5396            } else {
5397                clearTimeout(layer.actionTimeout);
5398                layer.actionTimeout = setTimeout(this.showLayer, delay, layerId, 0);
5399            }
5400        }
5401    };
5402
5403    p.hideLayer = function(layerId, delay) {
5404        var layer = this.__findLayerById(layerId);
5405        if (layer) {
5406            if (!delay) {
5407                layer.hide();
5408            } else {
5409                clearTimeout(layer.actionTimeout);
5410                layer.actionTimeout = setTimeout(this.hideLayer, delay, layerId, 0);
5411            }
5412        }
5413    }
5414
5415    p.toggleLayer = function(layerId, delay) {
5416        var layer = this.__findLayerById(layerId);
5417        if (layer) {
5418            if (!delay) {
5419                layer.isShowing ? layer.hide() : layer.start();
5420            } else {
5421                clearTimeout(layer.actionTimeout);
5422                layer.actionTimeout = setTimeout(this.toggleLayer, delay, layerId, 0);
5423            }
5424        }
5425    }
5426
5427    p.showLayers = function(layerIds, delay) {
5428        var self = this;
5429        $.each(layerIds.replace(/\s+/g, '').split('|'), function(index, layerId) {
5430            self.showLayer(layerId, delay);
5431        });
5432    };
5433
5434
5435    p.hideLayers = function(layerIds, delay) {
5436        var self = this;
5437        $.each(layerIds.replace(/\s+/g, '').split('|'), function(index, layerId) {
5438            self.hideLayer(layerId, delay);
5439        });
5440    };
5441
5442    p.toggleLayers = function(layerIds, delay) {
5443        var self = this;
5444        $.each(layerIds.replace(/\s+/g, '').split('|'), function(index, layerId) {
5445            self.toggleLayer(layerId, delay);
5446        });
5447    };
5448
5449    averta.EventDispatcher.extend(p);
5450})(jQuery);
5451
5452/* ================== bin-debug/js/pro/MasterSlider.js =================== */
5453/**
5454 * Master Slider Main JavaScript File
5455 */
5456
5457;
5458(function($) {
5459
5460    "use strict";
5461
5462    var LayerTypes = {
5463        'image': MSImageLayerElement,
5464        'text': MSLayerElement,
5465        'video': MSVideoLayerElement,
5466        'hotspot': MSHotspotLayer,
5467        'button': MSButtonLayer
5468    };
5469    window.MasterSlider = function() {
5470
5471        // Default Options
5472        this.options = {
5473            forceInit: true, // Force calling init even an error occurs in jQuery's dom ready method.
5474            autoplay: false, // Enables the autoplay slideshow.
5475            loop: false, // Enables the continuous sliding mode.
5476            mouse: true, // Whether the user can use mouse drag navigation.
5477            swipe: true, // Whether the drag/swipe navigation is enabled.
5478            grabCursor: true, // Whether the slider uses grab mouse cursor.
5479            space: 0, // The spacing value between slides in pixels.
5480            fillMode: 'fill', // Specifies the slide background scaling method. Its acceptable values are "fill", "fit", "stretch", "center" and "tile".
5481            start: 1, // The slider starting slide number.
5482            view: 'basic', // The slide changing transition.
5483            width: 300, // The base width of slides. It helps the slider to resize in correct ratio.
5484            height: 150, // The base height of slides, It helps the slider to resize in correct ratio.
5485            inView: 15, // Specifies number of slides which will be added at a same time in DOM.
5486            critMargin: 1, //
5487            mobileBGVideo: false, // Whether show background videos in mobile devices.
5488            heightLimit: true, // It force the slide to use max height value as its base specified height value.
5489            smoothHeight: true, // Whether the slider uses smooth animation while its height changes.
5490            autoHeight: false, // Whether the slider adapts its height to each slide height or not. It overrides heightLimit option.
5491            minHeight: -1, // @since 2.13.0, Specifies min height value for the slider, it prevents slider to shows too narrow in small screens.
5492            fullwidth: false, // It enables the slider to adapt width to its parent element. It's very useful for creating full-width sliders. In default it takes max width as its base width value.
5493            fullheight: false, // It enables the slider to adapt height to its parent element.
5494            autofill: false, // It enables the slider to adapt width and height to its parent element, It's very useful for creating fullscreen or fullwindow slider.
5495            layersMode: 'center', // It accepts two values "center" and "full". The "center" value indicates that the slider aligns layers to the center. This option is only effective in full width mode.
5496            hideLayers: false, // Whether the slider hides all layers before changing slide.
5497            endPause: false, // Whether the slider pauses slideshow when it stays at the last slide.
5498            centerControls: true, // Whether the slider aligns UI controls to center. This option is only effective in full width mode.
5499            overPause: true, // Whether the slider pauses slideshow on hover.
5500            shuffle: false, // Enables the shuffle slide order.
5501            speed: 17, // Specifies slide changing speed. It accepts float values between 0 and 100.
5502            dir: 'h', // Specifies slide changing direction. It accepts two values "h" (horizontal) and "v" (vertical).
5503            preload: 0, // Specifies number of slides which will be loaded by slider. 0 value means the slider loads slides in sequence.
5504            wheel: false, // Whether slider uses mouse wheel for navigation.
5505            layout: 'boxed', // It accepts 'fullwidth', 'fullscreen', 'fillwidth', 'autofill', 'partialview', 'boxed'. It overrides 'fullwidth' and 'autofill' (added in v1.5.6)
5506            autofillTarget: null, // @since 2.13.0, Specifies the parent element of slider width jQuery selector, it used for sizing slider with autofill layout. Default value is the first parent element of slider.
5507            fullscreenMargin: 0, // Specifies margin amount to the bottom of slider, it's only effective on fullscreen slider.
5508            instantStartLayers: false, // @since 1.5.0, Whether instantly shows slide layers.
5509            parallaxMode: 'mouse', // @since 1.6.0, Specifies mode of parallax effect accepts: "mouse", "mouse:x-only", "mouse:y-only" and "swipe"
5510            rtl: false, // @since 1.8.0, Whether Right-to-left direction slider.
5511            deepLink: null, // @since 2.1.0, null value disables slider deep-linking any string values identifies the slider in page's url like /#msslider-1
5512            deepLinkType: 'path', // @since 2.1.0, type of hash value in page's url possible values, path and query (  #gallery/1 || #gallery=4 )
5513            disablePlugins: [], // @since 2.9.6, list of disabled Master Slider plugin names for this instance.
5514            responsive: true,
5515            tabletWidth: 768,
5516            tabletHeight: null,
5517            phoneWidth: 480,
5518            phoneHeight: null,
5519            sizingReference: 'window', // window
5520        };
5521
5522        this.slides = [];
5523        this.activePlugins = [];
5524        this.$element = null;
5525
5526        // used by new layout method. to force fullwidth or fullscreen
5527        this.lastMargin = 0;
5528
5529        // Reserved side spaces of slider
5530        this.leftSpace = 0;
5531        this.topSpace = 0;
5532        this.rightSpace = 0;
5533        this.bottomSpace = 0;
5534
5535        // hold on stack
5536        this._holdOn = 0;
5537
5538        var that = this;
5539        this.resize_listener = function() { that._resize(); };
5540        $(window).bind('resize', this.resize_listener);
5541
5542    };
5543
5544    MasterSlider.author = 'Averta Ltd. (www.averta.net)';
5545    MasterSlider.version = '2.81.8';
5546    MasterSlider.releaseDate = 'Feb 2021';
5547
5548    // Master Slider plugins.
5549    MasterSlider._plugins = []
5550    var MS = MasterSlider;
5551    MS.registerPlugin = function(plugin) {
5552        if (MS._plugins.indexOf(plugin) === -1) {
5553            MS._plugins.push(plugin);
5554        }
5555    };
5556
5557    var p = MasterSlider.prototype;
5558
5559    /*-------------- METHODS --------------*/
5560
5561    /**
5562     * create one slide object for each slide and add it to slide controller
5563     * @since 1.0
5564     * @private
5565     */
5566    p.__setupSlides = function() {
5567        var that = this,
5568            new_slide,
5569            ind = 0;
5570
5571        this.$element.children('.ms-slide').each(function(index) {
5572
5573            var $slide_ele = $(this);
5574
5575            new_slide = new MSSlide();
5576            new_slide.$element = $slide_ele;
5577            new_slide.slider = that;
5578            new_slide.delay = $slide_ele.data('delay') !== undefined ? $slide_ele.data('delay') : 3;
5579            new_slide.fillMode = $slide_ele.data('fill-mode') !== undefined ? $slide_ele.data('fill-mode') : that.options.fillMode;
5580            new_slide.index = ind++;
5581            new_slide.id = $slide_ele.data('id');
5582
5583            // Slide Background Image
5584            var slide_img = $slide_ele.children('img:not(.ms-layer)');
5585            if (slide_img.length > 0) {
5586                new_slide.setBG(slide_img[0]);
5587            }
5588
5589            // Slide Video Background
5590            var slide_video = $slide_ele.children('video');
5591            if (slide_video.length > 0) new_slide.setBGVideo(slide_video);
5592            // controls
5593            if (that.controls) {
5594                for (var i = 0, l = that.controls.length; i < l; ++i)
5595                    that.controls[i].slideAction(new_slide);
5596            }
5597
5598            // Slide Link and Video
5599            var slide_link = $slide_ele.children('a').each(function(index) {
5600                var $this = $(this);
5601                if (this.getAttribute('data-type') === 'video') {
5602                    new_slide.video = this.getAttribute('href');
5603
5604                    new_slide.videoAutoPlay = $this.data('autoplay');
5605
5606                    $this.remove();
5607                } else if (!$this.hasClass('ms-layer')) {
5608                    new_slide.link = $(this);
5609                    //new_slide.link_targ = this.getAttribute('target');
5610                    //$this.remove();
5611                }
5612            }); //.remove();
5613
5614            // Slide Layers
5615            that.__createSlideLayers(new_slide, $slide_ele.find('.ms-layer'));
5616            that.slides.push(new_slide);
5617            that.slideController.view.addSlide(new_slide);
5618
5619        });
5620    };
5621
5622    /**
5623     * Setups the overlay layers to the slider
5624     * @since 2.50
5625     */
5626    p._setupOverlayLayers = function() {
5627        var self = this,
5628            $ollayers = this.$element.children('.ms-overlay-layers').eq(0);
5629
5630        if (!$ollayers.length) {
5631            return;
5632        }
5633
5634        var overlayLayers = new MSOverlayLayers(this);
5635        overlayLayers.$element = $ollayers;
5636        self.__createSlideLayers(overlayLayers, $ollayers.find('.ms-layer'));
5637
5638        this.view.$element.prepend($ollayers);
5639        this.overlayLayers = overlayLayers;
5640        overlayLayers.create();
5641    };
5642
5643    /**
5644     * Creates layers of specified layer
5645     * @param  {MSSlide} slide
5646     * @param  {Array} layers
5647     * @since 1.0
5648     * @private
5649     */
5650    p.__createSlideLayers = function(slide, layers) {
5651        if (layers.length == 0) return;
5652        slide.setupLayerController();
5653
5654        layers.each(function(index, domEle) {
5655            var $layer_element = $(this),
5656                $parent_ele;
5657
5658            if (domEle.nodeName === 'A' && $layer_element.find('>img').data('type') === 'image') {
5659                $parent_ele = $(this);
5660                $layer_element = $parent_ele.find('img');
5661            }
5662
5663            var layer = new(LayerTypes[$layer_element.data('type') || 'text'])();
5664            layer.$element = $layer_element;
5665            layer.link = $parent_ele;
5666            layer.id = layer.$element.data('id');
5667            layer.waitForAction = layer.$element.data('wait');
5668            layer.masked = layer.$element.data('masked');
5669            layer.maskWidth = layer.$element.data('mask-width');
5670            layer.maskHeight = layer.$element.data('mask-height');
5671
5672            var eff_parameters = {},
5673                end_eff_parameters = {};
5674
5675            if ($layer_element.data('effect') !== undefined) eff_parameters.name = $layer_element.data('effect');
5676            if ($layer_element.data('ease') !== undefined) eff_parameters.ease = $layer_element.data('ease');
5677            if ($layer_element.data('duration') !== undefined) eff_parameters.duration = $layer_element.data('duration');
5678            if ($layer_element.data('delay') !== undefined) eff_parameters.delay = $layer_element.data('delay');
5679
5680            if ($layer_element.data('hide-effect')) end_eff_parameters.name = $layer_element.data('hide-effect');
5681            if ($layer_element.data('hide-ease')) end_eff_parameters.ease = $layer_element.data('hide-ease');
5682            if ($layer_element.data('hide-duration') !== undefined) end_eff_parameters.duration = $layer_element.data('hide-duration');
5683            if ($layer_element.data('hide-time') !== undefined) end_eff_parameters.time = $layer_element.data('hide-time');
5684
5685
5686            layer.setStartAnim(eff_parameters);
5687            layer.setEndAnim(end_eff_parameters);
5688
5689            slide.layerController.addLayer(layer);
5690
5691        });
5692
5693    };
5694    /**
5695     * remove slider initialize loading
5696     * @since 1.0
5697     * @private
5698     */
5699    p._removeLoading = function() {
5700        $(window).unbind('resize', this.resize_listener);
5701        this.$element.removeClass('before-init')
5702            .css('visibility', 'visible')
5703            .css('height', '')
5704            .css('opacity', 0);
5705        CTween.fadeIn(this.$element);
5706        this.$loading.remove();
5707
5708        if (this.slideController)
5709            this.slideController.__resize();
5710    };
5711
5712    /**
5713     * resize listener, it only used for aligning slider loading and after slider init it will be removed
5714     * @param  {Event} e
5715     * @since 1.0
5716     * @private
5717     */
5718    p._resize = function(e) {
5719        if (this.$loading) {
5720            var h = this.$loading[0].clientWidth / this.aspect;
5721            h = this.options.heightLimit ? Math.min(h, this.options.height) : h;
5722
5723            this.$loading.height(h);
5724            this.$element.height(h);
5725        }
5726    };
5727
5728    /**
5729     * changes the order of slides element before setup slides
5730     * @since 1.0
5731     * @private
5732     */
5733    p._shuffleSlides = function() {
5734        var slides = this.$element.children('.ms-slide'),
5735            r;
5736
5737        for (var i = 0, l = slides.length; i < l; ++i) {
5738            r = Math.floor(Math.random() * (l - 1));
5739            if (i != r) {
5740                this.$element[0].insertBefore(slides[i], slides[r]);
5741                slides = this.$element.children('.ms-slide');
5742            }
5743        }
5744    };
5745
5746    /**
5747     * New method of setting up the layout of slider
5748     * @since 1.5.6
5749     */
5750    p._setupSliderLayout = function() {
5751
5752        // create side spaces
5753        this._updateSideMargins();
5754        this.lastMargin = this.leftSpace;
5755
5756        var lo = this.options.layout;
5757
5758
5759        if (lo !== 'boxed' && lo !== 'partialview') {
5760            this.options.fullwidth = true; // enable slider fullscreen for fullwidth, fillwidth, autofill and fullscreen layouts.
5761        }
5762        if (lo === 'fullscreen' || lo === 'autofill') {
5763            this.options.fullheight = true;
5764
5765            if (lo === 'autofill') {
5766                this.$autofillTarget = $(this.options.autofillTarget);
5767                if (this.$autofillTarget.length === 0) {
5768                    this.$autofillTarget = this.$element.parent();
5769                }
5770            }
5771
5772        }
5773
5774        // partial view
5775        if (lo === 'partialview') {
5776            this.$element.addClass('ms-layout-partialview');
5777        }
5778        if (lo === 'fullscreen' || lo === 'fullwidth' || lo === 'autofill') {
5779            $(window).bind('resize', { that: this }, this._updateLayout);
5780            this._updateLayout();
5781        }
5782
5783        // bind resize handler of slidecontroller __resize
5784        $(window).bind('resize', this.slideController.resize_listener);
5785    };
5786
5787    /**
5788     * updates layout of slider based on window size
5789     * @param  {Event} event
5790     * @since 1.5.6
5791     */
5792    p._updateLayout = function(event) {
5793        var that = event ? event.data.that : this,
5794            lo = that.options.layout,
5795            $element = that.$element,
5796            $win = $(window);
5797
5798        // height
5799        if (lo === 'fullscreen') {
5800            document.body.style.overflow = 'hidden';
5801            $element.height($win.height() - that.options.fullscreenMargin - that.topSpace - that.bottomSpace);
5802            document.body.style.overflow = '';
5803        } else if (lo === 'autofill') {
5804            $element.height(that.$autofillTarget.height() - that.options.fullscreenMargin - that.topSpace - that.bottomSpace)
5805                .width(that.$autofillTarget.width() - that.leftSpace - that.rightSpace);
5806            return;
5807        }
5808        // width
5809        $element.width($win.width() - that.leftSpace - that.rightSpace);
5810        var margin = -$element.offset().left + that.leftSpace + that.lastMargin;
5811        $element.css('margin-left', margin);
5812        that.lastMargin = margin;
5813        //
5814    };
5815
5816
5817    /**
5818     * initialize the slider, called by document ready
5819     * <code>holdOn</code> property prevents auto initialize slider after document ready it used by plugins of slider like Flickr
5820     * @since 1.0
5821     * @protected
5822     */
5823    p._init = function() {
5824
5825        if (this._holdOn > 0 || !this._docReady) {
5826            return;
5827        }
5828
5829        this.initialized = true;
5830
5831        if (this.options.preload !== 'all') {
5832            this._removeLoading();
5833        }
5834        //else
5835        //	this.$element.css('width' , this.$loading[0].clientWidth);
5836
5837        if (this.options.shuffle) this._shuffleSlides();
5838
5839        MSLayerEffects.setup();
5840        this.slideController.setupView();
5841        this.view = this.slideController.view;
5842
5843        this.$controlsCont = $('<div></div>
5843').addClass('ms-inner-controls-cont'); //.appendTo(this.$element);
5844        if (this.options.centerControls) {
5845            this.$controlsCont.css('max-width', this.options.width + 'px');
5846        }
5847
5848        this.$controlsCont.prepend(this.view.$element);
5849
5850        this.$msContainer = $('<div></div>').addClass('ms-container').prependTo(this.$element).append(this.$controlsCont);
5851
5852        if (this.controls) {
5853            for (var i = 0, l = this.controls.length; i < l; ++i) {
5854                this.controls[i].setup();
5855            }
5856        }
5857        /*else{
5858        	this.$element.append(this.view.$element);
5859        }*/
5860
5861        this._setupSliderLayout();
5862        this.__setupSlides();
5863        this.slideController.setup();
5864        this._setupOverlayLayers();
5865
5866        if (this.controls) {
5867            for (i = 0, l = this.controls.length; i < l; ++i)
5868                this.controls[i].create();
5869        }
5870
5871        if (this.options.autoHeight) {
5872            this.slideController.view.$element.height(this.slideController.currentSlide.getHeight());
5873        }
5874
5875        // add grab cursor
5876        if (this.options.swipe && !window._touch && this.options.grabCursor && this.options.mouse) {
5877            var $view = this.view.$element;
5878
5879            $view.mousedown(function() {
5880                $view.removeClass('ms-grab-cursor');
5881                $view.addClass('ms-grabbing-cursor');
5882
5883                if (window.MSBrowserInfo.msie && window.ms_grabbing_curosr) {
5884                    $view[0].style.cursor = 'url(' + window.ms_grabbing_curosr + '), move';
5885                }
5886
5887            }).addClass('ms-grab-cursor');
5888
5889            $(document).mouseup(function() {
5890                $view.removeClass('ms-grabbing-cursor');
5891                $view.addClass('ms-grab-cursor');
5892
5893                if (window.MSBrowserInfo.msie && window.ms_grab_curosr) {
5894                    $view[0].style.cursor = 'url(' + window.ms_grab_curosr + '), move';
5895                }
5896
5897            });
5898        }
5899
5900        this.slideController.__dispatchInit();
5901    };
5902
5903    /**
5904     * changes the height of slider, it used in autoheight slider
5905     * @param {Number} value
5906     * @since 1.0
5907     * @public
5908     */
5909    p.setHeight = function(value) {
5910        if (this.options.smoothHeight) {
5911            if (this.htween) {
5912                if (this.htween.reset) this.htween.reset();
5913                else this.htween.stop(true);
5914            }
5915            this.htween = CTween.animate(this.slideController.view.$element, 500, { height: value }, { ease: 'easeOutQuart' });
5916        } else
5917            this.slideController.view.$element.height(value);
5918    };
5919
5920    /**
5921     * reserves white space in sides of slider, it used by controls
5922     * @param  {String} side  left|right|top|bottom
5923     * @param  {Number} space
5924     * @returns {Number} start position in space.
5925     * @since 1.5.7
5926     * @public
5927     */
5928    p.reserveSpace = function(side, space) {
5929        var sideSpace = side + 'Space',
5930            pos = this[sideSpace];
5931
5932        this[sideSpace] += space;
5933
5934        this._updateSideMargins();
5935
5936        return pos;
5937    };
5938
5939    /**
5940     * returns the reserved space, it used by controls and called when aligned control hides
5941     * @param  {String} side
5942     * @param  {Number} space
5943     * @since 1.5.7
5944     * @public
5945     */
5946    /*p.returnSpace = function(side, space){
5947    	var sideSpace = side+'Space';
5948    	this[sideSpace] = Math.max(0 , this[sideSpace] - space);
5949
5950    	this.api.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESERVED_SPACE_CHANGE));
5951    	this._updateSideMargins();
5952    };*/
5953
5954    p._updateSideMargins = function() {
5955        this.$element.css('margin', this.topSpace + 'px ' + this.rightSpace + 'px ' + this.bottomSpace + 'px ' + this.leftSpace + 'px');
5956    }
5957
5958    p._realignControls = function() {
5959        this.rightSpace = this.leftSpace = this.topSpace = this.bottomSpace = 0;
5960        this._updateSideMargins();
5961        this.api.dispatchEvent(new MSSliderEvent(MSSliderEvent.RESERVED_SPACE_CHANGE));
5962    };
5963
5964    /*------------------------- Public Methods -----------------------*/
5965
5966    /**
5967     * Adds new control to the slider
5968     * @param  {String} control
5969     * @param  {Object} options [description]
5970     * @since 1.0
5971     * @public
5972     */
5973    p.control = function(control, options) {
5974        if (!(control in MSSlideController.SliderControlList)) return;
5975        if (!this.controls) this.controls = [];
5976        var ins = new MSSlideController.SliderControlList[control](options);
5977        ins.slider = this;
5978        this.controls.push(ins);
5979
5980        return this;
5981    };
5982
5983    /**
5984     * Hold on slider from initialization
5985     * @since 2.9.6
5986     * @public
5987     */
5988    p.holdOn = function() {
5989        this._holdOn++;
5990    };
5991
5992    /**
5993     * Let the slider to initialize
5994     * @since 2.9.6
5995     */
5996    p.release = function() {
5997        this._holdOn--;
5998        this._init();
5999    };
6000
6001    /**
6002     * setup slider
6003     * @param  {String|jQuery object} id
6004     * @param  {Object} options
6005     * @since 1.0
6006     * @public
6007     */
6008    p.setup = function(target, options) {
6009        if (typeof target === 'string') {
6010            this.$element = $('#' + target);
6011        } else {
6012            this.$element = target.eq(0);
6013        }
6014
6015        //create a copy from slider markup, it will be used in destroy method.
6016        this.setupMarkup = this.$element.html();
6017
6018        if (this.$element.length === 0) {
6019            //if(console) console.log('Master Slider Error: #'+id+' not found.');
6020            return;
6021        }
6022
6023        this.$element.addClass('master-slider').addClass('before-init');
6024
6025        // IE prefix class
6026        // add browser prefix class name
6027        if (window.MSBrowserInfo.msie) {
6028            this.$element.addClass('ms-ie')
6029                .addClass('ms-ie' + window.MSBrowserInfo.version.slice(0, window.MSBrowserInfo.version.indexOf('.')));
6030        } else if (window.MSBrowserInfo.webkit) {
6031            this.$element.addClass('ms-wk');
6032        } else if (window.MSBrowserInfo.mozilla) {
6033            this.$element.addClass('ms-moz');
6034        }
6035
6036
6037        // Android prefix class
6038        var ua = navigator.userAgent.toLowerCase();
6039        var isAndroid = ua.indexOf("android") > -1;
6040        if (isAndroid) {
6041            this.$element.addClass('ms-android');
6042        }
6043
6044        var that = this;
6045        $.extend(this.options, options);
6046
6047        this.aspect = this.options.width / this.options.height;
6048
6049        this.responsiveWidth = [this.options.phoneWidth, this.options.tabletWidth, this.options.width];
6050        this.responsiveHeight = [this.options.phoneHeight, this.options.tabletHeight, this.options.height];
6051        this.responsiveAspect = [this.options.phoneWidth / this.options.phoneHeight, this.options.tabletWidth / this.options.tabletHeight, this.options.width / this.options.height];
6052
6053        this.$loading = $('<div></div>').
6054        addClass('ms-loading-container').
6055        insertBefore(this.$element).
6056        append($('<div></div>').addClass('ms-loading'));
6057
6058        this.$loading.parent().css('position', 'relative');
6059
6060        // old methods
6061        if (this.options.autofill) {
6062            this.options.fullwidth = true;
6063            this.options.fullheight = true;
6064        }
6065
6066        if (this.options.fullheight) {
6067            this.$element.addClass('ms-fullheight');
6068        }
6069
6070        //this._setupSliderLayout();
6071        this._resize();
6072
6073        // define slide controller and api
6074        this.slideController = new MSSlideController(this);
6075        this.api = this.slideController;
6076
6077        // setup plugins
6078        for (var i = 0, l = MS._plugins.length; i !== l; i++) {
6079            var plugin = MS._plugins[i];
6080
6081            if (this.options.disablePlugins.indexOf(plugin.name) === -1) {
6082                this.activePlugins.push(new plugin(this));
6083            }
6084        }
6085
6086        if (this.options.forceInit) {
6087            MasterSlider.addJQReadyErrorCheck(this);
6088        }
6089
6090        $(document).ready(function() {
6091            if (!that.initialized) {
6092                that._docReady = true;
6093                that._init();
6094            }
6095        });
6096
6097        return this;
6098    };
6099
6100    p.getActiveBreakpoint = function(getIndex) {
6101        var bpList = ['phone', 'tablet', 'desktop'];
6102        var bpSizes = [
6103            this.options.phoneWidth || 480,
6104            this.options.tabletWidth || 768,
6105            this.options.width
6106        ];
6107
6108        var currentSize = this.options.sizingReference === 'self' ? this.$element.outerWidth(false) : window.innerWidth;
6109        var bp = 'desktop';
6110        var bpIndex = 2;
6111
6112        bpSizes.every(function(size, index) {
6113            if (size >= currentSize) {
6114                bp = bpList[index];
6115                bpIndex = index;
6116                return false;
6117            }
6118
6119            return true;
6120        }.bind(this));
6121
6122        return getIndex ? bpIndex : bp;
6123    };
6124
6125    p.getBreakpointReferenceSize = function() {
6126        var bp = this.getActiveBreakpoint();
6127        if (bp === 'desktop') {
6128            return this.options.width;
6129        }
6130
6131        return this.options[bp + 'Width'];
6132    }
6133
6134    p.getResponsiveValue = function(repsVal) {
6135        var bpIndex = this.getActiveBreakpoint(true);
6136        return repsVal.slice(bpIndex).filter(function(value) { return value !== undefined && value !== Infinity })[0];
6137    };
6138
6139    /**
6140     * destroy the slider instance
6141     * @param  {Boolean} insertMarkup	 whether add slider markup after destroy.
6142     * @since 1.4
6143     * @public
6144     */
6145    p.destroy = function(insertMarkup) {
6146
6147        // destroy active plugins
6148        for (var i = 0, l = this.activePlugins.length; i !== l; i++) {
6149            this.activePlugins[i].destroy();
6150        }
6151
6152        if (this.controls) {
6153            for (i = 0, l = this.controls.length; i !== l; i++)
6154                this.controls[i].destroy();
6155        }
6156
6157        if (this.slideController) this.slideController._destroy();
6158
6159        if (this.$loading) this.$loading.remove();
6160
6161        if (insertMarkup) {
6162            this.$element.html(this.setupMarkup).css('visibility', 'hidden');
6163        } else {
6164            this.$element.remove();
6165        }
6166
6167        var lo = this.options.layout;
6168        if (lo === 'fullscreen' || lo === 'fullwidth') {
6169            $(window).unbind('resize', this._updateLayout);
6170        }
6171
6172        this.view = null;
6173        this.slides = null;
6174        this.options = null;
6175        this.slideController = null;
6176        this.api = null;
6177        this.resize_listener = null;
6178
6179
6180        this.activePlugins = null;
6181    };
6182
6183})(jQuery);
6184
6185/**
6186 * Master Slider jQuery Plugin
6187 * @author Averta
6188 */
6189(function($, window, document, undefined) {
6190
6191    var pluginName = "masterslider",
6192        defaults = {
6193            controls: {}
6194        };
6195
6196    function MasterSliderPlugin(element, options) {
6197        this.element = element;
6198        this.$element = $(element);
6199        this.settings = $.extend({}, defaults, options);
6200        this._defaults = defaults;
6201        this._name = pluginName;
6202        this.init();
6203    }
6204
6205    $.extend(MasterSliderPlugin.prototype, {
6206        init: function() {
6207
6208            var self = this;
6209
6210            // create new instance form Master Slider
6211            this._slider = new MasterSlider();
6212
6213            // add controls
6214            for (var control in this.settings.controls) {
6215                this._slider.control(control, this.settings.controls[control]);
6216            }
6217
6218            this._slider.setup(this.$element, this.settings);
6219
6220            // override api eventdisaptcher method
6221            var _superDispatch = this._slider.api.dispatchEvent;
6222            this._slider.api.dispatchEvent = function(event) {
6223                self.$element.trigger(event.type);
6224                _superDispatch.call(this, event);
6225            };
6226
6227        },
6228
6229        api: function() {
6230            return this._slider.api;
6231        },
6232
6233        slider: function() {
6234            return this._slider;
6235        }
6236
6237    });
6238
6239    $.fn[pluginName] = function(options) {
6240        var args = arguments,
6241            plugin = 'plugin_' + pluginName;
6242
6243        // Is the first parameter an object (options), or was omitted,
6244        // instantiate a new instance of the plugin.
6245        if (options === undefined || typeof options === 'object') {
6246            return this.each(function() {
6247
6248                // Only allow the plugin to be instantiated once,
6249                // so we check that the element has no plugin instantiation yet
6250                if (!$.data(this, plugin)) {
6251                    $.data(this, plugin, new MasterSliderPlugin(this, options));
6252                }
6253            });
6254
6255            // If the first parameter is a string and it doesn't start
6256            // with an underscore or "contains" the `init`-function,
6257            // treat this as a call to a public method.
6258        } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
6259
6260            // Cache the method call
6261            // to make it possible
6262            // to return a value
6263            var returns;
6264
6265            this.each(function() {
6266                var instance = $.data(this, plugin);
6267
6268                // Tests that there's already a plugin-instance
6269                // and checks that the requested public method exists
6270                if (instance instanceof MasterSliderPlugin && typeof instance[options] === 'function') {
6271
6272                    // Call the method of our plugin instance,
6273                    // and pass it the supplied arguments.
6274                    returns = instance[options].apply(instance, Array.prototype.slice.call(args, 1));
6275                }
6276
6277                // Map slider api functions to slider jq plugin
6278                if (instance instanceof MasterSliderPlugin && typeof instance._slider.api[options] === 'function') {
6279                    returns = instance._slider.api[options].apply(instance._slider.api, Array.prototype.slice.call(args, 1));
6280                }
6281
6282                // Allow instances to be destroyed via the 'destroy' method
6283                if (options === 'destroy') {
6284                    $.data(this, plugin, null);
6285                }
6286            });
6287
6288            // If the earlier cached method
6289            // gives a value back return the value,
6290            // otherwise return this to preserve chainability.
6291            return returns !== undefined ? returns : this;
6292        }
6293    };
6294
6295})(jQuery, window, document);
6296
6297;
6298(function($, window, document, undefined) {
6299    "use strict";
6300
6301    /* ------------------------------------------------------------------------------ */
6302
6303    var sliderInstances = [];
6304    MasterSlider.addJQReadyErrorCheck = function(slider) {
6305        sliderInstances.push(slider);
6306    };
6307
6308    var _ready = $.fn.ready,
6309        _onerror = window.onerror;
6310
6311    // override jQuery ready
6312    $.fn.ready = function() {
6313
6314        // override window on load event
6315        window.onerror = function() {
6316
6317            if (sliderInstances.length !== 0) {
6318                for (var i = 0, l = sliderInstances.length; i !== l; i++) {
6319                    var slider = sliderInstances[i];
6320                    if (!slider.initialized) {
6321                        slider._docReady = true;
6322                        slider._init();
6323                    }
6324                }
6325            }
6326
6327            if (_onerror) {
6328                return _onerror.apply(this, arguments);
6329            }
6330
6331            return false;
6332        }
6333
6334        return _ready.apply(this, arguments);
6335    };
6336
6337})(jQuery, window, document);
6338
6339/* ================== bin-debug/js/pro/views/ViewEvents.js =================== */
6340window.MSViewEvents = function(type, data) {
6341    this.type = type;
6342    this.data = data;
6343};
6344
6345MSViewEvents.SWIPE_START = 'swipeStart';
6346MSViewEvents.SWIPE_END = 'swipeEnd';
6347MSViewEvents.SWIPE_MOVE = 'swipeMove';
6348MSViewEvents.SWIPE_CANCEL = 'swipeCancel';
6349MSViewEvents.SCROLL = 'scroll';
6350MSViewEvents.CHANGE_START = 'slideChangeStart';
6351MSViewEvents.CHANGE_END = 'slideChangeEnd';
6352
6353/* ================== bin-debug/js/pro/views/BasicView.js =================== */
6354;
6355(function($) {
6356
6357    "use strict";
6358
6359    window.MSBasicView = function(options) {
6360
6361        this.options = {
6362            loop: false,
6363            dir: 'h',
6364            autoHeight: false,
6365            spacing: 5,
6366            mouseSwipe: true,
6367            swipe: true,
6368            speed: 17,
6369            minSlideSpeed: 2,
6370            viewNum: 20,
6371            critMargin: 1
6372        };
6373
6374        $.extend(this.options, options);
6375
6376        this.dir = this.options.dir;
6377        this.loop = this.options.loop;
6378        this.spacing = this.options.spacing;
6379
6380        this.__width = 0;
6381        this.__height = 0;
6382
6383        this.__cssProb = this.dir === 'h' ? 'left' : 'top';
6384        this.__offset = this.dir === 'h' ? 'offsetLeft' : 'offsetTop';
6385        this.__dimension = this.dir === 'h' ? '__width' : '__height';
6386
6387        this.__translate_end = window._css3d ? ' translateZ(0px)' : '';
6388
6389        this.$slideCont = $('<div></div>').addClass('ms-slide-container');
6390        this.$element = $('<div></div>').addClass('ms-view').addClass('ms-basic-view').append(this.$slideCont);
6391
6392        this.currentSlide = null;
6393        this.index = -1;
6394        this.slidesCount = 0;
6395
6396        this.slides = [];
6397        this.slideList = []; // All of slides with added priority sort;
6398        this.viewSlidesList = [];
6399
6400        this.css3 = window._cssanim;
6401        this.start_buffer = 0;
6402        this.firstslide_snap = 0;
6403
6404        this.slideChanged = false;
6405
6406        this.controller = new Controller(0, 0, {
6407            snapping: true,
6408            snapsize: 100,
6409            paging: true,
6410            snappingMinSpeed: this.options.minSlideSpeed,
6411            friction: (100 - this.options.speed * 0.5) / 100,
6412            endless: this.loop
6413        });
6414
6415        this.controller.renderCallback(this.dir === 'h' ? this._horizUpdate : this._vertiUpdate, this);
6416        this.controller.snappingCallback(this.__snapUpdate, this);
6417        this.controller.snapCompleteCallback(this.__snapCompelet, this);
6418
6419        averta.EventDispatcher.call(this);
6420    };
6421
6422    var p = MSBasicView.prototype;
6423
6424    /*-------------- METHODS --------------*/
6425
6426    p.__snapCompelet = function(snap, type) {
6427        // if(this.loop && Math.abs(this.__contPos) > 20000){
6428        // 	this.__locateSlides();
6429        // 	this.gotoSlide(this.index , true);
6430        // }
6431        //
6432
6433        if (!this.slideChanged) {
6434            return;
6435        }
6436
6437        this.slideChanged = false;
6438
6439        this.__locateSlides();
6440        this.start_buffer = 0;
6441        this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_END));
6442    };
6443
6444    p.__snapUpdate = function(controller, snap, change) {
6445
6446        if (this.loop) {
6447            var target_index = this.index + change;
6448            this.updateLoop(target_index);
6449
6450            if (target_index >= this.slidesCount) target_index = target_index - this.slidesCount;
6451            if (target_index < 0) target_index = this.slidesCount + target_index;
6452
6453            this.index = target_index;
6454        } else {
6455            if (snap < 0 || snap >= this.slidesCount) return
6456            this.index = snap;
6457        }
6458
6459        this._checkCritMargins();
6460
6461        if (window.MSBrowserInfo.mozilla) {
6462            this.slideList[this.index].$element[0].style.marginTop = '0.1px';
6463            if (this.currentSlide) {
6464                this.currentSlide.$element[0].style.marginTop = '';
6465            }
6466        }
6467        var new_slide = this.slideList[this.index];
6468        if (new_slide === this.currentSlide) return;
6469        this.currentSlide = new_slide;
6470
6471        if (this.autoUpdateZIndex) {
6472            this.__updateSlidesZindex();
6473        }
6474
6475        this.slideChanged = true;
6476        this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START));
6477    };
6478
6479
6480    p._checkCritMargins = function() {
6481        if (this.normalMode) return;
6482
6483        var hlf = Math.floor(this.options.viewNum / 2),
6484            inView = this.viewSlidesList.indexOf(this.slideList[this.index]),
6485            size = (this[this.__dimension] + this.spacing),
6486            cm = this.options.critMargin;
6487
6488        if (this.loop) {
6489            if (inView <= cm || inView >= this.viewSlidesList.length - cm) {
6490                size *= (inView - hlf);
6491                this.__locateSlides(false, size + this.start_buffer);
6492                this.start_buffer += size;
6493            }
6494
6495            return;
6496        }
6497
6498        if ((inView < cm && this.index >= cm) || (inView >= this.viewSlidesList.length - cm && this.index < this.slidesCount - cm)) {
6499            this.__locateSlides(false);
6500        }
6501
6502    };
6503
6504
6505    p._vertiUpdate = function(controller, value) {
6506
6507        this.__contPos = value;
6508        this.dispatchEvent(new MSViewEvents(MSViewEvents.SCROLL));
6509
6510        if (this.css3) {
6511            this.$slideCont[0].style[window._jcsspfx + 'Transform'] = 'translateY(' + -value + 'px)' + this.__translate_end;
6512            return;
6513        }
6514
6515        this.$slideCont[0].style.top = -value + 'px';
6516
6517    };
6518
6519    p._horizUpdate = function(controller, value) {
6520
6521        this.__contPos = value;
6522        this.dispatchEvent(new MSViewEvents(MSViewEvents.SCROLL));
6523
6524        if (this.css3) {
6525            this.$slideCont[0].style[window._jcsspfx + 'Transform'] = 'translateX(' + -value + 'px)' + this.__translate_end;
6526            return;
6527        }
6528
6529        this.$slideCont[0].style.left = -value + 'px';
6530
6531    };
6532
6533
6534    p.__updateViewList = function() {
6535
6536        if (this.normalMode) {
6537            this.viewSlidesList = this.slides;
6538            return;
6539        }
6540
6541        var temp = this.viewSlidesList.slice();
6542
6543        // update view list
6544        this.viewSlidesList = [];
6545        var i = 0,
6546            hlf = Math.floor(this.options.viewNum / 2),
6547            l;
6548
6549        if (this.loop) {
6550            for (; i !== this.options.viewNum; i++)
6551                this.viewSlidesList.push(this.slides[this.currentSlideLoc - hlf + i]);
6552        } else {
6553            // before
6554            for (i = 0; i !== hlf && this.index - i !== -1; i++)
6555                this.viewSlidesList.unshift(this.slideList[this.index - i]);
6556            // after
6557            for (i = 1; i !== hlf && this.index + i !== this.slidesCount; i++)
6558                this.viewSlidesList.push(this.slideList[this.index + i]);
6559        }
6560
6561        for (i = 0, l = temp.length; i !== l; i++)
6562            if (this.viewSlidesList.indexOf(temp[i]) === -1)
6563                temp[i].sleep();
6564
6565        temp = null;
6566
6567        if (this.currentSlide) {
6568            this.__updateSlidesZindex();
6569        }
6570    };
6571
6572    p.__locateSlides = function(move, start) {
6573
6574        this.__updateViewList();
6575
6576        start = !this.loop ? this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing) : start || 0;
6577
6578        // old method
6579        /*for(i = 0; i < this.slidesCount ; ++i){
6580        	var pos =  i * (this[this.__dimension] + this.spacing);
6581
6582        	this.slides[i].position = pos;
6583        	this.slides[i].$element[0].style[this.__cssProb] =  pos + 'px';
6584        }*/
6585
6586        var l = this.viewSlidesList.length,
6587            slide;
6588
6589        for (var i = 0; i !== l; i++) {
6590            var pos = start + i * (this[this.__dimension] + this.spacing);
6591            slide = this.viewSlidesList[i];
6592            slide.wakeup();
6593            slide.position = pos;
6594            slide.$element[0].style[this.__cssProb] = pos + 'px';
6595        }
6596
6597        if (move !== false) this.controller.changeTo(this.slideList[this.index].position, false, null, null, false);
6598
6599    };
6600
6601    p.__createLoopList = function() {
6602        var return_arr = [];
6603        var i = 0,
6604            count = this.slidesCount / 2;
6605
6606        var before_count = (this.slidesCount % 2 === 0) ? count - 1 : Math.floor(count);
6607        var after_count = (this.slidesCount % 2 === 0) ? count : Math.floor(count);
6608
6609        this.currentSlideLoc = before_count;
6610
6611        // before
6612        for (i = 1; i <= before_count; ++i)
6613            return_arr.unshift(this.slideList[(this.index - i < 0) ? this.slidesCount - i + this.index : this.index - i]);
6614
6615        // current
6616        return_arr.push(this.slideList[this.index]);
6617
6618        // after
6619        for (i = 1; i <= after_count; ++i)
6620            return_arr.push(this.slideList[(this.index + i >= this.slidesCount) ? this.index + i - this.slidesCount : this.index + i]);
6621
6622        return return_arr;
6623
6624    };
6625
6626    /*
6627     * Calculate shortest distance from index to target.
6628     * It will used in loop gesture.
6629     *
6630     * Negative values means left direction.
6631     */
6632
6633    p.__getSteps = function(index, target) {
6634        var right = (target < index) ? this.slidesCount - index + target : target - index;
6635        var left = Math.abs(this.slidesCount - right);
6636
6637        return (right < left) ? right : -left;
6638    };
6639
6640    p.__pushEnd = function() {
6641        var first_slide = this.slides.shift();
6642        var last_slide = this.slides[this.slidesCount - 2];
6643
6644        this.slides.push(first_slide);
6645
6646        if (!this.normalMode) return;
6647
6648        var pos = last_slide.$element[0][this.__offset] + this.spacing + this[this.__dimension];
6649        first_slide.$element[0].style[this.__cssProb] = pos + 'px';
6650        first_slide.position = pos;
6651    };
6652
6653    p.__pushStart = function() {
6654        var last_slide = this.slides.pop();
6655        var first_slide = this.slides[0];
6656
6657        this.slides.unshift(last_slide);
6658
6659        if (!this.normalMode) return;
6660
6661        var pos = first_slide.$element[0][this.__offset] - this.spacing - this[this.__dimension];
6662        last_slide.$element[0].style[this.__cssProb] = pos + 'px';
6663        last_slide.position = pos;
6664    };
6665
6666    // @since 1.7.0
6667    // adds z-index to slides
6668    p.__updateSlidesZindex = function() {
6669
6670
6671        var slide,
6672            l = this.viewSlidesList.length,
6673            hlf = Math.floor(l / 2);
6674
6675        if (this.loop) {
6676            var loc = this.viewSlidesList.indexOf(this.currentSlide);
6677            for (var i = 0; i !== l; i++) {
6678                slide = this.viewSlidesList[i];
6679                this.viewSlidesList[i].$element.css('z-index', i <= loc ? i + 1 : l - i);
6680            }
6681        } else {
6682
6683            var beforeNum = this.currentSlide.index - this.viewSlidesList[0].index,
6684                afterNum = l - beforeNum,
6685                diff = beforeNum - afterNum;
6686
6687            for (var i = 0; i !== l; i++) {
6688                this.viewSlidesList[i].$element.css('z-index', i <= beforeNum ? i + 1 : l - i);
6689            }
6690
6691            this.currentSlide.$element.css('z-index', l);
6692        }
6693
6694    };
6695
6696    p.addSlide = function(slide) {
6697        slide.view = this;
6698        this.slides.push(slide);
6699        this.slideList.push(slide);
6700        this.slidesCount++;
6701    };
6702
6703    p.appendSlide = function(slide) {
6704        this.$slideCont.append(slide.$element);
6705    };
6706
6707    p.updateLoop = function(index) {
6708        if (this.loop) {
6709            var steps = this.__getSteps(this.index, index);
6710
6711            for (var i = 0, l = Math.abs(steps); i < l; ++i) {
6712                if (steps < 0) this.__pushStart();
6713                else this.__pushEnd();
6714            }
6715        }
6716    };
6717
6718    p.gotoSlide = function(index, fast) {
6719        this.updateLoop(index);
6720        this.index = index;
6721
6722        var target_slide = this.slideList[index];
6723
6724        this._checkCritMargins();
6725
6726        this.controller.changeTo(target_slide.position, !fast, null, null, false);
6727        if (target_slide === this.currentSlide) return;
6728        this.slideChanged = true;
6729        this.currentSlide = target_slide;
6730
6731        if (this.autoUpdateZIndex) {
6732            this.__updateSlidesZindex();
6733        }
6734
6735        this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START));
6736        if (fast) this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_END));
6737    };
6738
6739    p.next = function(checkLoop) {
6740        if (checkLoop && !this.loop && this.index + 1 >= this.slidesCount) {
6741            this.controller.bounce(10);
6742            return;
6743        }
6744
6745        this.gotoSlide((this.index + 1 >= this.slidesCount) ? 0 : this.index + 1);
6746    };
6747
6748    p.previous = function(checkLoop) {
6749        if (checkLoop && !this.loop && this.index - 1 < 0) {
6750            this.controller.bounce(-10);
6751            return;
6752        }
6753
6754        this.gotoSlide((this.index - 1 < 0) ? this.slidesCount - 1 : this.index - 1);
6755    };
6756
6757    /* --------------- Swipe control ------------------*/
6758
6759    p.setupSwipe = function() {
6760
6761        this.swipeControl = new averta.TouchSwipe(this.$element);
6762        this.swipeControl.swipeType = this.dir === 'h' ? 'horizontal' : 'vertical';
6763        var that = this;
6764
6765        if (this.dir === 'h') {
6766            this.swipeControl.onSwipe = function(status) {
6767                that.horizSwipeMove(status);
6768            };
6769        } else {
6770            this.swipeControl.onSwipe = function(status) {
6771                that.vertSwipeMove(status);
6772            };
6773        }
6774
6775    };
6776
6777    p.vertSwipeMove = function(status) {
6778        var phase = status.phase;
6779        if (phase === 'start') {
6780            this.controller.stop();
6781            this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_
6781START, status));
6782        } else if (phase === 'move' && (!this.loop || Math.abs(this.currentSlide.position - this.controller.value + status.moveY) < this.cont_size / 2)) {
6783            this.controller.drag(status.moveY);
6784            this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_MOVE, status));
6785        } else if (phase === 'end' || phase === 'cancel') {
6786
6787            var speed = status.distanceY / status.duration * 50 / 3,
6788                speedh = Math.abs(status.distanceY / status.duration * 50 / 3);
6789
6790            if (Math.abs(speed) > 0.1 && Math.abs(speed) >= speedh) {
6791                this.controller.push(-speed);
6792                if (speed > this.controller.options.snappingMinSpeed)
6793                    this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_END, status));
6794            } else {
6795                this.controller.cancel();
6796                this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_CANCEL, status));
6797            }
6798
6799        }
6800    };
6801
6802    p.horizSwipeMove = function(status) {
6803        var phase = status.phase;
6804
6805        if (phase === 'start') {
6806            this.controller.stop();
6807            this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_
6807START, status));
6808        } else if (phase === 'move' && (!this.loop || Math.abs(this.currentSlide.position - this.controller.value + status.moveX) < this.cont_size / 2)) {
6809            this.controller.drag(status.moveX);
6810            this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_MOVE, status));
6811        } else if (phase === 'end' || phase === 'cancel') {
6812
6813            var speed = status.distanceX / status.duration * 50 / 3,
6814                speedv = Math.abs(status.distanceY / status.duration * 50 / 3);
6815
6816            if (Math.abs(speed) > 0.1 && Math.abs(speed) >= speedv) {
6817                this.controller.push(-speed);
6818                if (speed > this.controller.options.snappingMinSpeed)
6819                    this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_END, status));
6820            } else {
6821                this.controller.cancel();
6822                this.dispatchEvent(new MSViewEvents(MSViewEvents.SWIPE_CANCEL, status));
6823            }
6824
6825        }
6826    };
6827
6828    /* ------------------------------------------------*/
6829
6830    p.setSize = function(width, height, hard) {
6831        if (this.lastWidth === width && height === this.lastHeight && !hard) return;
6832
6833        this.$element.width(width).height(height);
6834
6835        for (var i = 0; i < this.slidesCount; ++i)
6836            this.slides[i].setSize(width, height, hard);
6837
6838        this.__width = width;
6839        this.__height = height;
6840
6841        if (this.__created) {
6842            this.__locateSlides();
6843
6844            this.cont_size = (this.slidesCount - 1) * (this[this.__dimension] + this.spacing);
6845            if (!this.loop) this.controller._max_value = this.cont_size;
6846
6847            this.controller.options.snapsize = this[this.__dimension] + this.spacing;
6848            this.controller.changeTo(this.currentSlide.position, false, null, null, false);
6849            this.controller.cancel();
6850
6851            this.lastWidth = width;
6852            this.lastHeight = height;
6853        }
6854    };
6855
6856    p.create = function(index) {
6857
6858        this.__created = true;
6859
6860        this.index = Math.min((index || 0), this.slidesCount - 1);
6861        this.lastSnap = this.index; // it will be used to check snap changed or not on snap complete
6862
6863        if (this.loop)
6864            this.slides = this.__createLoopList();
6865
6866        this.normalMode = this.slidesCount <= this.options.viewNum;
6867
6868        for (var i = 0; i < this.slidesCount; ++i)
6869            this.slides[i].create();
6870
6871        this.__locateSlides();
6872
6873        this.controller.options.snapsize = this[this.__dimension] + this.spacing;
6874        if (!this.loop) this.controller._max_value = (this.slidesCount - 1) * (this[this.__dimension] + this.spacing);
6875
6876        this.gotoSlide(this.index, true);
6877
6878        if (this.options.swipe && (window._touch || this.options.mouseSwipe))
6879            this.setupSwipe();
6880
6881    };
6882
6883    p.destroy = function() {
6884        if (!this.__created) return;
6885
6886        for (var i = 0; i < this.slidesCount; ++i)
6887            this.slides[i].destroy();
6888
6889        this.slides = null;
6890        this.slideList = null;
6891        this.$element.remove();
6892
6893        this.controller.destroy();
6894        this.controller = null;
6895    };
6896
6897    averta.EventDispatcher.extend(p);
6898
6899    MSSlideController.registerView('basic', MSBasicView);
6900
6901})(jQuery);
6902
6903/* ================== bin-debug/js/pro/views/WaveView.js =================== */
6904;
6905(function($) {
6906
6907    "use strict";
6908
6909    window.MSWaveView = function(options) {
6910        MSBasicView.call(this, options);
6911        this.$element.removeClass('ms-basic-view').addClass('ms-wave-view');
6912        this.$slideCont.css(window._csspfx + 'transform-style', 'preserve-3d');
6913
6914        // Auto update z index of slides
6915        // @since 1.7
6916        this.autoUpdateZIndex = true;
6917    };
6918
6919    MSWaveView.extend(MSBasicView);
6920    MSWaveView._3dreq = true;
6921    MSWaveView._fallback = MSBasicView;
6922
6923    var p = MSWaveView.prototype;
6924    var _super = MSBasicView.prototype;
6925
6926    /*-------------- METHODS --------------*/
6927
6928    /*p.__setSlideTransDuration = function(value){
6929    	for(var i=0; i<this.slidesCount; ++i)
6930    		this.slides[i].$element.css(window._csspfx + 'transition-duration' , value + 'ms');
6931    };*/
6932
6933    p._horizUpdate = function(controller, value) {
6934
6935        _super._horizUpdate.call(this, controller, value);
6936
6937        var cont_scroll = -value;
6938        var slide_pos, slide, distance;
6939
6940        for (var i = 0; i < this.slidesCount; ++i) {
6941            slide = this.slideList[i];
6942            //slide_pos = parseInt(slide.$element.css('left'));
6943            distance = -cont_scroll - slide.position;
6944            this.__updateSlidesHoriz(slide, distance);
6945        }
6946
6947    };
6948
6949    p._vertiUpdate = function(controller, value) {
6950
6951        _super._vertiUpdate.call(this, controller, value);
6952
6953        var cont_scroll = -value;
6954        var slide_pos, slide, distance;
6955
6956        for (var i = 0; i < this.slidesCount; ++i) {
6957            slide = this.slideList[i];
6958            //slide_pos = parseInt(slide.$element.css('left'));
6959            distance = -cont_scroll - slide.position;
6960            this.__updateSlidesVertic(slide, distance);
6961        }
6962
6963    };
6964
6965
6966    p.__updateSlidesHoriz = function(slide, distance) {
6967        var value = Math.abs(distance * 100 / this.__width);
6968        //var value2 = Math.min(value , 100);
6969        //	var sp = Math.min(100 , )
6970        //slide.$bg_img.css('opacity' , (100 -  Math.abs(distance * 120 / this.__width / 3)) / 100);
6971        slide.$element[0].style[window._csspfx + 'transform'] = 'translateZ(' + -value * 3 + 'px) rotateY(0.01deg)' /* translateX('+(distance < 0 ? 1 : -1) * -value * 5+'px)'*/ ;
6972    };
6973
6974    p.__updateSlidesVertic = function(slide, distance) {
6975        this.__updateSlidesHoriz(slide, distance);
6976    };
6977
6978    /*
6979    p.swipeMove = function(status){
6980
6981    	if(status.phase == 'start'){
6982    		this.__setSlideTransDuration(0);
6983    	}else if(status.phase == 'end'){
6984    		this.__setSlideTransDuration(this.__slideDuration);
6985    	}
6986
6987    	_super.swipeMove.call(this , status);
6988    };
6989
6990    p.create = function(index){
6991    	_super.create.call(this , index);
6992
6993    	for(var i = 0; i<this.slidesCount ; ++i){
6994    		this.slides[i].$element.css(window._csspfx + 'transition-property' , window._csspfx 		+ 'transform');
6995    		this.slides[i].$element.css(window._csspfx + 'transition-duration' , this.slideDuration + 'ms');
6996    	}
6997    };
6998    */
6999    MSSlideController.registerView('wave', MSWaveView);
7000})(jQuery);
7001
7002/* ================== bin-debug/js/pro/views/FadeBasicView.js =================== */
7003/**
7004 * Master Slider Fade Basic view
7005 * @author averta
7006 * @version 1.1
7007 * @package MS
7008 */
7009
7010;
7011(function() {
7012
7013    window.MSFadeBasicView = function(options) {
7014        MSWaveView.call(this, options);
7015        this.$element.removeClass('ms-wave-view').addClass('ms-fade-basic-view');
7016    };
7017
7018    MSFadeBasicView.extend(MSWaveView);
7019
7020    var p = MSFadeBasicView.prototype;
7021    var _super = MSFadeBasicView.prototype;
7022
7023    /*-------------- METHODS --------------*/
7024
7025    p.__updateSlidesHoriz = function(slide, distance) {
7026        var value = Math.abs(distance * 0.6 / this.__width);
7027        value = 1 - Math.min(value, 0.6);
7028        slide.$element.css('opacity', value);
7029    };
7030
7031    p.__updateSlidesVertic = function(slide, distance) {
7032        this.__updateSlidesHoriz(slide, distance);
7033    };
7034
7035    MSSlideController.registerView('fadeBasic', MSFadeBasicView);
7036    MSWaveView._fallback = MSFadeBasicView;
7037})();
7038
7039/* ================== bin-debug/js/pro/views/FadeWaveView.js =================== */
7040/**
7041 * Master Slider Fade Wave View
7042 * @author averta
7043 * @version 1.0
7044 * @extends {MSWaveView}
7045 */
7046;
7047(function() {
7048
7049    window.MSFadeWaveView = function(options) {
7050        MSWaveView.call(this, options);
7051        this.$element.removeClass('ms-wave-view').addClass('ms-fade-wave-view');
7052    };
7053
7054    MSFadeWaveView.extend(MSWaveView);
7055    MSFadeWaveView._3dreq = true;
7056    MSFadeWaveView._fallback = MSFadeBasicView;
7057
7058    var p = MSFadeWaveView.prototype;
7059    var _super = MSWaveView.prototype;
7060
7061    /*-------------- METHODS --------------*/
7062
7063    p.__updateSlidesHoriz = function(slide, distance) {
7064        var value = Math.abs(distance * 100 / this.__width);
7065        value = Math.min(value, 100);
7066        slide.$element.css('opacity', 1 - value / 300);
7067        slide.$element[0].style[window._jcsspfx + 'Transform'] = 'scale(' + (1 - value / 800) + ') rotateY(0.01deg) ';
7068    };
7069
7070    p.__updateSlidesVertic = function(slide, distance) {
7071        this.__updateSlidesHoriz(slide, distance);
7072    };
7073
7074    MSSlideController.registerView('fadeWave', MSFadeWaveView);
7075
7076})();
7077
7078/* ================== bin-debug/js/pro/views/FlowView.js =================== */
7079;
7080(function($) {
7081
7082    "use strict";
7083
7084    window.MSFlowView = function(options) {
7085        MSWaveView.call(this, options);
7086        this.$element.removeClass('ms-wave-view').addClass('ms-flow-view');
7087        //this.$slideCont.css(window._csspfx + 'transform-style' , 'preserve-3d');
7088    };
7089
7090    MSFlowView.extend(MSWaveView);
7091    MSFlowView._3dreq = true;
7092    MSFlowView._fallback = MSFadeBasicView;
7093
7094    var p = MSFlowView.prototype;
7095    var _super = MSWaveView.prototype;
7096
7097    /*-------------- METHODS --------------*/
7098
7099
7100    p.__updateSlidesHoriz = function(slide, distance) {
7101        var value = Math.abs(distance * 100 / this.__width);
7102        var rvalue = Math.min(value * 0.3, 30) * (distance < 0 ? -1 : 1);
7103        var zvalue = value * 1.2;
7104        slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ(' + -zvalue * 5 + 'px) rotateY(' + rvalue + 'deg) ';
7105    };
7106
7107    p.__updateSlidesVertic = function(slide, distance) {
7108        var value = Math.abs(distance * 100 / this.__width);
7109        var rvalue = Math.min(value * 0.3, 30) * (distance < 0 ? -1 : 1);
7110        var zvalue = value * 1.2;
7111        slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ(' + -zvalue * 5 + 'px) rotateX(' + -rvalue + 'deg) ';
7112    };
7113
7114
7115    MSSlideController.registerView('flow', MSFlowView);
7116})(jQuery);
7117
7118/* ================== bin-debug/js/pro/views/FadeFlowView.js =================== */
7119/**
7120 * Master Slider Fade Flow View
7121 * @author averta
7122 * @extends {MSWaveView}
7123 * @version 1.0
7124 */
7125;
7126(function() {
7127
7128    window.MSFadeFlowView = function(options) {
7129        MSWaveView.call(this, options);
7130        this.$element.removeClass('ms-wave-view').addClass('ms-fade-flow-view');
7131    };
7132
7133    MSFadeFlowView.extend(MSWaveView);
7134    MSFadeFlowView._3dreq = true;
7135
7136    var p = MSFadeFlowView.prototype;
7137    var _super = MSWaveView.prototype;
7138
7139    /*-------------- METHODS --------------*/
7140
7141    p.__calculate = function(distance) {
7142        var value = Math.min(Math.abs(distance * 100 / this.__width), 100);
7143        var rvalue = Math.min(value * 0.5, 50) * (distance < 0 ? -1 : 1);
7144        return { value: value, rvalue: rvalue };
7145    };
7146
7147    p.__updateSlidesHoriz = function(slide, distance) {
7148        var clc = this.__calculate(distance);
7149        slide.$element.css('opacity', 1 - clc.value / 300);
7150        console.log(window._jcsspfx + 'transform', 'translateZ(' + -clc.value + 'px) rotateY(' + clc.rvalue + 'deg) ')
7151        slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ(' + -clc.value + 'px) rotateY(' + clc.rvalue + 'deg) ';
7152    };
7153
7154    p.__updateSlidesVertic = function(slide, distance) {
7155        var clc = this.__calculate(distance);
7156        slide.$element.css('opacity', 1 - clc.value / 300);
7157        slide.$element[0].style[window._jcsspfx + 'Transform'] = 'translateZ(' + -clc.value + 'px) rotateX(' + -clc.rvalue + 'deg) ';
7158    };
7159
7160    MSSlideController.registerView('fadeFlow', MSFadeFlowView);
7161
7162})();
7163
7164/* ================== bin-debug/js/pro/views/MaskView.js =================== */
7165;
7166(function($) {
7167
7168    "use strict";
7169
7170    window.MSMaskView = function(options) {
7171        MSBasicView.call(this, options);
7172        this.$element.removeClass('ms-basic-view').addClass('ms-mask-view');
7173
7174    };
7175
7176    MSMaskView.extend(MSBasicView);
7177
7178    var p = MSMaskView.prototype;
7179    var _super = MSBasicView.prototype;
7180
7181    /*-------------- METHODS --------------*/
7182
7183    p.addSlide = function(slide) { // OK
7184        slide.view = this;
7185
7186        slide.$frame = $('<div></div>').addClass('ms-mask-frame').append(slide.$element);
7187        slide.$element[0].style.position = 'relative';
7188        //this.$slideCont.append(slide.$frame);
7189        slide.autoAppend = false;
7190
7191        this.slides.push(slide);
7192        this.slideList.push(slide);
7193
7194        this.slidesCount++;
7195    };
7196
7197    p.setSize = function(width, height) {
7198        var slider = this.slides[0].slider;
7199
7200        for (var i = 0; i < this.slidesCount; ++i) {
7201            this.slides[i].$frame[0].style.width = width + 'px';
7202            if (!slider.options.autoHeight)
7203                this.slides[i].$frame[0].style.height = height + 'px';
7204        }
7205
7206        _super.setSize.call(this, width, height);
7207    };
7208
7209    // p.__snapUpdate = function(controller , snap , change){
7210
7211    // 	if(this.loop){
7212    // 		var target_index = this.index + change;
7213    // 		this.updateLoop(target_index);
7214
7215    // 		if(target_index >= this.slidesCount)	target_index = target_index - this.slidesCount;
7216    // 		if(target_index <  0)					target_index = this.slidesCount + target_index;
7217
7218    // 		this.index = target_index;
7219    // 	}else{
7220    // 		if(snap < 0 ||  snap >= this.slidesCount) return
7221    // 		this.index = snap;
7222    // 	}
7223
7224
7225    // 	this._checkCritMargins();
7226
7227    // 	if(window.MSBrowserInfo.mozilla){
7228
7229    // 		this.slideList[this.index].$frame[0].style.marginTop 	= '0.1px';
7230    // 		this.slideList[this.index].$element[0].style.marginTop 	= '0.1px';
7231
7232    // 		if(this.currentSlide){
7233    // 			this.currentSlide.$frame[0].style.marginTop 	= '';
7234    // 			this.currentSlide.$element[0].style.marginTop 	= '';
7235    // 		}
7236    // 	}
7237
7238    // 		var new_slide = this.slideList[this.index];
7239    // 	if(new_slide === this.currentSlide)return;
7240
7241    // 	this.currentSlide = new_slide;
7242    // 	this.dispatchEvent(new MSViewEvents(MSViewEvents.CHANGE_START));
7243    // };
7244
7245    p._horizUpdate = function(controller, value) {
7246
7247        _super._horizUpdate.call(this, controller, value);
7248
7249        var i = 0;
7250
7251        if (this.css3) {
7252            for (i = 0; i < this.slidesCount; ++i) {
7253                this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateX(' + (value - this.slideList[i].position) + 'px)' + this.__translate_end;
7254            }
7255            return;
7256        }
7257
7258        for (i = 0; i < this.slidesCount; ++i) {
7259            this.slideList[i].$element[0].style.left = (value - this.slideList[i].position) + 'px';
7260        }
7261
7262    };
7263
7264    p._vertiUpdate = function(controller, value) {
7265
7266        _super._vertiUpdate.call(this, controller, value);
7267
7268        var i = 0;
7269
7270        if (this.css3) {
7271            for (i = 0; i < this.slidesCount; ++i) {
7272                this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateY(' + (value - this.slideList[i].position) + 'px)' + this.__translate_end;
7273            }
7274            return;
7275        }
7276
7277        for (i = 0; i < this.slidesCount; ++i) {
7278            this.slideList[i].$element[0].style.top = (value - this.slideList[i].position) + 'px';
7279        }
7280
7281    };
7282
7283    p.__pushEnd = function() { // OK
7284        var first_slide = this.slides.shift();
7285        var last_slide = this.slides[this.slidesCount - 2];
7286
7287        this.slides.push(first_slide);
7288        if (!this.normalMode) return;
7289
7290        var pos = last_slide.$frame[0][this.__offset] + this.spacing + this[this.__dimension];
7291        first_slide.$frame[0].style[this.__cssProb] = pos + 'px';
7292        first_slide.position = pos;
7293    };
7294
7295    p.__pushStart = function() { // OK
7296
7297        var last_slide = this.slides.pop();
7298        var first_slide = this.slides[0];
7299
7300        this.slides.unshift(last_slide);
7301
7302        if (!this.normalMode) return;
7303
7304        var pos = first_slide.$frame[0][this.__offset] - this.spacing - this[this.__dimension];
7305        last_slide.$frame[0].style[this.__cssProb] = pos + 'px';
7306        last_slide.position = pos;
7307    };
7308
7309    p.__updateViewList = function() {
7310
7311        if (this.normalMode) {
7312            this.viewSlidesList = this.slides;
7313            return;
7314        }
7315
7316        var temp = this.viewSlidesList.slice();
7317
7318        // update view list
7319        this.viewSlidesList = [];
7320        var i = 0,
7321            hlf = Math.floor(this.options.viewNum / 2),
7322            l;
7323
7324        if (this.loop) {
7325            for (; i !== this.options.viewNum; i++)
7326                this.viewSlidesList.push(this.slides[this.currentSlideLoc - hlf + i]);
7327        } else {
7328            // before
7329            for (i = 0; i !== hlf && this.index - i !== -1; i++)
7330                this.viewSlidesList.unshift(this.slideList[this.index - i]);
7331            // after
7332            for (i = 1; i !== hlf && this.index + i !== this.slidesCount; i++)
7333                this.viewSlidesList.push(this.slideList[this.index + i]);
7334        }
7335
7336        for (i = 0, l = temp.length; i !== l; i++) {
7337            if (this.viewSlidesList.indexOf(temp[i]) === -1) {
7338                temp[i].sleep();
7339                temp[i].$frame.detach();
7340            }
7341        }
7342
7343        temp = null;
7344    };
7345
7346
7347    p.__locateSlides = function(move, start) { // OK
7348
7349        this.__updateViewList();
7350
7351        start = !this.loop ? this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing) : start || 0;
7352
7353        // Old method
7354        // for(var i = 0; i < this.slidesCount ; ++i){
7355        // 	var pos =  i * (this[this.__dimension] + this.spacing);
7356
7357        // 	this.slides[i].position = pos;
7358        // 	this.slides[i].$frame[0].style[this.__cssProb] =  pos + 'px';
7359        // }
7360
7361        var l = this.viewSlidesList.length,
7362            slide;
7363
7364        for (var i = 0; i !== l; i++) {
7365            var pos = start + i * (this[this.__dimension] + this.spacing);
7366            slide = this.viewSlidesList[i];
7367
7368            this.$slideCont.append(slide.$frame);
7369            slide.wakeup(false);
7370            slide.position = pos;
7371
7372            if (slide.selected && slide.bgvideo) {
7373                try {
7374                    slide.bgvideo.play();
7375                } catch (e) {}
7376            }
7377
7378            slide.$frame[0].style[this.__cssProb] = pos + 'px';
7379        }
7380
7381        if (move !== false) this.controller.changeTo(this.slideList[this.index].position, false, null, null, false);
7382
7383    };
7384
7385    MSSlideController.registerView('mask', MSMaskView);
7386})(jQuery);
7387
7388/* ================== bin-debug/js/pro/views/ParallaxMaskView.js =================== */
7389;
7390(function($) {
7391
7392    "use strict";
7393
7394    window.MSParallaxMaskView = function(options) {
7395        MSMaskView.call(this, options);
7396        this.$element.removeClass('ms-basic-view').addClass('ms-parallax-mask-view');
7397
7398    };
7399
7400    MSParallaxMaskView.extend(MSMaskView);
7401    MSParallaxMaskView.parallaxAmount = 0.5;
7402
7403    var p = MSParallaxMaskView.prototype;
7404    var _super = MSBasicView.prototype;
7405
7406    /*-------------- METHODS --------------*/
7407
7408    p._horizUpdate = function(controller, value) {
7409        _super._horizUpdate.call(this, controller, value);
7410
7411        var i = 0;
7412
7413        if (this.css3) {
7414            for (i = 0; i < this.slidesCount; ++i) {
7415                this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateX(' + (value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount + 'px)' + this.__translate_end;
7416            }
7417            return;
7418        }
7419
7420        for (i = 0; i < this.slidesCount; ++i) {
7421            this.slideList[i].$element[0].style.left = (value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount + 'px';
7422        }
7423
7424    };
7425
7426    p._vertiUpdate = function(controller, value) {
7427
7428        _super._vertiUpdate.call(this, controller, value);
7429
7430        var i = 0;
7431
7432        if (this.css3) {
7433            for (i = 0; i < this.slidesCount; ++i) {
7434                this.slideList[i].$element[0].style[window._jcsspfx + 'Transform'] = 'translateY(' + (value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount + 'px)' + this.__translate_end;
7435            }
7436            return;
7437        }
7438
7439        for (i = 0; i < this.slidesCount; ++i) {
7440            this.slideList[i].$element[0].style.top = (value - this.slideList[i].position) * MSParallaxMaskView.parallaxAmount + 'px';
7441        }
7442
7443    };
7444
7445
7446    MSSlideController.registerView('parallaxMask', MSParallaxMaskView);
7447})(jQuery);
7448
7449/* ================== bin-debug/js/pro/views/FadeView.js =================== */
7450;
7451(function($) {
7452
7453    "use strict";
7454
7455    window.MSFadeView = function(options) {
7456        MSBasicView.call(this, options);
7457        this.$element.removeClass('ms-basic-view').addClass('ms-fade-view');
7458        this.controller.renderCallback(this.__update, this);
7459    };
7460
7461    MSFadeView.extend(MSBasicView);
7462
7463    var p = MSFadeView.prototype;
7464    var _super = MSBasicView.prototype;
7465
7466    /*-------------- METHODS --------------*/
7467
7468    p.__update = function(controller, value) {
7469        var cont_scroll = -value;
7470        var slide_pos, slide, distance;
7471
7472        for (var i = 0; i < this.slidesCount; ++i) {
7473            slide = this.slideList[i];
7474            distance = -cont_scroll - slide.position;
7475            this.__updateSlides(slide, distance);
7476        }
7477    };
7478
7479    p.__updateSlides = function(slide, distance) {
7480        var value = Math.abs(distance / this[this.__dimension]);
7481        if (1 - value <= 0) {
7482            slide.$element.fadeTo(0, 0).css('visibility', 'hidden');
7483        } else {
7484            slide.$element.fadeTo(0, 1 - value).css('visibility', '');
7485        }
7486    };
7487
7488    p.__locateSlides = function(move, start) {
7489
7490        this.__updateViewList();
7491
7492        // Old method
7493        // for(var i = 0; i < this.slidesCount ; ++i){
7494        // 	this.slides[i].position = i * this[this.__dimension];
7495        // }
7496
7497        start = !this.loop ? this.slides.indexOf(this.viewSlidesList[0]) * (this[this.__dimension] + this.spacing) : start || 0;
7498
7499        var l = this.viewSlidesList.length,
7500            slide;
7501
7502        for (var i = 0; i !== l; i++) {
7503            var pos = start + i * this[this.__dimension];
7504            slide = this.viewSlidesList[i];
7505            slide.wakeup();
7506            slide.position = pos;
7507        }
7508
7509        if (move !== false) this.controller.changeTo(this.slideList[this.index].position, false, null, null, false);
7510
7511    };
7512
7513    p.__pushEnd = function() {
7514        var first_slide = this.slides.shift();
7515        var last_slide = this.slides[this.slidesCount - 2];
7516        this.slides.push(first_slide);
7517        first_slide.position = last_slide.position + this[this.__dimension];
7518    };
7519
7520    p.__pushStart = function() {
7521        var last_slide = this.slides.pop();
7522        var first_slide = this.slides[0];
7523        this.slides.unshift(last_slide);
7524        last_slide.position = first_slide.position - this[this.__dimension];
7525    };
7526
7527    p.create = function(index) {
7528        _super.create.call(this, index);
7529        this.spacing = 0;
7530        this.controller.options.minValidDist = 10;
7531    };
7532
7533    MSSlideController.registerView('fade', MSFadeView);
7534})(jQuery);
7535
7536/* ================== bin-debug/js/pro/views/ScaleView.js =================== */
7537;
7538(function($) {
7539
7540    "use strict";
7541
7542    window.MSScaleView = function(options) {
7543        MSBasicView.call(this, options);
7544        this.$element.removeClass('ms-basic-view').addClass('ms-scale-view');
7545        this.controller.renderCallback(this.__update, this);
7546    };
7547
7548    MSScaleView.extend(MSFadeView);
7549
7550    var p = MSScaleView.prototype;
7551    var _super = MSFadeView.prototype;
7552
7553    /*-------------- METHODS --------------*/
7554
7555    p.__updateSlides = function(slide, distance) {
7556        var value = Math.abs(distance / this[this.__dimension]),
7557            element = slide.$element[0];
7558
7559        if (1 - value <= 0) {
7560            element.style.opacity = 0;
7561            element.style.visibility = 'hidden';
7562            element.style[window._jcsspfx + 'Transform'] = '';
7563        } else {
7564            element.style.opacity = 1 - value;
7565            element.style.visibility = '';
7566            element.style[window._jcsspfx + 'Transform'] = 'perspective(2000px) translateZ(' + (value * (distance < 0 ? -0.5 : 0.5)) * 300 + 'px)';
7567        }
7568
7569    };
7570
7571    p.create = function(index) {
7572        _super.create.call(this, index);
7573        this.controller.options.minValidDist = 0.03;
7574    };
7575
7576    MSSlideController.registerView('scale', MSScaleView);
7577})(jQuery);
7578
7579/* ================== bin-debug/js/pro/views/StackView.js =================== */
7580/**
7581 * Master Slider Stack View 
7582 * @package Master Slider jQuery
7583 * @author Averta
7584 */
7585
7586;
7587(function($) {
7588
7589    "use strict";
7590
7591    window.MSStackView = function(options) {
7592        MSBasicView.call(this, options);
7593        this.$element.removeClass('ms-basic-view').addClass('ms-stack-view');
7594        this.controller.renderCallback(this.__update, this);
7595        this.autoUpdateZIndex = true;
7596    };
7597
7598    MSStackView.extend(MSFadeView);
7599    MSStackView._3dreq = true;
7600    MSStackView._fallback = MSFadeView;
7601
7602    var p = MSStackView.prototype;
7603    var _super = MSFadeView.prototype;
7604
7605    /*-------------- METHODS --------------*/
7606
7607    /**
7608     * Updates slides z index
7609     */
7610    p.__updateSlidesZindex = function() {
7611        var slide,
7612            l = this.viewSlidesList.length;
7613
7614        for (var i = 0; i !== l; i++) {
7615            slide = this.viewSlidesList[i];
7616            this.viewSlidesList[i].$element.css('z-index', l - i);
7617        }
7618
7619    };
7620
7621
7622    p.__updateSlides = function(slide, distance) {
7623        var value = Math.abs(distance / this[this.__dimension]),
7624            element = slide.$element[0];
7625
7626        if (1 - value <= 0) {
7627            element.style.opacity = 1;
7628            element.style.visibility = 'hidden';
7629            element.style[window._jcsspfx + 'Transform'] = '';
7630        } else {
7631            element.style.visibility = '';
7632
7633            if (distance < 0) {
7634                element.style[window._jcsspfx + 'Transform'] = 'perspective(2000px) translateZ(' + (value * -300) + 'px)';
7635            } else {
7636                element.style[window._jcsspfx + 'Transform'] = this.__translate + '(' + (-value * this[this.__dimension]) + 'px)';
7637            }
7638
7639        }
7640
7641    };
7642
7643
7644    p.create = function(index) {
7645        _super.create.call(this, index);
7646        this.controller.options.minValidDist = 0.03;
7647        this.__translate = this.dir === 'h' ? 'translateX' : 'translateY';
7648    };
7649
7650
7651    MSSlideController.registerView('stack', MSStackView);
7652})(jQuery);
7653
7654/* ================== bin-debug/js/pro/views/FocusVi
7654ew.js =================== */
7655/**
7656 * Master Slider Focus View
7657 * @version 1.1
7658 * @author averta
7659 * @package MS
7660 * @extends {MSFadeBasicView}
7661 */
7662
7663;
7664(function() {
7665
7666    'use strict';
7667
7668    var perspective = 2000;
7669
7670    window.MSFocusView = function(options) {
7671        MSWaveView.call(this, options);
7672        this.$element.removeClass('ms-wave-view').addClass('ms-focus-view');
7673        this.options.centerSpace = this.options.centerSpace || 1;
7674    };
7675
7676    MSFocusView.extend(MSWaveView);
7677    MSFocusView._3dreq = true;
7678    MSFocusView._fallback = MSFadeBasicView;
7679
7680    var p = MSFocusView.prototype;
7681    var _super = MSWaveView.prototype;
7682
7683    /*-------------- METHODS --------------*/
7684
7685    p.__calcview = function(z, w) {
7686        var a = w / 2 * z / (z + perspective);
7687        return a * (z + perspective) / perspective;
7688    };
7689
7690    p.__updateSlidesHoriz = function(slide, distance) {
7691        var value = Math.abs(distance * 100 / this.__width);
7692        value = -Math.min(value, 100) * 15;
7693        slide.$element.css(window._csspfx + 'transform', 'translateZ(' + (value + 1) + 'px) rotateY(0.01deg) translateX(' + (distance < 0 ? 1 : -1) * (-this.__calcview(value, this.__width) * this.options.centerSpace) + 'px)');
7694    };
7695
7696    p.__updateSlidesVertic = function(slide, distance) {
7697        var value = Math.abs(distance * 100 / this.__width);
7698        value = -Math.min(value, 100) * 15;
7699        slide.$element.css(window._csspfx + 'transform', 'translateZ(' + (value + 1) + 'px) rotateY(0.01deg) translateY(' + (distance < 0 ? 1 : -1) * (-this.__calcview(value, this.__width) * this.options.centerSpace) + 'px)');
7700    };
7701
7702    MSSlideController.registerView('focus', MSFocusView);
7703
7704})();
7705
7706/* ================== bin-debug/js/pro/views/PartialWaveView.js =================== */
7707/**
7708 * Master Slider Partial Wave View
7709 * @version 1.0
7710 * @author averta
7711 * @extends {MSWaveView}
7712 */
7713
7714;
7715(function() {
7716
7717    window.MSPartialWaveView = function(options) {
7718        MSWaveView.call(this, options);
7719        this.$element.removeClass('ms-wave-view').addClass('ms-partial-wave-view');
7720    };
7721
7722    MSPartialWaveView.extend(MSWaveView);
7723    MSPartialWaveView._3dreq = true;
7724    MSPartialWaveView._fallback = MSFadeBasicView;
7725
7726    var p = MSPartialWaveView.prototype;
7727    var _super = MSWaveView.prototype;
7728
7729    /*-------------- METHODS --------------*/
7730
7731    p.__updateSlidesHoriz = function(slide, distance) {
7732        var value = Math.abs(distance * 100 / this.__width);
7733        if (slide.hasBG) {
7734            slide.$bg_img.css('opacity', (100 - Math.abs(distance * 120 / this.__width / 3)) / 100);
7735        }
7736        slide.$element.css(window._csspfx + 'transform', 'translateZ(' + -value * 3 + 'px) rotateY(0.01deg) translateX(' + distance * 0.75 + 'px)');
7737    };
7738
7739    p.__updateSlidesVertic = function(slide, distance) {
7740        var value = Math.abs(distance * 100 / this.__width);
7741        if (slide.hasBG) {
7742            slide.$bg_img.css('opacity', (100 - Math.abs(distance * 120 / this.__width / 3)) / 100);
7743        }
7744        slide.$element.css(window._csspfx + 'transform', 'translateZ(' + -value * 3 + 'px) rotateY(0.01deg) translateY(' + distance * 0.75 + 'px)');
7745    };
7746
7747    MSSlideController.registerView('partialWave', MSPartialWaveView);
7748
7749})();
7750
7751/* ================== bin-debug/js/pro/views/BoxView.js =================== */
7752;
7753(function($) {
7754
7755    "use strict";
7756
7757    window.MSBoxView = function(options) {
7758        MSBasicView.call(this, options);
7759        this.$element.removeClass('ms-basic-view').addClass('ms-box-view');
7760        this.controller.renderCallback(this.__update, this);
7761    };
7762
7763    MSBoxView.extend(MSFadeView);
7764    MSBoxView._3dreq = true;
7765
7766    var p = MSBoxView.prototype;
7767    var _super = MSFadeView.prototype;
7768
7769    /*-------------- METHODS --------------*/
7770
7771    p.__updateSlides = function(slide, distance) {
7772        var value = Math.abs(distance / this[this.__dimension]),
7773            element = slide.$element[0];
7774
7775        if (1 - value <= 0) {
7776            //element.style.opacity = 0.5;
7777            element.style.visibility = 'hidden';
7778            element.style[window._jcsspfx + 'Transform'] = '';
7779        } else {
7780            //element.style.opacity = 0.5 + (1 - value) * 0.5;
7781            element.style.visibility = '';
7782            element.style[window._jcsspfx + 'Transform'] = 'rotate' + this._rotateDir + '(' + (value * (distance < 0 ? 1 : -1)) * 90 * this._calcFactor + 'deg)';
7783            element.style[window._jcsspfx + 'TransformOrigin'] = '50% 50% -' + (slide[this.__dimension] / 2) + 'px';
7784            element.style.zIndex = Math.ceil((1 - value) * 2);
7785        }
7786    };
7787
7788    p.create = function(index) {
7789        _super.create.call(this, index);
7790        this.controller.options.minValidDist = 0.03;
7791        this._rotateDir = this.options.dir === 'h' ? 'Y' : 'X';
7792        this._calcFactor = this.options.dir === 'h' ? 1 : -1;
7793
7794    };
7795
7796    MSSlideController.registerView('box', MSBoxView);
7797})(jQuery);
7798
7799/* ================== bin-debug/js/pro/uicontrols/BaseControl.js =================== */
7800;
7801(function($) {
7802
7803    "use strict";
7804
7805    var BaseControl = function() {
7806        this.options = {
7807            prefix: 'ms-',
7808            autohide: true,
7809            overVideo: true,
7810            customClass: null
7811        };
7812    };
7813
7814    var p = BaseControl.prototype;
7815
7816    /* -------------------------------- */
7817
7818    p.slideAction = function(slide) {
7819
7820    };
7821
7822    p.setup = function() {
7823        this.cont = this.options.insertTo ? $(this.options.insertTo) : this.slider.$controlsCont;
7824        if (!this.options.overVideo) this._hideOnvideoStarts();
7825
7826    };
7827
7828    p.checkHideUnder = function() {
7829        if (this.options.hideUnder) {
7830            //this.slider.api.addEventListener(MSSliderEvent.RESIZE, this.onSliderResize, this);
7831            this.needsRealign = !this.options.insetTo && (this.options.align === 'left' || this.options.align === 'right') && this.options.inset === false;
7832            $(window).bind('resize', { that: this }, this.onResize);
7833            this.onResize();
7834
7835        }
7836    };
7837
7838    /**
7839     * hide control if width of slider changes to lower that specified value [hideUnder]
7840     * @since 1.5.7
7841     * @protected
7842     */
7843    p.onResize = function(event) {
7844        var that = (event && event.data.that) || this;
7845        var w = window.innerWidth;
7846        if (w <= that.options.hideUnder && !that.detached) {
7847            that.hide(true);
7848            that.detached = true;
7849            that.onDetach();
7850        } else if (w >= that.options.hideUnder && that.detached) {
7851            that.detached = false;
7852            that.visible();
7853            that.onAppend();
7854        }
7855    };
7856
7857    p.create = function() {
7858        var that = this;
7859        if (this.options.autohide) {
7860
7861            this.hide(true);
7862
7863            this.slider.$controlsCont.mouseenter($.proxy(this._onMouseEnter, this))
7864                .mouseleave($.proxy(this._onMouseLeave, this))
7865                .mousedown($.proxy(this._onMouseDown, this));
7866
7867            if (this.$element) {
7868                this.$element.mouseenter($.proxy(this._onMouseEnter, this))
7869                    .mouseleave($.proxy(this._onMouseLeave, this))
7870                    .mousedown($.proxy(this._onMouseDown, this));
7871            }
7872
7873            $(document).mouseup($.proxy(this._onMouseUp, this));
7874        }
7875
7876        if (this.options.align) {
7877            this.$element.addClass('ms-align-' + this.options.align);
7878        }
7879
7880        // add custom class to control 
7881        if (this.options.customClass && this.$element) {
7882            this.$element.addClass(this.options.customClass);
7883        }
7884    };
7885
7886    /**
7887     * Mouse Enter Listener 
7888     * @since 2.2
7889     */
7890    p._onMouseEnter = function() {
7891        if (!this._disableAH && !this.mdown) {
7892            this.visible();
7893        }
7894
7895        this.mleave = false;
7896    };
7897
7898    /**
7899     * Mouse Leave Listener 
7900     * @since 2.2
7901     */
7902    p._onMouseLeave = function() {
7903        if (!this.mdown) {
7904            this.hide();
7905        }
7906
7907        this.mleave = true;
7908    };
7909
7910    /**
7911     * Mouse Down Listener 
7912     * @since 2.2
7913     */
7914    p._onMouseDown = function() {
7915        this.mdown = true;
7916    };
7917
7918    /**
7919     * Mouse Up Listener 
7920     * @since 2.2
7921     */
7922    p._onMouseUp = function() {
7923        if (this.mdown && this.mleave) {
7924            this.hide();
7925        }
7926
7927        this.mdown = false;
7928    };
7929
7930    /**
7931     * calls by the parent class [MSBaseControl] when the control element visibles [hideUnder option]
7932     * @since 1.5.7
7933     */
7934    p.onAppend = function() {
7935        if (this.needsRealign) {
7936            this.slider._realignControls();
7937        }
7938    };
7939
7940    /**
7941     * calls by the parent class [MSBaseControl] when the control element visibles [hideUnder option]
7942     * @since 1.5.7
7943     */
7944    p.onDetach = function() {
7945        if (this.needsRealign) {
7946            this.slider._realignControls();
7947        }
7948    };
7949
7950    p._hideOnvideoStarts = function() {
7951        var that = this;
7952        this.slider.api.addEventListener(MSSliderEvent.VIDEO_PLAY, function() {
7953            that._disableAH = true;
7954            that.hide();
7955        });
7956
7957        this.slider.api.addEventListener(MSSliderEvent.VIDEO_CLOSE, function() {
7958            that._disableAH = false;
7959            that.visible();
7960        });
7961    };
7962
7963    p.hide = function(fast) {
7964        if (fast) {
7965            this.$element.css('opacity', 0);
7966            this.$element.css('display', 'none');
7967        } else {
7968            clearTimeout(this.hideTo);
7969            var $element = this.$element;
7970            this.hideTo = setTimeout(function() {
7971                CTween.fadeOut($element, 400, false);
7972            }, 20);
7973        }
7974
7975        this.$element.addClass('ms-ctrl-hide');
7976    };
7977
7978    p.visible = function() {
7979        if (this.detached) return;
7980        clearTimeout(this.hideTo);
7981        this.$element.css('display', '');
7982        CTween.fadeIn(this.$element, 400, false);
7983        this.$element.removeClass('ms-ctrl-hide');
7984    };
7985
7986    p.destroy = function() {
7987
7988        if (this.options && this.options.hideUnder) {
7989            //this.slider.api.removeEventListener(MSSliderEvent.RESIZE, this.onResize, this);
7990            $(window).unbind('resize', this.onResize);
7991        }
7992    };
7993
7994    window.BaseControl = BaseControl;
7995
7996})(jQuery);
7997
7998/* ================== bin-debug/js/pro/uicontrols/Arrows.js =================== */
7999;
8000(function($) {
8001
8002    "use strict";
8003
8004    var MSArrows = function(options) {
8005        BaseControl.call(this);
8006        $.extend(this.options, options);
8007    };
8008
8009    MSArrows.extend(BaseControl);
8010
8011    var p = MSArrows.prototype;
8012    var _super = BaseControl.prototype;
8013
8014    /* -------------------------------- */
8015
8016    p.setup = function() {
8017        var that = this;
8018
8019        this.$next = $('<div></div>')
8020            .addClass(this.options.prefix + 'nav-next')
8021            //.appendTo(this.cont)
8022            .bind('click', function() {
8023                that.slider.api.next(true);
8024            });
8025
8026
8027        this.$prev = $('<div></div>')
8028            .addClass(this.options.prefix + 'nav-prev')
8029            //.appendTo(this.cont)
8030            .bind('click', function() {
8031                that.slider.api.previous(true);
8032            });
8033
8034        _super.setup.call(this);
8035
8036        this.cont.append(this.$next);
8037        this.cont.append(this.$prev);
8038
8039        this.checkHideUnder(); // super method
8040    };
8041
8042    p.hide = function(fast) {
8043        if (fast) {
8044            this.$prev.css('opacity', 0).css('display', 'none');
8045            this.$next.css('opacity', 0).css('display', 'none');
8046            return;
8047        }
8048
8049        CTween.fadeOut(this.$prev, 400, false);
8050        CTween.fadeOut(this.$next, 400, false);
8051
8052        this.$prev.addClass('ms-ctrl-hide');
8053        this.$next.addClass('ms-ctrl-hide');
8054    };
8055
8056    p.visible = function() {
8057        if (this.detached) return;
8058        CTween.fadeIn(this.$prev, 400);
8059        CTween.fadeIn(this.$next, 400);
8060        this.$prev.removeClass('ms-ctrl-hide').css('display', '');
8061        this.$next.removeClass('ms-ctrl-hide').css('display', '');
8062    };
8063
8064    p.destroy = function() {
8065        _super.destroy();
8066        this.$next.remove();
8067        this.$prev.remove();
8068    };
8069
8070    window.MSArrows = MSArrows;
8071    MSSlideController.registerControl('arrows', MSArrows);
8072})(jQuery);
8073
8074/* ================== bin-debug/js/pro/uicontrols/Thumblist.js =================== */
8075;
8076(function($) {
8077
8078    "use strict";
8079
8080    var MSThumblist = function(options) {
8081        BaseControl.call(this);
8082
8083        // default options
8084        this.options.dir = 'h';
8085        this.options.wheel = options.dir === 'v';
8086        this.options.arrows = false;
8087        this.options.speed = 17;
8088        this.options.align = null;
8089        this.options.inset = false;
8090        this.options.margin = 10;
8091        this.options.space = 10;
8092        this.options.width = 100;
8093        this.options.height = 100;
8094        this.options.type = 'thumbs'; // tabs
8095        this.options.hover = false;
8096
8097
8098        $.extend(this.options, options);
8099
8100        this.thumbs = [];
8101        this.index_count = 0;
8102
8103        this.__dimen = this.options.dir === 'h' ? 'width' : 'height';
8104        this.__alignsize = this.options.dir === 'h' ? 'height' : 'width';
8105        this.__jdimen = this.options.dir === 'h' ? 'outerWidth' : 'outerHeight';
8106        this.__pos = this.options.dir === 'h' ? 'left' : 'top';
8107
8108        this.click_enable = true;
8109
8110    };
8111
8112    MSThumblist.extend(BaseControl);
8113
8114    var p = MSThumblist.prototype;
8115    var _super = BaseControl.prototype;
8116
8117    /* -------------------------------- */
8118
8119    p.setup = function() {
8120        this.$element = $('<div></div>')
8121            .addClass(this.options.prefix + 'thumb-list');
8122
8123        if (this.options.type === 'tabs') {
8124            this.$element.addClass(this.options.prefix + 'tabs');
8125        }
8126
8127        this.$element.addClass('ms-dir-' + this.options.dir);
8128
8129        _super.setup.call(this);
8130
8131
8132        if (this.slider.$controlsCont === this.cont) {
8133            this.$element.appendTo(this.slider.$element);
8134        } else {
8135            this.$element.appendTo(this.cont);
8136        }
8137
8138        this.$thumbscont = $('<div></div>')
8139            .addClass('ms-thumbs-cont')
8140            .appendTo(this.$element);
8141
8142        if (this.options.arrows) {
8143            var that = this;
8144            this.$fwd = $('<div></div>').addClass('ms-thumblist-fwd').appendTo(this.$element).click(function() { that.controller.push(-15); });
8145            this.$bwd = $('<div></div>').addClass('ms-thumblist-bwd').appendTo(this.$element).click(function() { that.controller.push(15); });
8146        }
8147
8148        // align control
8149        if (!this.options.insetTo && this.options.align) {
8150            var align = this.options.align;
8151            if (this.options.inset) {
8152                this.$element.css(align, this.options.margin);
8153            } else if (align === 'top') {
8154                this.$element.detach().prependTo(this.slider.$element).css({
8155                    'margin-bottom': this.options.margin,
8156                    'position': 'relative'
8157                });
8158            } else if (align === 'bottom') {
8159                this.$element.css({
8160                    'margin-top': this.options.margin,
8161                    'position': 'relative'
8162                });
8163            } else {
8164                this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
8165                this.align();
8166            }
8167
8168            if (this.options.dir === 'v') {
8169                this.$element.width(this.options.width);
8170            } else {
8171                this.$element.height(this.options.height);
8172            }
8173        }
8174
8175        this.checkHideUnder(); // super method
8176
8177    };
8178
8179    /**
8180     * calls by "RESERVED_SPACE_CHANGE" realigns the control in slider
8181     * @since 1.5.7
8182     */
8183    p.align = function(event) {
8184        if (this.detached) {
8185            return;
8186        }
8187        var align = this.options.align;
8188        var pos = this.slider.reserveSpace(align, this.options[this.__alignsize] + this.options.margin * 2);
8189        this.$element.css(align, -pos - this.options[this.__alignsize] - this.options.margin);
8190    };
8191
8192    p.slideAction = function(slide) {
8193        var thumb_ele = slide.$element.find('.ms-thumb');
8194        var that = this;
8195
8196        var thumb_frame = $('<div></div>')
8197            .addClass('ms-thumb-frame')
8198            .append(thumb_ele)
8199            .append($('<div class="ms-thumb-ol"></div>'))
8200            .bind(this.options.hover ? 'hover' : 'click', function() { that.changeSlide(thumb_frame); });
8201
8202        if (this.options.align) {
8203            thumb_frame.width(this.options.width - (this.options.dir === 'v' && this.options.type === 'tabs' ? 12 : 0)) // less arrow size 12px
8204                .height(this.options.height)
8205                .css('margin-' + (this.options.dir === 'v' ? 'bottom' : 'right'), this.options.space);
8206        }
8207
8208        thumb_frame[0].index = this.index_count++;
8209
8210        this.$thumbscont.append(thumb_frame);
8211
8212        // Added Fillmode support to thumblist
8213        // @since 1.6.0
8214        if (this.options.fillMode && thumb_ele.is('img')) {
8215            var aligner = new window.MSAligner(this.options.fillMode, thumb_frame, thumb_ele);
8216            thumb_ele[0].aligner = aligner;
8217            thumb_ele.one('load', function(e) {
8218                var $this = $(this);
8219                $this[0].aligner.init($this.width(), $this.height());
8220                $this[0].aligner.align();
8221            }).each($.jqLoadFix);
8222        }
8223
8224        if (window.MSBrowserInfo.msie)
8225            thumb_ele.on('dragstart', function(event) { event.preventDefault(); }); // disable native dragging
8226
8227        this.thumbs.push(thumb_frame);
8228    };
8229
8230    p.create = function() {
8231        _super.create.call(this);
8232
8233        this.__translate_end = window._css3d ? ' translateZ(0px)' : '';
8234        this.controller = new Controller(0, 0, {
8235            //snapping	     : true,
8236            snappingMinSpeed: 2,
8237            friction: (100 - this.options.speed * 0.5) / 100
8238        });
8239
8240        this.controller.renderCallback(this.options.dir === 'h' ? this._hMove : this._vMove, this);
8241        //this.controller.snappingCallback(this.__snapUpdate , this);
8242        //this.controller.snapCompleteCallback(this.__snapCompelet , this);
8243
8244        var that = this;
8245        this.resize_listener = function() { that.__resize(); };
8246        $(window).bind('resize', this.resize_listener);
8247
8248        this.thumbSize = this.thumbs[0][this.__jdimen](true);
8249
8250        this.setupSwipe();
8251        this.__resize();
8252
8253        var that = this;
8254        if (this.options.wheel) {
8255
8256            this.wheellistener = function(event) {
8257                var e = window.event || event.orginalEvent || event;
8258                var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
8259                that.controller.push(-delta * 10);
8260                return false;
8261            };
8262
8263            if (window.MSBrowserInfo.mozilla) this.$element[0].addEventListener('DOMMouseScroll', this.wheellistener);
8264            else this.$element.bind('mousewheel', this.wheellistener);
8265        }
8266
8267        this.slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.update, this);
8268        this.slider.api.addEventListener(MSSliderEvent.HARD_UPDATE, this.realignThumbs, this);
8269        this.cindex = this.slider.api.index();
8270        this.select(this.thumbs[this.cindex]);
8271
8272
8273    };
8274
8275    p._hMove = function(controller, value) {
8276        this.__contPos = value;
8277        if (window._cssanim) {
8278            this.$thumbscont[0].style[window._jcsspfx + 'Transform'] = 'translateX(' + -value + 'px)' + this.__translate_end;
8279            return;
8280        }
8281        this.$thumbscont[0].style.left = -value + 'px';
8282    };
8283
8284    p._vMove = function(controller, value) {
8285        this.__contPos = value;
8286        if (window._cssanim) {
8287            this.$thumbscont[0].style[window._jcsspfx + 'Transform'] = 'translateY(' + -value + 'px)' + this.__translate_end;
8288            return;
8289        }
8290        this.$thumbscont[0].style.top = -value + 'px';
8291    };
8292
8293    p.setupSwipe = function() {
8294        this.swipeControl = new averta.TouchSwipe(this.$element);
8295        this.swipeControl.swipeType = this.options.dir === 'h' ? 'horizontal' : 'vertical';
8296
8297        var that = this;
8298        if (this.options.dir === 'h')
8299            this.swipeControl.onSwipe = function(status) { that.horizSwipeMove(status); };
8300        else
8301            this.swipeControl.onSwipe = function(status) { that.vertSwipeMove(status); };
8302    };
8303
8304    p.vertSwipeMove = function(status) {
8305        if (this.dTouch) return;
8306        var phase = status.phase;
8307        if (phase === 'start')
8308            this.controller.stop();
8309        else if (phase === 'move')
8310            this.controller.drag(status.moveY);
8311        else if (phase === 'end' || phase === 'cancel') {
8312            var speed = Math.abs(status.distanceY / status.duration * 50 / 3);
8313            if (speed > 0.1) {
8314                this.controller.push(-status.distanceY / status.duration * 50 / 3);
8315            } else {
8316                this.click_enable = true;
8317                this.controller.cancel();
8318            }
8319        }
8320    };
8321
8322    p.horizSwipeMove = function(status) {
8323        if (this.dTouch) return;
8324        var phase = status.phase;
8325        if (phase === 'start') {
8326            this.controller.stop();
8327            this.click_enable = false;
8328        } else if (phase === 'move')
8329            this.controller.drag(status.moveX);
8330        else if (phase === 'end' || phase === 'cancel') {
8331            var speed = Math.abs(status.distanceX / status.duration * 50 / 3);
8332            if (speed > 0.1) {
8333                this.controller.push(-status.distanceX / status.duration * 50 / 3);
8334            } else {
8335                this.click_enable = true;
8336                this.controller.cancel();
8337            }
8338        }
8339    };
8340
8341    p.update = function() {
8342        var nindex = this.slider.api.index();
8343        if (this.cindex === nindex) return;
8344
8345        if (this.cindex != null) this.unselect(this.thumbs[this.cindex]);
8346        this.cindex = nindex;
8347        this.select(this.thumbs[this.cindex]);
8348
8349        if (!this.dTouch) this.updateThumbscroll();
8350    };
8351
8352    p.realignThumbs = function() {
8353        this.$element.find('.ms-thumb').each(function(index, thumb) {
8354            if (thumb.aligner) {
8355                thumb.aligner.align();
8356            }
8357        });
8358    };
8359
8360    p.updateThumbscroll = function() {
8361        var thumb_size;
8362
8363        var pos = this.thumbSize * this.cindex;
8364
8365        if (this.controller.value == NaN) this.controller.value = 0;
8366
8367        if (pos - this.controller.value < 0) {
8368            this.controller.gotoSnap(this.cindex, true);
8369            return;
8370        }
8371
8372        if (pos + this.thumbSize - this.controller.value > this.$element[this.__dimen]()) {
8373            var first_snap = this.cindex - Math.floor(this.$element[this.__dimen]() / this.thumbSize) + 1;
8374            this.controller.gotoSnap(first_snap, true);
8375            return;
8376        }
8377    };
8378
8379    p.changeSlide = function(thumb) {
8380        if (!this.click_enable || this.cindex === thumb[0].index) return;
8381        this.slider.api.gotoSlide(thumb[0].index);
8382    };
8383
8384    p.unselect = function(ele) {
8385        ele.removeClass('ms-thumb-frame-selected');
8386    };
8387
8388    p.select = function(ele) {
8389        ele.addClass('ms-thumb-frame-selected');
8390    };
8391
8392    p.__resize = function() {
8393        var size = this.$element[this.__dimen]();
8394
8395        if (this.ls === size) return;
8396
8397        this.ls = size;
8398
8399        this.thumbSize = this.thumbs[0][this.__jdimen](true);
8400        var len = this.slider.api.count() * this.thumbSize;
8401        this.$thumbscont[0].style[this.__dimen] = len + 'px';
8402
8403        if (len <= size) {
8404            this.dTouch = true;
8405            this.controller.stop();
8406            this.$thumbscont[0].style[this.__pos] = (size - len) * .5 + 'px';
8407            this.$thumbscont[0].style[window._jcsspfx + 'Transform'] = '';
8408        } else {
8409            this.dTouch = false;
8410            this.click_enable = true;
8411            this.$thumbscont[0].style[this.__pos] = '';
8412            this.controller._max_value = len - size;
8413            this.controller.options.snapsize = this.thumbSize;
8414            this.updateThumbscroll();
8415        }
8416
8417    };
8418
8419    p.destroy = function() {
8420        _super.destroy();
8421
8422        if (this.options.wheel) {
8423            if (window.MSBrowserInfo.mozilla) this.$element[0].removeEventListener('DOMMouseScroll', this.wheellistener);
8424            else this.$element.unbind('mousewheel', this.wheellistener);
8425            this.wheellistener = null;
8426        }
8427
8428        $(window).unbind('resize', this.resize_listener);
8429
8430        this.$element.remove();
8431
8432        this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
8433        this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START, this.update, this);
8434    };
8435
8436    window.MSThumblist = MSThumblist;
8437    MSSlideController.registerControl('thumblist', MSThumblist);
8438
8439})(jQuery);
8440
8441/* ================== bin-debug/js/pro/uicontrol
8441s/Bullets.js =================== */
8442;
8443(function($) {
8444
8445    "use strict";
8446
8447    var MSBulltes = function(options) {
8448        BaseControl.call(this);
8449
8450        this.options.dir = 'h';
8451        this.options.inset = true;
8452        this.options.margin = 10;
8453        this.options.space = 10;
8454
8455
8456        $.extend(this.options, options);
8457
8458        this.bullets = [];
8459
8460    };
8461
8462    MSBulltes.extend(BaseControl);
8463
8464    var p = MSBulltes.prototype;
8465    var _super = BaseControl.prototype;
8466
8467    /* -------------------------------- */
8468
8469    p.setup = function() {
8470        _super.setup.call(this);
8471
8472        this.$element = $('<div></div>')
8473            .addClass(this.options.prefix + 'bullets')
8474            .addClass('ms-dir-' + this.options.dir)
8475            .appendTo(this.cont);
8476
8477        this.$bullet_cont = $('<div></div>')
8478            .addClass('ms-bullets-count')
8479            .appendTo(this.$element);
8480
8481        if (!this.options.insetTo && this.options.align) {
8482
8483            var align = this.options.align;
8484            if (this.options.inset) {
8485                this.$element.css(align, this.options.margin);
8486            }
8487
8488        }
8489
8490        this.checkHideUnder(); // super method
8491    };
8492
8493    p.create = function() {
8494        _super.create.call(this);
8495        var that = this;
8496
8497        this.slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.update, this);
8498        this.cindex = this.slider.api.index();
8499        for (var i = 0; i < this.slider.api.count(); ++i) {
8500            var bullet = $('<div></div>').addClass('ms-bullet');
8501            bullet[0].index = i;
8502            bullet.on('click', function() { that.changeSlide(this.index); });
8503            this.$bullet_cont.append(bullet);
8504            this.bullets.push(bullet);
8505            if (this.options.dir === 'h') {
8506                bullet.css('margin', this.options.space / 2);
8507            } else {
8508                bullet.css('margin', this.options.space);
8509            }
8510        }
8511
8512        if (this.options.dir === 'h') {
8513            this.$element.width(bullet.outerWidth(true) * this.slider.api.count());
8514        } else {
8515            this.$element.css('margin-top', -this.$element.outerHeight(true) / 2);
8516        }
8517
8518        this.select(this.bullets[this.cindex]);
8519    };
8520
8521    p.update = function() {
8522        var nindex = this.slider.api.index();
8523        if (this.cindex === nindex) return;
8524
8525        if (this.cindex != null) this.unselect(this.bullets[this.cindex]);
8526        this.cindex = nindex;
8527        this.select(this.bullets[this.cindex]);
8528    };
8529
8530    p.changeSlide = function(index) {
8531        if (this.cindex === index) return;
8532        this.slider.api.gotoSlide(index);
8533    };
8534
8535    p.unselect = function(ele) {
8536        ele.removeClass('ms-bullet-selected');
8537    };
8538
8539    p.select = function(ele) {
8540        ele.addClass('ms-bullet-selected');
8541    };
8542
8543    p.destroy = function() {
8544        _super.destroy();
8545        this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START, this.update, this);
8546        this.$element.remove();
8547    };
8548
8549    window.MSBulltes = MSBulltes;
8550
8551    MSSlideController.registerControl('bullets', MSBulltes);
8552
8553})(jQuery);
8554
8555/* ================== bin-debug/js/pro/uicontrols/Scrollbar.js =================== */
8556;
8557(function($) {
8558
8559    "use strict";
8560
8561    var MSScrollbar = function(options) {
8562        BaseControl.call(this);
8563
8564        this.options.dir = 'h';
8565        this.options.autohide = true;
8566        this.options.width = 4;
8567        this.options.color = '#3D3D3D';
8568        this.options.margin = 10;
8569
8570        $.extend(this.options, options);
8571        this.__dimen = this.options.dir === 'h' ? 'width' : 'height';
8572        this.__jdimen = this.options.dir === 'h' ? 'outerWidth' : 'outerHeight';
8573        this.__pos = this.options.dir === 'h' ? 'left' : 'top';
8574        this.__translate_end = window._css3d ? ' translateZ(0px)' : '';
8575        this.__translate_start = this.options.dir === 'h' ? ' translateX(' : 'translateY(';
8576    };
8577
8578    MSScrollbar.extend(BaseControl);
8579
8580    var p = MSScrollbar.prototype;
8581    var _super = BaseControl.prototype;
8582
8583    /* -------------------------------- */
8584
8585    p.setup = function() {
8586
8587        this.$element = $('<div></div>')
8588            .addClass(this.options.prefix + 'sbar')
8589            .addClass('ms-dir-' + this.options.dir);
8590
8591        _super.setup.call(this);
8592
8593        if (this.slider.$controlsCont === this.cont) {
8594            this.$element.appendTo(this.slider.$element);
8595        } else {
8596            this.$element.appendTo(this.cont);
8597        }
8598
8599        this.$bar = $('<div></div>')
8600            .addClass(this.options.prefix + 'bar')
8601            .appendTo(this.$element);
8602
8603        if (this.slider.options.loop) {
8604            console.log('WARNING, MSScrollbar cannot work with looped slider.');
8605            this.disable = true;
8606            this.$element.remove();
8607        }
8608
8609        /**
8610         * align control
8611         * @since 1.5.7
8612         */
8613        // change width 
8614        if (this.options.dir === 'v') {
8615            this.$bar.width(this.options.width);
8616        } else {
8617            this.$bar.height(this.options.width);
8618        }
8619
8620        // change color
8621        this.$bar.css('background-color', this.options.color);
8622
8623        if (!this.options.insetTo && this.options.align) {
8624
8625            // reset old versions styles
8626            if (this.options.dir === 'v') {
8627                this.$element.css({
8628                    right: 'auto',
8629                    left: 'auto'
8630                });
8631            } else {
8632                this.$element.css({
8633                    top: 'auto',
8634                    bottom: 'auto'
8635                });
8636            }
8637
8638            var align = this.options.align;
8639            if (this.options.inset) {
8640                this.$element.css(align, this.options.margin);
8641            } else if (align === 'top') {
8642                this.$element.prependTo(this.slider.$element).css({
8643                    'margin-bottom': this.options.margin,
8644                    'position': 'relative'
8645                });
8646            } else if (align === 'bottom') {
8647                this.$element.css({
8648                    'margin-top': this.options.margin,
8649                    'position': 'relative'
8650                });
8651            } else {
8652                this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
8653                this.align();
8654            }
8655        }
8656
8657        this.checkHideUnder(); // super method
8658    };
8659
8660    /**
8661     * calls by "RESERVED_SPACE_CHGANE" realigns the control in slider
8662     * @since 1.5.7
8663     */
8664    p.align = function(event) {
8665        if (this.detached) {
8666            return;
8667        }
8668
8669        var align = this.options.align;
8670        var pos = this.slider.reserveSpace(align, this.options.margin * 2 + this.options.width);
8671        this.$element.css(align, -pos - this.options.margin - this.options.width);
8672    };
8673
8674    p.create = function() {
8675
8676        if (this.disable) return;
8677
8678        //_super.create.call(this);
8679        var that = this;
8680
8681        this.scroller = this.slider.api.scroller;
8682
8683        this.slider.api.view.addEventListener(MSViewEvents.SCROLL, this._update, this);
8684        this.slider.api.addEventListener(MSSliderEvent.RESIZE, this._resize, this);
8685
8686        this._resize();
8687
8688        if (this.options.autohide) {
8689            this.$bar.css('opacity', '0');
8690        }
8691    };
8692
8693    p._resize = function() {
8694        this.vdimen = this.$element[this.__dimen]();
8695        this.bar_dimen = this.slider.api.view['__' + this.__dimen] * this.vdimen / this.scroller._max_value;
8696        this.$bar[this.__dimen](this.bar_dimen);
8697    };
8698
8699    p._update = function() {
8700        var value = this.scroller.value * (this.vdimen - this.bar_dimen) / this.scroller._max_value;
8701        if (this.lvalue === value) return;
8702        this.lvalue = value;
8703
8704        if (this.options.autohide) {
8705            clearTimeout(this.hto);
8706            this.$bar.css('opacity', '1');
8707
8708            var that = this;
8709            this.hto = setTimeout(function() {
8710                //if(!that.slider.api.view.swipeControl.touchStarted)
8711                that.$bar.css('opacity', '0');
8712            }, 150);
8713        }
8714
8715        if (value < 0) {
8716            this.$bar[0].style[this.__dimen] = this.bar_dimen + value + 'px';
8717            return;
8718        }
8719
8720        if (value > this.vdimen - this.bar_dimen)
8721            this.$bar[0].style[this.__dimen] = this.vdimen - value + 'px';
8722
8723        if (window._cssanim) {
8724            this.$bar[0].style[window._jcsspfx + 'Transform'] = this.__translate_start + value + 'px)' + this.__translate_end;
8725            return;
8726        }
8727
8728        this.$bar[0].style[this.__pos] = value + 'px';
8729
8730    };
8731
8732    p.destroy = function() {
8733        _super.destroy();
8734        this.slider.api.view.removeEventListener(MSViewEvents.SCROLL, this._update, this);
8735        this.slider.api.removeEventListener(MSSliderEvent.RESIZE, this._resize, this);
8736        this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
8737
8738        this.$element.remove();
8739    };
8740
8741    window.MSScrollbar = MSScrollbar;
8742    MSSlideController.registerControl('scrollbar', MSScrollbar);
8743})(jQuery);
8744
8745/* ================== bin-debug/js/pro/uicontrols/Timebar.js =================== */
8746;
8747(function($) {
8748
8749    "use strict";
8750
8751    var MSTimerbar = function(options) {
8752        BaseControl.call(this);
8753
8754        this.options.autohide = false;
8755        this.options.width = 4;
8756        this.options.color = '#FFFFFF';
8757        this.options.inset = true;
8758        this.options.margin = 0;
8759
8760        $.extend(this.options, options);
8761    };
8762
8763    MSTimerbar.extend(BaseControl);
8764
8765    var p = MSTimerbar.prototype;
8766    var _super = BaseControl.prototype;
8767
8768    /* -------------------------------- */
8769
8770    p.setup = function() {
8771        var that = this;
8772        _super.setup.call(this);
8773
8774        this.$element = $('<div></div>')
8775            .addClass(this.options.prefix + 'timerbar');
8776
8777        _super.setup.call(this);
8778
8779        if (this.slider.$controlsCont === this.cont) {
8780            this.$element.appendTo(this.slider.$element);
8781        } else {
8782            this.$element.appendTo(this.cont);
8783        }
8784
8785        this.$bar = $('<div></div>')
8786            .addClass('ms-time-bar')
8787            .appendTo(this.$element);
8788
8789        // change width 
8790        if (this.options.dir === 'v') {
8791            this.$bar.width(this.options.width);
8792            this.$element.width(this.options.width);
8793        } else {
8794            this.$bar.height(this.options.width);
8795            this.$element.height(this.options.width);
8796        }
8797
8798        // change color
8799        this.$bar.css('background-color', this.options.color);
8800
8801        if (!this.options.insetTo && this.options.align) {
8802
8803            this.$element.css({
8804                top: 'auto',
8805                bottom: 'auto'
8806            });
8807
8808            var align = this.options.align;
8809            if (this.options.inset) {
8810                this.$element.css(align, this.options.margin);
8811            } else if (align === 'top') {
8812                this.$element.prependTo(this.slider.$element).css({
8813                    'margin-bottom': this.options.margin,
8814                    'position': 'relative'
8815                });
8816            } else if (align === 'bottom') {
8817                this.$element.css({
8818                    'margin-top': this.options.margin,
8819                    'position': 'relative'
8820                });
8821            } else {
8822                this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
8823                this.align();
8824            }
8825        }
8826
8827        this.checkHideUnder(); // super method
8828
8829    };
8830
8831    /**
8832     * calls by "RESERVED_SPACE_CHGANE" realigns the control in slider
8833     * @since 1.5.7
8834     */
8835    p.align = function(event) {
8836        if (this.detached) {
8837            return;
8838        }
8839
8840        var align = this.options.align;
8841        var pos = this.slider.reserveSpace(align, this.options.margin * 2 + this.options.width);
8842        this.$element.css(align, -pos - this.options.margin - this.options.width);
8843    };
8844
8845    p.create = function() {
8846        _super.create.call(this);
8847        this.slider.api.addEventListener(MSSliderEvent.WAITING, this._update, this);
8848        this._update();
8849    };
8850
8851    p._update = function() {
8852        this.$bar[0].style.width = this.slider.api._delayProgress + '%';
8853    };
8854
8855    p.destroy = function() {
8856        _super.destroy();
8857        this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
8858        this.slider.api.removeEventListener(MSSliderEvent.WAITING, this._update, this);
8859        this.$element.remove();
8860    };
8861
8862    window.MSTimerbar = MSTimerbar;
8863    MSSlideController.registerControl('timebar', MSTimerbar);
8864})(jQuery);
8865
8866/* ================== bin-debug/js/pro/uicontrols/CircleTimer.js =================== */
8867;
8868(function($) {
8869
8870    "use strict";
8871
8872    var MSCircleTimer = function(options) {
8873        BaseControl.call(this);
8874
8875        this.options.color = '#A2A2A2';
8876        this.options.stroke = 10;
8877        this.options.radius = 4;
8878
8879        this.options.autohide = false;
8880        $.extend(this.options, options);
8881    };
8882
8883    MSCircleTimer.extend(BaseControl);
8884
8885    var p = MSCircleTimer.prototype;
8886    var _super = BaseControl.prototype;
8887
8888    /* -------------------------------- */
8889
8890    p.setup = function() {
8891        var that = this;
8892        _super.setup.call(this);
8893
8894        this.$element = $('<div></div>')
8895            .addClass(this.options.prefix + 'ctimer')
8896            .appendTo(this.cont);
8897
8898        this.$canvas = $('<canvas></canvas>')
8899            .addClass('ms-ctimer-canvas')
8900            .appendTo(this.$element);
8901
8902        this.$bar = $('<div></div>')
8903            .addClass('ms-ctimer-bullet')
8904            .appendTo(this.$element);
8905
8906        if (!this.$canvas[0].getContext) {
8907            this.destroy();
8908            this.disable = true;
8909            return;
8910        }
8911
8912
8913        this.ctx = this.$canvas[0].getContext('2d');
8914        this.prog = 0;
8915
8916        this.__w = (this.options.radius + this.options.stroke / 2) * 2;
8917        this.$canvas[0].width = this.__w;
8918        this.$canvas[0].height = this.__w;
8919
8920        this.checkHideUnder(); // super method
8921    };
8922
8923    p.create = function() {
8924        if (this.disable) return;
8925        _super.create.call(this);
8926        this.slider.api.addEventListener(MSSliderEvent.WAITING, this._update, this);
8927
8928        var that = this;
8929        this.$element.click(function() {
8930            if (that.slider.api.paused)
8931                that.slider.api.resume();
8932            else
8933                that.slider.api.pause();
8934        });
8935
8936        this._update();
8937    };
8938
8939    p._update = function() {
8940        var that = this;
8941        $(this).stop(true).animate({ prog: this.slider.api._delayProgress * 0.01 }, { duration: 200, step: function() { that._draw(); } });
8942        //this.$bar[0].style.width = this.slider.api._delayProgress/100 * this.$element.width() + 'px';
8943    };
8944
8945    p._draw = function() {
8946        this.ctx.clearRect(0, 0, this.__w, this.__w);
8947        this.ctx.beginPath();
8948        this.ctx.arc(this.__w * .5, this.__w * .5, this.options.radius, Math.PI * 1.5, Math.PI * 1.5 + 2 * Math.PI * this.prog, false);
8949        this.ctx.strokeStyle = this.options.color;
8950        this.ctx.lineWidth = this.options.stroke;
8951        this.ctx.stroke();
8952    };
8953
8954    p.destroy = function() {
8955        _super.destroy();
8956        if (this.disable) return;
8957        $(this).stop(true);
8958        this.slider.api.removeEventListener(MSSliderEvent.WAITING, this._update, this);
8959        this.$element.remove();
8960    };
8961
8962    window.MSCircleTimer = MSCircleTimer;
8963    MSSlideController.registerControl('circletimer', MSCircleTimer);
8964})(jQuery);
8965
8966/* ================== bin-debug/js/pro/uicontrols/Lightbox.js =================== */
8967;
8968(function($) {
8969
8970    "use strict";
8971
8972    window.MSLightbox = function(options) {
8973        BaseControl.call(this, options);
8974
8975        this.options.autohide = false;
8976        $.extend(this.options, options);
8977
8978        this.data_list = [];
8979    };
8980    MSLightbox.fadeDuratation = 400;
8981    MSLightbox.extend(BaseControl);
8982
8983    var p = MSLightbox.prototype;
8984    var _super = BaseControl.prototype;
8985
8986    /* -------------------------------- */
8987    p.setup = function() {
8988        _super.setup.call(this);
8989
8990        this.$element = $('<div></div>')
8991            .addClass(this.options.prefix + 'lightbox-btn')
8992            .appendTo(this.cont);
8993
8994        this.checkHideUnder(); // super method
8995    };
8996
8997    p.slideAction = function(slide) {
8998        $('<div></div>')
8999            .addClass(this.options.prefix + 'lightbox-btn')
9000            .appendTo(slide.$element)
9001            .append($(slide.$element.find('.ms-lightbox')));
9002
9003    };
9004
9005    p.create = function() {
9006        _super.create.call(this);
9007
9008    };
9009
9010
9011    MSSlideController.registerControl('lightbox', MSLightbox);
9012})(jQuery);
9013
9014/* ================== bin-debug/js/pro/uicontrols/SlideInfo.js =================== */
9015;
9016(function($) {
9017
9018    "use strict";
9019
9020    window.MSSlideInfo = function(options) {
9021        BaseControl.call(this, options);
9022
9023        this.options.autohide = false;
9024        this.options.align = null;
9025        this.options.inset = false;
9026        this.options.margin = 10;
9027        this.options.size = 100;
9028        this.options.dir = 'h';
9029
9030        $.extend(this.options, options);
9031
9032        this.data_list = [];
9033    };
9034    MSSlideInfo.fadeDuratation = 400;
9035    MSSlideInfo.extend(BaseControl);
9036
9037    var p = MSSlideInfo.prototype;
9038    var _super = BaseControl.prototype;
9039
9040    /* -------------------------------- */
9041    p.setup = function() {
9042        this.$element = $('<div></div>')
9043            .addClass(this.options.prefix + 'slide-info')
9044            .addClass('ms-dir-' + this.options.dir);
9045
9046        _super.setup.call(this);
9047
9048        if (this.slider.$controlsCont === this.cont) {
9049            this.$element.appendTo(this.slider.$element); // insert in outer container out of overflow hidden
9050        } else {
9051            this.$element.appendTo(this.cont);
9052        }
9053
9054        // align control
9055        if (!this.options.insetTo && this.options.align) {
9056            var align = this.options.align;
9057            if (this.options.inset) {
9058                this.$element.css(align, this.options.margin);
9059            } else if (align === 'top') {
9060                this.$element.prependTo(this.slider.$element).css({
9061                    'margin-bottom': this.options.margin,
9062                    'position': 'relative'
9063                });
9064            } else if (align === 'bottom') {
9065                this.$element.css({
9066                    'margin-top': this.options.margin,
9067                    'position': 'relative'
9068                });
9069            } else {
9070                this.slider.api.addEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
9071                this.align();
9072            }
9073
9074            if (this.options.dir === 'v') {
9075                this.$element.width(this.options.size);
9076            } else {
9077                this.$element.css('min-height', this.options.size);
9078            }
9079        }
9080
9081        this.checkHideUnder(); // super method
9082    };
9083
9084    /**
9085     * calls by "RESERVED_SPACE_CHGANE" realigns the control in slider
9086     * @since 1.5.7
9087     */
9088    p.align = function(event) {
9089        if (this.detached) {
9090            return;
9091        }
9092        var align = this.options.align;
9093        var pos = this.slider.reserveSpace(align, this.options.size + this.options.margin * 2);
9094        this.$element.css(align, -pos - this.options.size - this.options.margin);
9095    };
9096
9097    p.slideAction = function(slide) {
9098        var info_ele = $(slide.$element.find('.ms-info'));
9099        var that = this;
9100        info_ele.detach();
9101
9102        this.data_list[slide.index] = info_ele;
9103    };
9104
9105    p.create = function() {
9106        _super.create.call(this);
9107        this.slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.update, this);
9108        this.cindex = this.slider.api.index();
9109        this.switchEle(this.data_list[this.cindex]);
9110    };
9111
9112    p.update = function() {
9113        var nindex = this.slider.api.index();
9114        this.switchEle(this.data_list[nindex]);
9115        this.cindex = nindex;
9116    };
9117
9118    p.switchEle = function(ele) {
9119        if (this.current_ele) {
9120            var that = this;
9121
9122            if (this.current_ele[0].tween) this.current_ele[0].tween.stop(true);
9123            this.current_ele[0].tween = CTween.animate(this.current_ele, MSSlideInfo.fadeDuratation, { opacity: 0 }, {
9124                complete: function() {
9125                    this.detach();
9126                    this[0].tween = null;
9127                    ele.css('position', 'relative');
9128                },
9129                target: this.current_ele
9130            });
9131
9132            //this.current_ele.css('position', 'absolute');			
9133            ele.css('position', 'absolute');
9134        }
9135
9136        this.__show(ele);
9137    };
9138
9139    p.__show = function(ele) {
9140        ele.appendTo(this.$element).css('opacity', '0'); ///.css('position', 'relative');
9141
9142        // calculate max height
9143        if (this.current_ele) {
9144            ele.height(Math.max(ele.height(), this.current_ele.height()));
9145        }
9146
9147        clearTimeout(this.tou);
9148        this.tou = setTimeout(function() {
9149            CTween.fadeIn(ele, MSSlideInfo.fadeDuratation);
9150            ele.css('height', '');
9151        }, MSSlideInfo.fadeDuratation);
9152
9153
9154        if (ele[0].tween) ele[0].tween.stop(true);
9155        this.current_ele = ele;
9156    };
9157
9158    p.destroy = function() {
9159        _super.destroy();
9160        clearTimeout(this.tou);
9161        if (this.current_ele && this.current_ele[0].tween) {
9162            this.current_ele[0].tween.stop('true');
9163        }
9164        this.$element.remove();
9165        this.slider.api.removeEventListener(MSSliderEvent.RESERVED_SPACE_CHANGE, this.align, this);
9166        this.slider.api.removeEventListener(MSSliderEvent.CHANGE_START, this.update, this);
9167    };
9168
9169    MSSlideController.registerControl('slideinfo', MSSlideInfo);
9170})(jQuery);
9171
9172/* ================== bin-debug/js/pro/plugins/MSGallery.js =================== */
9173/**
9174 *	Master Slider, Gallery Template v1.0
9175 * 	@author: Averta Ltd.
9176 */
9177
9178;
9179(function($) {
9180
9181    window.MSGallery = function(id, slider) {
9182        this.id = id;
9183        this.slider = slider;
9184
9185        this.telement = $('#' + id);
9186
9187        this.botcont = $('<div></div>').addClass('ms-gallery-botcont').appendTo(this.telement);
9188        this.thumbcont = $('<div></div>').addClass('ms-gal-thumbcont hide-thumbs').appendTo(this.botcont);
9189        this.playbtn = $('<div></div>').addClass('ms-gal-playbtn').appendTo(this.botcont);
9190        this.thumbtoggle = $('<div></div>').addClass('ms-gal-thumbtoggle').appendTo(this.botcont);
9191
9192        // adds required controls to slider
9193        slider.control('thumblist', { insertTo: this.thumbcont, auto
9193hide: false, dir: 'h' });
9194        slider.control('slidenum', { insertTo: this.botcont, autohide: false });
9195        slider.control('slideinfo', { insertTo: this.botcont, autohide: false });
9196        slider.control('timebar', { insertTo: this.botcont, autohide: false });
9197        slider.control('bullets', { insertTo: this.botcont, autohide: false });
9198    };
9199
9200    var p = MSGallery.prototype;
9201
9202    p._init = function() {
9203        var that = this;
9204
9205        if (!this.slider.api.paused)
9206            this.playbtn.addClass('btn-pause');
9207
9208        this.playbtn.click(function() {
9209            if (that.slider.api.paused) {
9210                that.slider.api.resume();
9211                that.playbtn.addClass('btn-pause');
9212            } else {
9213                that.slider.api.pause();
9214                that.playbtn.removeClass('btn-pause');
9215            }
9216        });
9217
9218
9219        this.thumbtoggle.click(function() {
9220
9221            if (that.vthumbs) {
9222                //that.hideThumbs();
9223                that.thumbtoggle.removeClass('btn-hide');
9224                that.vthumbs = false;
9225                that.thumbcont.addClass('hide-thumbs');
9226            } else {
9227                //that.showThumbs();
9228                that.thumbtoggle.addClass('btn-hide');
9229                that.thumbcont.removeClass('hide-thumbs');
9230                that.vthumbs = true;
9231            }
9232        });
9233
9234    };
9235
9236    p.setup = function() {
9237        var that = this;
9238        $(document).ready(function() { that._init(); });
9239    };
9240
9241
9242})(jQuery);
9243
9244/* ================== bin-debug/js/pro/plugins/MSFlickrV2.js =================== */
9245/**
9246 * Master Slider Flickr Plugin Version 2
9247 * @version 2.0.0
9248 * @author Averta Ltd.
9249 */
9250;
9251(function($) {
9252
9253    /**
9254     * Generate Flickr photoset url
9255     * @param  {String} key   api key
9256     * @param  {String} id    photoset id
9257     * @param  {Number} count number of images
9258     * @return {String}
9259     */
9260    var getPhotosetURL = function(key, id, count) {
9261        return 'https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=' + key + '&photoset_id=' + id + '&per_page=' + count + '&extras=url_o,description,date_taken,owner_name,views&format=json&jsoncallback=?';
9262    };
9263
9264    /**
9265     * Generate Flickr user public images url
9266     * @param  {String} key   api key
9267     * @param  {String} id    user id
9268     * @param  {Number} count number of images
9269     * @return {String}
9270     */
9271    var getUserPublicURL = function(key, id, count) {
9272        return 'https://api.flickr.com/services/rest/?&method=flickr.people.getPublicPhotos&api_key=' + key + '&user_id=' + id + '&per_page=' + count + '&extras=url_o,description,date_taken,owner_name,views&format=json&jsoncallback=?';
9273    };
9274
9275    /**
9276     * Generates image path
9277     * @param  {String} fid    
9278     * @param  {String} server 
9279     * @param  {String} id     
9280     * @param  {String} secret 
9281     * @param  {String} size   
9282     * @return {String}        
9283     */
9284    var getImageSource = function(fid, server, id, secret, size, data) {
9285        if (size === '_o' && data) {
9286            return data.url_o;
9287        }
9288
9289        return 'https://farm' + fid + '.staticflickr.com/' + server + '/' + id + '_' + secret + size + '.jpg';
9290    };
9291
9292    window.MSFlickrV2 = function(slider, options) {
9293
9294        var _options = {
9295            count: 10,
9296            type: 'photoset',
9297            /*
9298             * s small square 75x75 
9299             * q large square 150x150 
9300             * t thumbnail, 100 on longest side
9301             */
9302            thumbSize: 'q',
9303
9304            /*
9305             * -	medium, 500 on longest side
9306             * z	medium 640, 640 on longest side
9307             * c	medium 800, 800 on longest side
9308             * b	large, 1024 on longest side
9309             * o	original image, either a jpg, gif or png, depending on source format
9310             */
9311            imgSize: 'c'
9312        };
9313
9314        this.slider = slider;
9315        this.slider.holdOn();
9316
9317        if (!options.key) {
9318            this.errMsg('Flickr API Key required. Please add it in settings.');
9319            return;
9320        }
9321
9322        $.extend(_options, options);
9323        this.options = _options;
9324
9325        var that = this;
9326
9327        if (this.options.type === 'photoset') {
9328            $.getJSON(getPhotosetURL(this.options.key, this.options.id, this.options.count), function(data) {
9329                that._photosData(data);
9330            });
9331        } else {
9332            $.getJSON(getUserPublicURL(this.options.key, this.options.id, this.options.count), function(data) {
9333                that.options.type = 'photos';
9334                that._photosData(data);
9335            });
9336        }
9337
9338        if (this.options.imgSize !== '' && this.options.imgSize !== '-')
9339            this.options.imgSize = '_' + this.options.imgSize;
9340
9341        this.options.thumbSize = '_' + this.options.thumbSize;
9342
9343        // grab slide template from slider markup
9344        this.slideTemplate = this.slider.$element.find('.ms-slide')[0].outerHTML;
9345        this.slider.$element.find('.ms-slide').remove(); // remove all slides from slider markup
9346    };
9347
9348    var p = MSFlickrV2.prototype;
9349
9350    p._photosData = function(data) {
9351
9352        if (data.stat === 'fail') {
9353            this.errMsg('Flickr API ERROR#' + data.code + ': ' + data.message);
9354            return;
9355        }
9356
9357        var that = this;
9358        var getInfo = this.options.author || this.options.desc;
9359        $.each(data[this.options.type].photo, function(i, item) {
9360
9361            var slide_cont = that.slideTemplate.replace(/{{[\w-]+}}/g, function(match) {
9362                match = match.replace(/{{|}}/g, '');
9363                if (shortCodes[match]) {
9364                    return shortCodes[match](item, that);
9365                } else {
9366                    return '{{' + match + '}}';
9367                }
9368
9369            });
9370
9371            $(slide_cont).appendTo(that.slider.$element);
9372
9373        });
9374
9375        that._initSlider();
9376    };
9377
9378    p.errMsg = function(msg) {
9379        this.slider.$element.css('display', 'block');
9380        if (!this.errEle)
9381            this.errEle = $('<div style="font-family:Arial; color:red; font-size:12px; position:absolute; top:10px; left:10px"></div>').appendTo(this.slider.$loading);
9382
9383        this.errEle.html(msg);
9384    };
9385
9386    p._initSlider = function() {
9387        this.slider.release();
9388    };
9389
9390    // a list of functions that generates data from short codes
9391    var shortCodes = {
9392        'image': function(data, that) {
9393            return getImageSource(data.farm, data.server, data.id, data.secret, that.options.imgSize, data);
9394        },
9395
9396        'thumb': function(data, that) {
9397            return getImageSource(data.farm, data.server, data.id, data.secret, that.options.thumbSize);
9398        },
9399
9400        'title': function(data, that) {
9401            return data.title;
9402        },
9403
9404        'owner-name': function(data, that) {
9405            return data.ownername;
9406        },
9407
9408        'date-taken': function(data, that) {
9409            return data.datetaken;
9410        },
9411
9412        'views': function(data, that) {
9413            return data.views;
9414        },
9415
9416        'description': function(data, that) {
9417            return data.description._content;
9418        }
9419    };
9420
9421})(jQuery);
9422
9423/* ================== bin-debug/js/pro/plugins/MSFacebookGallery.js =================== */
9424/**
9425 * Master Slider Facebook Gallery plugin
9426 * @author Averta Ltd.
9427 * @version 1.0.0
9428 */
9429;
9430(function($) {
9431
9432
9433    window.MSFacebookGallery = function(slider, options) {
9434        var _options = {
9435            count: 10,
9436            type: 'photostream', // album
9437            /*
9438            orginal/960/720/600/480/320/130
9439             */
9440            thumbSize: '320',
9441
9442            /*
9443 			orginal/960/720/600/480/320/130
9444 			 */
9445            imgSize: 'orginal',
9446
9447            https: false,
9448            token: ''
9449        };
9450
9451        this.slider = slider;
9452        this.slider.holdOn();
9453
9454        $.extend(_options, options);
9455        this.options = _options;
9456
9457        //this.graph = this.options.https ? 'https://graph.facebook.com' : 'http://graph.facebook.com';
9458        this.graph = 'https://graph.facebook.com';
9459
9460        var that = this;
9461
9462        if (this.options.type === 'photostream') {
9463            $.getJSON(this.graph + '/' + this.options.username + '/photos/uploaded/?fields=source,name,link,images,from&limit=' + this.options.count + '&access_token=' 
9463+ this.options.token, function(data) {
9464                that._photosData(data);
9465            });
9466        } else {
9467            $.getJSON(this.graph + '/' + this.options.albumId + '/photos?fields=source,name,link,images,from&limit=' + this.options.count + '&access_token=' + this.options.token, function(data) {
9468                that._photosData(data);
9469            });
9470        }
9471
9472        // grab slide template from slider markup
9473        this.slideTemplate = this.slider.$element.find('.ms-slide')[0].outerHTML;
9474        this.slider.$element.find('.ms-slide').remove(); // remove all slides from slider markup
9475    };
9476
9477    var p = MSFacebookGallery.prototype;
9478
9479    p._photosData = function(content) {
9480
9481        if (content.error) {
9482            this.errMsg('Facebook API ERROR#' + content.error.code + '(' + content.error.type + ')' + ': ' + content.error.message);
9483            return;
9484        }
9485
9486        var that = this;
9487        var getInfo = this.options.author || this.options.desc;
9488
9489        for (var i = 0, l = content.data.length; i !== l; i++) {
9490
9491            var slide_cont = that.slideTemplate.replace(/{{[\w-]+}}/g, function(match) {
9492                match = match.replace(/{{|}}/g, '');
9493                if (shortCodes[match]) {
9494                    return shortCodes[match](content.data[i], that);
9495                } else {
9496                    return '{{' + match + '}}';
9497                }
9498
9499            });
9500
9501            $(slide_cont).appendTo(that.slider.$element);
9502        }
9503
9504        that._initSlider();
9505    };
9506
9507    p.errMsg = function(msg) {
9508        this.slider.$element.css('display', 'block');
9509        if (!this.errEle)
9510            this.errEle = $('<div style="font-family:Arial; color:red; font-size:12px; position:absolute; top:10px; left:10px"></div>').appendTo(this.slider.$loading);
9511
9512        this.errEle.html(msg);
9513    };
9514
9515    p._initSlider = function() {
9516        this.slider.release();
9517    };
9518
9519    var getImageSource = function(images, size) {
9520
9521        if (size === 'orginal') {
9522            return images[0].source;
9523        }
9524
9525        for (var i = 0, l = images.length; i !== l; i++) {
9526            if (images[i].source.indexOf(size + 'x' + size) !== -1)
9527                return images[i].source;
9528        }
9529        //  console.log(images)
9530        return images[0].source;
9531    };
9532
9533    // a list of functions that generates data from short codes
9534    var shortCodes = {
9535        'image': function(data, that) {
9536
9537            return getImageSource(data.images, that.options.imgSize);
9538        },
9539
9540        'thumb': function(data, that) {
9541            return getImageSource(data.images, that.options.thumbSize);
9542        },
9543
9544        'name': function(data, that) {
9545            return data.name;
9546        },
9547
9548        'owner-name': function(data, that) {
9549            return data.from.name;
9550        },
9551
9552        'link': function(data, that) {
9553            return data.link;
9554        }
9555    };
9556
9557})(jQuery);
9558
9559/* ================== bin-debug/js/pro/plugins/MSScrollParallax.js =================== */
9560/**
9561 * Master Slider Parallax Layers Fade
9562 * @description Moves and fades layers of current slide while scrolling window.
9563 * @package MasterSlider
9564 * @author Averta
9565 * @since v1.8.0
9566 */
9567
9568(function($) {
9569
9570    'use strict';
9571
9572    window.MSScrollParallax = function(slider, parallax, bgparallax, fade) {
9573        this.fade = fade;
9574        this.slider = slider;
9575        this.parallax = parallax / 100;
9576        this.bgparallax = bgparallax / 100;
9577
9578        slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
9579        slider.api.addEventListener(MSSliderEvent.DESTROY, this.destory, this);
9580        slider.api.addEventListener(MSSliderEvent.CHANGE_END, this.resetLayers, this);
9581        slider.api.addEventListener(MSSliderEvent.CHANGE_START, this.updateCurrentSlide, this);
9582    };
9583
9584    window.MSScrollParallax.setup = function(slider, parallax, bgparallax, fade) {
9585        // disable in mobile devices
9586        if (window._mobile) {
9587            return;
9588        }
9589
9590        if (parallax == null) {
9591            parallax = 50;
9592        }
9593
9594        if (bgparallax == null) {
9595            bgparallax = 40;
9596        }
9597
9598        return new MSScrollParallax(slider, parallax, bgparallax, fade);
9599    };
9600
9601    var p = window.MSScrollParallax.prototype;
9602
9603    p.init = function(e) {
9604        this.slider.$element.addClass('ms-scroll-parallax');
9605        this.sliderOffset = this.slider.$element.offset().top;
9606        this.updateCurrentSlide();
9607        // wrap layers element
9608        var slides = this.slider.api.view.slideList,
9609            slide;
9610        for (var i = 0, l = slides.length; i !== l; i++) {
9611            slide = slides[i];
9612            if (slide.hasLayers) {
9613                slide.layerController.$layers.wrap('<div class="ms-scroll-parallax-cont"></div>');
9614                slide.$scrollParallaxCont = slide.layerController.$layers.parent();
9615            }
9616        }
9617
9618        $(window).on('scroll', { that: this }, this.moveParallax).trigger('scroll');
9619    };
9620
9621    p.resetLayers = function(e) {
9622        if (!this.lastSlide) {
9623            return;
9624        }
9625
9626        var layers = this.lastSlide.$scrollParallaxCont;
9627
9628        if (window._css2d) {
9629            if (layers) {
9630                layers[0].style[window._jcsspfx + 'Transform'] = '';
9631            }
9632
9633            if (this.lastSlide.hasBG) {
9634                this.lastSlide.$imgcont[0].style[window._jcsspfx + 'Transform'] = '';
9635            }
9636
9637        } else {
9638            if (layers) {
9639                layers[0].style.top = '';
9640            }
9641
9642            if (this.lastSlide.hasBG) {
9643                this.lastSlide.$imgcont[0].style.top = '0px';
9644            }
9645        }
9646    };
9647
9648    p.updateCurrentSlide = function(e) {
9649        this.lastSlide = this.currentSlide;
9650
9651        this.currentSlide = this.slider.api.currentSlide;
9652        this.moveParallax({ data: { that: this } });
9653    };
9654
9655    p.moveParallax = function(e) {
9656        var that = e.data.that,
9657            slider = that.slider,
9658            offset = that.sliderOffset,
9659            scrollTop = $(window).scrollTop(),
9660            layers = that.currentSlide.$scrollParallaxCont,
9661            out = offset - scrollTop;
9662
9663        if (out <= 0) {
9664
9665            if (layers) {
9666                if (window._css3d) {
9667                    layers[0].style[window._jcsspfx + 'Transform'] = 'translateY(' + -out * that.parallax + 'px) translateZ(0.4px)';
9668                } else if (window._css2d) {
9669                    layers[0].style[window._jcsspfx + 'Transform'] = 'translateY(' + -out * that.parallax + 'px)';
9670                } else {
9671                    layers[0].style.top = -out * that.parallax + 'px';
9672                }
9673            }
9674
9675            that.updateSlidesBG(-out * that.bgparallax + 'px', true);
9676
9677            if (layers && that.fade) {
9678                layers.css('opacity', (1 - Math.min(1, -out / slider.api.height)));
9679            }
9680
9681        } else {
9682            if (layers) {
9683                if (window._css2d) {
9684                    layers[0].style[window._jcsspfx + 'Transform'] = '';
9685                } else {
9686                    layers[0].style.top = '';
9687                }
9688            }
9689
9690            that.updateSlidesBG('0px', false);
9691
9692            if (layers && that.fade) {
9693                layers.css('opacity', 1);
9694            }
9695
9696        }
9697
9698    };
9699
9700    p.updateSlidesBG = function(pos, fixed) {
9701        var slides = this.slider.api.view.slideList,
9702            position = (fixed && !window.MSBrowserInfo.msie && !window.MSBrowserInfo.opera ? 'fixed' : '');
9703
9704        for (var i = 0, l = slides.length; i !== l; i++) {
9705            if (slides[i].hasBG) {
9706                slides[i].$imgcont[0].style.position = position;
9707                slides[i].$imgcont[0].style.top = pos;
9708            }
9709
9710            if (slides[i].$bgvideocont) {
9711                slides[i].$bgvideocont[0].style.position = position;
9712                slides[i].$bgvideocont[0].style.top = pos;
9713            }
9714        }
9715
9716    };
9717
9718    p.destory = function() {
9719        slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this);
9720        slider.api.removeEventListener(MSSliderEvent.DESTROY, this.destory, this);
9721        slider.api.removeEventListener(MSSliderEvent.CHANGE_END, this.resetLayers, this);
9722        slider.api.removeEventListener(MSSliderEvent.CHANGE_START, this.updateCurrentSlide, this);
9723        $(window).off('scroll', this.moveParallax);
9724    };
9725
9726})(jQuery);
9727
9728/* ================== bin-debug/js/pro/plugins/MSKeyboardNav.js =================== */
9729/**
9730 * Keyboard navigation plugin for Master Slider.
9731 * @version  1.0.0
9732 * @author Averta
9733 * @package MasterSlider jQuery
9734 */
9735;
9736(function($, document, window) {
9737    var PId = 0;
9738
9739    // check if master slider is available
9740    if (!window.MasterSlider) {
9741        return;
9742    }
9743
9744    var KeyboardNav = function(slider) {
9745        this.slider = slider;
9746        this.PId = PId++;
9747
9748        if (this.slider.options.keyboard) {
9749            slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
9750        }
9751    };
9752
9753    KeyboardNav.name = 'MSKeyboardNav';
9754    var p = KeyboardNav.prototype;
9755
9756    /**
9757     * initiate the plugin
9758     */
9759    p.init = function() {
9760        var api = this.slider.api;
9761
9762        $(document).on('keydown.kbnav' + this.PId, function(event) {
9763            var which = event.which;
9764
9765            if (which === 37 || which === 40) {
9766                api.previous(true);
9767            } else if (which === 38 || which === 39) {
9768                api.next(true);
9769            }
9770
9771        });
9772
9773    };
9774
9775    /**
9776     * destroy the plugin
9777     */
9778    p.destroy = function() {
9779        $(document).off('keydown.kbnav' + this.PId);
9780        this.slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this);
9781    };
9782
9783    // install plugin to master slider
9784    MasterSlider.registerPlugin(KeyboardNav);
9785
9786})(jQuery, document, window);
9787
9788/* ================== bin-debug/js/pro/plugins/MSStartOnAppear.js =================== */
9789/**
9790 * Start on appear plugin for Master Slider.
9791 * 
9792 * @description This plugin prevents slider automatically initialization and inits slider when it appears inside of the browser window.
9793 * @version  1.0.0
9794 * @author Averta
9795 * @package MasterSlider jQuery
9796 */
9797
9798;
9799(function($, document, window) {
9800    var PId = 0,
9801        $window = $(window),
9802        $doc = $(document);
9803
9804    // check if master slider is available
9805    if (!window.MasterSlider) {
9806        return;
9807    }
9808
9809    var StartOnAppear = function(slider) {
9810        this.PId = PId++;
9811        this.slider = slider;
9812        this.$slider = slider.$element;
9813
9814        if (this.slider.options.startOnAppear) {
9815            // hold on slider
9816            slider.holdOn();
9817            $doc.ready($.proxy(this.init, this));
9818        }
9819    };
9820
9821    StartOnAppear.name = 'MSStartOnAppear';
9822    var p = StartOnAppear.prototype;
9823
9824    /**
9825     * initiate the plugin
9826     */
9827    p.init = function() {
9828        var api = this.slider.api;
9829        $window.on('scroll.soa' + this.PId, $.proxy(this._onScroll, this)).trigger('scroll');
9830    };
9831
9832    p._onScroll = function() {
9833        // check slider position
9834        var vpBottom = $window.scrollTop() + $window.height(),
9835            top = this.$slider.offset().top;
9836
9837        if (top < vpBottom) {
9838            $window.off('scroll.soa' + this.PId);
9839            this.slider.release();
9840        }
9841    };
9842
9843    /**
9844     * destroy the plugin
9845     */
9846    p.destroy = function() {};
9847
9848    // install plugin to master slider
9849    MasterSlider.registerPlugin(StartOnAppear);
9850
9851})(jQuery, document, window);
9852
9853/* ================== bin-debug/js/pro/plugins/MSFilters.js =================== */
9854/**
9855 * Master Slider Filters Plugin
9856 * This plugin adds CSS3 filters to the slides, like brightness, grayscale, sepia, ... It works in major browser and devices but in IE `opacity` only supported.
9857 *
9858 * @package Master Slider jQuery
9859 * @author Averta
9860 * @version  1.0.0a
9861 */
9862
9863;
9864(function(document, window, jQuery) {
9865
9866    var filterUnits = {
9867            'hue-rotate': 'deg',
9868            'blur': 'px'
9869        },
9870        initialValues = {
9871            'opacity': 1,
9872            'contrast': 1,
9873            'brightness': 1,
9874            'saturate': 1,
9875            'hue-rotate': 0,
9876            'invert': 0,
9877            'sepia': 0,
9878            'blur': 0,
9879            'grayscale': 0
9880        }
9881
9882    // check if master slider is available
9883    if (!window.MasterSlider) {
9884        return;
9885    }
9886
9887    var Filters = function(slider) {
9888        this.slider = slider;
9889
9890        if (this.slider.options.filters) {
9891            slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
9892        }
9893    };
9894
9895    Filters.name = 'MSFilters';
9896    var p = Filters.prototype;
9897
9898    /**
9899     * initiate the plugin
9900     */
9901    p.init = function() {
9902        var api = this.slider.api,
9903            view = api.view;
9904
9905        this.filters = this.slider.options.filters;
9906        this.slideList = view.slideList;
9907        this.slidesCount = view.slidesCount;
9908        this.dimension = view[view.__dimension];
9909        this.target = this.slider.options.filterTarget === 'slide' ? '$element' : '$bg_img';
9910        this.filterName = window.MSBrowserInfo.webkit ? 'WebkitFilter' : 'filter';
9911
9912        // override controller update callback
9913        var superFun = view.controller.__renderHook.fun,
9914            superRef = view.controller.__renderHook.ref;
9915        view.controller.renderCallback(function(controller, value) {
9916            superFun.call(superRef, controller, value);
9917            this.applyEffect(value);
9918        }, this);
9919        this.applyEffect(view.controller.value);
9920
9921    };
9922
9923    /**
9924     * Apply css effect to slides based on slide position.
9925     * @param  {Number} value Current position of slider controller
9926     */
9927    p.applyEffect = function(value) {
9928        var factor, slide;
9929
9930        for (var i = 0; i < this.slidesCount; ++i) {
9931            slide = this.slideList[i];
9932            factor = Math.min(1, Math.abs(value - slide.position) / this.dimension);
9933
9934            if (slide[this.target]) {
9935                if (!window.MSBrowserInfo.msie) {
9936                    slide[this.target][0].style[this.filterName] = this.generateStyle(factor);
9937                } else if (this.filters.opacity != null) {
9938                    slide[this.target].opacity(1 - this.filters.opacity * factor);
9939                }
9940            }
9941        }
9942    };
9943
9944    /**
9945     * Generate filter style based on slide distance factor
9946     * @param  {Number} factor
9947     * @return {String} CSS style
9948     */
9949    p.generateStyle = function(factor) {
9950        var style = '',
9951            unit;
9952
9953        for (var filter in this.filters) {
9954            unit = filterUnits[filter] || '';
9955            style += filter + '(' + (initialValues[filter] + (this.filters[filter] - initialValues[filter]) * factor) + ') ';
9956        }
9957
9958        return style;
9959    };
9960
9961    /**
9962     * destroy the plugin
9963     */
9964    p.destroy = function() {
9965        this.slider.api.removeEventListener(MSSliderEvent.INIT, this.init, this);
9966    };
9967
9968    // install plugin to master slider
9969    MasterSlider.registerPlugin(Filters);
9970
9971
9972})(document, window, jQuery);
9973
9974/* ================== bin-debug/js/pro/plugins/MSScrollToAction.js =================== */
9975/**
9976 * Master Slider Scroll To Action Plugin.
9977 * 
9978 * @description This plugins adds page scrolling actions to the layer actions list.
9979 * @version  1.0.0
9980 * @author Averta
9981 * @package MasterSlider jQuery
9982 */
9983
9984;
9985(function($, document, window) {
9986
9987    // check if master slider is available
9988    if (!window.MasterSlider) {
9989        return;
9990    }
9991
9992    var ScrollToAction = function(slider) {
9993        this.slider = slider;
9994        slider.api.addEventListener(MSSliderEvent.INIT, this.init, this);
9995    };
9996
9997    ScrollToAction.name = 'MSScrollToAction';
9998    var p = ScrollToAction.prototype;
9999
10000    /**
10001     * initiate the plugin
10002     */
10003    p.init = function() {
10004        var api = this.slider.api;
10005
10006        // define actions
10007        api.scrollToEnd = _scrollToEnd;
10008        api.scrollTo = _scrollTo;
10009    };
10010
10011    /**
10012     * destroy the plugin
10013     */
10014    p.destroy = function() {};
10015
10016    /**
10017     * Scroll window to the target element in page
10018     * @param {Number} duration animation duration (seconds)
10019     */
10020    var _scrollTo = function(target, duration) {
10021        var sliderEle = this.slider.$element,
10022            target = $(target).eq(0);
10023
10024        if (target.length === 0) {
10025            return;
10026        }
10027        console.log(target.offset().top, duration)
10028
10029        if (duration == null) {
10030            duration = 1.4;
10031        }
10032
10033        $('html, body').animate({
10034            scrollTop: target.offset().top
10035        }, duration * 1000, 'easeInOutQuad');
10036    };
10037
10038    /**
10039     * Scroll window to the bottom of slider
10040     * @param {Number} duration animation duration (seconds)
10041     */
10042    var _scrollToEnd = function(duration) {
10043        var sliderEle = this.slider.$element;
10044
10045        if (duration == null) {
10046            duration = 1.4;
10047        }
10048
10049        $('html, body').animate({
10050            scrollTop: sliderEle.offset().top + sliderEle.outerHeight(false)
10051        }, duration * 1000, 'easeInOutQuad');
10052    }
10053
10054    // install plugin to master slider
10055    MasterSlider.registerPlugin(ScrollToAction);
10056
10057})(jQuery, document, window);
10058
10059/* ================== bin-debug/js/pro/plugins/MSReadyCheck.js =================== */
10060;
10061(function($, window, document, undefined) {
10062    "use strict";
10063
10064    // sample of using MSReady
10065    // ( window.MSReady = MSReady || [] ).push( function( jQuery ) {
10066
10067    // });
10068
10069    if (window.MSReady) {
10070        for (var i = 0, l = MSReady.length; i !== l; i++) {
10071            MSReady[i].call(null, $);
10072        }
10073    }
10074})(jQuery, window, document);

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.