PageSourceSearch

https://www.socialnews.xyz/wp-content/cache/wpfc-minified/ff5lcevw/9my5r.js

js socialnews.xyz collected 2026-10-02 03:03:42 UTC 135,139 bytes, 3,147 lines download raw bytes

1// source --> https://www.socialnews.xyz/wp-content/plugins/sticky-menu-or-anything-on-scroll/assets/js/jq-sticky-anything.min.js?ver=2.1.1 
2/**
3* @preserve Sticky Anything 2.22 | (c) WebFactory Ltd | GPL2 Licensed
4*/
5
6var stickyAnythingBreakpoint = '' // solely to use as a debugging breakpoint, if needed.
7
8!function(e){function t(t,i){e(".sticky-element-original").clone().insertAfter(e(".sticky-element-original")).addClass("sticky-element-cloned").removeClass("element-is-not-sticky").addClass("element-is-sticky").css("position","fixed").css("top",t+"px").css("margin-left","0").css("z-index",i).removeClass("sticky-element-original").hide()}e.fn.stickThis=function(i){var n,s=e.extend({top:0,minscreenwidth:0,maxscreenwidth:99999,zindex:1,legacymode:!1,dynamicmode:!1,debugmode:!1,pushup:"",adminbar:!1},i),l=e(this).length,r=e(s.pushup).length;return r<1?(1==s.debugmode&&s.pushup&&console.error('STICKY ANYTHING DEBUG: There are no elements with the selector/class/ID you selected for the Push-up element ("'+s.pushup+'").'),s.pushup=""):r>1&&(1==s.debugmode&&console.error("STICKY ANYTHING DEBUG: There are "+r+' elements on the page with the selector/class/ID you selected for the push-up element ("'+s.pushup+'"). You can select only ONE element to push the sticky element up.'),s.pushup=""),l<1?1==s.debugmode&&console.error('STICKY ANYTHING DEBUG: There are no elements with the selector/class/ID you selected for the sticky element ("'+this.selector+'").'):l>1?1==s.debugmode&&console.error("STICKY ANYTHING DEBUG: There There are "+r+' elements with the selector/class/ID you selected for the sticky element ("'+this.selector+'"). You can only make ONE element sticky.'):1==s.legacymode?(e(this).addClass("sticky-element-original").addClass("element-is-not-sticky"),1!=s.dynamicmode&&t(s.top,s.zindex,s.adminbar),checkElement=setInterval(function(){!function(i,n,s,l,o,r,d){var a=e(".sticky-element-original").offset();if(orgElementTop=a.top,o){var c=e(o).offset();pushElementTop=c.top}var m=window,g="inner";"innerWidth"in window||(g="client",m=document.documentElement||document.body);viewport=m[g+"Width"],d&&e("body").hasClass("admin-bar")&&viewport>600?adminBarHeight=e("#wpadminbar").height():adminBarHeight=0;e(window).scrollTop()>=orgElementTop-i-adminBarHeight&&viewport>=n&&viewport<=s?(orgElement=e(".sticky-element-original"),coordsOrgElement=orgElement.offset(),leftOrgElement=coordsOrgElement.left,widthOrgElement=orgElement[0].getBoundingClientRect().width,widthOrgElement||(widthOrgElement=orgElement.css("width")),heightOrgElement=orgElement.outerHeight(),paddingOrgElement=[orgElement.css("padding-top"),orgElement.css("padding-right"),orgElement.css("padding-bottom"),orgElement.css("padding-left")],paddingCloned=paddingOrgElement[0]+" "+paddingOrgElement[1]+" "+paddingOrgElement[2]+" "+paddingOrgElement[3],1==r&&e(".sticky-element-cloned").length<1&&t(i,l),elementHeight=0,heightOrgElement<1?elementHeight=e(".sticky-element-cloned").outerHeight():elementHeight=e(".sticky-element-original").outerHeight(),o&&e(window).scrollTop()>pushElementTop-i-elementHeight-adminBarHeight?stickyTopMargin=pushElementTop-i-elementHeight-e(window).scrollTop():stickyTopMargin=adminBarHeight,e(".sticky-element-cloned").css("left",leftOrgElement+"px").css("top",i+"px").css("width",widthOrgElement).css("margin-top",stickyTopMargin).css("padding",paddingCloned).show(),e(".sticky-element-original").css("visibility","hidden")):(1==r?e(".sticky-element-cloned").remove():e(".sticky-element-cloned").hide(),e(".sticky-element-original").css("visibility","visible"))}(s.top,s.minscreenwidth,s.maxscreenwidth,s.zindex,s.pushup,s.dynamicmode,s.adminbar)},10)):(e(this).addClass("sticky-element-original").addClass("element-is-not-sticky"),orgAssignedStyles=(n=e(this),o={},o.display=n.css("display"),o.float=n.css("float"),o.flex=n.css("flex"),o["box-sizing"]=n.css("box-sizing"),o.clear=n.css("clear"),o.overflow=n.css("overflow"),o.transform=n.css("transform"),o),orgInlineStyles=e(".sticky-element-original").attr("style"),null==orgInlineStyles&&(orgInlineStyles=""),e(".sticky-element-original").addClass("sticky-element-active").before('<div class="sticky-element-placeholder" style="width:0; height:0; margin:0; padding:0; visibility:hidden;"></div>'),checkElement=setInterval(function(){!function(t,i,n,s,l,o,r,d){$listenerElement=e(".sticky-element-active");var a=$listenerElement.offset();if(orgElementTop=a.top,l){var c=e(l).offset();pushElementTop=c.top}var m=window,g="inner";"innerWidth"in window||(g="client",m=document.documentElement||document.body);viewport=m[g+"Width"],o&&e("body").hasClass("admin-bar")&&viewport>600?adminBarHeight=e("#wpadminbar").height():adminBarHeight=0;if(e(window).scrollTop()>=orgElementTop-t-adminBarHeight&&viewport>=i&&viewport<=n){for(var h in coordsOrgElement=$listenerElement.offset(),leftOrgElement=coordsOrgElement.left,widthPlaceholder=$listenerElement[0].getBoundingClientRect().width,widthPlaceholder||(widthPlaceholder=$listenerElement.css("width")),heightPlaceholder=$listenerElement[0].getBoundingClientRect().height,heightPlaceholder||(heightPlaceholder=$listenerElement.css("height")),widthSticky=e(".sticky-element-original").css("width"),"0px"==widthSticky&&(widthSticky=e(".sticky-element-original")[0].getBoundingClientRect().width),heightSticky=e(".sticky-element-original").height(),paddingOrgElement=[e(".sticky-element-original").css("padding-top"),e(".sticky-element-original").css("padding-right"),e(".sticky-element-original").css("padding-bottom"),e(".sticky-element-original").css("padding-left")],paddingSticky=paddingOrgElement[0]+" "+paddingOrgElement[1]+" "+paddingOrgElement[2]+" "+paddingOrgElement[3],marginOrgElement=[$listenerElement.css("margin-top"),$listenerElement.css("margin-right"),$listenerElement.css("margin-bottom"),$listenerElement.css("margin-left")],marginPlaceholder=marginOrgElement[0]+" "+marginOrgElement[1]+" "+marginOrgElement[2]+" "+marginOrgElement[3],assignedStyles="",r)"inline"==r[h]?assignedStyles+=h+":inline-block; ":assignedStyles+=h+":"+r[h]+"; ";elementHeight=0,heightPlaceholder<1?elementHeight=e(".sticky-element-cloned").outerHeight():elementHeight=e(".sticky-element-original").outerHeight(),l&&e(window).scrollTop()>pushElementTop-t-elementHeight-adminBarHeight?stickyTopMargin=pushElementTop-t-elementHeight-e(window).scrollTop():stickyTopMargin=adminBarHeight,assignedStyles+="width:"+widthPlaceholder+"px; height:"+heightPlaceholder+"px; margin:"+marginPlaceholder+";",e(".sticky-element-original").removeClass("sticky-element-active").removeClass("element-is-not-sticky").addClass("element-is-sticky").css("cssText","margin-top: "+stickyTopMargin+"px !important; margin-left: 0 !important").css("position","fixed").css("left",leftOrgElement+"px").css("top",t+"px").css("width",widthSticky).css("padding",paddingSticky).css("z-index",s),e(".
8sticky-element-original").each(function(){this.style.setProperty("margin-top",stickyTopMargin,"important")}),e(".sticky-element-placeholder").hasClass("sticky-element-active")||e(".sticky-element-placeholder").addClass("sticky-element-active").attr("style",assignedStyles)}else e(".sticky-element-original").addClass("sticky-element-active").removeClass("element-is-sticky").addClass("element-is-not-sticky").attr("style",d),e(".sticky-element-placeholder").hasClass("sticky-element-active")&&e(".sticky-element-placeholder").removeClass("sticky-element-active").removeAttr("style").css("width","0").css("height","0").css("margin","0").css("padding","0")}(s.top,s.minscreenwidth,s.maxscreenwidth,s.zindex,s.pushup,s.adminbar,orgAssignedStyles,orgInlineStyles)},10)),this}}(jQuery);
9// source --> https://www.socialnews.xyz/wp-content/plugins/wp-posts-carousel/owl.carousel/owl.carousel.js?ver=2.0.0 
10/**
11 * Owl carousel
12 * @version 2.0.0
13 * @author Bartosz Wojciechowski
14 * @license The MIT License (MIT)
15 * @todo Lazy Load Icon
16 * @todo prevent animationend bubling
17 * @todo itemsScaleUp
18 * @todo Test Zepto
19 * @todo stagePadding calculate wrong active classes
20 */
21;(function($, window, document, undefined) {
22
23	var drag, state, e;
24
25	/**
26	 * Template for status information about drag and touch events.
27	 * @private
28	 */
29	drag = {
30		start: 0,
31		startX: 0,
32		startY: 0,
33		current: 0,
34		currentX: 0,
35		currentY: 0,
36		offsetX: 0,
37		offsetY: 0,
38		distance: null,
39		startTime: 0,
40		endTime: 0,
41		updatedX: 0,
42		targetEl: null
43	};
44
45	/**
46	 * Template for some status informations.
47	 * @private
48	 */
49	state = {
50		isTouch: false,
51		isScrolling: false,
52		isSwiping: false,
53		direction: false,
54		inMotion: false
55	};
56
57	/**
58	 * Event functions references.
59	 * @private
60	 */
61	e = {
62		_onDragStart: null,
63		_onDragMove: null,
64		_onDragEnd: null,
65		_transitionEnd: null,
66		_resizer: null,
67		_responsiveCall: null,
68		_goToLoop: null,
69		_checkVisibile: null
70	};
71
72	/**
73	 * Creates a carousel.
74	 * @class The Owl Carousel.
75	 * @public
76	 * @param {HTMLElement|jQuery} element - The element to create the carousel for.
77	 * @param {Object} [options] - The options
78	 */
79	function Owl(element, options) {
80
81		/**
82		 * Current settings for the carousel.
83		 * @public
84		 */
85		this.settings = null;
86
87		/**
88		 * Current options set by the caller including defaults.
89		 * @public
90		 */
91		this.options = $.extend({}, Owl.Defaults, options);
92
93		/**
94		 * Plugin element.
95		 * @public
96		 */
97		this.$element = $(element);
98
99		/**
100		 * Caches informations about drag and touch events.
101		 */
102		this.drag = $.extend({}, drag);
103
104		/**
105		 * Caches some status informations.
106		 * @protected
107		 */
108		this.state = $.extend({}, state);
109
110		/**
111		 * @protected
112		 * @todo Must be documented
113		 */
114		this.e = $.extend({}, e);
115
116		/**
117		 * References to the running plugins of this carousel.
118		 * @protected
119		 */
120		this._plugins = {};
121
122		/**
123		 * Currently suppressed events to prevent them from beeing retriggered.
124		 * @protected
125		 */
126		this._supress = {};
127
128		/**
129		 * Absolute current position.
130		 * @protected
131		 */
132		this._current = null;
133
134		/**
135		 * Animation speed in milliseconds.
136		 * @protected
137		 */
138		this._speed = null;
139
140		/**
141		 * Coordinates of all items in pixel.
142		 * @todo The name of this member is missleading.
143		 * @protected
144		 */
145		this._coordinates = [];
146
147		/**
148		 * Current breakpoint.
149		 * @todo Real media queries would be nice.
150		 * @protected
151		 */
152		this._breakpoint = null;
153
154		/**
155		 * Current width of the plugin element.
156		 */
157		this._width = null;
158
159		/**
160		 * All real items.
161		 * @protected
162		 */
163		this._items = [];
164
165		/**
166		 * All cloned items.
167		 * @protected
168		 */
169		this._clones = [];
170
171		/**
172		 * Merge values of all items.
173		 * @todo Maybe this could be part of a plugin.
174		 * @protected
175		 */
176		this._mergers = [];
177
178		/**
179		 * Invalidated parts within the update process.
180		 * @protected
181		 */
182		this._invalidated = {};
183
184		/**
185		 * Ordered list of workers for the update process.
186		 * @protected
187		 */
188		this._pipe = [];
189
190		$.each(Owl.Plugins, $.proxy(function(key, plugin) {
191			this._plugins[key[0].toLowerCase() + key.slice(1)]
192				= new plugin(this);
193		}, this));
194
195		$.each(Owl.Pipe, $.proxy(function(priority, worker) {
196			this._pipe.push({
197				'filter': worker.filter,
198				'run': $.proxy(worker.run, this)
199			});
200		}, this));
201
202		this.setup();
203		this.initialize();
204	}
205
206	/**
207	 * Default options for the carousel.
208	 * @public
209	 */
210	Owl.Defaults = {
211		items: 3,
212		loop: false,
213		center: false,
214
215		mouseDrag: true,
216		touchDrag: true,
217		pullDrag: true,
218		freeDrag: false,
219
220		margin: 0,
221		stagePadding: 0,
222
223		merge: false,
224		mergeFit: true,
225		autoWidth: false,
226
227		startPosition: 0,
228		rtl: false,
229
230		smartSpeed: 250,
231		fluidSpeed: false,
232		dragEndSpeed: false,
233
234		responsive: {},
235		responsiveRefreshRate: 200,
236		responsiveBaseElement: window,
237		responsiveClass: false,
238
239		fallbackEasing: 'swing',
240
241		info: false,
242
243		nestedItemSelector: false,
244		itemElement: 'div',
245		stageElement: 'div',
246
247		// Classes and Names
248		themeClass: 'owl-theme',
249		baseClass: 'owl-carousel',
250		itemClass: 'owl-item',
251		centerClass: 'center',
252		activeClass: 'active'
253	};
254
255	/**
256	 * Enumeration for width.
257	 * @public
258	 * @readonly
259	 * @enum {String}
260	 */
261	Owl.Width = {
262		Default: 'default',
263		Inner: 'inner',
264		Outer: 'outer'
265	};
266
267	/**
268	 * Contains all registered plugins.
269	 * @public
270	 */
271	Owl.Plugins = {};
272
273	/**
274	 * Update pipe.
275	 */
276	Owl.Pipe = [ {
277		filter: [ 'width', 'items', 'settings' ],
278		run: function(cache) {
279			cache.current = this._items && this._items[this.relative(this._current)];
280		}
281	}, {
282		filter: [ 'items', 'settings' ],
283		run: function() {
284			var cached = this._clones,
285				clones = this.$stage.children('.cloned');
286
287			if (clones.length !== cached.length || (!this.settings.loop && cached.length > 0)) {
288				this.$stage.children('.cloned').remove();
289				this._clones = [];
290			}
291		}
292	}, {
293		filter: [ 'items', 'settings' ],
294		run: function() {
295			var i, n,
296				clones = this._clones,
297				items = this._items,
298				delta = this.settings.loop ? clones.length - Math.max(this.settings.items * 2, 4) : 0;
299
300			for (i = 0, n = Math.abs(delta / 2); i < n; i++) {
301				if (delta > 0) {
302					this.$stage.children().eq(items.length + clones.length - 1).remove();
303					clones.pop();
304					this.$stage.children().eq(0).remove();
305					clones.pop();
306				} else {
307					clones.push(clones.length / 2);
308					this.$stage.append(items[clones[clones.length - 1]].clone().addClass('cloned'));
309					clones.push(items.length - 1 - (clones.length - 1) / 2);
310					this.$stage.prepend(items[clones[clones.length - 1]].clone().addClass('cloned'));
311				}
312			}
313		}
314	}, {
315		filter: [ 'width', 'items', 'settings' ],
316		run: function() {
317			var rtl = (this.settings.rtl ? 1 : -1),
318				width = (this.width() / this.settings.items).toFixed(3),
319				coordinate = 0, merge, i, n;
320
321			this._coordinates = [];
322			for (i = 0, n = this._clones.length + this._items.length; i < n; i++) {
323				merge = this._mergers[this.relative(i)];
324				merge = (this.settings.mergeFit && Math.min(merge, this.settings.items)) || merge;
325				coordinate += (this.settings.autoWidth ? this._items[this.relative(i)].width() + this.settings.margin : width * merge) * rtl;
326
327				this._coordinates.push(coordinate);
328			}
329		}
330	}, {
331		filter: [ 'width', 'items', 'settings' ],
332		run: function() {
333			var i, n, width = (this.width() / this.settings.items).toFixed(3), css = {
334				'width': Math.abs(this._coordinates[this._coordinates.length - 1]) + this.settings.stagePadding * 2,
335				'padding-left': this.settings.stagePadding || '',
336				'padding-right': this.settings.stagePadding || ''
337			};
338
339			this.$stage.css(css);
340
341			css = { 'width': this.settings.autoWidth ? 'auto' : width - this.settings.margin };
342			css[this.settings.rtl ? 'margin-left' : 'margin-right'] = this.settings.margin;
343
344			if (!this.settings.autoWidth && $.grep(this._mergers, function(v) { return v > 1 }).length > 0) {
345				for (i = 0, n = this._coordinates.length; i < n; i++) {
346					css.width = Math.abs(this._coordinates[i]) - Math.abs(this._coordinates[i - 1] || 0) - this.settings.margin;
347					this.$stage.children().eq(i).css(css);
348				}
349			} else {
350				this.$stage.children().css(css);
351			}
352		}
353	}, {
354		filter: [ 'width', 'items', 'settings' ],
355		run: function(cache) {
356			cache.current && this.reset(this.$stage.children().index(cache.current));
357		}
358	}, {
359		filter: [ 'position' ],
360		run: function() {
361			this.animate(this.coordinates(this._current));
362		}
363	}, {
364		filter: [ 'width', 'position', 'items', 'settings' ],
365		run: function() {
366			var rtl = this.settings.rtl ? 1 : -1,
367				padding = this.settings.stagePadding * 2,
368				begin = this.coordinates(this.current()) + padding,
369				end = begin + this.width() * rtl,
370				inner, outer, matches = [], i, n;
371
372			for (i = 0, n = this._coordinates.length; i < n; i++) {
373				inner = this._coordinates[i - 1] || 0;
374				outer = Math.abs(this._coordinates[i]) + padding * rtl;
375
376				if ((this.op(inner, '<=', begin) && (this.op(inner, '>', end)))
377					|| (this.op(outer, '<', begin) && this.op(outer, '>', end))) {
378					matches.push(i);
379				}
380			}
381
382			this.$stage.children('.' + this.settings.activeClass).removeClass(this.settings.activeClass);
383			this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass(this.settings.activeClass);
384
385			if (this.settings.center) {
386				this.$stage.children('.' + this.settings.centerClass).removeClass(this.settings.centerClass);
387				this.$stage.children().eq(this.current()).addClass(this.settings.centerClass);
388			}
389		}
390	} ];
391
392	/**
393	 * Initializes the carousel.
394	 * @protected
395	 */
396	Owl.prototype.initialize = function() {
397		this.trigger('initialize');
398
399		this.$element
400			.addClass(this.settings.baseClass)
401			.addClass(this.settings.themeClass)
402			.toggleClass('owl-rtl', this.settings.rtl);
403
404		// check support
405		this.browserSupport();
406
407		if (this.settings.autoWidth && this.state.imagesLoaded !== true) {
408			var imgs, nestedSelector, width;
409			imgs = this.$element.find('img');
410			nestedSelector = this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector : undefined;
411			width = this.$element.children(nestedSelector).width();
412
413			if (imgs.length && width <= 0) {
414				this.preloadAutoWidthImages(imgs);
415				return false;
416			}
417		}
418
419		this.$element.addClass('owl-loading');
420
421		// create stage
422		this.$stage = $('<' + this.settings.stageElement + ' class="owl-stage"/>')
423			.wrap('<div class="owl-stage-outer">');
424
425		// append stage
426		this.$element.append(this.$stage.parent());
427
428		// append content
429		this.replace(this.$element.children().not(this.$stage.parent()));
430
431		// set view width
432		this._width = this.$element.width();
433
434		// update view
435		this.refresh();
436
437		this.$element.removeClass('owl-loading').addClass('owl-loaded');
438
439		// attach generic events
440		this.eventsCall();
441
442		// attach generic events
443		this.internalEvents();
444
445		// attach custom control events
446		this.addTriggerableEvents();
447
448		this.trigger('initialized');
449	};
450
451	/**
452	 * Setups the current settings.
453	 * @todo Remove responsive classes. Why should adaptive designs be brought into IE8?
454	 * @todo Support for media queries by using `matchMedia` would be nice.
455	 * @public
456	 */
457	Owl.prototype.setup = function() {
458		var viewport = this.viewport(),
459			overwrites = this.options.responsive,
460			match = -1,
461			settings = null;
462
463		if (!overwrites) {
464			settings = $.extend({}, this.options);
465		} else {
466			$.each(overwrites, function(breakpoint) {
467				if (breakpoint <= viewport && breakpoint > match) {
468					match = Number(breakpoint);
469				}
470			});
471
472			settings = $.extend({}, this.options, overwrites[match]);
473			delete settings.responsive;
474
475			// responsive class
476			if (settings.responsiveClass) {
477				this.$element.attr('class', function(i, c) {
478					return c.replace(/\b owl-responsive-\S+/g, '');
479				}).addClass('owl-responsive-' + match);
480			}
481		}
482
483		if (this.settings === null || this._breakpoint !== match) {
484			this.trigger('change', { property: { name: 'settings', value: settings } });
485			this._breakpoint = match;
486			this.settings = settings;
487			this.invalidate('settings');
488			this.trigger('changed', { property: { name: 'settings', value: this.settings } });
489		}
490	};
491
492	/**
493	 * Updates option logic if necessery.
494	 * @protected
495	 */
496	Owl.prototype.optionsLogic = function() {
497		// Toggle Center class
498		this.$element.toggleClass('owl-center', this.settings.center);
499
500		// if items number is less than in body
501		if (this.settings.loop && this._items.length < this.settings.items) {
502			this.settings.loop = false;
503		}
504
505		if (this.settings.autoWidth) {
506			this.settings.stagePadding = false;
507			this.settings.merge = false;
508		}
509	};
510
511	/**
512	 * Prepares an item before add.
513	 * @todo Rename event parameter `content` to `item`.
514	 * @protected
515	 * @returns {jQuery|HTMLElement} - The item container.
516	 */
517	Owl.prototype.prepare = function(item) {
518		var event = this.trigger('prepare', { content: item });
519
520		if (!event.data) {
521			event.data = $('<' + this.settings.itemElement + '/>')
522				.addClass(this.settings.itemClass).append(item)
523		}
524
525		this.trigger('prepared', { content: event.data });
526
527		return event.data;
528	};
529
530	/**
531	 * Updates the view.
532	 * @public
533	 */
534	Owl.prototype.update = function() {
535		var i = 0,
536			n = this._pipe.length,
537			filter = $.proxy(function(p) { return this[p] }, this._invalidated),
538			cache = {};
539
540		while (i < n) {
541			if (this._invalidated.all || $.grep(this._pipe[i].filter, filter).length > 0) {
542				this._pipe[i].run(cache);
543			}
544			i++;
545		}
546
547		this._invalidated = {};
548	};
549
550	/**
551	 * Gets the width of the view.
552	 * @public
553	 * @param {Owl.Width} [dimension=Owl.Width.Default] - The dimension to return.
554	 * @returns {Number} - The width of the view in pixel.
555	 */
556	Owl.prototype.width = function(dimension) {
557		dimension = dimension || Owl.Width.Default;
558		switch (dimension) {
559			case Owl.Width.Inner:
560			case Owl.Width.Outer:
561				return this._width;
562			default:
563				return this._width - this.settings.stagePadding * 2 + this.settings.margin;
564		}
565	};
566
567	/**
568	 * Refreshes the carousel primarily for adaptive purposes.
569	 * @public
570	 */
571	Owl.prototype.refresh = function() {
572		if (this._items.length === 0) {
573			return false;
574		}
575
576		var start = new Date().getTime();
577
578		this.trigger('refresh');
579
580		this.setup();
581
582		this.optionsLogic();
583
584		// hide and show methods helps here to set a proper widths,
585		// this prevents scrollbar to be calculated in stage width
586		this.$stage.addClass('owl-refresh');
587
588		this.update();
589
590		this.$stage.removeClass('owl-refresh');
591
592		this.state.orientation = window.orientation;
593
594		this.watchVisibility();
595
596		this.trigger('refreshed');
597	};
598
599	/**
600	 * Save internal event references and add event based functions.
601	 * @protected
602	 */
603	Owl.prototype.eventsCall = function() {
604		// Save events references
605		this.e._onDragStart = $.proxy(function(e) {
606			this.onDragStart(e);
607		}, this);
608		this.e._onDragMove = $.proxy(function(e) {
609			this.onDragMove(e);
610		}, this);
611		this.e._onDragEnd = $.proxy(function(e) {
612			this.onDragEnd(e);
613		}, this);
614		this.e._onResize = $.proxy(function(e) {
615			this.onResize(e);
616		}, this);
617		this.e._transitionEnd = $.proxy(function(e) {
618			this.transitionEnd(e);
619		}, this);
620		this.e._preventClick = $.proxy(function(e) {
621			this.preventClick(e);
622		}, this);
623	};
624
625	/**
626	 * Checks window `resize` event.
627	 * @protected
628	 */
629	Owl.prototype.onThrottledResize = function() {
630		window.clearTimeout(this.resizeTimer);
631		this.resizeTimer = window.setTimeout(this.e._onResize, this.settings.responsiveRefreshRate);
632	};
633
634	/**
635	 * Checks window `resize` event.
636	 * @protected
637	 */
638	Owl.prototype.onResize = function() {
639		if (!this._items.length) {
640			return false;
641		}
642
643		if (this._width === this.$element.width()) {
644			return false;
645		}
646
647		if (this.trigger('resize').isDefaultPrevented()) {
648			return false;
649		}
650
651		this._width = this.$element.width();
652
653		this.invalidate('width');
654
655		this.refresh();
656
657		this.trigger('resized');
658	};
659
660	/**
661	 * Checks for touch/mouse drag event type and add run event handlers.
662	 * @protected
663	 */
664	Owl.prototype.eventsRouter = function(event) {
665		var type = event.type;
666
667		if (type === "mousedown" || type === "touchstart") {
668			this.onDragStart(event);
669		} else if (type === "mousemove" || type === "touchmove") {
670			this.onDragMove(event);
671		} else if (type === "mouseup" || type === "touchend") {
672			this.onDragEnd(event);
673		} else if (type === "touchcancel") {
674			this.onDragEnd(event);
675		}
676	};
677
678	/**
679	 * Checks for touch/mouse drag options and add necessery event handlers.
680	 * @protected
681	 */
682	Owl.prototype.internalEvents = function() {
683		var isTouch = isTouchSupport(),
684			isTouchIE = isTouchSupportIE();
685
686		if (this.settings.mouseDrag){
687			this.$stage.on('mousedown', $.proxy(function(event) { this.eventsRouter(event) }, this));
688			this.$stage.on('dragstart', function() { return false });
689			this.$stage.get(0).onselectstart = function() { return false };
690		} else {
691			this.$element.addClass('owl-text-select-on');
692		}
693
694		if (this.settings.touchDrag && !isTouchIE){
695			this.$stage.on('touchstart touchcancel', $.proxy(function(event) { this.eventsRouter(event) }, this));
696		}
697
698		// catch transitionEnd event
699		if (this.transitionEndVendor) {
700			this.on(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd, false);
701		}
702
703		// responsive
704		if (this.settings.responsive !== false) {
705			this.on(window, 'resize', $.proxy(this.onThrottledResize, this));
706		}
707	};
708
709	/**
710	 * Handles touchstart/mousedown event.
711	 * @protected
712	 * @param {Event} event - The event arguments.
713	 */
714	Owl.prototype.onDragStart = function(event) {
715		var ev, isTouchEvent, pageX, pageY, animatedPos;
716
717		ev = event.originalEvent || event || window.event;
718
719		// prevent right click
720		if (ev.which === 3 || this.state.isTouch) {
721			return false;
722		}
723
724		if (ev.type === 'mousedown') {
725			this.$stage.addClass('owl-grab');
726		}
727
728		this.trigger('drag');
729		this.drag.startTime = new Date().getTime();
730		this.speed(0);
731		this.state.isTouch = true;
732		this.state.isScrolling = false;
733		this.state.isSwiping = false;
734		this.drag.distance = 0;
735
736		pageX = getTouches(ev).x;
737		pageY = getTouches(ev).y;
738
739		// get stage position left
740		this.drag.offsetX = this.$stage.position().left;
741		this.drag.offsetY = this.$stage.position().top;
742
743		if (this.settings.rtl) {
744			this.drag.offsetX = this.$stage.position().left + this.$stage.width() - this.width()
745				+ this.settings.margin;
746		}
747
748		// catch position // ie to fix
749		if (this.state.inMotion && this.support3d) {
750			animatedPos = this.getTransformProperty();
751			this.drag.offsetX = animatedPos;
752			this.animate(animatedPos);
753			this.state.inMotion = true;
754		} else if (this.state.inMotion && !this.support3d) {
755			this.state.inMotion = false;
756			return false;
757		}
758
759		this.drag.startX = pageX - this.drag.offsetX;
760		this.drag.startY = pageY - this.drag.offsetY;
761
762		this.drag.start = pageX - this.drag.startX;
763		this.drag.targetEl = ev.target || ev.srcElement;
764		this.drag.updatedX = this.drag.start;
765
766		// to do/check
767		// prevent links and images dragging;
768		if (this.drag.targetEl.tagName === "IMG" || this.drag.targetEl.tagName === "A") {
769			this.drag.targetEl.draggable = false;
770		}
771
772		$(document).on('mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents', $.proxy(function(event) {this.eventsRouter(event)},this));
773	};
774
775	/**
776	 * Handles the touchmove/mousemove events.
777	 * @todo Simplify
778	 * @protected
779	 * @param {Event} event - The event arguments.
780	 */
781	Owl.prototype.onDragMove = function(event) {
782		var ev, isTouchEvent, pageX, pageY, minValue, maxValue, pull;
783
784		if (!this.state.isTouch) {
785			return;
786		}
787
788		if (this.state.isScrolling) {
789			return;
790		}
791
792		ev = event.originalEvent || event || window.event;
793
794		pageX = getTouches(ev).x;
795		pageY = getTouches(ev).y;
796
797		// Drag Direction
798		this.drag.currentX = pageX - this.drag.startX;
799		this.drag.currentY = pageY - this.drag.startY;
800		this.drag.distance = this.drag.currentX - this.drag.offsetX;
801
802		// Check move direction
803		if (this.drag.distance < 0) {
804			this.state.direction = this.settings.rtl ? 'right' : 'left';
805		} else if (this.drag.distance > 0) {
806			this.state.direction = this.settings.rtl ? 'left' : 'right';
807		}
808		// Loop
809		if (this.settings.loop) {
810			if (this.op(this.drag.currentX, '>', this.coordinates(this.minimum())) && this.state.direction === 'right') {
811				this.drag.currentX -= (this.settings.center && this.coordinates(0)) - this.coordinates(this._items.length);
812			} else if (this.op(this.drag.currentX, '<', this.coordinates(this.maximum())) && this.state.direction === 'left') {
813				this.drag.currentX += (this.settings.center && this.coordinates(0)) - this.coordinates(this._items.length);
814			}
815		} else {
816			// pull
817			minValue = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum());
818			maxValue = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum());
819			pull = this.settings.pullDrag ? this.drag.distance / 5 : 0;
820			this.drag.currentX = Math.max(Math.min(this.drag.currentX, minValue + pull), maxValue + pull);
821		}
822
823		// Lock browser if swiping horizontal
824
825		if ((this.drag.distance > 8 || this.drag.distance < -8)) {
826			if (ev.preventDefault !== undefined) {
827				ev.preventDefault();
828			} else {
829				ev.returnValue = false;
830			}
831			this.state.isSwiping = true;
832		}
833
834		this.drag.updatedX = this.drag.currentX;
835
836		// Lock Owl if scrolling
837		if ((this.drag.currentY > 16 || this.drag.currentY < -16) && this.state.isSwiping === false) {
838			this.state.isScrolling = true;
839			this.drag.updatedX = this.drag.start;
840		}
841
842		this.animate(this.drag.updatedX);
843	};
844
845	/**
846	 * Handles the touchend/mouseup events.
847	 * @protected
848	 */
849	Owl.prototype.onDragEnd = function(event) {
850		var compareTimes, distanceAbs, closest;
851
852		if (!this.state.isTouch) {
853			return;
854		}
855
856		if (event.type === 'mouseup') {
857			this.$stage.removeClass('owl-grab');
858		}
859
860		this.trigger('dragged');
861
862		// prevent links and images dragging;
863		this.drag.targetEl.removeAttribute("draggable");
864
865		// remove drag event listeners
866
867		this.state.isTouch = false;
868		this.state.isScrolling = false;
869		this.state.isSwiping = false;
870
871		// to check
872		if (this.drag.distance === 0 && this.state.inMotion !== true) {
873			this.state.inMotion = false;
874			return false;
875		}
876
877		// prevent clicks while scrolling
878
879		this.drag.endTime = new Date().getTime();
880		compareTimes = this.drag.endTime - this.drag.startTime;
881		distanceAbs = Math.abs(this.drag.distance);
882
883		// to test
884		if (distanceAbs > 3 || compareTimes > 300) {
885			this.removeClick(this.drag.targetEl);
886		}
887
888		closest = this.closest(this.drag.updatedX);
889
890		this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed);
891		this.current(closest);
892		this.invalidate('position');
893		this.update();
894
895		// if pullDrag is off then fire transitionEnd event manually when stick
896		// to border
897		if (!this.settings.pullDrag && this.drag.updatedX === this.coordinates(closest)) {
898			this.transitionEnd();
899		}
900
901		this.drag.distance = 0;
902
903		$(document).off('.owl.dragEvents');
904	};
905
906	/**
907	 * Attaches `preventClick` to disable link while swipping.
908	 * @protected
909	 * @param {HTMLElement} [target] - The target of the `click` event.
910	 */
911	Owl.prototype.removeClick = function(target) {
912		this.drag.targetEl = target;
913		$(target).on('click.preventClick', this.e._preventClick);
914		// to make sure click is removed:
915		window.setTimeout(function() {
916			$(target).off('click.preventClick');
917		}, 300);
918	};
919
920	/**
921	 * Suppresses click event.
922	 * @protected
923	 * @param {Event} ev - The event arguments.
924	 */
925	Owl.prototype.preventClick = function(ev) {
926		if (ev.preventDefault) {
927			ev.preventDefault();
928		} else {
929			ev.returnValue = false;
930		}
931		if (ev.stopPropagation) {
932			ev.stopPropagation();
933		}
934		$(ev.target).off('click.preventClick');
935	};
936
937	/**
938	 * Catches stage position while animate (only CSS3).
939	 * @protected
940	 * @returns
941	 */
942	Owl.prototype.getTransformProperty = function() {
943		var transform, matrix3d;
944
945		transform = window.getComputedStyle(this.$stage.get(0), null).getPropertyValue(this.vendorName + 'transform');
946		// var transform = this.$stage.css(this.vendorName + 'transform')
947		transform = transform.replace(/matrix(3d)?\(|\)/g, '').split(',');
948		matrix3d = transform.length === 16;
949
950		return matrix3d !== true ? transform[4] : transform[12];
951	};
952
953	/**
954	 * Gets absolute position of the closest item for a coordinate.
955	 * @todo Setting `freeDrag` makes `closest` not reusable. See #165.
956	 * @protected
957	 * @param {Number} coordinate - The coordinate in pixel.
958	 * @return {Number} - The absolute position of the closest item.
959	 */
960	Owl.prototype.closest = function(coordinate) {
961		var position = -1, pull = 30, width = this.width(), coordinates = this.coordinates();
962
963		if (!this.settings.freeDrag) {
964			// check closest item
965			$.each(coordinates, $.proxy(function(index, value) {
966				if (coordinate > value - pull && coordinate < value + pull) {
967					position = index;
968				} else if (this.op(coordinate, '<', value)
969					&& this.op(coordinate, '>', coordinates[index + 1] || value - width)) {
970					position = this.state.direction === 'left' ? index + 1 : index;
971				}
972				return position === -1;
973			}, this));
974		}
975
976		if (!this.settings.loop) {
977			// non loop boundries
978			if (this.op(coordinate, '>', coordinates[this.minimum()])) {
979				position = coordinate = this.minimum();
980			} else if (this.op(coordinate, '<', coordinates[this.maximum()])) {
981				position = coordinate = this.maximum();
982			}
983		}
984
985		return position;
986	};
987
988	/**
989	 * Animates the stage.
990	 * @public
991	 * @param {Number} coordinate - The coordinate in pixels.
992	 */
993	Owl.prototype.animate = function(coordinate) {
994		this.trigger('translate');
995		this.state.inMotion = this.speed() > 0;
996
997/*		if (this.support3d) {
998			this.$stage.css({
999				transform: 'translate3d(' + coordinate + 'px' + ',0px, 0px)',
1000				transition: (this.speed() / 1000) + 's'
1001			});
1002		} else if (this.state.isTouch) {
1003			this.$stage.css({
1004				left: coordinate + 'px'
1005			});
1006		} else {*/
1007			this.$stage.animate({
1008				left: coordinate + 'px'
1009			}, this.speed(), this.settings.fallbackEasing, $.proxy(function() {
1010				//if (this.state.inMotion) {
1011					this.transitionEnd();
1012				//}
1013			}, this));
1014/*		}*/
1015	};
1016
1017	/**
1018	 * Sets the absolute position of the current item.
1019	 * @public
1020	 * @param {Number} [position] - The new absolute position or nothing to leave it unchanged.
1021	 * @returns {Number} - The absolute position of the current item.
1022	 */
1023	Owl.prototype.current = function(position) {
1024		if (position === undefined) {
1025			return this._current;
1026		}
1027
1028		if (this._items.length === 0) {
1029			return undefined;
1030		}
1031
1032		position = this.normalize(position);
1033
1034		if (this._current !== position) {
1035			var event = this.trigger('change', { property: { name: 'position', value: position } });
1036
1037			if (event.data !== undefined) {
1038				position = this.normalize(event.data);
1039			}
1040
1041			this._current = position;
1042
1043			this.invalidate('position');
1044
1045			this.trigger('changed', { property: { name: 'position', value: this._current } });
1046		}
1047
1048		return this._current;
1049	};
1050
1051	/**
1052	 * Invalidates the given part of the update routine.
1053	 * @param {String}
1053 part - The part to invalidate.
1054	 */
1055	Owl.prototype.invalidate = function(part) {
1056		this._invalidated[part] = true;
1057	}
1058
1059	/**
1060	 * Resets the absolute position of the current item.
1061	 * @public
1062	 * @param {Number} position - The absolute position of the new item.
1063	 */
1064	Owl.prototype.reset = function(position) {
1065		position = this.normalize(position);
1066
1067		if (position === undefined) {
1068			return;
1069		}
1070
1071		this._speed = 0;
1072		this._current = position;
1073
1074		this.suppress([ 'translate', 'translated' ]);
1075
1076		this.animate(this.coordinates(position));
1077
1078		this.release([ 'translate', 'translated' ]);
1079	};
1080
1081	/**
1082	 * Normalizes an absolute or a relative position for an item.
1083	 * @public
1084	 * @param {Number} position - The absolute or relative position to normalize.
1085	 * @param {Boolean} [relative=false] - Whether the given position is relative or not.
1086	 * @returns {Number} - The normalized position.
1087	 */
1088	Owl.prototype.normalize = function(position, relative) {
1089		var n = (relative ? this._items.length : this._items.length + this._clones.length);
1090
1091		if (!$.isNumeric(position) || n < 1) {
1092			return undefined;
1093		}
1094
1095		if (this._clones.length) {
1096			position = ((position % n) + n) % n;
1097		} else {
1098			position = Math.max(this.minimum(relative), Math.min(this.maximum(relative), position));
1099		}
1100
1101		return position;
1102	};
1103
1104	/**
1105	 * Converts an absolute position for an item into a relative position.
1106	 * @public
1107	 * @param {Number} position - The absolute position to convert.
1108	 * @returns {Number} - The converted position.
1109	 */
1110	Owl.prototype.relative = function(position) {
1111		position = this.normalize(position);
1112		position = position - this._clones.length / 2;
1113		return this.normalize(position, true);
1114	};
1115
1116	/**
1117	 * Gets the maximum position for an item.
1118	 * @public
1119	 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1120	 * @returns {Number}
1121	 */
1122	Owl.prototype.maximum = function(relative) {
1123		var maximum, width, i = 0, coordinate,
1124			settings = this.settings;
1125
1126		if (relative) {
1127			return this._items.length - 1;
1128		}
1129
1130		if (!settings.loop && settings.center) {
1131			maximum = this._items.length - 1;
1132		} else if (!settings.loop && !settings.center) {
1133			maximum = this._items.length - settings.items;
1134		} else if (settings.loop || settings.center) {
1135			maximum = this._items.length + settings.items;
1136		} else if (settings.autoWidth || settings.merge) {
1137			revert = settings.rtl ? 1 : -1;
1138			width = this.$stage.width() - this.$element.width();
1139			while (coordinate = this.coordinates(i)) {
1140				if (coordinate * revert >= width) {
1141					break;
1142				}
1143				maximum = ++i;
1144			}
1145		} else {
1146			throw 'Can not detect maximum absolute position.'
1147		}
1148
1149		return maximum;
1150	};
1151
1152	/**
1153	 * Gets the minimum position for an item.
1154	 * @public
1155	 * @param {Boolean} [relative=false] - Whether to return an absolute position or a relative position.
1156	 * @returns {Number}
1157	 */
1158	Owl.prototype.minimum = function(relative) {
1159		if (relative) {
1160			return 0;
1161		}
1162
1163		return this._clones.length / 2;
1164	};
1165
1166	/**
1167	 * Gets an item at the specified relative position.
1168	 * @public
1169	 * @param {Number} [position] - The relative position of the item.
1170	 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1171	 */
1172	Owl.prototype.items = function(position) {
1173		if (position === undefined) {
1174			return this._items.slice();
1175		}
1176
1177		position = this.normalize(position, true);
1178		return this._items[position];
1179	};
1180
1181	/**
1182	 * Gets an item at the specified relative position.
1183	 * @public
1184	 * @param {Number} [position] - The relative position of the item.
1185	 * @return {jQuery|Array.<jQuery>} - The item at the given position or all items if no position was given.
1186	 */
1187	Owl.prototype.mergers = function(position) {
1188		if (position === undefined) {
1189			return this._mergers.slice();
1190		}
1191
1192		position = this.normalize(position, true);
1193		return this._mergers[position];
1194	};
1195
1196	/**
1197	 * Gets the absolute positions of clones for an item.
1198	 * @public
1199	 * @param {Number} [position] - The relative position of the item.
1200	 * @returns {Array.<Number>} - The absolute positions of clones for the item or all if no position was given.
1201	 */
1202	Owl.prototype.clones = function(position) {
1203		var odd = this._clones.length / 2,
1204			even = odd + this._items.length,
1205			map = function(index) { return index % 2 === 0 ? even + index / 2 : odd 
1205- (index + 1) / 2 };
1206
1207		if (position === undefined) {
1208			return $.map(this._clones, function(v, i) { return map(i) });
1209		}
1210
1211		return $.map(this._clones, function(v, i) { return v === position ? map(i) : null });
1212	};
1213
1214	/**
1215	 * Sets the current animation speed.
1216	 * @public
1217	 * @param {Number} [speed] - The animation speed in milliseconds or nothing to leave it unchanged.
1218	 * @returns {Number} - The current animation speed in milliseconds.
1219	 */
1220	Owl.prototype.speed = function(speed) {
1221		if (speed !== undefined) {
1222			this._speed = speed;
1223		}
1224
1225		return this._speed;
1226	};
1227
1228	/**
1229	 * Gets the coordinate of an item.
1230	 * @todo The name of this method is missleanding.
1231	 * @public
1232	 * @param {Number} position - The absolute position of the item within `minimum()` and `maximum()`.
1233	 * @returns {Number|Array.<Number>} - The coordinate of the item in pixel or all coordinates.
1234	 */
1235	Owl.prototype.coordinates = function(position) {
1236		var coordinate = null;
1237
1238		if (position === undefined) {
1239			return $.map(this._coordinates, $.proxy(function(coordinate, index) {
1240				return this.coordinates(index);
1241			}, this));
1242		}
1243
1244		if (this.settings.center) {
1245			coordinate = this._coordinates[position];
1246			coordinate += (this.width() - coordinate + (this._coordinates[position - 1] || 0)) / 2 * (this.settings.rtl ? -1 : 1);
1247		} else {
1248			coordinate = this._coordinates[position - 1] || 0;
1249		}
1250
1251		return coordinate;
1252	};
1253
1254	/**
1255	 * Calculates the speed for a translation.
1256	 * @protected
1257	 * @param {Number} from - The absolute position of the start item.
1258	 * @param {Number} to - The absolute position of the target item.
1259	 * @param {Number} [factor=undefined] - The time factor in milliseconds.
1260	 * @returns {Number} - The time in milliseconds for the translation.
1261	 */
1262	Owl.prototype.duration = function(from, to, factor) {
1263		return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor || this.settings.smartSpeed));
1264	};
1265
1266	/**
1267	 * Slides to the specified item.
1268	 * @public
1269	 * @param {Number} position - The position of the item.
1270	 * @param {Number} [speed] - The time in milliseconds for the transition.
1271	 */
1272	Owl.prototype.to = function(position, speed) {
1273		if (this.settings.loop) {
1274			var distance = position - this.relative(this.current()),
1275				revert = this.current(),
1276				before = this.current(),
1277				after = this.current() + distance,
1278				direction = before - after < 0 ? true : false,
1279				items = this._clones.length + this._items.length;
1280
1281			if (after < this.settings.items && direction === false) {
1282				revert = before + this._items.length;
1283				this.reset(revert);
1284			} else if (after >= items - this.settings.items && direction === true) {
1285				revert = before - this._items.length;
1286				this.reset(revert);
1287			}
1288			window.clearTimeout(this.e._goToLoop);
1289			this.e._goToLoop = window.setTimeout($.proxy(function() {
1290				this.speed(this.duration(this.current(), revert + distance, speed));
1291				this.current(revert + distance);
1292				this.update();
1293			}, this), 30);
1294		} else {
1295			this.speed(this.duration(this.current(), position, speed));
1296			this.current(position);
1297			this.update();
1298		}
1299	};
1300
1301	/**
1302	 * Slides to the next item.
1303	 * @public
1304	 * @param {Number} [speed] - The time in milliseconds for the transition.
1305	 */
1306	Owl.prototype.next = function(speed) {
1307		speed = speed || false;
1308		this.to(this.relative(this.current()) + 1, speed);
1309	};
1310
1311	/**
1312	 * Slides to the previous item.
1313	 * @public
1314	 * @param {Number} [speed] - The time in milliseconds for the transition.
1315	 */
1316	Owl.prototype.prev = function(speed) {
1317		speed = speed || false;
1318		this.to(this.relative(this.current()) - 1, speed);
1319	};
1320
1321	/**
1322	 * Handles the end of an animation.
1323	 * @protected
1324	 * @param {Event} event - The event arguments.
1325	 */
1326	Owl.prototype.transitionEnd = function(event) {
1327
1328		// if css2 animation then event object is undefined
1329		if (event !== undefined) {
1330			event.stopPropagation();
1331
1332			// Catch only owl-stage transitionEnd event
1333			if ((event.target || event.srcElement || event.originalTarget) !== this.$stage.get(0)) {
1334				return false;
1335			}
1336		}
1337
1338		this.state.inMotion = false;
1339		this.trigger('translated');
1340	};
1341
1342	/**
1343	 * Gets viewport width.
1344	 * @protected
1345	 * @return {Number} - The width in pixel.
1346	 */
1347	Owl.prototype.viewport = function() {
1348		var width;
1349		if (this.options.responsiveBaseElement !== window) {
1350			width = $(this.options.responsiveBaseElement).width();
1351		} else if (window.innerWidth) {
1352			width = window.innerWidth;
1353		} else if (document.documentElement && document.documentElement.clientWidth) {
1354			width = document.documentElement.clientWidth;
1355		} else {
1356			throw 'Can not detect viewport width.';
1357		}
1358		return width;
1359	};
1360
1361	/**
1362	 * Replaces the current content.
1363	 * @public
1364	 * @param {HTMLElement|jQuery|String} content - The new content.
1365	 */
1366	Owl.prototype.replace = function(content) {
1367		this.$stage.empty();
1368		this._items = [];
1369
1370		if (content) {
1371			content = (content instanceof jQuery) ? content : $(content);
1372		}
1373
1374		if (this.settings.nestedItemSelector) {
1375			content = content.find('.' + this.settings.nestedItemSelector);
1376		}
1377
1378		content.filter(function() {
1379			return this.nodeType === 1;
1380		}).each($.proxy(function(index, item) {
1381			item = this.prepare(item);
1382			this.$stage.append(item);
1383			this._items.push(item);
1384			this._mergers.push(item.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1);
1385		}, this));
1386
1387		this.reset($.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0);
1388
1389		this.invalidate('items');
1390	};
1391
1392	/**
1393	 * Adds an item.
1394	 * @todo Use `item` instead of `content` for the event arguments.
1395	 * @public
1396	 * @param {HTMLElement|jQuery|String} content - The item content to add.
1397	 * @param {Number} [position] - The relative position at which to insert the item otherwise the item will be added to the end.
1398	 */
1399	Owl.prototype.add = function(content, position) {
1400		position = position === undefined ? this._items.length : this.normalize(position, true);
1401
1402		this.trigger('add', { content: content, position: position });
1403
1404		if (this._items.length === 0 || position === this._items.length) {
1405			this.$stage.append(content);
1406			this._items.push(content);
1407			this._mergers.push(content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1);
1408		} else {
1409			this._items[position].before(content);
1410			this._items.splice(position, 0, content);
1411			this._mergers.splice(position, 0, content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1 || 1);
1412		}
1413
1414		this.invalidate('items');
1415
1416		this.trigger('added', { content: content, position: position });
1417	};
1418
1419	/**
1420	 * Removes an item by its position.
1421	 * @todo Use `item` instead of `content` for the event arguments.
1422	 * @public
1423	 * @param {Number} position - The relative position of the item to remove.
1424	 */
1425	Owl.prototype.remove = function(position) {
1426		position = this.normalize(position, true);
1427
1428		if (position === undefined) {
1429			return;
1430		}
1431
1432		this.trigger('remove', { content: this._items[position], position: position });
1433
1434		this._items[position].remove();
1435		this._items.splice(position, 1);
1436		this._mergers.splice(position, 1);
1437
1438		this.invalidate('items');
1439
1440		this.trigger('removed', { content: null, position: position });
1441	};
1442
1443	/**
1444	 * Adds triggerable events.
1445	 * @protected
1446	 */
1447	Owl.prototype.addTriggerableEvents = function() {
1448		var handler = $.proxy(function(callback, event) {
1449			return $.proxy(function(e) {
1450				if (e.relatedTarget !== this) {
1451					this.suppress([ event ]);
1452					callback.apply(this, [].slice.call(arguments, 1));
1453					this.release([ event ]);
1454				}
1455			}, this);
1456		}, this);
1457
1458		$.each({
1459			'next': this.next,
1460			'prev': this.prev,
1461			'to': this.to,
1462			'destroy': this.destroy,
1463			'refresh': this.refresh,
1464			'replace': this.replace,
1465			'add': this.add,
1466			'remove': this.remove
1467		}, $.proxy(function(event, callback) {
1468			this.$element.on(event + '.owl.carousel', handler(callback, event + '.owl.carousel'));
1469		}, this));
1470
1471	};
1472
1473	/**
1474	 * Watches the visibility of the carousel element.
1475	 * @protected
1476	 */
1477	Owl.prototype.watchVisibility = function() {
1478
1479		// test on zepto
1480		if (!isElVisible(this.$element.get(0))) {
1481			this.$element.addClass('owl-hidden');
1482			window.clearInterval(this.e._checkVisibile);
1483			this.e._checkVisibile = window.setInterval($.proxy(checkVisible, this), 500);
1484		}
1485
1486		function isElVisible(el) {
1487			return el.offsetWidth > 0 && el.offsetHeight > 0;
1488		}
1489
1490		function checkVisible() {
1491			if (isElVisible(this.$element.get(0))) {
1492				this.$element.removeClass('owl-hidden');
1493				this.refresh();
1494				window.clearInterval(this.e._checkVisibile);
1495			}
1496		}
1497	};
1498
1499	/**
1500	 * Preloads images with auto width.
1501	 * @protected
1502	 * @todo Still to test
1503	 */
1504	Owl.prototype.preloadAutoWidthImages = function(imgs) {
1505		var loaded, that, $el, img;
1506
1507		loaded = 0;
1508		that = this;
1509		imgs.each(function(i, el) {
1510			$el = $(el);
1511			img = new Image();
1512
1513			img.onload = function() {
1514				loaded++;
1515				$el.attr('src', img.src);
1516				$el.css('opacity', 1);
1517				if (loaded >= imgs.length) {
1518					that.state.imagesLoaded = true;
1519					that.initialize();
1520				}
1521			};
1522
1523			img.src = $el.attr('src') || $el.attr('data-src') || $el.attr('data-src-retina');
1524		});
1525	};
1526
1527	/**
1528	 * Destroys the carousel.
1529	 * @public
1530	 */
1531	Owl.prototype.destroy = function() {
1532
1533		if (this.$element.hasClass(this.settings.themeClass)) {
1534			this.$element.removeClass(this.settings.themeClass);
1535		}
1536
1537		if (this.settings.responsive !== false) {
1538			$(window).off('resize.owl.carousel');
1539		}
1540
1541		if (this.transitionEndVendor) {
1542			this.off(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd);
1543		}
1544
1545		for ( var i in this._plugins) {
1546			this._plugins[i].destroy();
1547		}
1548
1549		if (this.settings.mouseDrag || this.settings.touchDrag) {
1550			this.$stage.off('mousedown touchstart touchcancel');
1551			$(document).off('.owl.dragEvents');
1552			this.$stage.get(0).onselectstart = function() {};
1553			this.$stage.off('dragstart', function() { return false });
1554		}
1555
1556		// remove event handlers in the ".owl.carousel" namespace
1557		this.$element.off('.owl');
1558
1559		this.$stage.children('.cloned').remove();
1560		this.e = null;
1561		this.$element.removeData('owlCarousel');
1562
1563		this.$stage.children().contents().unwrap();
1564		this.$stage.children().unwrap();
1565		this.$stage.unwrap();
1566	};
1567
1568	/**
1569	 * Operators to calculate right-to-left and left-to-right.
1570	 * @protected
1571	 * @param {Number} [a] - The left side operand.
1572	 * @param {String} [o] - The operator.
1573	 * @param {Number} [b] - The right side operand.
1574	 */
1575	Owl.prototype.op = function(a, o, b) {
1576		var rtl = this.settings.rtl;
1577		switch (o) {
1578			case '<':
1579				return rtl ? a > b : a < b;
1580			case '>':
1581				return rtl ? a < b : a > b;
1582			case '>=':
1583				return rtl ? a <= b : a >= b;
1584			case '<=':
1585				return rtl ? a >= b : a <= b;
1586			default:
1587				break;
1588		}
1589	};
1590
1591	/**
1592	 * Attaches to an internal event.
1593	 * @protected
1594	 * @param {HTMLElement} element - The event source.
1595	 * @param {String} event - The event name.
1596	 * @param {Function} listener - The event handler to attach.
1597	 * @param {Boolean} capture - Wether the event should be handled at the capturing p
1597hase or not.
1598	 */
1599	Owl.prototype.on = function(element, event, listener, capture) {
1600		if (element.addEventListener) {
1601			element.addEventListener(event, listener, capture);
1602		} else if (element.attachEvent) {
1603			element.attachEvent('on' + event, listener);
1604		}
1605	};
1606
1607	/**
1608	 * Detaches from an internal event.
1609	 * @protected
1610	 * @param {HTMLElement} element - The event source.
1611	 * @param {String} event - The event name.
1612	 * @param {Function} listener - The attached event handler to detach.
1613	 * @param {Boolean} capture - Wether the attached event handler was registered as a capturing listener or not.
1614	 */
1615	Owl.prototype.off = function(element, event, listener, capture) {
1616		if (element.removeEventListener) {
1617			element.removeEventListener(event, listener, capture);
1618		} else if (element.detachEvent) {
1619			element.detachEvent('on' + event, listener);
1620		}
1621	};
1622
1623	/**
1624	 * Triggers an public event.
1625	 * @protected
1626	 * @param {String} name - The event name.
1627	 * @param {*} [data=null] - The event data.
1628	 * @param {String} [namespace=.owl.carousel] - The event namespace.
1629	 * @returns {Event} - The event arguments.
1630	 */
1631	Owl.prototype.trigger = function(name, data, namespace) {
1632		var status = {
1633			item: { count: this._items.length, index: this.current() }
1634		}, handler = $.camelCase(
1635			$.grep([ 'on', name, namespace ], function(v) { return v })
1636				.join('-').toLowerCase()
1637		), event = $.Event(
1638			[ name, 'owl', namespace || 'carousel' ].join('.').toLowerCase(),
1639			$.extend({ relatedTarget: this }, status, data)
1640		);
1641
1642		if (!this._supress[name]) {
1643			$.each(this._plugins, function(name, plugin) {
1644				if (plugin.onTrigger) {
1645					plugin.onTrigger(event);
1646				}
1647			});
1648
1649			this.$element.trigger(event);
1650
1651			if (this.settings && typeof this.settings[handler] === 'function') {
1652				this.settings[handler].apply(this, event);
1653			}
1654		}
1655
1656		return event;
1657	};
1658
1659	/**
1660	 * Suppresses events.
1661	 * @protected
1662	 * @param {Array.<String>} events - The events to suppress.
1663	 */
1664	Owl.prototype.suppress = function(events) {
1665		$.each(events, $.proxy(function(index, event) {
1666			this._supress[event] = true;
1667		}, this));
1668	}
1669
1670	/**
1671	 * Releases suppressed events.
1672	 * @protected
1673	 * @param {Array.<String>} events - The events to release.
1674	 */
1675	Owl.prototype.release = function(events) {
1676		$.each(events, $.proxy(function(index, event) {
1677			delete this._supress[event];
1678		}, this));
1679	}
1680
1681	/**
1682	 * Checks the availability of some browser features.
1683	 * @protected
1684	 */
1685	Owl.prototype.browserSupport = function() {
1686		this.support3d = isPerspective();
1687
1688		if (this.support3d) {
1689			this.transformVendor = isTransform();
1690
1691			// take transitionend event name by detecting transition
1692			var endVendors = [ 'transitionend', 'webkitTransitionEnd', 'transitionend', 'oTransitionEnd' ];
1693			this.transitionEndVendor = endVendors[isTransition()];
1694
1695			// take vendor name from transform name
1696			this.vendorName = this.transformVendor.replace(/Transform/i, '');
1697			this.vendorName = this.vendorName !== '' ? '-' + this.vendorName.toLowerCase() + '-' : '';
1698		}
1699
1700		this.state.orientation = window.orientation;
1701	};
1702
1703	/**
1704	 * Get touch/drag coordinats.
1705	 * @private
1706	 * @param {event} - mousedown/touchstart event
1707	 * @returns {object} - Contains X and Y of current mouse/touch position
1708	 */
1709
1710	function getTouches(event) {
1711		if (event.touches !== undefined) {
1712			return {
1713				x: event.touches[0].pageX,
1714				y: event.touches[0].pageY
1715			};
1716		}
1717
1718		if (event.touches === undefined) {
1719			if (event.pageX !== undefined) {
1720				return {
1721					x: event.pageX,
1722					y: event.pageY
1723				};
1724			}
1725
1726		if (event.pageX === undefined) {
1727			return {
1728					x: event.clientX,
1729					y: event.clientY
1730				};
1731			}
1732		}
1733	}
1734
1735	/**
1736	 * Checks for CSS support.
1737	 * @private
1738	 * @param {Array} array - The CSS properties to check for.
1739	 * @returns {Array} - Contains the supported CSS property name and its index or `false`.
1740	 */
1741	function isStyleSupported(array) {
1742		var p, s, fake = document.createElement('div'), list = array;
1743		for (p in list) {
1744			s = list[p];
1745			if (typeof fake.style[s] !== 'undefined') {
1746				fake = null;
1747				return [ s, p ];
1748			}
1749		}
1750		return [ false ];
1751	}
1752
1753	/**
1754	 * Checks for CSS transition support.
1755	 * @private
1756	 * @todo Realy bad design
1757	 * @returns {Number}
1758	 */
1759	function isTransition() {
1760		return isStyleSupported([ 'transition', 'WebkitTransition', 'MozTransition', 'OTransition' ])[1];
1761	}
1762
1763	/**
1764	 * Checks for CSS transform support.
1765	 * @private
1766	 * @returns {String} The supported property name or false.
1767	 */
1768	function isTransform() {
1769		return isStyleSupported([ 'transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ])[0];
1770	}
1771
1772	/**
1773	 * Checks for CSS perspective support.
1774	 * @private
1775	 * @returns {String} The supported property name or false.
1776	 */
1777	function isPerspective() {
1778		return isStyleSupported([ 'perspective', 'webkitPerspective', 'MozPerspective', 'OPerspective', 'MsPerspective' ])[0];
1779	}
1780
1781	/**
1782	 * Checks wether touch is supported or not.
1783	 * @private
1784	 * @returns {Boolean}
1785	 */
1786	function isTouchSupport() {
1787		return 'ontouchstart' in window || !!(navigator.msMaxTouchPoints);
1788	}
1789
1790	/**
1791	 * Checks wether touch is supported or not for IE.
1792	 * @private
1793	 * @returns {Boolean}
1794	 */
1795	function isTouchSupportIE() {
1796		return window.navigator.msPointerEnabled;
1797	}
1798
1799	/**
1800	 * The jQuery Plugin for the Owl Carousel
1801	 * @public
1802	 */
1803	$.fn.owlCarousel = function(options) {
1804		return this.each(function() {
1805			if (!$(this).data('owlCarousel')) {
1806				$(this).data('owlCarousel', new Owl(this, options));
1807			}
1808		});
1809	};
1810
1811	/**
1812	 * The constructor for the jQuery Plugin
1813	 * @public
1814	 */
1815	$.fn.owlCarousel.Constructor = Owl;
1816
1817})(window.Zepto || window.jQuery, window, document);
1818
1819/**
1820 * Lazy Plugin
1821 * @version 2.0.0
1822 * @author Bartosz Wojciechowski
1823 * @license The MIT License (MIT)
1824 */
1825;(function($, window, document, undefined) {
1826
1827	/**
1828	 * Creates the lazy plugin.
1829	 * @class The Lazy Plugin
1830	 * @param {Owl} carousel - The Owl Carousel
1831	 */
1832	var Lazy = function(carousel) {
1833
1834		/**
1835		 * Reference to the core.
1836		 * @protected
1837		 * @type {Owl}
1838		 */
1839		this._core = carousel;
1840
1841		/**
1842		 * Already loaded items.
1843		 * @protected
1844		 * @type {Array.<jQuery>}
1845		 */
1846		this._loaded = [];
1847
1848		/**
1849		 * Event handlers.
1850		 * @protected
1851		 * @type {Object}
1852		 */
1853		this._handlers = {
1854			'initialized.owl.carousel change.owl.carousel': $.proxy(function(e) {
1855				if (!e.namespace) {
1856					return;
1857				}
1858
1859				if (!this._core.settings || !this._core.settings.lazyLoad) {
1860					return;
1861				}
1862
1863				if ((e.property && e.property.name == 'position') || e.type == 'initialized') {
1864					var settings = this._core.settings,
1865						n = (settings.center && Math.ceil(settings.items / 2)  || (settings.stagePadding > 0 && settings.items + 1) || settings.items),
1866						i = ((settings.center && n * -1) || 0),
1867						position = (e.property && e.property.value !== undefined ? e.property.value : this._core.current()) + i,
1868						clones = this._core.clones().length,
1869						load = $.proxy(function(i, v) { this.load(v) }, this);
1870
1871					while (i <= n) {
1872					    this.load(i + this._core.relative(position));
1873					    clones && $.each(this._core.clones(this._core.relative(position++)), load);
1874					    i++;
1875					}
1876				}
1877			}, this)
1878		};
1879
1880		// set the default options
1881		this._core.options = $.extend({}, Lazy.Defaults, this._core.options);
1882
1883		// register event handler
1884		this._core.$element.on(this._handlers);
1885	}
1886
1887	/**
1888	 * Default options.
1889	 * @public
1890	 */
1891	Lazy.Defaults = {
1892		lazyLoad: false
1893	}
1894
1895	/**
1896	 * Loads all resources of an item at the specified position.
1897	 * @param {Number} position - The absolute position of the item.
1898	 * @protected
1899	 */
1900	Lazy.prototype.load = function(position) {
1901		var $item = this._core.$stage.children().eq(position),
1902			$elements = $item && $item.find('.owl-lazy');
1903
1904		if (!$elements || $.inArray($item.get(0), this._loaded) > -1) {
1905			return;
1906		}
1907
1908		$elements.each($.proxy(function(index, element) {
1909			var $element = $(element), image,
1910				url = (window.devicePixelRatio > 1 && $element.attr('data-src-retina')) || $element.attr('data-src');
1911
1912			this._core.trigger('load', { element: $element, url: url }, 'lazy');
1913
1914			if ($element.is('img')) {
1915				$element.one('load.owl.lazy', $.proxy(function() {
1916					$element.css('opacity', 1);
1917					this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
1918				}, this)).attr('src', url);
1919			} else {
1920				image = new Image();
1921				image.onload = $.proxy(function() {
1922					$element.css({
1923						'background-image': 'url(' + url + ')',
1924						'opacity': '1'
1925					});
1926					this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
1927				}, this);
1928				image.src = url;
1929			}
1930		}, this));
1931
1932		this._loaded.push($item.get(0));
1933	}
1934
1935	/**
1936	 * Destroys the plugin.
1937	 * @public
1938	 */
1939	Lazy.prototype.destroy = function() {
1940		var handler, property;
1941
1942		for (handler in this.handlers) {
1943			this._core.$element.off(handler, this.handlers[handler]);
1944		}
1945		for (property in Object.getOwnPropertyNames(this)) {
1946			typeof this[property] != 'function' && (this[property] = null);
1947		}
1948	}
1949
1950	$.fn.owlCarousel.Constructor.Plugins.Lazy = Lazy;
1951
1952})(window.Zepto || window.jQuery, window, document);
1953
1954/**
1955 * AutoHeight Plugin
1956 * @version 2.0.0
1957 * @author Bartosz Wojciechowski
1958 * @license The MIT License (MIT)
1959 */
1960;(function($, window, document, undefined) {
1961
1962	/**
1963	 * Creates the auto height plugin.
1964	 * @class The Auto Height Plugin
1965	 * @param {Owl} carousel - The Owl Carousel
1966	 */
1967	var AutoHeight = function(carousel) {
1968		/**
1969		 * Reference to the core.
1970		 * @protected
1971		 * @type {Owl}
1972		 */
1973		this._core = carousel;
1974
1975		/**
1976		 * All event handlers.
1977		 * @protected
1978		 * @type {Object}
1979		 */
1980
1981		this._handlers = {
1982			'initialized.owl.carousel': $.proxy(function() {
1983				if (this._core.settings.autoHeight) {
1984					this.update();
1985				}
1986			}, this),
1987			'resized.owl.carousel': $.proxy(function() {
1988				if (this._core.settings.autoHeight) {
1989					this.update();
1990				}
1991			}, this),
1992			'refreshed.owl.carousel': $.proxy(function() {
1993				if (this._core.settings.autoHeight) {
1994					this.update();
1995				}
1996			}, this),
1997			'changed.owl.carousel': $.proxy(function(e) {
1998				if (this._core.settings.autoHeight && e.property.name == 'position'){
1999					this.update();
2000				}
2001			}, this),
2002			'loaded.owl.carousel': $.proxy(function(e) {
2003				if (this._core.settings.autoHeight && e.element.closest('.' + this._core.settings.itemClass) === this._core.$stage.children().eq(this._core.current())) {
2004					this.update();
2005				}
2006			}, this)
2007		};
2008
2009		// set default options
2010		this._core.options = $.extend({}, AutoHeight.Defaults, this._core.options);
2011
2012		// register event handlers
2013		this._core.$element.on(this._handlers);
2014	};
2015
2016	/**
2017	 * Default options.
2018	 * @public
2019	 */
2020	AutoHeight.Defaults = {
2021		autoHeight: false,
2022		autoHeightClass: 'owl-height'
2023	};
2024
2025	/**
2026	 * Updates the view.
2027	 */
2028	AutoHeight.prototype.update = function() {
2029
2030		var start = this._core._current,
2031			end = start + this._core.settings.items,
2032			visible = this._core.$stage.children().toArray().slice(start, end);
2033			heights = [],
2034			maxheight = 0;
2035
2036		$.each(visible, function(index, item) {
2037			$(item).css("height", $(">div", item).outerHeight()+"px");
2038			heights.push($(item).outerHeight());
2039		});
2040
2041		maxheight = Math.max.apply(null, heights);
2042
2043		this._core.$stage.parent()
2044			.height(maxheight)
2045		 	.addClass(this._core.settings.autoHeightClass);
2046
2047
2048	};
2049
2050	AutoHeight.prototype.destroy = function() {
2051		var handler, property;
2052
2053		for (handler in this._handlers) {
2054			this._core.$element.off(handler, this._handlers[handler]);
2055		}
2056		for (property in Object.getOwnPropertyNames(this)) {
2057			typeof this[property] != 'function' && (this[property] = null);
2058		}
2059
2060	};
2061
2062
2063	$.fn.owlCarousel.Constructor.Plugins.AutoHeight = AutoHeight;
2064
2065
2066})(window.Zepto || window.jQuery, window, document);
2067
2068/**
2069 * Video Plugin
2070 * @version 2.0.0
2071 * @author Bartosz Wojciechowski
2072 * @license The MIT License (MIT)
2073 */
2074;(function($, window, document, undefined) {
2075
2076	/**
2077	 * Creates the video plugin.
2078	 * @class The Video Plugin
2079	 * @param {Owl} carousel - The Owl Carousel
2080	 */
2081	var Video = function(carousel) {
2082		/**
2083		 * Reference to the core.
2084		 * @protected
2085		 * @type {Owl}
2086		 */
2087		this._core = carousel;
2088
2089		/**
2090		 * Cache all video URLs.
2091		 * @protected
2092		 * @type {Object}
2093		 */
2094		this._videos = {};
2095
2096		/**
2097		 * Current playing item.
2098		 * @protected
2099		 * @type {jQuery}
2100		 */
2101		this._playing = null;
2102
2103		/**
2104		 * Whether this is in fullscreen or not.
2105		 * @protected
2106		 * @type {Boolean}
2107		 */
2108		this._fullscreen = false;
2109
2110		/**
2111		 * All event handlers.
2112		 * @protected
2113		 * @type {Object}
2114		 */
2115		this._handlers = {
2116			'resize.owl.carousel': $.proxy(function(e) {
2117				if (this._core.settings.video && !this.isInFullScreen()) {
2118					e.preventDefault();
2119				}
2120			}, this),
2121			'refresh.owl.carousel changed.owl.carousel': $.proxy(function(e) {
2122				if (this._playing) {
2123					this.stop();
2124				}
2125			}, this),
2126			'prepared.owl.carousel': $.proxy(function(e) {
2127				var $element = $(e.content).find('.owl-video');
2128				if ($element.length) {
2129					$element.css('display', 'none');
2130					this.fetch($element, $(e.content));
2131				}
2132			}, this)
2133		};
2134
2135		// set default options
2136		this._core.options = $.extend({}, Video.Defaults, this._core.options);
2137
2138		// register event handlers
2139		this._core.$element.on(this._handlers);
2140
2141		this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e) {
2142			this.play(e);
2143		}, this));
2144	};
2145
2146	/**
2147	 * Default options.
2148	 * @public
2149	 */
2150	Video.Defaults = {
2151		video: false,
2152		videoHeight: false,
2153		videoWidth: false
2154	};
2155
2156	/**
2157	 * Gets the video ID and the type (YouTube/Vimeo only).
2158	 * @protected
2159	 * @param {jQuery} target - The target containing the video data.
2160	 * @param {jQuery} item - The item containing the video.
2161	 */
2162	Video.prototype.fetch = function(target, item) {
2163
2164		var type = target.attr('data-vimeo-id') ? 'vimeo' : 'youtube',
2165			id = target.attr('data-vimeo-id') || target.attr('data-youtube-id'),
2166			width = target.attr('data-width') || this._core.settings.videoWidth,
2167			height = target.attr('data-height') || this._core.settings.videoHeight,
2168			url = target.attr('href');
2169
2170		if (url) {
2171			id = url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
2172
2173			if (id[3].indexOf('youtu') > -1) {
2174				type = 'youtube';
2175			} else if (id[3].indexOf('vimeo') > -1) {
2176				type = 'vimeo';
2177			} else {
2178				throw new Error('Video URL not supported.');
2179			}
2180			id = id[6];
2181		} else {
2182			throw new Error('Missing video URL.');
2183		}
2184
2185		this._videos[url] = {
2186			type: type,
2187			id: id,
2188			width: width,
2189			height: height
2190		};
2191
2192		item.attr('data-video', url);
2193
2194		this.thumbnail(target, this._videos[url]);
2195	};
2196
2197	/**
2198	 * Creates video thumbnail.
2199	 * @protected
2200	 * @param {jQuery} target - The target containing the video data.
2201	 * @param {Object} info - The video info object.
2202	 * @see `fetch`
2203	 */
2204	Video.prototype.thumbnail = function(target, video) {
2205
2206		var tnLink,
2207			icon,
2208			path,
2209			dimensions = video.width && video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"' : '',
2210			customTn = target.find('img'),
2211			srcType = 'src',
2212			lazyClass = '',
2213			settings = this._core.settings,
2214			create = function(path) {
2215				icon = '<div class="owl-video-play-icon"></div>';
2216
2217				if (settings.lazyLoad) {
2218					tnLink = '<div class="owl-video-tn ' + lazyClass + '" ' + srcType + '="' + path + '"></div>';
2219				} else {
2220					tnLink = '<div class="owl-video-tn" style="opacity:1;background-image:url(' + path + ')"></div>';
2221				}
2222				target.after(tnLink);
2223				target.after(icon);
2224			};
2225
2226		// wrap video content into owl-video-wrapper div
2227		target.wrap('<div class="owl-video-wrapper"' + dimensions + '></div>');
2228
2229		if (this._core.settings.lazyLoad) {
2230			srcType = 'data-src';
2231			lazyClass = 'owl-lazy';
2232		}
2233
2234		// custom thumbnail
2235		if (customTn.length) {
2236			create(customTn.attr(srcType));
2237			customTn.remove();
2238			return false;
2239		}
2240
2241		if (video.type === 'youtube') {
2242			path = "http://img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
2243			create(path);
2244		} else if (video.type === 'vimeo') {
2245			$.ajax({
2246				type: 'GET',
2247				url: 'http://vimeo.com/api/v2/video/' + video.id + '.json',
2248				jsonp: 'callback',
2249				dataType: 'jsonp',
2250				success: function(data) {
2251					path = data[0].thumbnail_large;
2252					create(path);
2253				}
2254			});
2255		}
2256	};
2257
2258	/**
2259	 * Stops the current video.
2260	 * @public
2261	 */
2262	Video.prototype.stop = function() {
2263		this._core.trigger('stop', null, 'video');
2264		this._playing.find('.owl-video-frame').remove();
2265		this._playing.removeClass('owl-video-playing');
2266		this._playing = null;
2267	};
2268
2269	/**
2270	 * Starts the current video.
2271	 * @public
2272	 * @param {Event} ev - The event arguments.
2273	 */
2274	Video.prototype.play = function(ev) {
2275		this._core.trigger('play', null, 'video');
2276
2277		if (this._playing) {
2278			this.stop();
2279		}
2280
2281		var target = $(ev.target || ev.srcElement),
2282			item = target.closest('.' + this._core.settings.itemClass),
2283			video = this._videos[item.attr('data-video')],
2284			width = video.width || '100%',
2285			height = video.height || this._core.$stage.height(),
2286			html, wrap;
2287
2288		if (video.type === 'youtube') {
2289			html = '<iframe width="' + width + '" height="' + height + '" src="http://www.youtube.com/embed/'
2290				+ video.id + '?autoplay=1&v=' + video.id + '" frameborder="0" allowfullscreen></iframe>';
2291		} else if (video.type === 'vimeo') {
2292			html = '<iframe src="http://player.vimeo.com/video/' + video.id + '?autoplay=1" width="' + width
2293				+ '" height="' + height
2294				+ '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>';
2295		}
2296
2297		item.addClass('owl-video-playing');
2298		this._playing = item;
2299
2300		wrap = $('<div style="height:' + height + 'px; width:' + width + 'px" class="owl-video-frame">'
2301			+ html + '</div>');
2302		target.after(wrap);
2303	};
2304
2305	/**
2306	 * Checks whether an video is currently in full screen mode or not.
2307	 * @todo Bad style because looks like a readonly method but changes members.
2308	 * @protected
2309	 * @returns {Boolean}
2310	 */
2311	Video.prototype.isInFullScreen = function() {
2312
2313		// if Vimeo Fullscreen mode
2314		var element = document.fullscreenElement || document.mozFullScreenElement
2315			|| document.webkitFullscreenElement;
2316
2317		if (element && $(element).parent().hasClass('owl-video-frame')) {
2318			this._core.speed(0);
2319			this._fullscreen = true;
2320		}
2321
2322		if (element && this._fullscreen && this._playing) {
2323			return false;
2324		}
2325
2326		// comming back from fullscreen
2327		if (this._fullscreen) {
2328			this._fullscreen = false;
2329			return false;
2330		}
2331
2332		// check full screen mode and window orientation
2333		if (this._playing) {
2334			if (this._core.state.orientation !== window.orientation) {
2335				this._core.state.orientation = window.orientation;
2336				return false;
2337			}
2338		}
2339
2340		return true;
2341	};
2342
2343	/**
2344	 * Destroys the plugin.
2345	 */
2346	Video.prototype.destroy = function() {
2347		var handler, property;
2348
2349		this._core.$element.off('click.owl.video');
2350
2351		for (handler in this._handlers) {
2352			this._core.$element.off(handler, this._handlers[handler]);
2353		}
2354		for (property in Object.getOwnPropertyNames(this)) {
2355			typeof this[property] != 'function' && (this[property] = null);
2356		}
2357	};
2358
2359	$.fn.owlCarousel.Constructor.Plugins.Video = Video;
2360
2361})(window.Zepto || window.jQuery, window, document);
2362
2363/**
2364 * Animate Plugin
2365 * @version 2.0.0
2366 * @author Bartosz Wojciechowski
2367 * @license The MIT License (MIT)
2368 */
2369;(function($, window, document, undefined) {
2370
2371	/**
2372	 * Creates the animate plugin.
2373	 * @class The Navigation Plugin
2374	 * @param {Owl} scope - The Owl Carousel
2375	 */
2376	var Animate = function(scope) {
2377		this.core = scope;
2378		this.core.options = $.extend({}, Animate.Defaults, this.core.options);
2379		this.swapping = true;
2380		this.previous = undefined;
2381		this.next = undefined;
2382
2383		this.handlers = {
2384			'change.owl.carousel': $.proxy(function(e) {
2385				if (e.property.name == 'position') {
2386					this.previous = this.core.current();
2387					this.next = e.property.value;
2388				}
2389			}, this),
2390			'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e) {
2391				this.swapping = e.type == 'translated';
2392			}, this),
2393			'translate.owl.carousel': $.proxy(function(e) {
2394				if (this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) {
2395					this.swap();
2396				}
2397			}, this)
2398		};
2399
2400		this.core.$element.on(this.handlers);
2401	};
2402
2403	/**
2404	 * Default options.
2405	 * @public
2406	 */
2407	Animate.Defaults = {
2408		animateOut: false,
2409		animateIn: false
2410	};
2411
2412	/**
2413	 * Toggles the animation classes whenever an translations starts.
2414	 * @protected
2415	 * @returns {Boolean|undefined}
2416	 */
2417	Animate.prototype.swap = function() {
2418
2419		if (this.core.settings.items !== 1 || !this.core.support3d) {
2420			return;
2421		}
2422
2423		this.core.speed(0);
2424
2425		var left,
2426			clear = $.proxy(this.clear, this),
2427			previous = this.core.$stage.children().eq(this.previous),
2428			next = this.core.$stage.children().eq(this.next),
2429			incoming = this.core.settings.animateIn,
2430			outgoing = this.core.settings.animateOut;
2431
2432		if (this.core.current() === this.previous) {
2433			return;
2434		}
2435
2436		if (outgoing) {
2437			left = this.core.coordinates(this.previous) - this.core.coordinates(this.next);
2438			previous.css( { 'left': left + 'px' } )
2439				.addClass('animated owl-animated-out')
2440				.addClass(outgoing)
2441				.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear);
2442		}
2443
2444		if (incoming) {
2445			next.addClass('animated owl-animated-in')
2446				.addClass(incoming)
2447				.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear);
2448		}
2449	};
2450
2451	Animate.prototype.clear = function(e) {
2452		$(e.target).css( { 'left': '' } )
2453			.removeClass('animated owl-animated-out owl-animated-in')
2454			.removeClass(this.core.settings.animateIn)
2455			.removeClass(this.core.settings.animateOut);
2456		this.core.transitionEnd();
2457	}
2458
2459	/**
2460	 * Destroys the plugin.
2461	 * @public
2462	 */
2463	Animate.prototype.destroy = function() {
2464		var handler, property;
2465
2466		for (handler in this.handlers) {
2467			this.core.$element.off(handler, this.handlers[handler]);
2468		}
2469		for (property in Object.getOwnPropertyNames(this)) {
2470			typeof this[property] != 'function' && (this[property] = null);
2471		}
2472	};
2473
2474	$.fn.owlCarousel.Constructor.Plugins.Animate = Animate;
2475
2476})(window.Zepto || window.jQuery, window, document);
2477
2478/**
2479 * Autoplay Plugin
2480 * @version 2.0.0
2481 * @author Bartosz Wojciechowski
2482 * @license The MIT License (MIT)
2483 */
2484;(function($, window, document, undefined) {
2485
2486	/**
2487	 * Creates the autoplay plugin.
2488	 * @class The Autoplay Plugin
2489	 * @param {Owl} scope - The Owl Carousel
2490	 */
2491	var Autoplay = function(scope) {
2492		this.core = scope;
2493		this.core.options = $.extend({}, Autoplay.Defaults, this.core.options);
2494
2495		this.handlers = {
2496			'translated.owl.carousel refreshed.owl.carousel': $.proxy(function() {
2497				this.autoplay();
2498			}, this),
2499			'play.owl.autoplay': $.proxy(function(e, t, s) {
2500				this.play(t, s);
2501			}, this),
2502			'stop.owl.autoplay': $.proxy(function() {
2503				this.stop();
2504			}, this),
2505			'mouseover.owl.autoplay': $.proxy(function() {
2506				if (this.core.settings.autoplayHoverPause) {
2507					this.pause();
2508				}
2509			}, this),
2510			'mouseleave.owl.autoplay': $.proxy(function() {
2511				if (this.core.settings.autoplayHoverPause) {
2512					this.autoplay();
2513				}
2514			}, this)
2515		};
2516
2517		this.core.$element.on(this.handlers);
2518	};
2519
2520	/**
2521	 * Default options.
2522	 * @public
2523	 */
2524	Autoplay.Defaults = {
2525		autoplay: false,
2526		autoplayTimeout: 5000,
2527		autoplayHoverPause: false,
2528		autoplaySpeed: false
2529	};
2530
2531	/**
2532	 * @protected
2533	 * @todo Must be documented.
2534	 */
2535	Autoplay.prototype.autoplay = function() {
2536		if (this.core.settings.autoplay && !this.core.state.videoPlay) {
2537			window.clearInterval(this.interval);
2538
2539			this.interval = window.setInterval($.proxy(function() {
2540				this.play();
2541			}, this), this.core.settings.autoplayTimeout);
2542		} else {
2543			window.clearInterval(this.interval);
2544		}
2545	};
2546
2547	/**
2548	 * Starts the autoplay.
2549	 * @public
2550	 * @param {Number} [timeout] - ...
2551	 * @param {Number} [speed] - ...
2552	 * @returns {Boolean|undefined} - ...
2553	 * @todo Must be documented.
2554	 */
2555	Autoplay.prototype.play = function(timeout, speed) {
2556		// if tab is inactive - doesnt work in <IE10
2557		if (document.hidden === true) {
2558			return;
2559		}
2560
2561		if (this.core.state.isTouch || this.core.state.isScrolling
2562			|| this.core.state.isSwiping || this.core.state.inMotion) {
2563			return;
2564		}
2565
2566		if (this.core.settings.autoplay === false) {
2567			window.clearInterval(this.interval);
2568			return;
2569		}
2570
2571		this.core.next(this.core.settings.autoplaySpeed);
2572	};
2573
2574	/**
2575	 * Stops the autoplay.
2576	 * @public
2577	 */
2578	Autoplay.prototype.stop = function() {
2579		window.clearInterval(this.interval);
2580	};
2581
2582	/**
2583	 * Pauses the autoplay.
2584	 * @public
2585	 */
2586	Autoplay.prototype.pause = function() {
2587		window.clearInterval(this.interval);
2588	};
2589
2590	/**
2591	 * Destroys the plugin.
2592	 */
2593	Autoplay.prototype.destroy = function() {
2594		var handler, property;
2595
2596		window.clearInterval(this.interval);
2597
2598		for (handler in this.handlers) {
2599			this.core.$element.off(handler, this.handlers[handler]);
2600		}
2601		for (property in Object.getOwnPropertyNames(this)) {
2602			typeof this[property] != 'function' && (this[property] = null);
2603		}
2604	};
2605
2606	$.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay;
2607
2608})(window.Zepto || window.jQuery, window, document);
2609
2610/**
2611 * Navigation Plugin
2612 * @version 2.0.0
2613 * @author Artus Kolanowski
2614 * @license The MIT License (MIT)
2615 */
2616;(function($, window, document, undefined) {
2617	'use strict';
2618
2619	/**
2620	 * Creates the navigation plugin.
2621	 * @class The Navigation Plugin
2622	 * @param {Owl} carousel - The Owl Carousel.
2623	 */
2624	var Navigation = function(carousel) {
2625		/**
2626		 * Reference to the core.
2627		 * @protected
2628		 * @type {Owl}
2629		 */
2630		this._core = carousel;
2631
2632		/**
2633		 * Indicates whether the plugin is initialized or not.
2634		 * @protected
2635		 * @type {Boolean}
2636		 */
2637		this._initialized = false;
2638
2639		/**
2640		 * The current paging indexes.
2641		 * @protected
2642		 * @type {Array}
2643		 */
2644		this._pages = [];
2645
2646		/**
2647		 * All DOM elements of the user interface.
2648		 * @protected
2649		 * @type {Object}
2650		 */
2651		this._controls = {};
2652
2653		/**
2654		 * Markup for an indicator.
2655		 * @protected
2656		 * @type {Array.<String>}
2657		 */
2658		this._templates = [];
2659
2660		/**
2661		 * The carousel element.
2662		 * @type {jQuery}
2663		 */
2664		this.$element = this._core.$element;
2665
2666		/**
2667		 * Overridden methods of the carousel.
2668		 * @protected
2669		 * @type {Object}
2670		 */
2671		this._overrides = {
2672			next: this._core.next,
2673			prev: this._core.prev,
2674			to: this._core.to
2675		};
2676
2677		/**
2678		 * All event handlers.
2679		 * @protected
2680		 * @type {Object}
2681		 */
2682		this._handlers = {
2683			'prepared.owl.carousel': $.proxy(function(e) {
2684				if (this._core.settings.dotsData) {
2685					this._templates.push($(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot'));
2686				}
2687			}, this),
2688			'add.owl.carousel': $.proxy(function(e) {
2689				if (this._core.settings.dotsData) {
2690					this._templates.splice(e.position, 0, $(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot'));
2691				}
2692			}, this),
2693			'remove.owl.carousel prepared.owl.carousel': $.proxy(function(e) {
2694				if (this._core.settings.dotsData) {
2695					this._templates.splice(e.position, 1);
2696				}
2697			}, this),
2698			'change.owl.carousel': $.proxy(function(e) {
2699				if (e.property.name == 'position') {
2700					if (!this._core.state.revert && !this._core.settings.loop && this._core.settings.navRewind) {
2701						var current = this._core.current(),
2702							maximum = this._core.maximum(),
2703							minimum = this._core.minimum();
2704						e.data = e.property.value > maximum
2705							? current >= maximum ? minimum : maximum
2706							: e.property.value < minimum ? maximum : e.property.value;
2707					}
2708				}
2709			}, this),
2710			'changed.owl.carousel': $.proxy(function(e) {
2711				if (e.property.name == 'position') {
2712					this.draw();
2713				}
2714			}, this),
2715			'refreshed.owl.carousel': $.proxy(function() {
2716				if (!this._initialized) {
2717					this.initialize();
2718					this._initialized = true;
2719				}
2720				this._core.trigger('refresh', null, 'navigation');
2721				this.update();
2722				this.draw();
2723				this._core.trigger('refreshed', null, 'navigation');
2724			}, this)
2725		};
2726
2727		// set default options
2728		this._core.options = $.extend({}, Navigation.Defaults, this._core.options);
2729
2730		// register event handlers
2731		this.$element.on(this._handlers);
2732	}
2733
2734	/**
2735	 * Default options.
2736	 * @public
2737	 * @todo Rename `slideBy` to `navBy`
2738	 */
2739	Navigation.Defaults = {
2740		nav: false,
2741		navRewind: true,
2742		navText: [ 'prev', 'next' ],
2743		navSpeed: false,
2744		navElement: 'div',
2745		navContainer: false,
2746		navContainerClass: 'owl-nav',
2747		navClass: [ 'owl-prev', 'owl-next' ],
2748		slideBy: 1,
2749		dotClass: 'owl-dot',
2750		dotsClass: 'owl-dots',
2751		dots: true,
2752		dotsEach: false,
2753		dotData: false,
2754		dotsSpeed: false,
2755		dotsContainer: false,
2756		controlsClass: 'owl-controls'
2757	}
2758
2759	/**
2760	 * Initializes the layout of the plugin and extends the carousel.
2761	 * @protected
2762	 */
2763	Navigation.prototype.initialize = function() {
2764		var $container, override,
2765			options = this._core.settings;
2766
2767		// create the indicator template
2768		if (!options.dotsData) {
2769			this._templates = [ $('<div>')
2770				.addClass(options.dotClass)
2771				.append($('<span>'))
2772				.prop('outerHTML') ];
2773		}
2774
2775		// create controls container if needed
2776		if (!options.navContainer || !options.dotsContainer) {
2777			this._controls.$container = $('<div>')
2778				.addClass(options.controlsClass)
2779				.appendTo(this.$element);
2780		}
2781
2782		// create DOM structure for absolute navigation
2783		this._controls.$indicators = options.dotsContainer ? $(options.dotsContainer)
2784			: $('<div>').hide().addClass(options.dotsClass).appendTo(this._controls.$container);
2785
2786		this._controls.$indicators.on('click', 'div', $.proxy(function(e) {
2787			var index = $(e.target).parent().is(this._controls.$indicators)
2788				? $(e.target).index() : $(e.target).parent().index();
2789
2790			e.preventDefault();
2791
2792			this.to(index, options.dotsSpeed);
2793		}, this));
2794
2795		// create DOM structure for relative navigation
2796		$container = options.navContainer ? $(options.navContainer)
2797			: $('<div>').addClass(options.navContainerClass).prependTo(this._controls.$container);
2798
2799		this._controls.$next = $('<' + options.navElement + '>');
2800		this._controls.$previous = this._controls.$next.clone();
2801
2802		this._controls.$previous
2803			.addClass(options.navClass[0])
2804			.html(options.navText[0])
2805			.hide()
2806			.prependTo($container)
2807			.on('click', $.proxy(function(e) {
2808				this.prev(options.navSpeed);
2809			}, this));
2810		this._controls.$next
2811			.addClass(options.navClass[1])
2812			.html(options.navText[1])
2813			.hide()
2814			.appendTo($container)
2815			.on('click', $.proxy(function(e) {
2816				this.next(options.navSpeed);
2817			}, this));
2818
2819		// override public methods of the carousel
2820		for (override in this._overrides) {
2821			this._core[override] = $.proxy(this[override], this);
2822		}
2823	}
2824
2825	/**
2826	 * Destroys the plugin.
2827	 * @protected
2828	 */
2829	Navigation.prototype.destroy = function() {
2830		var handler, control, property, override;
2831
2832		for (handler in this._handlers) {
2833			this.$element.off(handler, this._handlers[handler]);
2834		}
2835		for (control in this._controls) {
2836			this._controls[control].remove();
2837		}
2838		for (override in this.overides) {
2839			this._core[override] = this._overrides[override];
2840		}
2841		for (property in Object.getOwnPropertyNames(this)) {
2842			typeof this[property] != 'function' && (this[property] = null);
2843		}
2844	}
2845
2846	/**
2847	 * Updates the internal state.
2848	 * @protected
2849	 */
2850	Navigation.prototype.update = function() {
2851		var i, j, k,
2852			options = this._core.settings,
2853			lower = this._core.clones().length / 2,
2854			upper = lower + this._core.items().length,
2855			size = options.center || options.autoWidth || options.dotData
2856				? 1 : options.dotsEach || options.items;
2857
2858		if (options.slideBy !== 'page') {
2859			options.slideBy = Math.min(options.slideBy, options.items);
2860		}
2861
2862		if (options.dots || options.slideBy == 'page') {
2863			this._pages = [];
2864
2865			for (i = lower, j = 0, k = 0; i < upper; i++) {
2866				if (j >= size || j === 0) {
2867					this._pages.push({
2868						start: i - lower,
2869						end: i - lower + size - 1
2870					});
2871					j = 0, ++k;
2872				}
2873				j += this._core.mergers(this._core.relative(i));
2874			}
2875		}
2876	}
2877
2878	/**
2879	 * Draws the user interface.
2880	 * @todo The option `dotData` wont work.
2881	 * @protected
2882	 */
2883	Navigation.prototype.draw = function() {
2884		var difference, i, html = '',
2885			options = this._core.settings,
2886			$items = this._core.$stage.children(),
2887			index = this._core.relative(this._core.current());
2888
2889		if (options.nav && !options.loop && !options.navRewind) {
2890			this._controls.$previous.toggleClass('disabled', index <= 0);
2891			this._controls.$next.toggleClass('disabled', index >= this._core.maximum());
2892		}
2893
2894		this._controls.$previous.toggle(options.nav);
2895		this._controls.$next.toggle(options.nav);
2896
2897		if (options.dots) {
2898			difference = this._pages.length - this._controls.$indicators.children().length;
2899
2900			if (options.dotData && difference !== 0) {
2901				for (i = 0; i < this._controls.$indicators.children().length; i++) {
2902					html += this._templates[this._core.relative(i)];
2903				}
2904				this._controls.$indicators.html(html);
2905			} else if (difference > 0) {
2906				html = new Array(difference + 1).join(this._templates[0]);
2907				this._controls.$indicators.append(html);
2908			} else if (difference < 0) {
2909				this._controls.$indicators.children().slice(difference).remove();
2910			}
2911
2912			this._controls.$indicators.find('.active').removeClass('active');
2913			this._controls.$indicators.children().eq($.inArray(this.current(), this._pages)).addClass('active');
2914		}
2915
2916		this._controls.$indicators.toggle(options.dots);
2917	}
2918
2919	/**
2920	 * Extends event data.
2921	 * @protected
2922	 * @param {Event} event - The event object which gets thrown.
2923	 */
2924	Navigation.prototype.onTrigger = function(event) {
2925		var settings = this._core.settings;
2926
2927		event.page = {
2928			index: $.inArray(this.current(), this._pages),
2929			count: this._pages.length,
2930			size: settings && (settings.center || settings.autoWidth || settings.dotData
2931				? 1 : settings.dotsEach || settings.items)
2932		};
2933	}
2934
2935	/**
2936	 * Gets the current page position of the carousel.
2937	 * @protected
2938	 * @returns {Number}
2939	 */
2940	Navigation.prototype.current = function() {
2941		var index = this._core.relative(this._core.current());
2942		return $.grep(this._pages, function(o) {
2943			return o.start <= index && o.end >= index;
2944		}).pop();
2945	}
2946
2947	/**
2948	 * Gets the current succesor/predecessor position.
2949	 * @protected
2950	 * @returns {Number}
2951	 */
2952	Navigation.prototype.getPosition = function(successor) {
2953		var position, length,
2954			options = this._core.settings;
2955
2956		if (options.slideBy == 'page') {
2957			position = $.inArray(this.current(), this._pages);
2958			length = this._pages.length;
2959			successor ? ++position : --position;
2960			position = this._pages[((position % length) + length) % length].start;
2961		} else {
2962			position = this._core.relative(this._core.current());
2963			length = this._core.items().length;
2964			successor ? position += options.slideBy : position -= options.slideBy;
2965		}
2966		return position;
2967	}
2968
2969	/**
2970	 * Slides to the next item or page.
2971	 * @public
2972	 * @param {Number} [speed=false] - The time in milliseconds for the transition.
2973	 */
2974	Navigation.prototype.next = function(speed) {
2975		$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
2976	}
2977
2978	/**
2979	 * Slides to the previous item or page.
2980	 * @public
2981	 * @param {Number} [speed=false] - The time in milliseconds for the transition.
2982	 */
2983	Navigation.prototype.prev = function(speed) {
2984		$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
2985	}
2986
2987	/**
2988	 * Slides to the specified item or page.
2989	 * @public
2990	 * @param {Number} position - The position of the item or page.
2991	 * @param {Number} [speed] - The time in milliseconds for the transition.
2992	 * @param {Boolean} [standard=false] - Whether to use the standard behaviour or not.
2993	 */
2994	Navigation.prototype.to = function(position, speed, standard) {
2995		var length;
2996
2997		if (!standard) {
2998			length = this._pages.length;
2999			$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
3000		} else {
3001			$.proxy(this._overrides.to, this._core)(position, speed);
3002		}
3003	}
3004
3005	$.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation;
3006
3007})(window.Zepto || window.jQuery, window, document);
3008
3009/**
3010 * Hash Plugin
3011 * @version 2.0.0
3012 * @author Artus Kolanowski
3013 * @license The MIT License (MIT)
3014 */
3015;(function($, window, document, undefined) {
3016	'use strict';
3017
3018	/**
3019	 * Creates the hash plugin.
3020	 * @class The Hash Plugin
3021	 * @param {Owl} carousel - The Owl Carousel
3022	 */
3023	var Hash = function(carousel) {
3024		/**
3025		 * Reference to the core.
3026		 * @protected
3027		 * @type {Owl}
3028		 */
3029		this._core = carousel;
3030
3031		/**
3032		 * Hash table for the hashes.
3033		 * @protected
3034		 * @type {Object}
3035		 */
3036		this._hashes = {};
3037
3038		/**
3039		 * The carousel element.
3040		 * @type {jQuery}
3041		 */
3042		this.$element = this._core.$element;
3043
3044		/**
3045		 * All event handlers.
3046		 * @protected
3047		 * @type {Object}
3048		 */
3049		this._handlers = {
3050			'initialized.owl.carousel': $.proxy(function() {
3051				if (this._core.settings.startPosition == 'URLHash') {
3052					$(window).trigger('hashchange.owl.navigation');
3053				}
3054			}, this),
3055			'prepared.owl.carousel': $.proxy(function(e) {
3056				var hash = $(e.content).find('[data-hash]').andSelf('[data-hash]').attr('data-hash');
3057				this._hashes[hash] = e.content;
3058			}, this)
3059		};
3060
3061		// set default options
3062		this._core.options = $.extend({}, Hash.Defaults, this._core.options);
3063
3064		// register the event handlers
3065		this.$element.on(this._handlers);
3066
3067		// register event listener for hash navigation
3068		$(window).on('hashchange.owl.navigation', $.proxy(function() {
3069			var hash = window.location.hash.substring(1),
3070				items = this._core.$stage.children(),
3071				position = this._hashes[hash] && items.index(this._hashes[hash]) || 0;
3072
3073			if (!hash) {
3074				return false;
3075			}
3076
3077			this._core.to(position, false, true);
3078		}, this));
3079	}
3080
3081	/**
3082	 * Default options.
3083	 * @public
3084	 */
3085	Hash.Defaults = {
3086		URLhashListener: false
3087	}
3088
3089	/**
3090	 * Destroys the plugin.
3091	 * @public
3092	 */
3093	Hash.prototype.destroy = function() {
3094		var handler, property;
3095
3096		$(window).off('hashchange.owl.navigation');
3097
3098		for (handler in this._handlers) {
3099			this._core.$element.off(handler, this._handlers[handler]);
3100		}
3101		for (property in Object.getOwnPropertyNames(this)) {
3102			typeof this[property] != 'function' && (this[property] = null);
3103		}
3104	}
3105
3106	$.fn.owlCarousel.Constructor.Plugins.Hash = Hash;
3107
3108})(window.Zepto || window.jQuery, window, document);
3109// source --> https://www.socialnews.xyz/wp-content/plugins/wp-posts-carousel/owl.carousel/jquery.mousewheel.min.js?ver=3.1.12 
3110/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
3111 * Licensed under the MIT License (LICENSE.txt).
3112 *
3113 * Version: 3.1.12
3114 *
3115 * Requires: jQuery 1.2.2+
3116 */
3117!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1
3117),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
3118// source --> https://www.socialnews.xyz/wp-content/themes/mh-newsdesk-lite/js/scripts.js?ver=6.9.4 
3119/* Modernizr 2.8.3 (Custom Build) | Build: http://modernizr.com/download/#-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load */
3120
3121;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;
3121var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e});for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};
3122
3123jQuery(document).ready(function($){
3124
3125	/*! SlickNav Responsive Mobile Menu v1.0.0 */
3126
3127	;(function(e,t,n){function o(t,n){this.element=t;this.settings=e.extend({},r,n);this._defaults=r;this._name=i;this.init()}var r={label:"MENU",duplicate:true,duration:200,easingOpen:"swing",easingClose:"swing",closedSymbol:"&#9658;",openedSymbol:"&#9660;",prependTo:"body",parentTag:"a",closeOnClick:false,allowParentLinks:false,init:function(){},open:function(){},close:function(){}},i="slicknav",s="slicknav";o.prototype.init=function(){var n=this;var r=e(this.element);var i=this.settings;if(i.duplicate){n.mobileNav=r.clone();n.mobileNav.removeAttr("id");n.mobileNav.find("*").each(function(t,n){e(n).removeAttr("id")})}else n.mobileNav=r;var o=s+"_icon";if(i.label==""){o+=" "+s+"_no-text"}if(i.parentTag=="a"){i.parentTag='a href="#"'}n.mobileNav.attr("class",s+"_nav");var u=e('<div class="'+s+'_menu"></div>');n.btn=e("<"+i.parentTag+' aria-haspopup="true" tabindex="0" class="'+s+"_btn "+s+'_collapsed"><span class="'+s+'_menutxt">'+i.label+'</span><span class="'+o+'"><span class="'+s+'_icon-bar"></span><span class="'+s+'_icon-bar"></span><span class="'+s+'_icon-bar"></span></span></a>');e(u).append(n.btn);e(i.prependTo).prepend(u);u.append(n.mobileNav);var a=n.mobileNav.find("li");e(a).each(function(){var t=e(this);data={};data.children=t.children("ul").attr("role","menu");t.data("menu",data);if(data.children.length>0){var r=t.contents();var o=[];e(r).each(function(){if(!e(this).is("ul")){o.push(this)}else{return false}});var u=e(o).wrapAll("<"+i.parentTag+' role="menuitem" aria-haspopup="true" tabindex="-1" class="'+s+'_item"/>').parent();t.addClass(s+"_collapsed");t.addClass(s+"_parent");e(o).last().after('<span class="'+s+'_arrow">'+i.closedSymbol+"</span>")}else if(t.children().length==0){t.addClass(s+"_txtnode")}t.children("a").attr("role","menuitem").click(function(t){if(i.closeOnClick&&!e(t.target).parent().closest("li").hasClass(s+"_parent"))e(n.btn).click()});if(i.closeOnClick&&i.allowParentLinks){t.children("a").children("a").click(function(t){e(n.btn).click()})}});e(a).each(function(){var t=e(this).data("menu");n._visibilityToggle(t.children,false,null,true)});n._visibilityToggle(n.mobileNav,false,"init",true);n.mobileNav.attr("role","menu");
3127e(t).mousedown(function(){n._outlines(false)});e(t).keyup(function(){n._outlines(true)});e(n.btn).click(function(e){e.preventDefault();n._menuToggle()});n.mobileNav.on("click","."+s+"_item",function(t){t.preventDefault();n._itemClick(e(this))});e(n.btn).keydown(function(e){var t=e||event;if(t.keyCode==13){e.preventDefault();n._menuToggle()}});n.mobileNav.on("keydown","."+s+"_item",function(t){var r=t||event;if(r.keyCode==13){t.preventDefault();n._itemClick(e(t.target))}});if(i.allowParentLinks){e("."+s+"_item a").click(function(e){e.stopImmediatePropagation()})}};o.prototype._menuToggle=function(e){var t=this;var n=t.btn;var r=t.mobileNav;if(n.hasClass(s+"_collapsed")){n.removeClass(s+"_collapsed");n.addClass(s+"_open")}else{n.removeClass(s+"_open");n.addClass(s+"_collapsed")}n.addClass(s+"_animating");t._visibilityToggle(r,true,n)};o.prototype._itemClick=function(e){var t=this;var n=t.settings;var r=e.data("menu");if(!r){r={};r.arrow=e.children("."+s+"_arrow");r.ul=e.next("ul");r.parent=e.parent();e.data("menu",r)}if(r.parent.hasClass(s+"_collapsed")){r.arrow.html(n.openedSymbol);r.parent.removeClass(s+"_collapsed");r.parent.addClass(s+"_open");r.parent.addClass(s+"_animating");t._visibilityToggle(r.ul,true,e)}else{r.arrow.html(n.closedSymbol);r.parent.addClass(s+"_collapsed");r.parent.removeClass(s+"_open");r.parent.addClass(s+"_animating");t._visibilityToggle(r.ul,true,e)}};o.prototype._visibilityToggle=function(t,n,r,i){var o=this;var u=o.settings;var a=o._getActionItems(t);var f=0;if(n)f=u.duration;if(t.hasClass(s+"_hidden")){t.removeClass(s+"_hidden");t.slideDown(f,u.easingOpen,function(){e(r).removeClass(s+"_animating");e(r).parent().removeClass(s+"_animating");if(!i){u.open(r)}});t.attr("aria-hidden","false");a.attr("tabindex","0");o._setVisAttr(t,false)}else{t.addClass(s+"_hidden");t.slideUp(f,this.settings.easingClose,function(){t.attr("aria-hidden","true");a.attr("tabindex","-1");o._setVisAttr(t,true);t.hide();e(r).removeClass(s+"_animating");e(r).parent().removeClass(s+"_animating");if(!i)u.close(r);else if(r=="init")u.init()})}};o.prototype._setVisAttr=function(t,n){var r=this;var i=t.children("li").children("ul").not("."+s+"_hidden");if(!n){i.each(function(){var t=e(this);t.attr("aria-hidden","false");var i=r._getActionItems(t);i.attr("tabindex","0");r._setVisAttr(t,n)})}else{i.each(function(){var t=e(this);t.attr("aria-hidden","true");var i=r._getActionItems(t);i.attr("tabindex","-1");r._setVisAttr(t,n)})}};o.prototype._getActionItems=function(e){var t=e.data("menu");if(!t){t={};var n=e.children("li");var r=n.children("a");t.links=r.add(n.children("."+s+"_item"));e.data("menu",t)}return t.links};o.prototype._outlines=function(t){if(!t){e("."+s+"_item, ."+s+"_btn").css("outline","none")}else{e("."+s+"_item, ."+s+"_btn").css("outline","")}};o.prototype.toggle=function(){$this=this;$this._menuToggle()};o.prototype.open=function(){$this=this;if($this.btn.hasClass(s+"_collapsed")){$this._menuToggle()}};o.prototype.close=function(){$this=this;if($this.btn.hasClass(s+"_open")){$this._menuToggle()}};e.fn[i]=function(t){var n=arguments;if(t===undefined||typeof t==="object"){return this.each(function(){if(!e.data(this,"plugin_"+i)){e.data(this,"plugin_"+i,new o(this,t))}})}else if(typeof t==="string"&&t[0]!=="_"&&t!=="init"){var r;this.each(function(){var s=e.data(this,"plugin_"+i);if(s instanceof o&&typeof s[t]==="function"){r=s[t].apply(s,Array.prototype.slice.call(n,1))}});return r!==undefined?r:this}}})(jQuery,document,window)
3128
3129	$(function(){
3130		$('.main-nav').slicknav({ prependTo:'.header-menu', duration: 500, allowParentLinks: true });
3131	});
3132
3133});
3134// source --> https://www.socialnews.xyz/wp-content/plugins/all-in-one-schemaorg-rich-snippets/js/jquery.rating.min.js 
3135if(window.jQuery){(function($){if((!$.support.opacity&&!$.support.style)){try{document.execCommand("BackgroundImageCache",false,true);}catch(e){}}$.fn.rating=function(options){if(this.length==0){return this;}if(typeof arguments[0]=="string"){if(this.length>1){var args=arguments;return this.each(function(){$.fn.rating.apply($(this),args);});}$.fn.rating[arguments[0]].apply(this,$.makeArray(arguments).slice(1)||[]);return this;}var options=$.extend({},$.fn.rating.options,options||{});$.fn.rating.calls++;this.not(".star-rating-applied").addClass("star-rating-applied").each(function(){var control,input=$(this);var eid=(this.name||"unnamed-rating").replace(/\[|\]/g,"_").replace(/^\_+|\_+$/g,"");var context=$(this.form||document.body);var raters=context.data("rating");if(!raters||raters.call!=$.fn.rating.calls){raters={count:0,call:$.fn.rating.calls};}var rater=raters[eid]||context.data("rating"+eid);if(rater){control=rater.data("rating");}if(rater&&control){control.count++;}else{control=$.extend({},options||{},($.metadata?input.metadata():($.meta?input.data():null))||{},{count:0,stars:[],inputs:[]});control.serial=raters.count++;rater=$('<span class="star-rating-control"/>');input.before(rater);rater.addClass("rating-to-be-drawn");if(input.attr("disabled")||input.hasClass("disabled")){control.readOnly=true;}if(input.hasClass("required")){control.required=true;}rater.append(control.cancel=$('<div class="rating-cancel"><a title="'+control.cancel+'">'+control.cancelValue+"</a></div>").on("mouseover",function(){$(this).rating("drain");$(this).addClass("star-rating-hover");}).on("mouseout",function(){$(this).rating("draw");$(this).removeClass("star-rating-hover");}).on("click",function(){$(this).rating("select");}).data("rating",control));}var star=$('<div role="text" aria-label="'+this.title+'" class="star-rating rater-'+control.serial+'"><a title="'+(this.title||this.value)+'">'+this.value+"</a></div>");rater.append(star);
3135if(this.id){star.attr("id",this.id);}if(this.className){star.addClass(this.className);}if(control.half){control.split=2;}if(typeof control.split=="number"&&control.split>0){var stw=($.fn.width?star.width():0)||control.starWidth;var spi=(control.count%control.split),spw=Math.floor(stw/control.split);star.width(spw).find("a").css({"margin-left":"-"+(spi*spw)+"px"});}if(control.readOnly){star.addClass("star-rating-readonly");}else{star.addClass("star-rating-live").on("mouseover",function(){$(this).rating("fill");$(this).rating("focus");}).on("mouseout",function(){$(this).rating("draw");$(this).rating("blur");}).on("click",function(){$(this).rating("select");});}if(this.checked){control.current=star;}if(this.nodeName=="A"){if($(this).hasClass("selected")){control.current=star;}}input.hide();input.on("change.rating",function(event){if(event.selfTriggered){return false;}$(this).rating("select");});star.data("rating.input",input.data("rating.star",star));control.stars[control.stars.length]=star[0];control.inputs[control.inputs.length]=input[0];control.rater=raters[eid]=rater;control.context=context;input.data("rating",control);rater.data("rating",control);star.data("rating",control);context.data("rating",raters);context.data("rating"+eid,rater);});$(".rating-to-be-drawn").rating("draw").removeClass("rating-to-be-drawn");return this;};$.extend($.fn.rating,{calls:0,focus:function(){var control=this.data("rating");if(!control){return this;}if(!control.focus){return this;}var input=$(this).data("rating.input")||$(this.tagName=="INPUT"?this:null);if(control.focus){control.focus.apply(input[0],[input.val(),$("a",input.data("rating.star"))[0]]);}},blur:function(){var control=this.data("rating");if(!control){return this;}if(!control.blur){return this;}var input=$(this).data("rating.input")||$(this.tagName=="INPUT"?this:null);if(control.blur){control.blur.apply(input[0],[input.val(),$("a",input.data("rating.star"))[0]]);}},fill:function(){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}this.rating("drain");this.prevAll().addBack().filter(".rater-"+control.serial).addClass("star-rating-hover");},drain:function(){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}control.rater.children().filter(".rater-"+control.serial).removeClass("star-rating-on").removeClass("star-rating-hover");},draw:function(){var control=this.data("rating");if(!control){return this;}this.rating("drain");var current=$(control.current);var starson=current.length?current.prevAll().addBack().filter(".rater-"+control.serial):null;if(starson){starson.addClass("star-rating-on");}control.cancel[control.readOnly||control.required?"hide":"show"]();this.siblings()[control.readOnly?"addClass":"removeClass"]("star-rating-readonly");},select:function(value,wantCallBack){var control=this.data("rating");if(!control){return this;}if(control.readOnly){return;}control.current=null;if(typeof value!="undefined"||this.length>1){if(typeof value=="number"){return $(control.stars[value]).rating("select",undefined,wantCallBack);}if(typeof value=="string"){$.each(control.stars,function(){if($(this).data("rating.input").val()==value){$(this).rating("select",undefined,wantCallBack);}});return this;}}else{control.current=this[0].tagName=="INPUT"?this.data("rating.star"):(this.is(".rater-"+control.serial)?this:null);}this.data("rating",control);this.rating("draw");var current=$(control.current?control.current.data("rating.input"):null);var lastipt=$(control.inputs).filter(":checked");var deadipt=$(control.inputs).not(current);deadipt.prop("checked",false);current.prop("checked",true);$(current.length?current:lastipt).trigger({type:"change",selfTriggered:true});if((wantCallBack||wantCallBack==undefined)&&control.callback){control.callback.apply(current[0],[current.val(),$("a",control.current)[0]]);}return this;},readOnly:function(toggle,disable){var control=this.data("rating");if(!control){return this;}control.readOnly=toggle||toggle==undefined?true:false;if(disable){$(control.inputs).attr("disabled","disabled");}else{$(control.inputs).removeAttr("disabled");}this.data("rating",control);this.rating("draw");},disable:function(){this.rating("readOnly",true,true);},enable:function(){this.rating("readOnly",false,false);}});$.fn.rating.options={cancel:"Cancel Rating",cancelValue:"",split:0,starWidth:16};$(function(){$("input[type=radio].star").rating();});})(jQuery);}(function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/({.*})/,single:"metadata"},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length){settings.single="metadata";}var data=$.data(elem,settings.single);if(data){return data;}data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m){data=m[1];}}else{if(settings.type=="elem"){if(!elem.getElementsByTagName){return;}var e=elem.getElementsByTagName(settings.name);if(e.length){data=$.trim(e[0].innerHTML);}}else{if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr){data=attr;}}}}if(data.indexOf("{")<0){data="{"+data+"}";}data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);
3136/*!
3137 * jQuery Form Plugin
3138 * version: 3.27.0-2013.02.06
3139 * @requires jQuery v1.5 or later
3140 *
3141 * Examples and documentation at: http://malsup.com/jquery/form/
3142 * Project repository: https://github.com/malsup/form
3143 * Dual licensed under the MIT and GPL licenses:
3144 *    http://malsup.github.com/mit-license.txt
3145 *    http://malsup.github.com/gpl-license-v2.txt
3146 */
3147(function($){var feature={};feature.fileapi=$("<input type='file'/>").get(0).files!==undefined;
3147feature.formdata=window.FormData!==undefined;$.fn.ajaxSubmit=function(options){if(!this.length){log("ajaxSubmit: skipping submit process - no element selected");return this;}var method,action,url,$form=this;if(typeof options=="function"){options={success:options};}method=this.attr("method");action=this.attr("action");url=(typeof action==="string")?$.trim(action):"";url=url||window.location.href||"";if(url){url=(url.match(/^([^#]+)/)||[])[1];}options=$.extend(true,{url:url,success:$.ajaxSettings.success,type:method||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},options);var veto={};this.trigger("form-pre-serialize",[this,options,veto]);if(veto.veto){log("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this;}if(options.beforeSerialize&&options.beforeSerialize(this,options)===false){log("ajaxSubmit: submit aborted via beforeSerialize callback");return this;}var traditional=options.traditional;if(traditional===undefined){traditional=$.ajaxSettings.traditional;}var elements=[];var qx,a=this.formToArray(options.semantic,elements);if(options.data){options.extraData=options.data;qx=$.param(options.data,traditional);}if(options.beforeSubmit&&options.beforeSubmit(a,this,options)===false){log("ajaxSubmit: submit aborted via beforeSubmit callback");return this;}this.trigger("form-submit-validate",[a,this,options,veto]);if(veto.veto){log("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this;}var q=$.param(a,traditional);if(qx){q=(q?(q+"&"+qx):qx);}if(options.type.toUpperCase()=="GET"){options.url+=(options.url.indexOf("?")>=0?"&":"?")+q;options.data=null;}else{options.data=q;}var callbacks=[];if(options.resetForm){callbacks.push(function(){$form.resetForm();});}if(options.clearForm){callbacks.push(function(){$form.clearForm(options.includeHidden);});}if(!options.dataType&&options.target){var oldSuccess=options.success||function(){};callbacks.push(function(data){var fn=options.replaceTarget?"replaceWith":"html";$(options.target)[fn](data).each(oldSuccess,arguments);});}else{if(options.success){callbacks.push(options.success);}}options.success=function(data,status,xhr){var context=options.context||this;for(var i=0,max=callbacks.length;i<max;i++){callbacks[i].apply(context,[data,status,xhr||$form,$form]);}};var fileInputs=$('input[type=file]:enabled[value!=""]',this);var hasFileInputs=fileInputs.length>0;var mp="multipart/form-data";var multipart=($form.attr("enctype")==mp||$form.attr("encoding")==mp);var fileAPI=feature.fileapi&&feature.formdata;log("fileAPI :"+fileAPI);var shouldUseFrame=(hasFileInputs||multipart)&&!fileAPI;var jqxhr;if(options.iframe!==false&&(options.iframe||shouldUseFrame)){if(options.closeKeepAlive){$.get(options.closeKeepAlive,function(){jqxhr=fileUploadIframe(a);});}else{jqxhr=fileUploadIframe(a);}}else{if((hasFileInputs||multipart)&&fileAPI){jqxhr=fileUploadXhr(a);}else{jqxhr=$.ajax(options);}}$form.removeData("jqxhr").data("jqxhr",jqxhr);for(var k=0;k<elements.length;k++){elements[k]=null;}this.trigger("form-submit-notify",[this,options]);return this;function deepSerialize(extraData){var serialized=$.param(extraData).split("&");var len=serialized.length;var result=[];var i,part;for(i=0;i<len;i++){serialized[i]=serialized[i].replace(/\+/g," ");part=serialized[i].split("=");result.push([decodeURIComponent(part[0]),decodeURIComponent(part[1])]);}return result;}function fileUploadXhr(a){var formdata=new FormData();for(var i=0;i<a.length;i++){formdata.append(a[i].name,a[i].value);}if(options.extraData){var serializedData=deepSerialize(options.extraData);for(i=0;i<serializedData.length;i++){if(serializedData[i]){formdata.append(serializedData[i][0],serializedData[i][1]);}}}options.data=null;var s=$.extend(true,{},$.ajaxSettings,options,{contentType:false,processData:false,cache:false,type:method||"POST"});if(options.uploadProgress){s.xhr=function(){var xhr=jQuery.ajaxSettings.xhr();if(xhr.upload){xhr.upload.addEventListener("progress",function(event){var percent=0;var position=event.loaded||event.position;var total=event.total;if(event.lengthComputable){percent=Math.ceil(position/total*100);}options.uploadProgress(event,position,total,percent);},false);}return xhr;};}s.data=null;var beforeSend=s.beforeSend;s.beforeSend=function(xhr,o){o.data=formdata;
3147if(beforeSend){beforeSend.call(this,xhr,o);}};return $.ajax(s);}function fileUploadIframe(a){var form=$form[0],el,i,s,g,id,$io,io,xhr,sub,n,timedOut,timeoutHandle;var useProp=!!$.fn.prop;var deferred=$.Deferred();if(a){for(i=0;i<elements.length;i++){el=$(elements[i]);if(useProp){el.prop("disabled",false);}else{el.removeAttr("disabled");}}}s=$.extend(true,{},$.ajaxSettings,options);s.context=s.context||s;id="jqFormIO"+(new Date().getTime());if(s.iframeTarget){$io=$(s.iframeTarget);n=$io.attr("name");if(!n){$io.attr("name",id);}else{id=n;}}else{$io=$('<iframe name="'+id+'" src="'+s.iframeSrc+'" />');$io.css({position:"absolute",top:"-1000px",left:"-1000px"});}io=$io[0];xhr={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(status){var e=(status==="timeout"?"timeout":"aborted");log("aborting upload... "+e);this.aborted=1;try{if(io.contentWindow.document.execCommand){io.contentWindow.document.execCommand("Stop");}}catch(ignore){}$io.attr("src",s.iframeSrc);xhr.error=e;if(s.error){s.error.call(s.context,xhr,e,status);}if(g){$.event.trigger("ajaxError",[xhr,s,e]);}if(s.complete){s.complete.call(s.context,xhr,e);}}};g=s.global;if(g&&0===$.active++){$.event.trigger("ajaxStart");}if(g){$.event.trigger("ajaxSend",[xhr,s]);}if(s.beforeSend&&s.beforeSend.call(s.context,xhr,s)===false){if(s.global){$.active--;}deferred.reject();return deferred;}if(xhr.aborted){deferred.reject();return deferred;}sub=form.clk;if(sub){n=sub.name;if(n&&!sub.disabled){s.extraData=s.extraData||{};s.extraData[n]=sub.value;if(sub.type=="image"){s.extraData[n+".x"]=form.clk_x;s.extraData[n+".y"]=form.clk_y;}}}var CLIENT_TIMEOUT_ABORT=1;var SERVER_ABORT=2;function getDoc(frame){var doc=frame.contentWindow?frame.contentWindow.document:frame.contentDocument?frame.contentDocument:frame.document;return doc;}var csrf_token=$("meta[name=csrf-token]").attr("content");var csrf_param=$("meta[name=csrf-param]").attr("content");if(csrf_param&&csrf_token){s.extraData=s.extraData||{};s.extraData[csrf_param]=csrf_token;}function doSubmit(){var t=$form.attr("target"),a=$form.attr("action");form.setAttribute("target",id);if(!method){form.setAttribute("method","POST");}if(a!=s.url){form.setAttribute("action",s.url);}if(!s.skipEncodingOverride&&(!method||/post/i.test(method))){$form.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});}if(s.timeout){timeoutHandle=setTimeout(function(){timedOut=true;cb(CLIENT_TIMEOUT_ABORT);},s.timeout);}function checkState(){try{var state=getDoc(io).readyState;log("state = "+state);if(state&&state.toLowerCase()=="uninitialized"){setTimeout(checkState,50);}}catch(e){log("Server abort: ",e," (",e.name,")");cb(SERVER_ABORT);if(timeoutHandle){clearTimeout(timeoutHandle);}timeoutHandle=undefined;}}var extraInputs=[];try{if(s.extraData){for(var n in s.extraData){if(s.extraData.hasOwnProperty(n)){if($.isPlainObject(s.extraData[n])&&s.extraData[n].hasOwnProperty("name")&&s.extraData[n].hasOwnProperty("value")){extraInputs.push($('<input type="hidden" name="'+s.extraData[n].name+'">').val(s.extraData[n].value).appendTo(form)[0]);}else{extraInputs.push($('<input type="hidden" name="'+n+'">').val(s.extraData[n]).appendTo(form)[0]);}}}}if(!s.iframeTarget){$io.appendTo("body");if(io.attachEvent){io.attachEvent("onload",cb);}else{io.addEventListener("load",cb,false);}}setTimeout(checkState,15);var submitFn=document.createElement("form").submit;submitFn.apply(form);}finally{form.setAttribute("action",a);if(t){form.setAttribute("target",t);}else{$form.removeAttr("target");}$(extraInputs).remove();}}if(s.forceSync){doSubmit();}else{setTimeout(doSubmit,10);}var data,doc,domCheckCount=50,callbackProcessed;function cb(e){if(xhr.aborted||callbackProcessed){return;}try{doc=getDoc(io);}catch(ex){log("cannot access response document: ",ex);e=SERVER_ABORT;}if(e===CLIENT_TIMEOUT_ABORT&&xhr){xhr.abort("timeout");deferred.reject(xhr,"timeout");return;}else{if(e==SERVER_ABORT&&xhr){xhr.abort("server abort");deferred.reject(xhr,"error","server abort");return;}}if(!doc||doc.location.href==s.iframeSrc){if(!timedOut){return;}}if(io.detachEvent){io.detachEvent("onload",cb);}else{io.removeEventListener("load",cb,false);}var status="success",errMsg;
3147try{if(timedOut){throw"timeout";}var isXml=s.dataType=="xml"||doc.XMLDocument||$.isXMLDoc(doc);log("isXml="+isXml);if(!isXml&&window.opera&&(doc.body===null||!doc.body.innerHTML)){if(--domCheckCount){log("requeing onLoad callback, DOM not available");setTimeout(cb,250);return;}}var docRoot=doc.body?doc.body:doc.documentElement;xhr.responseText=docRoot?docRoot.innerHTML:null;xhr.responseXML=doc.XMLDocument?doc.XMLDocument:doc;if(isXml){s.dataType="xml";}xhr.getResponseHeader=function(header){var headers={"content-type":s.dataType};return headers[header];};if(docRoot){xhr.status=Number(docRoot.getAttribute("status"))||xhr.status;xhr.statusText=docRoot.getAttribute("statusText")||xhr.statusText;}var dt=(s.dataType||"").toLowerCase();var scr=/(json|script|text)/.test(dt);if(scr||s.textarea){var ta=doc.getElementsByTagName("textarea")[0];if(ta){xhr.responseText=ta.value;xhr.status=Number(ta.getAttribute("status"))||xhr.status;xhr.statusText=ta.getAttribute("statusText")||xhr.statusText;}else{if(scr){var pre=doc.getElementsByTagName("pre")[0];var b=doc.getElementsByTagName("body")[0];if(pre){xhr.responseText=pre.textContent?pre.textContent:pre.innerText;}else{if(b){xhr.responseText=b.textContent?b.textContent:b.innerText;}}}}}else{if(dt=="xml"&&!xhr.responseXML&&xhr.responseText){xhr.responseXML=toXml(xhr.responseText);}}try{data=httpData(xhr,dt,s);}catch(e){status="parsererror";xhr.error=errMsg=(e||status);}}catch(e){log("error caught: ",e);status="error";xhr.error=errMsg=(e||status);}if(xhr.aborted){log("upload aborted");status=null;}if(xhr.status){status=(xhr.status>=200&&xhr.status<300||xhr.status===304)?"success":"error";}if(status==="success"){if(s.success){s.success.call(s.context,data,"success",xhr);}deferred.resolve(xhr.responseText,"success",xhr);if(g){$.event.trigger("ajaxSuccess",[xhr,s]);}}else{if(status){if(errMsg===undefined){errMsg=xhr.statusText;}if(s.error){s.error.call(s.context,xhr,status,errMsg);}deferred.reject(xhr,"error",errMsg);if(g){$.event.trigger("ajaxError",[xhr,s,errMsg]);}}}if(g){$.event.trigger("ajaxComplete",[xhr,s]);}if(g&&!--$.active){$.event.trigger("ajaxStop");}if(s.complete){s.complete.call(s.context,xhr,status);}callbackProcessed=true;if(s.timeout){clearTimeout(timeoutHandle);}setTimeout(function(){if(!s.iframeTarget){$io.remove();}xhr.responseXML=null;},100);}var toXml=$.parseXML||function(s,doc){if(window.ActiveXObject){doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(s);}else{doc=(new DOMParser()).parseFromString(s,"text/xml");}return(doc&&doc.documentElement&&doc.documentElement.nodeName!="parsererror")?doc:null;};var parseJSON=$.parseJSON||function(s){return window["eval"]("("+s+")");};var httpData=function(xhr,type,s){var ct=xhr.getResponseHeader("content-type")||"",xml=type==="xml"||!type&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;if(xml&&data.documentElement.nodeName==="parsererror"){if($.error){$.error("parsererror");}}if(s&&s.dataFilter){data=s.dataFilter(data,type);}if(typeof data==="string"){if(type==="json"||!type&&ct.indexOf("json")>=0){data=parseJSON(data);}else{if(type==="script"||!type&&ct.indexOf("javascript")>=0){$.globalEval(data);}}}return data;};return deferred;}};$.fn.ajaxForm=function(options){options=options||{};options.delegation=options.delegation&&$.isFunction($.fn.on);if(!options.delegation&&this.length===0){var o={s:this.selector,c:this.context};if(!$.isReady&&o.s){log("DOM not ready, queuing ajaxForm");$(function(){$(o.s,o.c).ajaxForm(options);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}if(options.delegation){$(document).off("submit.form-plugin",this.selector,doAjaxSubmit).off("click.form-plugin",this.selector,captureSubmittingElement).on("submit.form-plugin",this.selector,options,doAjaxSubmit).on("click.form-plugin",this.selector,options,captureSubmittingElement);return this;}return this.ajaxFormUnbind().bind("submit.form-plugin",options,doAjaxSubmit).bind("click.form-plugin",options,captureSubmittingElement);};function doAjaxSubmit(e){var options=e.data;if(!e.isDefaultPrevented()){e.preventDefault();$(this).ajaxSubmit(options);}}function captureSubmittingElement(e){var target=e.target;var $el=$(target);if(!($el.is("[type=submit],[type=image]"))){var t=$el.closest("[type=submit]");if(t.length===0){return;}target=t[0];}var form=this;form.clk=target;if(target.type=="image"){if(e.offsetX!==undefined){form.clk_x=e.offsetX;form.clk_y=e.offsetY;}else{if(typeof $.fn.offset=="function"){var offset=$el.offset();form.clk_x=e.pageX-offset.left;form.clk_y=e.pageY-offset.top;}else{form.clk_x=e.pageX-target.offsetLeft;form.clk_y=e.pageY-target.offsetTop;}}}setTimeout(function(){form.clk=form.clk_x=form.clk_y=null;},100);}$.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin");};$.fn.formToArray=function(semantic,elements){var a=[];if(this.length===0){return a;}var form=this[0];var els=semantic?form.getElementsByTagName("*"):form.elements;if(!els){return a;}var i,j,n,v,el,max,jmax;for(i=0,max=els.length;i<max;i++){el=els[i];n=el.name;if(!n){continue;}if(semantic&&form.clk&&el.type=="image"){if(!el.disabled&&form.clk==el){a.push({name:n,value:$(el).val(),type:el.type});a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y});}continue;}v=$.fieldValue(el,true);if(v&&v.constructor==Array){if(elements){elements.push(el);}for(j=0,jmax=v.length;j<jmax;j++){a.push({name:n,value:v[j]});}}else{if(feature.fileapi&&el.type=="file"&&!el.disabled){if(elements){elements.push(el);}var files=el.files;if(files.length){for(j=0;j<files.length;j++){a.push({name:n,value:files[j],type:el.type});}}else{a.push({name:n,value:"",type:el.type});}}else{if(v!==null&&typeof v!="undefined"){if(elements){elements.push(el);}a.push({name:n,value:v,type:el.type,required:el.required});}}}}if(!semantic&&form.clk){var $input=$(form.clk),input=$input[0];n=input.name;if(n&&!input.disabled&&input.type=="image"){a.push({name:n,value:$input.val()});a.push({name:n+".x",value:form.clk_x},{name:n+".y",value:form.clk_y});}}return a;};
3147$.fn.formSerialize=function(semantic){return $.param(this.formToArray(semantic));};$.fn.fieldSerialize=function(successful){var a=[];this.each(function(){var n=this.name;if(!n){return;}var v=$.fieldValue(this,successful);if(v&&v.constructor==Array){for(var i=0,max=v.length;i<max;i++){a.push({name:n,value:v[i]});}}else{if(v!==null&&typeof v!="undefined"){a.push({name:this.name,value:v});}}});return $.param(a);};$.fn.fieldValue=function(successful){for(var val=[],i=0,max=this.length;i<max;i++){var el=this[i];var v=$.fieldValue(el,successful);if(v===null||typeof v=="undefined"||(v.constructor==Array&&!v.length)){continue;}if(v.constructor==Array){$.merge(val,v);}else{val.push(v);}}return val;};$.fieldValue=function(el,successful){var n=el.name,t=el.type,tag=el.tagName.toLowerCase();if(successful===undefined){successful=true;}if(successful&&(!n||el.disabled||t=="reset"||t=="button"||(t=="checkbox"||t=="radio")&&!el.checked||(t=="submit"||t=="image")&&el.form&&el.form.clk!=el||tag=="select"&&el.selectedIndex==-1)){return null;}if(tag=="select"){var index=el.selectedIndex;if(index<0){return null;}var a=[],ops=el.options;var one=(t=="select-one");var max=(one?index+1:ops.length);for(var i=(one?index:0);i<max;i++){var op=ops[i];if(op.selected){var v=op.value;if(!v){v=(op.attributes&&op.attributes.value&&!(op.attributes.value.specified))?op.text:op.value;}if(one){return v;}a.push(v);}}return a;}return $(el).val();};$.fn.clearForm=function(includeHidden){return this.each(function(){$("input,select,textarea",this).clearFields(includeHidden);});};$.fn.clearFields=$.fn.clearInputs=function(includeHidden){var re=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var t=this.type,tag=this.tagName.toLowerCase();if(re.test(t)||tag=="textarea"){this.value="";}else{if(t=="checkbox"||t=="radio"){this.checked=false;}else{if(tag=="select"){this.selectedIndex=-1;}else{if(t=="file"){if(/MSIE/.test(navigator.userAgent)){$(this).replaceWith($(this).clone());}else{$(this).val("");}}else{if(includeHidden){if((includeHidden===true&&/hidden/.test(t))||(typeof includeHidden=="string"&&$(this).is(includeHidden))){this.value="";}}}}}}});};$.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset();}});};$.fn.enable=function(b){if(b===undefined){b=true;}return this.each(function(){this.disabled=!b;});};$.fn.selected=function(select){if(select===undefined){select=true;}return this.each(function(){var t=this.type;if(t=="checkbox"||t=="radio"){this.checked=select;}else{if(this.tagName.toLowerCase()=="option"){var $sel=$(this).parent("select");if(select&&$sel[0]&&$sel[0].type=="select-one"){$sel.find("option").selected(false);}this.selected=select;}}});};$.fn.ajaxSubmit.debug=false;function log(){if(!$.fn.ajaxSubmit.debug){return;}var msg="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(msg);}else{if(window.opera&&window.opera.postError){window.opera.postError(msg);}}}})(jQuery);eval(function(p,a,c,k,e,r){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36));};if(!"".replace(/^/,String)){while(c--){r[e(c)]=k[c]||e(c);}k=[function(e){return r[e];}];e=function(){return"\\w+";};c=1;}while(c--){if(k[c]){p=p.replace(new RegExp("\\b"+e(c)+"\\b","g"),k[c]);}}return p;}(";5(1W.1C)(8($){5((!$.1s.1V&&!$.1s.1U))2d{1j.1X(\"1T\",C,s)}1R(e){};$.o.4=8(j){5(3.u==0)9 3;5(M V[0]=='1m'){5(3.u>1){7 k=V;9 3.18(8(){$.o.4.K($(3),k)})};$.o.4[V[0]].K(3,$.27(V).26(1)||[]);9 3};7 j=$.1b({},$.o.4.1w,j||{});$.o.4.P++;3.1y('.l-4-1g').p('l-4-1g').18(8(){7 b,m=$(3);7 c=(3.2g||'28-4').1f(/\\[|\\]/g,'Y').1f(/^\\Y+|\\Y+$/g,'');7 d=$(3.2h||1j.1H);7 e=d.6('4');5(!e||e.1o!=$.o.4.P)e={E:0,1o:$.o.4.P};7 f=e[c]||d.6('4'+c);5(f)b=f.6('4');5(f&&b)b.E++;R{b=$.1b({},j||{},($.1d?m.1d():($.25?m.6():w))||{},{E:0,L:[],v:[]});b.z=e.E++;f=$('<1G 13=\"l-4-1I\"/>');m.1J(f);f.p('4-12-11-10');5(m.Z('G')||m.14('G'))b.n=s;5(m.14('1c'))b.1c=s;f.1r(b.D=$('<W 13=\"4-D\"><a U=\"'+b.D+'\">'+b.1B+'</a></W>').q('1e',8(){$(3).4('N');$(3).p('l-4-T')}).q('1h',8(){$(3).4('x');$(3).I('l-4-T')}).q('1i',8(){$(3).4('y')}).6('4',b))};7 g=$('<W 20=\"21\" 22-24=\"'+3.U+'\" 13=\"l-4 t-'+b.z+'\"><a U=\"'+(3.U||3.1k)+'\">
3147'+3.1k+'</a></W>');f.1r(g);5(3.X)g.Z('X',3.X);5(3.1x)g.p(3.1x);5(b.29)b.B=2;5(M b.B=='1l'&&b.B>0){7 h=($.o.15?g.15():0)||b.1n;7 i=(b.E%b.B),17=1K.1L(h/b.B);g.15(17).1M('a').1N({'1O-1P':'-'+(i*17)+'1Q'})};5(b.n)g.p('l-4-1p');R g.p('l-4-1S').q('1e',8(){$(3).4('1q');$(3).4('J')}).q('1h',8(){$(3).4('x');$(3).4('H')}).q('1i',8(){$(3).4('y')});5(3.S)b.r=g;5(3.1Y==\"A\"){5($(3).14('1Z'))b.r=g};m.1t();m.q('1u.4',8(a){5(a.1v)9 C;$(3).4('y')});g.6('4.m',m.6('4.l',g));b.L[b.L.u]=g[0];b.v[b.v.u]=m[0];b.t=e[c]=f;b.23=d;m.6('4',b);f.6('4',b);g.6('4',b);d.6('4',e);d.6('4'+c,f)});$('.4-12-11-10').4('x').I('4-12-11-10');9 3};$.1b($.o.4,{P:0,J:8(){7 a=3.6('4');5(!a)9 3;5(!a.J)9 3;7 b=$(3).6('4.m')||$(3.19=='1a'?3:w);5(a.J)a.J.K(b[0],[b.Q(),$('a',b.6('4.l'))[0]])},H:8(){7 a=3.6('4');5(!a)9 3;5(!a.H)9 3;7 b=$(3).6('4.m')||$(3.19=='1a'?3:w);5(a.H)a.H.K(b[0],[b.Q(),$('a',b.6('4.l'))[0]])},1q:8(){7 a=3.6('4');5(!a)9 3;5(a.n)9;3.4('N');3.1z().1A().O('.t-'+a.z).p('l-4-T')},N:8(){7 a=3.6('4');5(!a)9 3;5(a.n)9;a.t.2a().O('.t-'+a.z).I('l-4-q').I('l-4-T')},x:8(){7 a=3.6('4');5(!a)9 3;3.4('N');7 b=$(a.r);7 c=b.u?b.1z().1A().O('.t-'+a.z):w;5(c)c.p('l-4-q');a.D[a.n||a.1c?'1t':'2b']();3.2c()[a.n?'p':'I']('l-4-1p')},y:8(a,b){7 c=3.6('4');5(!c)9 3;5(c.n)9;c.r=w;5(M a!='F'||3.u>1){5(M a=='1l')9 $(c.L[a]).4('y',F,b);5(M a=='1m'){$.18(c.L,8(){5($(3).6('4.m').Q()==a)$(3).4('y',F,b)});9 3}}R{c.r=3[0].19=='1a'?3.6('4.l'):(3.2e('.t-'+c.z)?3:w)};3.6('4',c);3.4('x');7 d=$(c.r?c.r.6('4.m'):w);7 e=$(c.v).O(':S');7 f=$(c.v).1y(d);f.1D('S',C);d.1D('S',s);$(d.u?d:e).2f({1E:'1u',1v:s});5((b||b==F)&&c.1F)c.1F.K(d[0],[d.Q(),$('a',c.r)[0]]);9 3},n:8(a,b){7 c=3.6('4');5(!c)9 3;c.n=a||a==F?s:C;5(b)$(c.v).Z(\"G\",\"G\");R $(c.v).2i(\"G\");3.6('4',c);3.4('x')},2j:8(){3.4('n',s,s)},2k:8(){3.4('n',C,C)}});$.o.4.1w={D:'2l 2m',1B:'',B:0,1n:16};$(8(){$('m[1E=2n].l').4()})})(1C);",62,148,"|||this|rating|if|data|var|function|return||||||||||||star|input|readOnly|fn|addClass|on|current|true|rater|length|inputs|null|draw|select|serial||split|false|cancel|count|undefined|disabled|blur|removeClass|focus|apply|stars|typeof|drain|filter|calls|val|else|checked|hover|title|arguments|div|id|_|attr|drawn|be|to|class|hasClass|width||spw|each|tagName|INPUT|extend|required|metadata|mouseover|replace|applied|mouseout|click|document|value|number|string|starWidth|call|readonly|fill|append|support|hide|change|selfTriggered|options|className|not|prevAll|addBack|cancelValue|jQuery|prop|type|callback|span|body|control|before|Math|floor|find|css|margin|left|px|catch|live|BackgroundImageCache|style|opacity|window|execCommand|nodeName|selected|role|text|aria|context|label|meta|slice|makeArray|unnamed|half|children|show|siblings|try|is|trigger|name|form|removeAttr|disable|enable|Cancel|Rating|radio".split("|"),0,{}));

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.