PageSourceSearch

https://lukons.lv/catalog/view/theme/journal3/lib/masterslider/masterslider.js?v=14218c54

js lukons.lv collected 2026-10-06 12:48:06 UTC 268,097 bytes, 9,840 lines download raw bytes

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