PageSourceSearch

https://quartapareteroma.it/wp-content/themes/quartapareteroma/library/js/init.js?ver=724860441

js quartapareteroma.it collected 2026-10-02 13:01:12 UTC 123,844 bytes, 3,434 lines download raw bytes

1/**
2 * Load utils - BEGIN
3 */
4/*
5 CSS Browser Selector 1.0
6 Originally written by Rafael Lima (http://rafael.adm.br)
7 http://rafael.adm.br/css_browser_selector
8 License: http://creativecommons.org/licenses/by/2.5/
9
10 Co-maintained by:
11 https://github.com/ridjohansen/css_browser_selector
12 https://github.com/wbruno/css_browser_selector
13 */
14
15"use strict";
16
17window.requestAnimFrame = (function() {
18	return  window.requestAnimationFrame	   ||
19			window.webkitRequestAnimationFrame ||
20			window.mozRequestAnimationFrame	||
21			window.oRequestAnimationFrame	  ||
22			window.msRequestAnimationFrame	 ||
23			function(/* function */ callback, /* DOMElement */ element){
24				window.setTimeout(callback, 1000 / 60);
25			};
26})();
27
28window.requestTimeout = function(fn, delay) {
29	if( !window.requestAnimationFrame	  	&&
30		!window.webkitRequestAnimationFrame &&
31		!(window.mozRequestAnimationFrame && window.mozCancelRequestAnimationFrame) && // Firefox 5 ships without cancel support
32		!window.oRequestAnimationFrame	  &&
33		!window.msRequestAnimationFrame)
34			return window.setTimeout(fn, delay);
35
36	var start = new Date().getTime(),
37		handle = new Object();
38
39	function loop(){
40		var current = new Date().getTime(),
41			delta = current - start;
42
43		delta >= delay ? fn.call() : handle.value = requestAnimFrame(loop);
44	};
45
46	handle.value = requestAnimFrame(loop);
47	return handle;
48};
49
50var uaInfo = {
51	ua: '',
52	is: function(t) {
53		return RegExp(t, "i").test(uaInfo.ua);
54	},
55	version: function(p, n) {
56		n = n.replace(".", "_");
57		var i = n.indexOf('_'),
58			ver = "";
59		while (i > 0) {
60			ver += " " + p + n.substring(0, i);
61			i = n.indexOf('_', i + 1);
62		}
63		ver += " " + p + n;
64		return ver;
65	},
66	getBrowser: function() {
67		var g = 'gecko',
68			w = 'webkit',
69			c = 'chrome',
70			f = 'firefox',
71			s = 'safari',
72			o = 'opera',
73			a = 'android',
74			bb = 'blackberry',
75			dv = 'device_',
76			ua = uaInfo.ua,
77			is = uaInfo.is;
78		return [
79			(!(/opera|webtv/i.test(ua)) && /msie\s(\d+)/.test(ua)) ? ('ie ie' + (/trident\/4\.0/.test(ua) ? '8' : RegExp.$1))
80			: is('edge\/') ? 'edge ie' + (/edge\/(\d+)\.(\d+)/.test(ua) ? RegExp.$1 + ' ie' + RegExp.$1 + '_' + RegExp.$2 : '') // IE Edge
81			: is('trident\/') ? 'ie ie'+ (/trident\/.+rv:(\d+)/i.test(ua) ? RegExp.$1 : '') //ie11+
82			: is('firefox/') ? g + " " + f + (/firefox\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua) ? ' ' + f + RegExp.$2 + ' ' + f + RegExp.$2 + "_" + RegExp.$4 : '')
83			: is('gecko/') ? g
84			: is('opera') ? o + (/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua) ? ' ' + o + RegExp.$2 + ' ' + o + RegExp.$2 + "_" + RegExp.$4 : (/opera(\s|\/)(\d+)\.(\d+)/.test(ua) ? ' ' + o + RegExp.$2 + " " + o + RegExp.$2 + "_" + RegExp.$3 : ''))
85			: is('konqueror') ? 'konqueror'
86			: is('blackberry') ? (bb + (/Version\/(\d+)(\.(\d+)+)/i.test(ua) ? " " + bb + RegExp.$1 + " " + bb + RegExp.$1 + RegExp.$2.replace('.', '_') : (/Blackberry ?(([0-9]+)([a-z]?))[\/|;]/gi.test(ua) ? ' ' + bb + RegExp.$2 + (RegExp.$3 ? ' ' + bb + RegExp.$2 + RegExp.$3 : '') : ''))) // blackberry
87			: is('android') ? (a + (/Version\/(\d+)(\.(\d+))+/i.test(ua) ? " " + a + RegExp.$1 + " " + a + RegExp.$1 + RegExp.$2.replace('.', '_') : '') + (/Android (.+); (.+) Build/i.test(ua) ? ' ' + dv + ((RegExp.$2).replace(/ /g, "_")).replace(/-/g, "_") : '')) //android
88			: is('chrome') ? w + ' ' + c + (/chrome\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua) ? ' ' + c + RegExp.$2 + ((RegExp.$4 > 0) ? ' ' + c + RegExp.$2 + "_" + RegExp.$4 : '') : '')
89			: is('iron') ? w + ' iron'
90			: is('applewebkit/') ? (w + ' ' + s + (/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua) ? ' ' + s + RegExp.$2 + " " + s + RegExp.$2 + RegExp.$3.replace('.', '_') : (/ Safari\/(\d+)/i.test(ua) ? ((RegExp.$1 == "419" || RegExp.$1 == "417" || RegExp.$1 == "416" || RegExp.$1 == "412") ? ' ' + s + '2_0' : RegExp.$1 == "312" ? ' ' + s + '1_3' : RegExp.$1 == "125" ? ' ' + s + '1_2' : RegExp.$1 == "85" ? ' ' + s + '1_0' : '') : ''))) //applewebkit
91			: is('mozilla/') ? g : ''
92		];
93	},
94	getPlatform : function() {
95		var wp = 'winphone',
96			a  = 'android',
97			bb = 'blackberry',
98			dv = 'device_',
99
100			ua = uaInfo.ua,
101			version = uaInfo.version,
102			is = uaInfo.is;
103
104		return [
105			is('j2me') ? 'j2me'
106			:is('windows phone') ? (wp + (/Windows Phone (\d+)(\.(\d+))+/i.test(ua) ? " " + wp + RegExp.$1 + " " + wp + RegExp.$1 + RegExp.$2.replace('.', '_') : (/Windows Phone OS (\d+)(\.(\d+))+/i.test(ua) ? " " + wp + RegExp.$1 + " " + wp + RegExp.$1 + RegExp.$2.replace('.', '_') : ''))) // Windows Phone
107			:is('blackberry') ? (bb + (/Version\/(\d+)(\.(\d+)+)/i.test(ua) ? " " + bb + RegExp.$1 + " " + bb + RegExp.$1 + RegExp.$2.replace('.', '_') : (/Blackberry ?(([0-9]+)([a-z]?))[\/|;]/gi.test(ua) ? ' ' + bb + RegExp.$2 + (RegExp.$3 ? ' ' + bb + RegExp.$2 + RegExp.$3 : '') : ''))) // blackberry
108			:is('android') ? (a + (/Version\/(\d+)(\.(\d+))+/i.test(ua) ? " " + a + RegExp.$1 + " " + a + RegExp.$1 + RegExp.$2.replace('.', '_') : '') + (/Android (.+); (.+) Build/i.test(ua) ? ' ' + dv + ((RegExp.$2).replace(/ /g, "_")).replace(/-/g, "_") : '')) //android
109			:is('ipad|ipod|iphone') ? (
110			(/CPU( iPhone)? OS (\d+[_|\.]\d+([_|\.]\d+)*)/i.test(ua) ? 'ios' + version('ios', RegExp.$2) : '') + ' ' + (/(ip(ad|od|hone))/gi.test(ua) ? RegExp.$1 : "")) //'iphone'
111			//:is('ipod')?'ipod'
112			//:is('ipad')?'ipad'
113			:is('playbook') ? 'playbook'
114			:is('kindle|silk') ? 'kindle'
115			:is('playbook') ? 'playbook'
116			:is('mac') ? 'mac' + (/mac os x ((\d+)[.|_](\d+))/.test(ua) ? (' mac' 
116+ (RegExp.$2) + ' mac' + (RegExp.$1).replace('.', "_")) : '')
117			:is('win') ? 'win' + (is('windows nt 10.0') ? ' win10'
118			:is('windows nt 6.3') ? ' win8_1'
119			:is('windows nt 6.2') ? ' win8'
120			:is('windows nt 6.1') ? ' win7'
121			:is('windows nt 6.0') ? ' vista'
122			:is('windows nt 5.2') || is('windows nt 5.1') ? ' win_xp'
123			:is('windows nt 5.0') ? ' win_2k'
124			:is('windows nt 4.0') || is('WinNT4.0') ? ' win_nt' : '')
125			:is('freebsd') ? 'freebsd'
126			:is('x11|linux') ? 'linux' : ''
127		];
128	},
129	getMobile: function() {
130		var is = uaInfo.is;
131		return [
132			is("android|mobi|mobile|j2me|iphone|ipod|ipad|blackberry|playbook|kindle|silk") ? 'mobile' : ''
133		];
134	},
135	getIpadApp: function() {
136		var is = uaInfo.is;
137		return [
138			(is('ipad|iphone|ipod') && !is('safari')) ? 'ipad_app' : ''
139		];
140	},
141	getLang: function() {
142		var ua = uaInfo.ua;
143		return [/[; |\[](([a-z]{2})(\-[a-z]{2})?)[)|;|\]]/i.test(ua) ? ('lang_' + RegExp.$2).replace("-", "_") + (RegExp.$3 != '' ? (' ' + 'lang_' + RegExp.$1).replace("-", "_") : '') : ''];
144	}
145}
146var screenInfo = {
147	width: (window.outerWidth || document.documentElement.clientWidth) - 15,
148	height: window.outerHeight || document.documentElement.clientHeight,
149	screens: [0, 768, 980, 1200],
150	screenSize: function() {
151		screenInfo.width = (window.outerWidth || document.documentElement.clientWidth) - 15;
152		screenInfo.height = window.outerHeight || document.documentElement.clientHeight;
153		var screens = screenInfo.screens,
154			i = screens.length,
155			arr = [],
156			maxw,
157			minw;
158		while (i--) {
159			if (screenInfo.width >= screens[i]) {
160				if (i) {
161					arr.push("minw_" + screens[(i)]);
162				}
163				if (i <= 2) {
164					arr.push("maxw_" + (screens[(i) + 1] - 1));
165				}
166				break;
167			}
168		}
169		return arr;
170	},
171	getOrientation: function() {
172		return screenInfo.width < screenInfo.height ? ["orientation_portrait"] : ["orientation_landscape"];
173	},
174	getInfo: function() {
175		var arr = [];
176		arr = arr.concat(screenInfo.screenSize());
177		arr = arr.concat(screenInfo.getOrientation());
178		return arr;
179	},
180	getPixelRatio: function() {
181		var arr = [],
182			pixelRatio = window.devicePixelRatio ? window.devicePixelRatio : 1;
183		if (pixelRatio > 1) {
184			arr.push('retina_' + parseInt(pixelRatio) + 'x');
185			arr.push('hidpi');
186		} else {
187			arr.push('no-hidpi');
188		}
189		return arr;
190	}
191}
192var dataUriInfo = {
193	data: new Image(),
194	div: document.createElement("div"),
195	isIeLessThan9: false,
196	getImg: function() {
197		dataUriInfo.data.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
198		dataUriInfo.div.innerHTML = "<!--[if lt IE 9]><i></i><![endif]-->";
199		dataUriInfo.isIeLessThan9 = dataUriInfo.div.getElementsByTagName("i").length == 1;
200		return dataUriInfo.data;
201	},
202	checkSupport: function() {
203		if (dataUriInfo.data.width != 1 || dataUriInfo.data.height != 1 || dataUriInfo.isIeLessThan9) {
204			return ["no-datauri"];
205		} else {
206			return ["datauri"];
207		}
208	}
209}
210
211function css_browser_selector(u, ns) {
212		var html = document.documentElement,
213			b = []
214		ns = ns ? ns : "";
215		/* ua */
216		uaInfo.ua = u.toLowerCase();
217		var browser = uaInfo.getBrowser();
218		if (browser == 'gecko') browser = (!(window.ActiveXObject) && "ActiveXObject" in window) ? 'ie ie11' : browser;
219		var pattTouch = /no-touch/g;
220		if (pattTouch.test(html.className)) b = b.concat('no-touch');
221		else b = b.concat('touch');
222		var pattAdmin = /admin-mode/g;
223		if (pattAdmin.test(html.className)) b = b.concat('admin-mode');
224		b = b.concat(browser);
225		b = b.concat(uaInfo.getPlatform());
226		b = b.concat(uaInfo.getMobile());
227		b = b.concat(uaInfo.getIpadApp());
228		b = b.concat(uaInfo.getLang());
229		/* js */
230		b = b.concat(['js']);
231		/* pixel ratio */
232		b = b.concat(screenInfo.getPixelRatio());
233		/* screen */
234		b = b.concat(screenInfo.getInfo());
235		var updateScreen = function() {
236			html.className = html.className.replace(/ ?orientation_\w+/g, "").replace(/ [min|max|cl]+[w|h]_\d+/g, "");
237			html.className = html.className + ' ' + screenInfo.getInfo().join(' ');
238		}
239		window.addEventListener('resize', updateScreen);
240		window.addEventListener('orientationchange', updateScreen);
241		/* dataURI */
242		var data = dataUriInfo.getImg();
243		data.onload = data.onerror = function() {
244				html.className += ' ' + dataUriInfo.checkSupport().join(' ');
245			}
246			/* removendo itens invalidos do array */
247		b = b.filter(function(e) {
248			return e;
249		});
250		/* prefixo do namespace */
251		b[0] = ns ? ns + b[0] : b[0];
252		html.className = b.join(' ' + ns);
253		return html.className;
254	}
255	// define css_browser_selector_ns before loading this script to assign a namespace
256var css_browser_selector_ns = css_browser_selector_ns || "";
257// init
258css_browser_selector(navigator.userAgent, css_browser_selector_ns);
259/**
260 * skip-link-focus-fix.js
261 *
262 * Helps with accessibility for keyboard only users.
263 *
264 * Learn more: https://github.com/Automattic/_s/pull/136
265 */
266(function() {
267	var is_webkit = navigator.userAgent.toLowerCase().indexOf('webkit') > -1,
268		is_opera = navigator.userAgent.toLowerCase().indexOf('opera') > -1,
269		is_ie = navigator.userAgent.toLowerCase().indexOf('msie') > -1;
270	if ((is_webkit || is_opera || is_ie) && document.getElementById && window.addEventListener) {
271		window.addEventListener('hashchange', function() {
272			var id = location.hash.substring(1),
273				element;
274			if (!(/^[A-z0-9_-]+$/.test(id))) {
275				return;
276			}
277			element = document.getElementById(id);
278			if (element) {
279				if (!(/^(?:a|select|input|button|textarea)$/i.test(element.tagName))) {
280					element.tabIndex = -1;
281				}
282				element.focus();
283			}
284		}, false);
285	}
286})();
287// Polyfill for creating CustomEvents on IE9/10/11
288// code pulled from:
289// https://github.com/d4tocchini/customevent-polyfill
290// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill
291try {
292	new CustomEvent("test");
293} catch (e) {
294	var CustomEvent = function(event, params) {
295		var evt;
296		params = params || {
297			bubbles: false,
298			cancelable: false,
299			detail: undefined
300		};
301		evt = document.createEvent("CustomEvent");
302		evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
303		return evt;
304	};
305	CustomEvent.prototype = window.Event.prototype;
306	window.CustomEvent = CustomEvent; // expose definition to window
307}
308// Evento - v1.0.0
309// by Erik Royall <[email protected]> (http://erikroyall.github.io)
310// Dual licensed under MIT and GPL
311// Array.prototype.indexOf shim
312// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
313Array.prototype.indexOf || (Array.prototype.indexOf = function(n) {
314	"use strict";
315	if (null == this) throw new TypeError;
316	var t, e, o = Object(this),
317		r = o.length >>> 0;
318	if (0 === r) return -1;
319	if (t = 0, arguments.length > 1 && (t = Number(arguments[1]), t != t ? t = 0 : 0 != t && 1 / 0 != t && t != -1 / 0 && (t = (t > 0 || -1) * Math.floor(Math.abs(t)))), t >= r) return -1;
320	for (e = t >= 0 ? t : Math.max(r - Math.abs(t), 0); r > e; e++)
321		if (e in o && o[e] === n) return e;
322	return -1
323});
324var evento = function(n) {
325	var t, e, o, r = n,
326		i = r.document,
327		f = {};
328	return t = function() {
329		return "function" == typeof i.addEventListener ? function(n, t, e) {
330			n.addEventListener(t, e, !1), f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t].push(e)
331		} : "function" == typeof i.attachEvent ? function(n, t, e) {
332			n.attachEvent(t, e), f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t].push(e)
333		} : function(n, t, e) {
334			n["on" + t] = e, f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t].push(e)
335		}
336	}(), e = function() {
337		return "function" == typeof i.removeEventListener ? function(n, t, e) {
338			n.removeEventListener(t, e, !1), Helio.each(f[n][t], function(o) {
339				o === e && (f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t][f[n][t].indexOf(o)] = void 0)
340			})
341		} : "function" == typeof i.detachEvent ? function(n, t, e) {
342			n.detachEvent(t, e), Helio.each(f[n][t], function(o) {
343				o === e && (f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t][f[n][t].indexOf(o)] = void 0)
344			})
345		} : function(n, t, e) {
346			n["on" + t] = void 0, Helio.each(f[n][t], function(o) {
347				o === e && (f[n] = f[n] || {}, f[n][t] = f[n][t] || [], f[n][t][f[n][t].indexOf(o)] = void 0)
348			})
349		}
350	}(), o = function(n, t) {
351		f[n] = f[n] || {}, f[n][t] = f[n][t] || [];
352		for (var e = 0, o = f[n][t].length; o > e; e += 1) f[n][t][e]()
353	}, {
354		add: t,
355		remove: e,
356		trigger: o,
357		_handlers: f
358	}
359}(this);
360/*
361 * OKVideo by OKFocus v2.3.2
362 * http://okfoc.us
363 *
364 * Copyright 2014, OKFocus
365 * Licensed under the MIT license.
366 *
367 */
368var player, OKEvents, options, videoWidth, videoHeight, YTplayers, youtubePlayers = new Array();
369// youtube player ready
370function onYouTubeIframeAPIReady() {
371	YTplayers = new Array();
372	jQuery('.no-touch .uncode-video-container.video').each(function() {
373		var playerY;
374		if (jQuery(this).attr('data-provider') == 'youtube') {
375			var id = jQuery(this).attr('data-id');
376			options = jQuery(window).data('okoptions-' + id);
377			options.time = jQuery(this).attr('data-t');
378			playerY = new YT.Player('okplayer-' + id, {
379				videoId: options.video ? options.video.id : null,
380				playerVars: {
381					'autohide': 1,
382					'autoplay': 0, //options.autoplay,
383					'disablekb': options.keyControls,
384					'cc_load_policy': options.captions,
385					'controls': options.controls,
386					'enablejsapi': 1,
387					'fs': 0,
388					'modestbranding': 1,
389					'origin': window.location.origin || (window.location.protocol + '//' + window.location.hostname),
390					'iv_load_policy': options.annotations,
391					'loop': options.loop,
392					'showinfo': 0,
393					'rel': 0,
394					'wmode': 'opaque',
395					'hd': options.hd,
396					'mute': 1
397				},
398				events: {
399					'onReady': OKEvents.yt.ready,
400					'onStateChange': OKEvents.yt.onStateChange,
401					'onError': OKEvents.yt.error
402				}
403			});
404			YTplayers[id] = playerY;
405			playerY.videoId = id;
406		}
407	});
408}
409// vimeo player ready
410function vimeoPlayerReady(id) {
411	options = jQuery(window).data('okoptions-' + id);
412	var jIframe = options.jobject,
413	iframe = jIframe[0];
414	jIframe.attr('src', jIframe.data('src'));
415	var playerV = $f(iframe);
416	// hide player until Vimeo hides controls...
417	playerV.addEvent('ready', function(e) {
418		OKEvents.v.onReady(iframe);
419		var carouselContainer = jQuery(iframe).closest('.owl-carousel');
420		if (carouselContainer.length) {
421			UNCODE.owlPlayVideo(carouselContainer);
422		}
423		// "Do not try to add listeners or call functions before receiving this event."
424		if (OKEvents.utils.isMobile()) {
425			// mobile devices cannot listen for play event
426			OKEvents.v.onPlay(playerV);
427		} else {
428			playerV.addEvent('play', OKEvents.v.onPlay(playerV));
429			playerV.addEvent('pause', OKEvents.v.onPause);
430			playerV.addEvent('finish', OKEvents.v.onFinish);
431		}
432		if (options.time != null) {
433			playerV.api('seekTo', (options.time).replace('t=', ''));
434		}
435
436		playerV.api('play');
437		jQuery(iframe).css({
438			visibility: 'visible',
439			opacity: 1
440		});
441
442	});
443}
444OKEvents = {
445	yt: {
446		ready: function(event) {
447			var id = event.target.videoId;
448			youtubePlayers[id] = event.target;
449			event.target.setVolume(options.volume);
450			if (options.autoplay === 1) {
451				if (options.playlist.list) {
452					player.loadPlaylist(options.playlist.list, options.playlist.index, options.playlist.startSeconds, options.playlist.suggestedQuality);
453				} else {
454					var inCarousel = jQuery('#okplayer-' + id).closest('.owl-item');
455					if (!inCarousel.length || (inCarousel.length && inCarousel.hasClass('active'))) {
456						if (options.time != null) {
457							event.target.seekTo(parseInt(options.time));
458						}
459						event.target.playVideo();
460					} else {
461						event.target.pauseVideo();
462					}
463				}
464			}
465			OKEvents.utils.isFunction(options.onReady) && options.onReady(event.target);
466		},
467		onStateChange: function(event) {
468			var id = event.target.videoId;
469			switch (event.data) {
470				case -1:
471					OKEvents.utils.isFunction(options.unstarted) && options.unstarted();
472					break;
473				case 0:
474					OKEvents.utils.isFunction(options.onFinished) && options.onFinished();
475					options.loop && event.target.playVideo();
476					break;
477				case 1:
478					OKEvents.utils.isFunction(options.onPlay) && options.onPlay();
479					setTimeout(function() {
480						UNCODE.initVideoComponent(document.body, '.uncode-video-container.video, .uncode-video-container.self-video');
481						jQuery('#okplayer-' + id).closest('.uncode-video-container').css('opacity', '1');
482					}, 300);
483					break;
484				case 2:
485					OKEvents.utils.isFunction(options.onPause) && options.onPause();
486					break;
487				case 3:
488					OKEvents.utils.isFunction(options.buffering) && options.buffering();
489					break;
490				case 5:
491					OKEvents.utils.isFunction(options.cued) && options.cued();
492					break;
493				default:
494					throw "OKVideo: received invalid data from YT player.";
495			}
496		},
497		error: function(event) {
498			throw event;
499		}
500	},
501	v: {
502		onReady: function(target) {
503			OKEvents.utils.isFunction(options.onReady) && options.onReady(target);
504		},
505		onPlay: function(player) {
506			if (!OKEvents.utils.isMobile()) player.api('setVolume', options.volume);
507			OKEvents.utils.isFunction(options.onPlay) && options.onPlay();
508			jQuery(player.element).closest('.uncode-video-container').css('opacity', '1');
509		},
510		onPause: function() {
511			OKEvents.utils.isFunction(options.onPause) && options.onPause();
512		},
513		onFinish: function() {
514			OKEvents.utils.isFunction(options.onFinish) && options.onFinish();
515		}
516	},
517	utils: {
518		isFunction: function(func) {
519			if (typeof func === 'function') {
520				return true;
521			} else {
522				return false;
523			}
524		},
525		isMobile: function() {
526			if (navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/)) {
527				return true;
528			} else {
529				return false;
530			}
531		}
532	}
533};
534// DOM class helper
535(function(window) {
536	'use strict';
537	// class helper functions from bonzo https://github.com/ded/bonzo
538	function classReg(className) {
539			return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
540		}
541		// classList support for class management
542		// altho to be fair, the api sucks because it won't accept multiple classes at once
543	var hasClass, addClass, removeClass;
544	if ('classList' in document.documentElement) {
545		hasClass = function(elem, c) {
546			if (elem !== null) return elem.classList.contains(c);
547		};
548		addClass = function(elem, c) {
549			if (elem !== null) elem.classList.add(c);
550		};
551		removeClass = function(elem, c) {
552			if (elem !== null) elem.classList.remove(c);
553		};
554	} else {
555		hasClass = function(elem, c) {
556			if (elem !== null) return classReg(c).test(elem.className);
557		};
558		addClass = function(elem, c) {
559			if (!hasClass(elem, c)) {
560				if (elem !== null) elem.className = elem.className + ' ' + c;
561			}
562		};
563		removeClass = function(elem, c) {
564			if (elem !== null) elem.className = elem.className.replace(classReg(c), ' ');
565		};
566	}
567
568	function toggleClass(elem, c) {
569		var fn = hasClass(elem, c) ? removeClass : addClass;
570		fn(elem, c);
571	}
572	var classie = {
573		// full names
574		hasClass: hasClass,
575		addClass: addClass,
576		removeClass: removeClass,
577		toggleClass: toggleClass,
578		// short names
579		has: hasClass,
580		add: addClass,
581		remove: removeClass,
582		toggle: toggleClass
583	};
584	// transport
585	if (typeof define === 'function' && define.amd) {
586		// AMD
587		define(classie);
588	} else {
589		// browser global
590		window.classie = classie;
591	}
592})(window);
593/* From Modernizr */
594function whichTransitionEvent() {
595		var t;
596		var el = document.createElement('fakeelement');
597		var transitions = {
598			'transition': 'transitionend',
599			'OTransition': 'oTransitionEnd',
600			'MozTransition': 'transitionend',
601			'WebkitTransition': 'webkitTransitionEnd'
602		}
603		for (t in transitions) {
604			if (el.style[t] !== undefined) {
605				return transitions[t];
606			}
607		}
608	}
609/**
610 * Load utils - END
611 */
612
613/**
614 * Start main js
615 */
616(function(window, undefined) {
617	'use strict';
618
619	// Init variables
620	var bodyTop,
621		scrollbarWidth = false,
622		noScroll = false,
623		boxEvent = new CustomEvent('boxResized'),
624		menuClose = new CustomEvent('menuClose'),
625		menuOpen = new CustomEvent('menuOpen'),
626		bodyBorder = 0,
627		adminBarHeight = 0,
628		boxWidth = 0,
629		boxLeft = 0,
630		parallaxRows,
631		parallaxCols,
632		parallaxHeaders,
633		kenburnsRows,
634		kenburnsCols,
635		visibleRows,
636		headerWithOpacity,
637		speedDivider = SiteParameters.parallax_factor,
638		adminBar,
639		pageHeader,
640		masthead,
641		mastheadMobile,
642		mastheadMobilePaddingTop = 0,
643		maincontainer,
644		menuwrapper,
645		menuhide,
646		menusticky,
647		menuHeight = 0,
648		menuMobileHeight = 0,
649		mainmenu = new Array(),
650		secmenu = new Array(),
651		secmenuHeight = 0,
652		transmenuHeight = 0,
653		header,
654		transmenuel,
655		logo,
656		logoel,
657		logolink,
658		logoMinScale,
659		lastScrollValue = 0,
660		wwidth = window.innerWidth || document.documentElement.clientWidth,
661		wheight = window.innerHeight || document.documentElement.clientHeight,
662		boxWrapper,
663		docheight = 0,
664		isMobile = classie.hasClass(document.documentElement, 'touch') ? true : false,
665		isIE = classie.hasClass(document.documentElement, 'ie') || classie.hasClass(document.documentElement, 'opera12') ? true : false,
666		isFF = classie.hasClass(document.documentElement, 'firefox') ? true : false,
667		isFullPage,
668		isFullPageSnap,
669		transitionEvent = whichTransitionEvent(),
670		footerScroller = false,
671		mediaQuery = 959,
672		mediaQueryMobile = 569,
673		menuOpened = false,
674		overlayOpened = false,
675		menuMobileTriggerEvent = new CustomEvent('menuMobileTrigged'),
676		resizeTimer,
677		hidingTimer,
678		isSplitMenu = false,
679		mainNavMenu,
680		mainNavWrapper,
681		isMobileTransparent = false,
682	checkVisible = function( elm ) {
683		var rect = elm.getBoundingClientRect();
684		var viewHeight = Math.max(document.documentElement.clientHeight, window.innerHeight);
685		return !(rect.bottom < 0 || rect.top - viewHeight >= 0);
686	},
687	initBox = function() {
688			var bodyBorderDiv = document.querySelectorAll('.body-borders .top-border');
689			if (bodyBorderDiv.length) {
690				bodyBorder = outerHeight(bodyBorderDiv[0]);
691			} else bodyBorder = 0;
692			UNCODE.isRTL = classie.hasClass(document.body, 'rtl') ? true : false,
693			UNCODE.bodyBorder = bodyBorder;
694			UNCODE.isFullPage = classie.hasClass(document.body, 'uncode-fullpage-slide') && !( UNCODE.isMobile && classie.hasClass(document.body, 'uncode-fp-mobile-disable') && window.innerWidth < 570 );
695			UNCODE.isFullPageSnap = classie.hasClass(document.body, 'uncode-scroll-snap');
696			if (bodyBorder != 0) {
697				if ( !UNCODE.isFullPage ) {
698					document.documentElement.style.marginTop = bodyBorder + 'px';
699				}
700				wheight = (window.innerHeight || document.documentElement.clientHeight) - (bodyBorder * 2);
701			}
702			if (!isMobile && !scrollbarWidth) {
703				// Create the measurement node
704				var scrollDiv = document.createElement("div");
705				scrollDiv.className = "scrollbar-measure";
706				var dombody = document.body;
707				if (dombody != null) {
708					dombody.appendChild(scrollDiv);
709					// Get the scrollbar width
710					scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
711					// Delete the DIV
712					dombody.removeChild(scrollDiv);
713				}
714			}
715			if (!isMobile) {
716				forEachElement('.box-container', function(el, i) {
717					if (!classie.hasClass(el, 'limit-width')) {
718						var elWidth = outerWidth(el),
719							newWidth = 12 * Math.ceil((wwidth - scrollbarWidth) / 12);
720						boxWidth = newWidth - (bodyBorder * 2);
721						boxLeft = (wwidth - boxWidth - scrollbarWidth) / 2;
722						el.style.width = boxWidth + 'px';
723						if ( UNCODE.isRTL )
724							el.style.marginRight = boxLeft + 'px';
725						else
726							el.style.marginLeft = boxLeft + 'px';
727						if (mainmenu != undefined && mainmenu[0] != undefined) {
728							mainmenu[0].style.width = boxWidth + 'px';
729						}
730					}
731				});
732			}
733
734			if (classie.hasClass(document.body, 'menu-mobile-transparent')) isMobileTransparent = true;
735
736			if (!isMobileTransparent) {
737				if (wwidth > mediaQuery && classie.hasClass(document.body, 'menu-force-opacity')) classie.removeClass(document.body, 'menu-force-opacity');
738				if (wwidth < mediaQuery && !classie.hasClass(document.body, 'menu-force-opacity')) classie.addClass(document.body, 'menu-force-opacity');
739			}
740		},
741		fixMenuHeight = function() {
742			if (!classie.hasClass(document.body, 'vmenu')) noScroll = true;
743
744			menuwrapper = document.querySelectorAll(".menu-wrapper");
745			masthead = document.getElementById("masthead");
746			if (classie.hasClass(document.body, 'hmenu-center-split')) {
747				mastheadMobile = new Array(document.getElementById("logo-container-mobile"), document.getElementById("main-logo").parentNode);
748			} else mastheadMobile = document.getElementById("logo-container-mobile");
749			menuhide = document.querySelector('#masthead .menu-hide, .main-header .menu-hide, #masthead .menu-hide-vertical');
750			menusticky = document.querySelectorAll('.menu-sticky, .menu-sticky-vertical');
751			transmenuel = document.querySelectorAll('.menu-transparent:not(.vmenu-container)');
752			var menuItemsButton = document.querySelectorAll('.menu-item-button .menu-btn-table');
753			logo = document.querySelector('#main-logo');
754			if (logo != undefined) logolink = (logo.firstElementChild || logo.firstChild);
755			if (logolink != undefined) logoMinScale = logolink.getAttribute("data-minheight");
756			logoel = document.querySelectorAll('.menu-shrink .logo-container');
757			mainmenu = document.querySelectorAll('.vmenu .vmenu-container, .menu-primary .menu-container');
758			if (classie.hasClass(document.body, 'hmenu-center')) {
759				var mainmenucenter = document.querySelectorAll('.hmenu-center .menu-container-mobile');
760				var first_array = Array.prototype.slice.call(mainmenu);
761				var second_array = Array.prototype.slice.call(mainmenucenter);
762				mainmenu = first_array.concat(second_array);
763			}
764			secmenu = document.querySelectorAll('.menu-secondary');
765			calculateMenuHeight(true);
766			for (var k = 0;
766 k < menuItemsButton.length; k++) {
767				var a_item = menuItemsButton[k].parentNode,
768					buttonHeight = outerHeight(menuItemsButton[k]);
769				a_item.style.height = buttonHeight + 'px';
770			}
771			if (classie.hasClass(document.body, 'hmenu-center-split')) {
772				mainNavMenu = document.querySelector('#masthead .navbar-main .menu-primary-inner');
773				mainNavWrapper = document.querySelector('#masthead > .menu-container');
774				isSplitMenu = true;
775			}
776			fixMenu();
777		},
778		calculateMenuHeight = function(first) {
779			menuHeight = transmenuHeight = secmenuHeight = 0;
780
781			if (mastheadMobile != null) {
782				if (mastheadMobile.length === 2) {
783					if (wwidth > mediaQuery) {
784						UNCODE.menuMobileHeight = outerHeight(mastheadMobile[1]);
785						mastheadMobilePaddingTop = parseFloat(getComputedStyle(mastheadMobile[1]).paddingTop);
786					} else {
787						UNCODE.menuMobileHeight = outerHeight(mastheadMobile[0]);
788						mastheadMobilePaddingTop = parseFloat(getComputedStyle(mastheadMobile[0]).paddingTop);
789					}
790				} else {
791					UNCODE.menuMobileHeight = outerHeight(mastheadMobile);
792					mastheadMobilePaddingTop = parseFloat(getComputedStyle(mastheadMobile).paddingTop);
793				}
794			}
795
796			if (wwidth > mediaQuery) {
797				for (var i = 0; i < mainmenu.length; i++) {
798					if (classie.hasClass(document.body, 'hmenu-center') && i === 1) continue;
799					if (!classie.hasClass(masthead, 'masthead-vertical')) {
800						menuHeight = menuHeight + outerHeight(mainmenu[i]);
801					} else menuHeight = 0;
802
803					if (isIE && first) {
804						getDivChildren(mainmenu[i], '.menu-horizontal-inner', function(innerMenu, i) {
805							innerMenu.style.height = menuHeight + 'px';
806						});
807					}
808
809					if (classie.hasClass(mainmenu[i].parentNode, 'menu-transparent')) {
810						transmenuHeight += menuHeight;
811					}
812				}
813
814				for (var j = 0; j < secmenu.length; j++) {
815					secmenuHeight += outerHeight(secmenu[j]);
816				}
817				menuHeight += secmenuHeight;
818			} else {
819				menuHeight = UNCODE.menuMobileHeight;
820				if (isMobileTransparent) {
821					for (var i = 0; i < mainmenu.length; i++) {
822						if (classie.hasClass(mainmenu[i].parentNode, 'menu-transparent')) {
823							transmenuHeight += menuHeight;
824						}
825					}
826				}
827				var search_box = document.querySelectorAll('.search-icon .drop-menu');
828				for (var i = 0; i < search_box.length; i++) {
829					search_box[i].removeAttribute('style');
830				}
831			}
832
833
834			if (classie.hasClass(document.documentElement, 'admin-mode')) {
835				adminBar = document.getElementById("wpadminbar");
836				if (wwidth > 600) {
837					if (adminBar != null) adminBarHeight = outerHeight(adminBar);
838					else {
839						if (wwidth > 782) adminBarHeight = 32;
840						else adminBarHeight = 46;
841					}
842				} else adminBarHeight = 0;
843			}
844			UNCODE.adminBarHeight = adminBarHeight;
845			UNCODE.menuHeight = menuHeight;
846
847			if ( UNCODE.isFullPage ) {
848				if ( UNCODE.adminBarHeight > 0 )
849					document.body.style.marginTop = ( ( UNCODE.adminBarHeight + UNCODE.bodyBorder ) * -1 ) + 'px';
850
851				document.body.style.paddingTop = ( UNCODE.adminBarHeight + UNCODE.bodyBorder ) + 'px';
852			}
853
854			if (masthead != undefined) {
855				//masthead.parentNode.style.height = menuHeight + 'px';
856				if (classie.hasClass(masthead, 'menu-transparent')) {
857					if (wwidth > mediaQuery) masthead.parentNode.style.height = '0px';
858				}
859			}
860
861			if (typeof menuhide == 'object' && menuhide != null && mainmenu[0] != undefined) {
862				var sticky_element = (typeof mainmenu.item === 'undefined' ? ((wwidth > mediaQuery) ? mainmenu[0] : mainmenu[1]) : mainmenu[0]);
863				if (sticky_element.style.top != '') {
864					sticky_element.style.top = UNCODE.bodyBorder + 'px'
865				}
866			}
867
868		},
869		centerSplitMenu = function() {
870			if (wwidth > mediaQuery && mainNavMenu) {
871				if (mainNavMenu.style.left == '') {
872					mainNavMenu.style.left = '0px';
873					var logoPos = logo.parentNode.getBoundingClientRect();
874					mainNavMenu.style.left = (wwidth / 2) - (logoPos.left + (logoPos.width / 2) ) + 'px';
875					mainNavWrapper.style.opacity = '1';
876				}
877				mainNavWrapper.style.opacity = '1';
878			}
879		},
880		initHeader = function() {
881			UNCODE.adaptive();
882			headerHeight('.header-wrapper');
883
884			parallaxHeaders = document.querySelectorAll('.header-parallax > .header-bg-wrapper > .header-bg');
885			header = document.querySelectorAll('.header-wrapper.header-uncode-block, .header-wrapper.header-revslider, .header-wrapper.header-layerslider, .header-basic .header-wrapper, .header-uncode-block > .row-container:first-child > .row > .row-inner > .col-lg-12 > .uncol, .header-uncode-block .uncode-slider .owl-carousel > .row-container:first-child .col-lg-12 .uncoltable');
886			headerWithOpacity = document.querySelectorAll('.header-scroll-opacity');
887			pageHeader = document.getElementById("page-header");
888			if (pageHeader != undefined) {
889				var backs = pageHeader.querySelectorAll('.header-bg'),
890					backsCarousel = pageHeader.querySelectorAll('.header-uncode-block .background-inner'),
891					uri_pattern = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig;
892				if (backs.length == 0 && backsCarousel.length == 0) {
893					pageHeader.setAttribute('data-imgready', 'true');
894				} else {
895					if (backsCarousel.length) {
896						for (var j = 0; j < backsCarousel.length; j++) {
897							if (j == 0) {
898								if (!!backsCarousel[j].style.backgroundImage && backsCarousel[j].style.backgroundImage !== void 0) {
899									var url = (backsCarousel[j].style.backgroundImage).match(uri_pattern),
900										image = new Image();
901									image.onload = function() {
902										pageHeader.setAttribute('data-imgready', 'true');
903									};
904									image.src = url[0];
905								} else {
906									pageHeader.setAttribute('data-imgready', 'true');
907								}
908							}
909						}
910					} else {
911						for (var i = 0; i < backs.length; i++) {
912							if (i == 0) {
913								if (!!backs[i].style.backgroundImage && backs[i].style.backgroundImage !== void 0) {
914									var url = (backs[i].style.backgroundImage).match(uri_pattern),
915										image = new Image();
916									image.onload = function() {
917										pageHeader.setAttribute('data-imgready', 'true');
918									};
919									image.src = url[0];
920								} else {
921									pageHeader.setAttribute('data-imgready', 'true');
922								}
923							}
924						}
925					}
926				}
927			}
928
929			if (masthead != undefined && !classie.hasClass(masthead, 'masthead-vert
929ical')) {
930				if (header.length) {
931					masthead.parentNode.style.height = menuHeight + 'px';
932					if (menuwrapper[0] != undefined) classie.addClass(menuwrapper[0], 'with-header');
933					for (var j = 0; j < header.length; j++) {
934						var headerel = header[j],
935							closestStyle = getClosest(headerel, 'style-light');
936						if (closestStyle != null && classie.hasClass(closestStyle, 'style-light')) switchColorsMenu(0, 'light');
937						else if (getClosest(headerel, 'style-dark') != null) switchColorsMenu(0, 'dark');
938						else {
939							if (masthead.style.opacity !== 1) masthead.style.opacity = 1;
940						}
941						if (classie.hasClass(masthead, 'menu-transparent')) {
942							if (isMobileTransparent || wwidth > mediaQuery) {
943								masthead.parentNode.style.height = '0px';
944								if (classie.hasClass(masthead, 'menu-add-padding')) {
945									var headerBlock = getClosest(headerel, 'header-uncode-block');
946									if (headerBlock != null) {
947										var innerRows = headerel.querySelectorAll('.column_parent > .uncol > .uncoltable > .uncell > .uncont, .uncode-slider .column_child > .uncol > .uncoltable > .uncell > .uncont');
948										for (var k = 0; k < innerRows.length; k++) {
949											if (innerRows[k] != undefined) {
950												if (wwidth > mediaQuery) innerRows[k].style.paddingTop = transmenuHeight + 'px';
951												else innerRows[k].style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px';
952											}
953										}
954									} else {
955										getDivChildren(headerel, '.header-content', function(headerContent, i) {
956											if (wwidth > mediaQuery) headerContent.style.paddingTop = transmenuHeight + 'px';
957											else headerContent.style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px';
958										});
959									}
960								}
961							}
962						}
963					}
964				} else {
965					if (menuwrapper[0] != undefined) classie.addClass(menuwrapper[0], 'no-header');
966					classie.removeClass(masthead, 'menu-transparent');
967					transmenuHeight = 0;
968					isMobileTransparent = false;
969				}
970			} else {
971				isMobileTransparent = false;
972			}
973			if (!transmenuel.length) isMobileTransparent = false;
974			bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'];
975			UNCODE.bodyTop = bodyTop;
976			if (!classie.hasClass(document.body, 'vmenu'))
977				initBox();
978			scrollFunction();
979			showHideScrollup(bodyTop);
980		},
981		initRow = function(currentRow) {
982			UNCODE.adaptive();
983			var el = currentRow.parentNode.parentNode.getAttribute("data-parent") == 'true' ? currentRow.parentNode : currentRow.parentNode.parentNode,
984				rowParent = el.parentNode,
985				rowInner = currentRow.parentNode,
986				percentHeight = el.getAttribute("data-height-ratio"),
987				minHeight = el.getAttribute("data-minheight"),
988				calculateHeight,
989				calculatePadding = 0,
990				isHeader = false,
991				isFirst = false,
992				uri_pattern = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig;
993
994			/** Add class to the row when contains responsive column size */
995			getDivChildren(el.parentNode, '.column_parent, .column_child', function(obj, i, total) {
996				if ((obj.className).indexOf("col-md-") > - 1) classie.addClass(obj.parentNode, 'cols-md-responsive');
997				if ((obj.className).indexOf("col-sm-") > - 1 && (obj.className).indexOf("col-sm-clear") == - 1) classie.addClass(obj.parentNode, 'cols-sm-responsive');
998			});
999
1000			setRowHeight(el);
1001
1002			var elements = 0;
1003			getDivChildren(el, '.row-internal .background-inner', function(obj, i, total) {
1004				elements++;
1005				if (i == 0) {
1006					if (!!obj.style.backgroundImage && obj.style.backgroundImage !== void 0) {
1007						var url = (obj.style.backgroundImage).match(uri_pattern),
1008							image = new Image();
1009						image.onload = function() {
1010							el.setAttribute('data-imgready', 'true');
1011							el.dispatchEvent(new CustomEvent('imgLoaded'));
1012						};
1013						image.src = url[0];
1014					} else {
1015						el.setAttribute('data-imgready', 'true');
1016						el.dispatchEvent(new CustomEvent('imgLoaded'));
1017					}
1018				}
1019			});
1020			if (elements == 0) {
1021				el.setAttribute('data-imgready', 'true');
1022			}
1023
1024			/** init parallax is not mobile */
1025			if ( ! UNCODE.isFullPage ) {
1026				bodyTop = document.documentElement['scrollTop'] || document.body['scrollTop'];
1027				kenburnsRows = el.parentNode.parentNode.querySelectorAll('.with-kburns > .row-background > .background-wrapper, .with-kburns > .header-bg-wrapper, .with-kburns > .fp-tableCell > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper');
1028				kenburnsCols = el.querySelectorAll('.with-kburns > .column-background > .background-wrapper');
1029				if (!UNCODE.isMobile) {
1030					parallaxRows = el.parentNode.parentNode.querySelectorAll('.with-parallax > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper');
1031					parallaxCols = el.querySelectorAll('.with-parallax > .column-background > .background-wrapper');
1032					visibleRows = el.parentNode.parentNode;
1033					parallaxRowCol(bodyTop);
1034					visibleRowCol(bodyTop);
1035				} else {
1036					kenburnsRowCol(bodyTop);
1037				}
1038			}
1039
1040			shapeDivider();
1041		},
1042		setRowHeight = function(container, forced, resized) {
1043			var currentTallest = 0,
1044				percentHeight = 0,
1045				minHeight = 0,
1046				el,
1047				child,
1048				hasSubCols = false;
1049			if (container.length == undefined) {
1050				container = [container];
1051			}
1052			// Loop for each container element to match their heights
1053			for (var i = 0; i < container.length; i++) {
1054				var el = container[i],
1055					$row = el,
1056					totalHeight = 0,
1057					colsArray = new Array(),
1058					calculatePadding = 0,
1059					$rowParent = $row.parentNode,
1060					isHeader = false,
1061					isFirst = false;
1062				$row.oversized = false;
1063				percentHeight = el.getAttribute("data-height-ratio");
1064				minHeight = el.getAttribute("data-minheight");
1065				child = (el.firstElementChild || el.firstChild);
1066				var childHeight = outerHeight(child);
1067				/** window height without header **/
1068				if (!!percentHeight || !!minHeight || forced || (isIE && classie.hasClass(el, 'unequal')) ) {
1069					child.style.height = '';
1070					if (!!percentHeight) {
1071						if (percentHeight == 'full') {
1072							currentTallest = parseInt(wheight);
1073						} else {
1074							currentTallest = parseInt((wheight * percentHeight) / 100);
1075						}
1076					} else {
1077						currentTallest = el.clientHeight;
1078					}
1079
1080					if (!!minHeight) {
1081						if (currentTallest < minHeight || currentTallest == undefined) currentTallest = parseInt(minHeight);
1082					}
1083
1084					var computedStyleRow = getComputedStyle(el),
1085						computedStyleRowParent = getComputedStyle($rowParent);
1086					calculatePadding -= (parseFloat(computedStyleRow.paddingTop) + parseFloat(computedStyleRowParent.paddingTop));
1087					calculatePadding -= (parseFloat(computedStyleRow.paddingBottom) + parseFloat(computedStyleRowParent.paddingBottom));
1088
1089					if (getClosest(el, 'header-uncode-block') != null) {
1090						el.setAttribute('data-row-header', 'true');
1091						isHeader = true;
1092					} else {
1093						if (pageHeader == null) {
1094							var prevRow = $rowParent.previousSibling;
1095							if (prevRow != null && prevRow.innerText == 'UNCODE.initHeader();') {
1096								isFirst = true;
1097							}
1098						}
1099					}
1100
1101					if (classie.hasClass(el, 'row-slider')) {
1102						percentHeight = el.getAttribute("data-height-ratio");
1103						minHeight = el.getAttribute("data-minheight");
1104						if (percentHeight == 'full') {
1105							currentTallest = parseInt(wheight);
1106						} else {
1107							currentTallest = parseInt((wheight * percentHeight) / 100);
1108						}
1109
1110						if (isHeader || isFirst) {
1111							if (isMobileTransparent || wwidth > mediaQuery) currentTallest -= menuHeight - transmenuHeight;
1112							else currentTallest -= menuHeight - secmenuHeight;
1113							currentTallest += calculatePadding;
1114						} else {
1115							if (isMobileTransparent || wwidth > mediaQuery) currentTallest += calculatePadding;
1116							else currentTallest = 'auto';
1117						}
1118
1119						getDivChildren(el, '.owl-carousel', function(owl, i) {
1120							owl.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px');
1121							if (isIE) {
1122								getDivChildren(owl, '.owl-stage', function(owlIn, i) {
1123									owlIn.style.height = (currentTallest == 'auto' ? '100%' : currentTallest + 'px');
1124								});
1125							}
1126						});
1127						if ( UNCODE.isFullPageSnap || classie.hasClass(masthead, 'menu-transparent') )
1128							continue;
1129						else {
1130							if ( classie.hasClass(document.body, 'uncode-fp-menu-hide') ) {
1131								$rowParent.parentNode.style.paddingTop = menuHeight + 'px';
1132							}
1133						}
1134					} else {
1135						if (isHeader || isFirst || UNCODE.isFullPage ) {
1136							if ( !( UNCODE.isFullPage && !classie.hasClass(masthead, 'menu-transparent') && classie.hasClass(document.body, 'uncode-fp-menu-hide') && !isHeader && !isFirst ) ) {
1137								if (isMobileTransparent || wwidth > mediaQuery) currentTallest -= menuHeight - transmenuHeight;
1138								else currentTallest -= menuHeight - secmenuHeight;
1139							}
1140							currentTallest += calculatePadding;
1141							if ( UNCODE.isFullPage && classie.hasClass(document.body, 'uncode-scroll-safe-padding') && classie.hasClass(masthead, 'menu-transparent') && !classie.hasClass(document.body, 'uncode-fp-menu-hide') ) {
1142								var safeMenuHeight = parseFloat(document.body.getAttribute("data-additional-padding")) + parseFloat(menuHeight);
1143								if ( (" " + child.parentNode.className + " ").replace(/[\n\t]/g, " ").indexOf("-top-padding ") < 0 || classie.hasClass(child.parentNode, 'single-top-padding') ) {
1144									classie.addClass(child.parentNode, 'fp-safe-padding-top');
1145									child.parentNode.style.paddingTop = safeMenuHeight + 'px';
1146								}
1147								if ( (" " + child.parentNode.className + " ").replace(/[\n\t]/g, " ").indexOf("-bottom-padding ") < 0 || classie.hasClass(child.parentNode, 'single-bottom-padding') ) {
1148									classie.addClass(child.parentNode, 'fp-safe-padding-bottom');
1149									child.parentNode.style.paddingBottom = safeMenuHeight + 'px';
1150								}
1151							}
1152							if ( !classie.hasClass(masthead, 'menu-transparent') && classie.hasClass(document.body, 'uncode-fp-menu-hide') && ( isFirst || isHeader ) )
1153								$rowParent.parentNode.style.paddingTop = menuHeight + 'px';
1154
1155						} else {
1156							if (wwidth > mediaQuery) currentTallest += calculatePadding;
1157							else currentTallest = 'auto';
1158
1159						}
1160					}
1161					if ( UNCODE.isFullPage ) {
1162						currentTallest -= UNCODE.adminBarHeight;
1163					}
1164					if (!!minHeight) {
1165						if (currentTallest < minHeight || currentTallest == 'auto') currentTallest = parseInt(minHeight);
1166					}
1167
1168					child.style.height = (currentTallest == 'auto' ? 'auto' : currentTallest + 'px');
1169				} else {
1170					currentTallest = 0;
1171				}
1172
1173				if (wwidth > mediaQuery) {
1174
1175					getDivChildren(el, '.column_parent', function(col, i, total) {
1176						var $col = col,
1177							$colHeight = 0,
1178							$colDiff = 0,
1179							$colPercDiff = 100;
1180						$col.oversized = false;
1181						$col.forceHeight = currentTallest;
1182						currentTallest = child.clientHeight;
1183						if ((isHeader || isFirst) && currentTallest != 'auto') currentTallest -= transmenuHeight;
1184						var getFirstCol = null,
1185						getMargin = 0,
1186						getSubMargin = 0;
1187						getDivChildren(col, '.row-child', function(obj, i, total) {
1188							var $colChild = obj,
1189								$colParent = $colChild.parentNode,
1190								computedStyleCol = getComputedStyle($colParent);
1191							parseFloat(computedStyleCol.marginTop);
1192							getSubMargin += parseFloat(computedStyleCol.marginTop);
1193						});
1194						currentTallest += getSubMargin;
1195						getDivChildren(col, '.row-child', function(obj, i, total) {
1196							var $colChild = obj,
1197								$colInner,
1198								$colParent = $colChild.parentNode,
1199								$uncont = $colParent.parentNode;
1200							for (var it = 0; it < $colChild.childNodes.length; it++) {
1201								if ( ! classie.hasClass($colChild.childNodes[it], 'uncode-divider-wrap') ) {
1202									$colInner = $colChild.childNodes[it];
1203									break;
1204								}
1205							}
1206							if (i == 0 && total > 1) getFirstCol = $colInner;
1207							$colChild.oversized = false;
1208							percentHeight = $colChild.getAttribute("data-height");
1209							minHeight = $colChild.getAttribute("data-minheight");
1210							if (percentHeight != null || minHeight != null) {
1211								if ( ! classie.hasClass($colInner, 'uncode-divider-wrap') )
1212									$colInner.style.height = '';
1213								$colParent.style.height = 'auto';
1214								$uncont.style.height = '100%';
1215								$colChild.removeAttribute("style");
1216								var newHeight = (percentHeight != null) ? Math.ceil((currentTallest) * (percentHeight / 100)) : parseInt(minHeight);
1217								var computedStyleCol = getComputedStyle($colParent);
1218								parseFloat(computedStyleCol.marginTop);
1219								getMargin = parseFloat(computedStyleCol.marginTop);
1220								newHeight -= (getMargin);
1221								$colPercDiff -= (percentHeight != null) ? percentHeight : 0;
1222								if (currentTallest > newHeight) {
1223									var getColHeight = outerHeight($colChild);
1224									if (getColHeight > newHeight) {
1225										$colHeight += getColHeight;
1226										$colDiff += getColHeight;
1227										$colChild.oversized = true;
1228										$col.oversized = true;
1229										$row.oversized = true;
1230									} else {
1231										$colHeight += newHeight;
1232										if ( ! classie.hasClass($colInner, 'uncode-divider-wrap') )
1233											$colInner.style.height = newHeight + 'px';
1234									}
1235								}
1236							} else {
1237								$colHeight += outerHeight($colChild);
1238							}
1239						});
1240						if (getFirstCol != null) {
1241							getFirstCol.style.height = (parseFloat(getFirstCol.style.height) - getMargin) + 'px';
1242						}
1243						colsArray.push({
1244							colHeight: $colHeight,
1245							colDiv: $col
1246						});
1247						$col.colDiff = $colDiff;
1248						$col.colPercDiff = $colPercDiff;
1249					});
1250
1251					if ($row.oversized) {
1252						child.style.height = '';
1253						colsArray.sort(function(a, b) {
1254							if (a.colHeight < b.colHeight) return 1;
1255							if (a.colHeight > b.colHeight) return -1;
1256							return 0;
1257						});
1258						var $totalHeight = 0;
1259						colsArray.forEach(function(col) {
1260							var $col = col.colDiv,
1261								$colHeight = col.colHeight;
1262							getDivChildren($col, '.row-child', function(obj, i, total) {
1263								var $colChild = obj,
1264									$colInner = $colChild.children[0],
1265									percentHeight = $colChild.getAttribute("data-height"),
1266									$colParent = $colChild.parentNode,
1267									$uncont = $colParent.parentNode,
1268									newHeight;
1269
1270								$colHeight = $col.forceHeight - $col.colDiff;
1271								if (percentHeight != null) {
1272									if ($colHeight > 0) {
1273										if ($col.oversized) {
1274											if (!$colChild.oversized) {
1275												newHeight = Math.ceil(($colHeight) * (percentHeight / $col.colPercDiff));
1276												if (i == total - 1 && total > 1) {
1277													$uncont.style.height = 'auto';
1278													$colChild.style.display = 'none';
1279													newHeight = outerHeight($col.parentNode) - outerHeight($uncont);
1280													$uncont.style.height = '100%';
1281													$colChild.style.display = 'table';
1282												}
1283												if (newHeight == 0) newHeight = Math.ceil(($col.forceHeight) * (percentHeight / 100));
1284												$colInner.style.height = newHeight + 'px';
1285											}
1286										} else {
1287											if ($totalHeight == 0) newHeight = Math.ceil(($colHeight) * (percentHeight / $col.colPercDiff));
1288											else {
1289												newHeight = Math.ceil(($totalHeight) * (percentHeight / $col.colPercDiff));
1290											}
1291											if (i == total - 1 && total > 1) {
1292												$uncont.style.height = 'auto';
1293												$colChild.style.display = 'none';
1294												newHeight = outerHeight($col.parentNode) - outerHeight($uncont);
1295												$uncont.style.height = '100%';
1296												$colChild.style.display = 'table';
1297											}
1298											$colInner.style.height = newHeight + 'px';
1299										}
1300									} else {
1301										if ($colChild.oversized) {
1302											if ($totalHeight == 0) newHeight = Math.ceil(($colHeight) * (percentHeight / $col.colPercDiff));
1303											else {
1304												if ($col.colPercDiff == 0) $col.colPercDiff = 100;
1305												newHeight = Math.ceil(($totalHeight) * (percentHeight / $col.colPercDiff));
1306											}
1307											if (i == total - 1 && total > 1) {
1308												$uncont.style.height = 'auto';
1309												$colChild.style.display = 'none';
1310												newHeight = outerHeight($col.parentNode) - outerHeight($uncont);
1311												$uncont.style.height = '100%';
1312												$colChild.style.display = 'table';
1313											}
1314											$colInner.style.height = newHeight + 'px';
1315										}
1316									}
1317								}
1318							});
1319							var uncell = $col.getElementsByClassName('uncell');
1320							if (uncell[0] != undefined && $totalHeight == 0) $totalHeight = outerHeight(uncell[0]);
1321						});
1322					}
1323					if (isFF) {
1324						getDivChildren(el, '.uncoltable', function(col, i, total) {
1325							if (col.style.minHeight != '') {
1326								col.style.height = '';
1327							}
1328						});
1329					}
1330					if (resized) {
1331						getDivChildren(el, '.row-child > .row-inner', function(obj, k, total) {
1332							if (obj.style.height == '') {
1333								if (wwidth > mediaQueryMobile) {
1334									var getStyle = (window.getComputedStyle((obj.parentNode), null)),
1335									getInnerHeight = (parseInt(obj.parentNode.clientHeight) - parseInt(getStyle.paddingTop) - parseInt(getStyle.paddingBottom));
1336									obj.style.height = getInnerHeight + 1 + 'px';
1337									obj.style.marginBottom = '-1px';
1338								}
1339							}
1340						});
1341						getDivChildren(el, '.row-parent > .row-inner', function(obj, k, total) {
1342							if (obj.style.height != '') {
1343								var getStyle = (window.getComputedStyle((obj.parentNode), null)),
1344								getInnerHeight = (parseInt(obj.parentNode.clientHeight) - parseInt(getStyle.paddingTop) - parseInt(getStyle.paddingBottom)),
1345								getTempHeight = parseInt(obj.style.height);
1346								if (getInnerHeight > getTempHeight) {
1347									obj.style.height = getInnerHeight + 1 + 'px';
1348									obj.style.marginBottom = '-1px';
1349								}
1350							}
1351						});
1352					}
1353				} else {
1354					if (isFF) {
1355						getDivChildren(el, '.uncoltable', function(col, i, total) {
1356							if (col.style.minHeight != '') {
1357								col.style.height = '';
1358								col.style.height = outerHeight(col.parentNode) + 'px';
1359							}
1360						});
1361					}
1362					if (isIE && (wwidth > mediaQueryMobile)) {
1363						if (child.style.height == 'auto') {
1364							child.style.height = outerHeight(child) + 'px';
1365						}
1366					}
1367				}
1368				if (isFF) {
1369					var sliderColumnFix = document.querySelector('.uncode-slider .row-inner > .column_child:only-child');
1370					if (sliderColumnFix != null) {
1371						if (wwidth > mediaQuery) {
1372							sliderColumnFix.style.setProperty("height", "");
1373						} else {
1374							sliderColumnFix.style.setProperty("height", "");
1375							sliderColumnFix.style.setProperty("height", outerHeight(sliderColumnFix.parentNode) + "px", "important");
1376						}
1377					}
1378				}
1379			};
1380		},
1381		headerHeight = function(container) {
1382			forEachElement(container, function(el, i) {
1383				var getHeight = el.getAttribute("data-height"),
1384					newHeight = ((wheight * getHeight) / 100);
1385				if (getHeight != 'fixed' && newHeight != 0) {
1386					if (isMobileTransparent || wwidth > mediaQuery) newHeight -= menuHeight - transmenuHeight;
1387					else newHeight -= menuHeight - secmenuHeight;
1388					el.style.height = newHeight + 'px';
1389				}
1390			});
1391			if (masthead != undefined) {
1392				masthead.parentNode.style.height = menuHeight + 'px';
1393				if (header != undefined && header.length) {
1394					if (classie.hasClass(masthead, 'menu-transparent')) {
1395						if (isMobileTransparent || wwidth > mediaQuery) {
1396							masthead.parentNode.style.height = '0px';
1397							if (classie.hasClass(masthead, 'menu-add-padding')) {
1398								for (var j = 0; j < header.length; j++) {
1399									var headerel = header[j];
1400									var headerBlock = getClosest(headerel, 'header-uncode-block');
1401									if (headerBlock != null) {
1402										var innerRows = headerel.querySelectorAll('.column_parent > .uncol > .uncoltable > .uncell > .uncont, .uncode-slider .column_child > .uncol > .uncoltable > .uncell > .uncont');
1403										for (var k = 0; k < innerRows.length; k++) {
1404											if (innerRows[k] != undefined) {
1405												if (wwidth > mediaQuery) innerRows[k].style.paddingTop = transmenuHeight + 'px';
1406												else innerRows[k].style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px';
1407											}
1408										}
1409									} else {
1410										getDivChildren(headerel, '.header-content', function(headerContent, i) {
1411											if (wwidth > mediaQuery) headerContent.style.paddingTop = transmenuHeight + 'px';
1412											else headerContent.style.paddingTop = (transmenuHeight - mastheadMobilePaddingTop) + 'px';
1413										});
1414									}
1415								}
1416							}
1417						}
1418					}
1419				}
1420			}
1421		},
1422		initVideoComponent = function(container, classTarget) {
1423			getDivChildren(container, classTarget, function(el, i) {
1424				var width = outerWidth(el),
1425					pWidth, // player width, to be defined
1426					height = outerHeight(el),
1427					pHeight, // player height, tbd
1428					$tubularPlayer = (el.getElementsByTagName('iframe').length == 1) ? el.getElementsByTagName('iframe') : el.getElementsByTagName('video'),
1429					ratio = (el.getAttribute("data-ratio") != null) ? Number(el.getAttribute("data-ratio")) : $tubularPlayer[0].getAttribute("data-ratio"),
1430					heightOffset = 80,
1431					widthOffset = heightOffset * ratio;
1432				// when screen aspect ratio differs from video, video must center and underlay one dimension
1433				if ($tubularPlayer[0] != undefined) {
1434					if (width / ratio < height) { // if new video height < window height (gap underneath)
1435						pWidth = Math.ceil((height + heightOffset) * ratio); // get new player width
1436						$tubularPlayer[0].style.width = pWidth + widthOffset + 'px';
1437						$tubularPlayer[0].style.height = height + heightOffset + 'px';
1438						$tubularPlayer[0].style.left = ((width - pWidth) / 2) - (widthOffset / 2) + 'px';
1439						$tubularPlayer[0].style.top = '-' + (heightOffset / 2) + 'px';
1440						$tubularPlayer[0].style.position = 'absolute';
1441					} else { // new video width < window width (gap to right)
1442						pHeight = Math.ceil(width / ratio); // get new player height
1443						$tubularPlayer[0].style.width = width + widthOffset + 'px';
1444						$tubularPlayer[0].style.height = pHeight + heightOffset + 'px';
1445						$tubularPlayer[0].style.left = '-' + (widthOffset / 2) + 'px';
1446						$tubularPlayer[0].style.top = ((height - pHeight) / 2) - (heightOffset / 2) + 'px';
1447						$tubularPlayer[0].style.position = 'absolute';
1448					}
1449				}
1450			});
1451		},
1452		init_overlay = function() {
1453			var triggerButton,
1454			closeButtons = new Array();
1455			function toggleOverlay(btn) {
1456				Array.prototype.forEach.call(document.querySelectorAll('div.overlay'), function(overlay) {
1457					if (btn.getAttribute('data-area') == overlay.getAttribute('data-area')) {
1458						var container = document.querySelector('div.' + btn.getAttribute('data-container')),
1459							inputField = overlay.querySelector('.search-field');
1460						if (classie.has(overlay, 'open')) {
1461							window.dispatchEvent(menuClose);
1462							overlayOpened = false;
1463							classie.remove(overlay, 'open');
1464							classie.remove(container, 'overlay-open');
1465							classie.add(overlay, 'close');
1466							classie.remove(overlay, 'open-items');
1467							var onEndTransitionFn = function(ev) {
1468								if (transitionEvent) {
1469									if (ev.propertyName !== 'visibility') return;
1470									this.removeEventListener(transitionEvent, onEndTransitionFn);
1471								}
1472								classie.remove(overlay, 'close');
1473							};
1474							if (transitionEvent) {
1475								overlay.addEventListener(transitionEvent, onEndTransitionFn);
1476							} else {
1477								onEndTransitionFn();
1478							}
1479						} else if (!classie.has(overlay, 'close')) {
1480							window.dispatchEvent(menuOpen);
1481							overlayOpened = true;
1482							classie.add(overlay, 'open');
1483							classie.add(container, 'overlay-open');
1484							if (jQuery('body.menu-overlay').length == 0) {
1485								setTimeout(function() {
1486									inputField.focus();
1487								}, 1000);
1488							}
1489							setTimeout(function() {
1490								if (classie.has(overlay, 'overlay-sequential')) classie.add(overlay, 'open-items');
1491							}, 800);
1492						}
1493					}
1494				});
1495
1496				if (classie.hasClass(btn, 'search-icon') || classie.hasClass(btn, 'menu-close-search')) return;
1497
1498				if (classie.hasClass(triggerButton, 'close')) {
1499					UNCODE.menuOpened = false;
1500					classie.removeClass(triggerButton, 'close');
1501					classie.addClass(triggerButton, 'closing');
1502					Array.prototype.forEach.call(closeButtons, function(closeButton) {
1503						if (!classie.hasClass(closeButton, 'menu-close-search')) {
1504							classie.removeClass(closeButton, 'close');
1505							classie.addClass(closeButton, 'closing');
1506						}
1507					});
1508					setTimeout(function() {
1509						classie.removeClass(triggerButton, 'closing');
1510						triggerButton.style.opacity = 1;
1511						Array.prototype.forEach.call(closeButtons, function(closeButton) {
1512							if (!classie.hasClass(closeButton, 'menu-close-search')) {
1513								classie.removeClass(closeButton, 'closing');
1514								closeButton.style.opacity = 0;
1515							}
1516						});
1517					}, 800);
1518				} else {
1519					UNCODE.menuOpened = true;
1520					triggerButton.style.opacity = 0;
1521					var getBtnRect = !classie.hasClass(triggerButton, 'search-icon') ? triggerButton.getBoundingClientRect() : null;
1522					Array.prototype.forEach.call(closeButtons, function(closeButton) {
1523						if (!classie.hasClass(closeButton, 'menu-close-search')) {
1524							classie.addClass(triggerButton, 'close');
1525							if (getBtnRect != null) closeButton.setAttribute('style', 'top:' + getBtnRect.top + 'px; left:'+ getBtnRect.left + 'px !important');
1526							classie.addClass(closeButton, 'close');
1527							closeButton.style.opacity = 1;
1528						}
1529					});
1530					window.addEventListener("resize", function() {
1531						positionCloseBtn(triggerButton, closeButtons);
1532					});
1533				}
1534			}
1535			function positionCloseBtn(triggerButton, closeButtons){
1536				var getBtnRect = !classie.hasClass(triggerButton, 'search-icon') ? triggerButton.getBoundingClientRect() : null;
1537				Array.prototype.forEach.call(closeButtons, function(closeButton) {
1538					if (!classie.hasClass(closeButton, 'menu-close-search')) {
1539						if (getBtnRect != null) closeButton.setAttribute('style', 'top:' + getBtnRect.top + 'px; left:'+ getBtnRect.left + 'px !important');
1540						closeButton.style.opacity = 1;
1541					}
1542				});
1543			}
1544			(function bindEscape() {
1545				document.onkeydown = function(evt) {
1546			    evt = evt || window.event;
1547			    var isEscape = false;
1548			    if ("key" in evt) {
1549			       isEscape = (evt.key == "Escape" || evt.key == "Esc");
1550			    } else {
1551			      isEscape = (evt.keyCode == 27);
1552			    }
1553			    if (isEscape && overlayOpened) {
1554			      Array.prototype.forEach.call(closeButtons, function(closeButton) {
1555			      	if (classie.hasClass(closeButton, 'overlay-close') && classie.hasClass(closeButton, 'menu-button-overlay')) {
1556			      		closeButton.click();
1557			      	}
1558			      });
1559			    }
1560				};
1561			})();
1562			Array.prototype.forEach.call(document.querySelectorAll('.trigger-overlay'), function(triggerBttn) {
1563				if (UNCODE.menuOpened) return;
1564				triggerBttn.addEventListener('click', function(e) {
1565					triggerButton = e.currentTarget;
1566					if (wwidth < mediaQuery && classie.hasClass(triggerButton, 'search-icon')) {
1567						return true;
1568					} else {
1569						e.stopPropagation();
1570						if (wwidth > mediaQuery) toggleOverlay(triggerButton);
1571						else {
1572							if (classie.addClass(triggerButton, 'search-icon')) return true;
1573						}
1574						e.preventDefault();
1575						return false;
1576					}
1577				}, false);
1578			});
1579			Array.prototype.forEach.call(document.querySelectorAll('.overlay-close'), function(closeBttn) {
1580				closeButtons.push(closeBttn);
1581				closeBttn.addEventListener('click', function(e) {
1582					if (wwidth > mediaQuery) toggleOverlay(closeBttn);
1583					e.preventDefault();
1584					return false;
1585				}, false);
1586			});
1587		},
1588		/** All scrolling functions - Begin */
1589		/** Shrink menu **/
1590		shrinkMenu = function(bodyTop) {
1591			var logoShrink,
1592				offset = 100;
1593			for (var i = 0; i < logoel.length; i++) {
1594				if (((secmenuHeight == 0) ? bodyTop > menuHeight : bodyTop > secmenuHeight + offset) && !classie.hasClass(logoel[i], 'shrinked') && (wwidth > mediaQuery)) {
1595					classie.addClass(logoel[i], 'shrinked');
1596					if (logoMinScale != undefined) {
1597						logoShrink = logolink.children;
1598						Array.prototype.forEach.call(logoShrink, function(singleLogo) {
1599							singleLogo.style.height = logoMinScale + 'px';
1600							singleLogo.style.lineHeight = logoMinScale + 'px';
1601							if (classie.hasClass(singleLogo, 'text-logo')) singleLogo.style.fontSize = logoMinScale + 'px';
1602						});
1603					}
1604					setTimeout(function() {
1605						calculateMenuHeight(false);
1606						//window.dispatchEvent(new Event('resize'));
1607					}, 300);
1608				} else if ((((secmenuHeight == 0) ? bodyTop == 0 : bodyTop <= secmenuHeight + offset) || (wwidth < mediaQuery)) && classie.hasClass(logoel[i], 'shrinked')) {
1609					classie.removeClass(logoel[i], 'shrinked');
1610					if (logoMinScale != undefined) {
1611						logoShrink = logolink.children;
1612						Array.prototype.forEach.call(logoShrink, function(singleLogo) {
1613							singleLogo.style.height = singleLogo.getAttribute('data-maxheight') + 'px';
1614							singleLogo.style.lineHeight = singleLogo.getAttribute('data-maxheight') + 'px';
1615							if (classie.hasClass(singleLogo, 'text-logo')) singleLogo.style.fontSize = singleLogo.getAttribute('data-maxheight') + 'px';
1616						});
1617					}
1618					setTimeout(function() {
1619						calculateMenuHeight(false);
1620						//window.dispatchEvent(new Event('resize'));
1621					}, 300);
1622				}
1623			}
1624		},
1625		/** Switch colors menu **/
1626		switchColorsMenu = function(bodyTop, style) {
1627			for (var i = 0; i < transmenuel.length; i++) {
1628				if (masthead.style.opacity !== 1) masthead.style.opacity = 1;
1629				if ((secmenuHeight == 0) ? bodyTop > menuHeight / 2 : bodyTop > secmenuHeight) {
1630					if (classie.hasClass(masthead, 'style-dark-original')) {
1631						logo.className = logo.className.replace("style-light", "style-dark");
1632					}
1633					if (classie.hasClass(masthead, 'style-light-original')) {
1634						logo.className = logo.className.replace("style-dark", "style-light");
1635					}
1636					if (style != undefined) {
1637						if (style == 'dark') {
1638							classie.removeClass(transmenuel[i], 'style-light-override');
1639						}
1640						if (style == 'light') {
1641							classie.removeClass(transmenuel[i], 'style-dark-override');
1642						}
1643						classie.addClass(transmenuel[i], 'style-' + style + '-override');
1644					}
1645				} else {
1646					if (style != undefined) {
1647						if (style == 'dark') {
1648							classie.removeClass(transmenuel[i], 'style-light-override');
1649						}
1650						if (style == 'light') {
1651							classie.removeClass(transmenuel[i], 'style-dark-override');
1652						}
1653						classie.addClass(transmenuel[i], 'style-' + style + '-override');
1654					}
1655				}
1656			}
1657			if (pageHeader != undefined) {
1658				if (style != undefined) {
1659					if (classie.hasClass(pageHeader, 'header-style-dark')) {
1660						classie.removeClass(pageHeader, 'header-style-dark');
1661					}
1662					if (classie.hasClass(pageHeader, 'header-style-light')) {
1663						classie.removeClass(pageHeader, 'header-style-light');
1664					}
1665					classie.addClass(pageHeader, 'header-style-' + style);
1666				}
1667			}
1668		},
1669		/** VisibleRows **/
1670		visibleRowCol = function(bodyTop) {
1671			if ( typeof visibleRows == 'object') {
1672				for (var i = 0; i < visibleRows.length; i++) {
1673					var section = visibleRows[i],
1674						sectionHeight = outerHeight(section),
1675						offSetTop = bodyTop + ( section != null ? section.getBoundingClientRect().top : 0 ),
1676						offSetPosition = wheight + bodyTop - offSetTop;
1677					if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) {
1678						classie.addClass($kenburnsInner[0], 'uncode-scroll-visible');
1679						visibleRows[i].dispatchEvent(new CustomEvent('enter-row'));
1680					} else {
1681						classie.removeClass($kenburnsInner[0], 'uncode-scroll-visible');
1682						visibleRows[i].dispatchEvent(new CustomEvent('exit-row'));
1683					}
1684				}
1685			}
1686		},
1687		/** KenBurns **/
1688		kenburnsRowCol = function(bodyTop) {
1689			var value;
1690			if ( typeof kenburnsRows == 'object' && kenburnsRows.length ) {
1691				for (var i = 0; i < kenburnsRows.length; i++) {
1692					var section = kenburnsRows[i].parentNode,
1693						sectionHeight = outerHeight(section),
1694						offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0),
1695						offSetPosition = wheight + bodyTop - offSetTop,
1696						$kenburnsInner = kenburnsRows[i].querySelectorAll('.background-inner, .header-bg');
1697					if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) {
1698						classie.addClass($kenburnsInner[0], 'uncode-kburns');
1699						$kenburnsInner[0].dispatchEvent(new CustomEvent('enter-kburns'));
1700					} else {
1701						classie.removeClass($kenburnsInner[0], 'uncode-kburns');
1702						$kenburnsInner[0].dispatchEvent(new CustomEvent('exit-kburns'));
1703					}
1704				}
1705			}
1706			if ( typeof kenburnsCols == 'object' && kenburnsCols.length ) {
1707				for (var j = 0; j < kenburnsCols.length; j++) {
1708					var elm = kenburnsCols[j],
1709						$kenburnsInner = elm.querySelectorAll('.background-inner');
1710					if (checkVisible(elm)) {
1711						classie.addClass($kenburnsInner[0], 'uncode-kburns');
1712						$kenburnsInner[0].dispatchEvent(new CustomEvent('enter-kburns'));
1713					} else {
1714						classie.removeClass($kenburnsInner[0], 'uncode-kburns');
1715						$kenburnsInner[0].dispatchEvent(new CustomEvent('exit-kburns'));
1716					}
1717				}
1718			}
1719		},
1720		/** Parallax Rows **/
1721		parallaxRowCol = function(bodyTop) {
1722			var value;
1723			if (typeof parallaxRows == 'object') {
1724				for (var i = 0; i < parallaxRows.length; i++) {
1725					var section = parallaxRows[i].parentNode,
1726						thisHeight = outerHeight(parallaxRows[i]),
1727						sectionHeight = outerHeight(section),
1728						offSetTop = bodyTop + (section != null ? (classie.hasClass(section.parentNode.parentNode, 'owl-carousel') ? section.parentNode.parentNode.getBoundingClientRect().top : section.getBoundingClientRect().top) : 0),
1729						offSetPosition = wheight + bodyTop - offSetTop;
1730					if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) {
1731						value = ((offSetPosition - wheight) * speedDivider);
1732						if (Math.abs(value) < (thisHeight - sectionHeight)) {
1733							translateElement(parallaxRows[i], value);
1734						} else {
1735							translateElement(parallaxRows[i], thisHeight - sectionHeight);
1736						}
1737					}
1738				}
1739			}
1740			if (typeof parallaxCols == 'object') {
1741				for (var j = 0; j < parallaxCols.length; j++) {
1742					var section = parallaxCols[j].parentNode,
1743						thisHeight = outerHeight(parallaxCols[j]),
1744						sectionHeight = outerHeight(section),
1745						offSetTop = bodyTop + (section != null ? section.getBoundingClientRect().top : 0),
1746						offSetPosition = wheight + bodyTop - offSetTop;
1747					if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) {
1748						value = ((offSetPosition - wheight) * speedDivider);
1749						value *= .8;
1750						if (Math.abs(value) < (thisHeight - sectionHeight)) {
1751							translateElement(parallaxCols[j], value);
1752						} else {
1753							translateElement(parallaxCols[j], thisHeight - sectionHeight);
1754						}
1755					}
1756				}
1757			}
1758		},
1759		/** Parallax Headers **/
1760		parallaxHeader = function(bodyTop) {
1761			var value;
1762			if (typeof parallaxHeaders == 'object') {
1763				for (var i = 0; i < parallaxHeaders.length; i++) {
1764					var section = parallaxHeaders[i].parentNode,
1765						thisSibling = section.nextSibling,
1766						thisHeight,
1767						sectionHeight,
1768						offSetTop,
1769						offSetPosition;
1770					if (classie.hasClass(parallaxHeaders[i], 'header-carousel-wrapper')) {
1771						getDivChildren(parallaxHeaders[i], '.t-background-cover', function(item, l, total) {
1772							thisHeight = outerHeight(item);
1773							sectionHeight = outerHeight(section);
1774							offSetTop = bodyTop + section.getBoundingClientRect().top;
1775							offSetPosition = wheight + bodyTop - offSetTop;
1776							if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) {
1777								value = ((offSetPosition - wheight) * speedDivider);
1778								if (Math.abs(value) < (thisHeight - sectionHeight)) {
1779									translateElement(item, value);
1780								}
1781							}
1782						});
1783					} else {
1784						thisHeight = outerHeight(parallaxHeaders[i]);
1785						sectionHeight = outerHeight(section);
1786						offSetTop = bodyTop + section.getBoundingClientRect().top;
1787						offSetPosition = wheight + bodyTop - offSetTop;
1788						if (offSetPosition > 0 && offSetPosition < (sectionHeight + wheight)) {
1789							value = ((offSetPosition - wheight) * speedDivider);
1790							if (Math.abs(value) < (thisHeight - sectionHeight)) {
1791								translateElement(parallaxHeaders[i], value);
1792							}
1793						}
1794					}
1795				}
1796			}
1797		},
1798		/** Header opacity **/
1799		headerOpacity = function(bodyTop) {
1800			if (headerWithOpacity && headerWithOpacity.length) {
1801				var thisHeight = outerHeight(headerWithOpacity[0]);
1802				if (bodyTop > thisHeight / 8) {
1803					if (pageHeader != undefined) classie.addClass(pageHeader, 'header-scrolled');
1804				} else {
1805					if (pageHeader != undefined) classie.removeClass(pageHeader, 'header-scrolled');
1806				}
1807			}
1808		},
1809		/** Show hide scroll top arrow **/
1810		showHideScrollup = function(bodyTop) {
1811			if (bodyTop != 0) {
1812				if (bodyTop > wheight || ((bodyTop + wheight) >= docheight) && docheight > 0) {
1813					classie.addClass(document.body, 'window-scrolled');
1814					classie.removeClass(document.body, 'hide-scrollup');
1815					if (footerScroller && footerScroller[0] != undefined) {
1816						footerScroller[0].style.display = '';
1817					}
1818				} else {
1819					if (classie.hasClass(document.body, 'window-scrolled')) classie.addClass(document.body, 'hide-scrollup');
1820					classie.removeClass(document.body, 'window-scrolled');
1821				}
1822			}
1823		},
1824		/** Fix menu **/
1825		fixMenu = function(){
1826			menuwrapper = document.querySelectorAll(".menu-wrapper");
1827			if ( ! classie.hasClass(document.body, 'vmenu') && UNCODE.isFullPage && !UNCODE.isFullPageSnap && classie.hasClass(document.body, 'uncode-fp-menu-hide') ) {
1828				menuwrapper = document.querySelector(".menu-wrapper");
1829				pageHeader = document.getElementById("page-header");
1830				menuwrapper.style.position = 'fixed';
1831				menuwrapper.style.zIndex = '5';
1832			}
1833		},
1834		/** Hide Menu **/
1835		hideMenu = function(bodyTop) {
1836			if (UNCODE.menuOpened || bodyTop < 0) return;
1837			if (classie.hasClass(document.body, 'vmenu')) {
1838				if (wwidth < mediaQuery) menuhide = document.querySelector('#masthead .menu-hide-vertical');
1839				else menuhide = null;
1840			}
1841			if (classie.hasClass(document.body, 'hmenu-center')) {
1842				if (wwidth > mediaQuery) menuhide = document.querySelector('#masthead .menu-hide');
1843				else menuhide = document.querySelector('.menu-container-mobile.menu-hide');
1844			}
1845			if (typeof menuhide == 'object' && menuhide != null && mainmenu[0] != undefined) {
1846				var translate,
1847				scrollingDown = true;
1848				/** fix for hmenu-center **/
1849				var sticky_element = (typeof mainmenu.item === 'undefined' ? ((wwidth > mediaQuery) ? mainmenu[0] : mainmenu[1]) : mainmenu[0]);
1850				if (lastScrollValue == bodyTop) return;
1851
1852				if (lastScrollValue > bodyTop) scrollingDown = false;
1853				else scrollingDown = true;
1854				lastScrollValue = bodyTop;
1855
1856				if (!scrollingDown) {
1857					if (!UNCODE.scrolling) {
1858						if ((secmenuHeight == 0) ? bodyTop == 0 : bodyTop < secmenuHeight) {
1859							classie.removeClass(sticky_element.parentNode, 'is_stuck');
1860							if (classie.hasClass(masthead, 'menu-transparent')) {
1861								if ((isMobileTransparent || wwidth > mediaQuery) && !classie.hasClass(masthead.parentNode, 'no-header')) masthead.parentNode.style.height = '0px';
1862							}
1863							if (wwidth < mediaQuery) sticky_element.style.position = 'fixed';
1864							else sticky_element.style.position = '';
1865							hideMenuReset(sticky_element);
1866							clearTimeout(hidingTimer);
1867						}
1868
1869						if (classie.hasClass(menuhide, 'menu-hided')) {
1870							classie.removeClass(menuhide, 'menu-hided');
1871							hidingTimer = setTimeout(function() {
1872								classie.addClass(sticky_element.parentNode, 'is_stuck');
1873								hideMenuReset(sticky_element);
1874							}, 400);
1875						}
1876					}
1877				} else {
1878					if (menusticky.length == 0 && bodyTop < wheight / 3) {
1879						if (sticky_element.style.position == 'fixed') sticky_element.style.position = '';
1880					}
1881					if (bodyTop > wheight / 2) {
1882						clearTimeout(hidingTimer);
1883						if (!classie.hasClass(menuhide, 'menu-hided')) {
1884							classie.addClass(menuhide, 'menu-hided');
1885							classie.addClass(sticky_element.parentNode, 'is_stuck');
1886							if (sticky_element.style.position != 'fixed') {
1887								sticky_element.style.visibility = 'hidden';
1888								sticky_element.style.position = 'fixed';
1889								sticky_element.style.top = '0px';
1890							}
1891							translateElement(menuhide, -UNCODE.menuMobileHeight - 1);
1892						}
1893					}
1894				}
1895			}
1896		},
1897		hideMenuReset = function(sticky_element) {
1898			var topOffset = 0;
1899			if (sticky_element.style.visibility == 'hidden') sticky_element.style.visibility = '';
1900			if (bodyBorder > 0) topOffset += bodyBorder;
1901			if (adminBar != null && window.getComputedStyle(adminBar,null).getPropertyValue("position") != 'fixed') adminBarHeight = 0;
1902			if (adminBarHeight > 0) topOffset += adminBarHeight;
1903			//sticky_element.style.top = topOffset + 'px';
1904			if (!classie.hasClass(document.body, 'boxed-width') && boxWidth > 0) sticky_element.style.width = boxWidth + 'px';
1905			translateElement(menuhide, 0);
1906		},
1907		/** Stick Menu **/
1908		stickMenu = function(bodyTop) {
1909			if (header && mainmenu[0] != undefined) {
1910				if (classie.hasClass(mainmenu[0], 'vmenu-container') && wwidth > mediaQuery) return;
1911				/** fix for hmenu-center **/
1912				var sticky_element = (typeof mainmenu.item === 'undefined' ? ((isMobileTransparent || wwidth > mediaQuery) ? mainmenu[0] : mainmenu[1]) : mainmenu[0]);
1913				if ((secmenuHeight == 0 && (isMobileTransparent || wwidth > mediaQuery)) ? bodyTop > (0 + adminBarHeight)  : bodyTop > (secmenuHeight + adminBarHeight)) {
1914					if (!classie.hasClass(sticky_element.parentNode, 'is_stuck')) {
1915						classie.addClass(sticky_element.parentNode, 'is_stuck');
1916						sticky_element.style.position = 'fixed';
1917						var getAnchorTop = bodyBorder;
1918						if (adminBar != null && window.getComputedStyle(adminBar,null).getPropertyValue("position") != 'fixed') adminBarHeight = 0;
1919						if (adminBarHeight > 0) getAnchorTop += adminBarHeight;
1920						sticky_element.style.top = getAnchorTop + 'px';
1921						if (!classie.hasClass(document.body, 'boxed-width') && boxWidth > 0) sticky_element.style.width = boxWidth + 'px';
1922					}
1923				} else {
1924					clearTimeout(hidingTimer);
1925					classie.removeClass(sticky_element.parentNode, 'is_stuck');
1926					sticky_element.style.position = 'fixed';
1927					if (isMobileTransparent || wwidth > mediaQuery) sticky_element.style.position = '';
1928					if (classie.hasClass(document.body, 'hmenu-center')) sticky_element.style.position = 'absolute';
1929					sticky_element.style.top = '';
1930				}
1931			}
1932		},
1933		translateElement = function(element, valueY) {
1934			var translate = 'translate3d(0, ' + valueY + 'px' + ', 0)';
1935			element.style['-webkit-transform'] = translate;
1936			element.style['-moz-transform'] = translate;
1937			element.style['-ms-transform'] = translate;
1938			element.style['-o-transform'] = translate;
1939			element.style['transform'] = translate;
1940		},
1941		scrollFunction = function() {
1942			if ( ! UNCODE.isFullPage ) {
1943				kenburnsRowCol(bodyTop);
1944				if (logoel != undefined && logoel.length && !isMobile) shrinkMenu(bodyTop);
1945				if (menusticky != undefined && menusticky.length) stickMenu(bodyTop);
1946					hideMenu(bodyTop);
1947				if (!isMobile) {
1948					if (header && menusticky != undefined && menusticky.length)
1949						switchColorsMenu(bodyTop);
1950					parallaxRowCol(bodyTop);
1951					parallaxHeader(bodyTop);
1952					headerOpacity(bodyTop);
1953					visibleRowCol(bodyTop);
1954				}
1955			}
1956		},
1957		/** Shape Dividers **/
1958		shapeDivider = function() {
1959			var $shape = '.uncode-divider-wrap';
1960
1961			forEachElement($shape, function($el, i) {
1962				var elH = parseInt( $el.getAttribute('data-height') ),
1963					elHunit = $el.getAttribute('data-unit'),
1964					newEl,
1965					$parent = $el.parentNode,
1966					parentH,
1967					$svg = $el.getElementsByTagName('svg')[0];
1968
1969				if ( elHunit == 'px' ) {
1970
1971					switch (true) {
1972						case (wwidth < 1500 && wwidth >= 1180):
1973							newEl = elH*0.8;
1974							break;
1975
1976						case (wwidth < 1180 && wwidth >= 960):
1977							newEl = elH*0.65;
1978							break;
1979
1980						case (wwidth < 960 && wwidth >= 570):
1981							newEl = elH*0.5;
1982							break;
1983
1984						case (wwidth < 570):
1985							newEl = elH*0.25;
1986							break;
1987
1988						default:
1989							newEl = elH;
1990					}
1991
1992					$el.style.height = newEl + elHunit;
1993				}
1994
1995
1996				if ( classie.hasClass($el, 'uncode-divider-preserve-ratio') && ( window.navigator.userAgent.indexOf('MSIE ') !== -1 || window.navigator.userAgent.indexOf('Trident/') !== -1 ) ) {
1997
1998					$svg.setAttribute('preserveAspectRatio','none');
1999
2000					var sizes = $svg.getAttribute('viewBox').split(' '),
2001						svgW = sizes[2],
2002						svgH = sizes[3],
2003						newSvgW;
2004
2005					newSvgW = newEl * ( svgW / svgH );
2006
2007					$svg.style.width = newSvgW + 'px';
2008
2009				}
2010			});
2011		};
2012	if (!noScroll) {
2013		window.addEventListener('scroll', function(e) {
2014			if ( ! UNCODE.isFullPage ) {
2015				bodyTop = document.documentElement.scrollTop || document.body.scrollTop;
2016				scrollFunction();
2017				showHideScrollup(bodyTop);
2018			}
2019		}, false);
2020	}
2021	/** All scrolling functions - End */
2022	/** help functions */
2023	function getClosest(el, tag) {
2024		do {
2025			if (el.className != undefined && el.className.indexOf(tag) > -1) return el;
2026		} while (el = el.parentNode);
2027		// not found :(
2028		return null;
2029	}
2030
2031	function outerHeight(el, includeMargin) {
2032		if (el != null) {
2033			var height = el.offsetHeight;
2034			if (includeMargin) {
2035				var style = el.currentStyle || getComputedStyle(el);
2036				height += parseInt(style.marginTop) + parseInt(style.marginBottom);
2037			}
2038			return height;
2039		}
2040	}
2041
2042	function outerWidth(el, includeMargin) {
2043			var width = el.offsetWidth;
2044			if (includeMargin) {
2045				var style = el.currentStyle || getComputedStyle(el);
2046				width += parseInt(style.marginLeft) + parseInt(style.marginRight);
2047			}
2048			return width;
2049		}
2050		// Replicate jQuery .each method
2051	function forEachElement(selector, fn) {
2052		var elements = document.querySelectorAll(selector);
2053		for (var i = 0; i < elements.length; i++) fn(elements[i], i);
2054	}
2055
2056	function getDivChildren(containerId, selector, fn) {
2057		if (containerId !== null) {
2058			var elements = containerId.querySelectorAll(selector);
2059			for (var i = 0; i < elements.length; i++) fn(elements[i], i, elements.length);
2060		}
2061	}
2062
2063	function hideFooterScroll() {
2064		if (classie.hasClass(document.body, 'hide-scrollup')) footerScroller[0].style.display = "none";
2065	}
2066	document.addEventListener("DOMContentLoaded", function(event) {
2067		UNCODE.adaptive();
2068		boxWrapper = document.querySelectorAll('.box-wrapper');
2069		docheight = boxWrapper[0] != undefined ? boxWrapper[0].offsetHeight : 0;
2070		if (!classie.hasClass(document.body, 'vmenu') && !classie.hasClass(document.body, 'menu-offcanvas')) init_overlay();
2071		kenburnsRows = document.querySelectorAll('.with-kburns > .row-background > .background-wrapper, .with-kburns > .header-bg-wrapper, .with-kburns > .fp-tableCell > .row-background > .background-wrapper, .with-kburns > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper');
2072		kenburnsCols = document.querySelectorAll('.with-kburns > .column-background > .background-wrapper');
2073		if (!UNCODE.isMobile) {
2074			parallaxRows = document.querySelectorAll('.with-parallax > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .row-background > .background-wrapper, .with-parallax > .fp-tableCell > .fp-scrollable > .fp-scroller > .row-background > .background-wrapper');
2075			parallaxCols = document.querySelectorAll('.with-parallax > .column-background > .background-wrapper');
2076		}
2077		footerScroller = document.querySelectorAll('.footer-scroll-top');
2078		if (footerScroller && footerScroller[0] != undefined) {
2079			if (transitionEvent) {
2080				footerScroller[0].addEventListener(transitionEvent, hideFooterScroll);
2081			}
2082		}
2083		Array.prototype.forEach.call(document.querySelectorAll('.row-inner'), function(el) {
2084			el.style.height = '';
2085			el.style.marginBottom = '';
2086		});
2087		setRowHeight(document.querySelectorAll('.page-wrapper .row-parent, footer .row-parent'));
2088	});
2089	/** On resize events **/
2090	window.addEventListener("resize", function() {
2091		docheight = (boxWrapper != undefined && boxWrapper[0] != undefined) ? boxWrapper[0].offsetHeight : 0;
2092		var oldWidth = wwidth;
2093		UNCODE.wwidth = wwidth = window.innerWidth || document.documentElement.clientWidth;
2094		UNCODE.wheight = wheight = (window.innerHeight || document.documentElement.clientHeight) - (bodyBorder * 2);
2095		if (isSplitMenu) centerSplitMenu();
2096		if (isMobile && (oldWidth == wwidth)) return false;
2097		calculateMenuHeight(false);
2098		initBox();
2099		headerHeight('.header-wrapper');
2100		window.dispatchEvent(boxEvent);
2101		scrollFunction();
2102		shapeDivider();
2103		showHideScrollup(bodyTop);
2104		clearTimeout(resizeTimer);
2105		resizeTimer = setTimeout(function() {
2106			UNCODE.wheight = wheight = (window.innerHeight || document.documentElement.clientHeight) - (bodyBorder * 2);
2107			Array.prototype.forEach.call(document.querySelectorAll('.row-inner'), function(el) {
2108				el.style.height = '';
2109				el.style.marginBottom = '';
2110			});
2111			setRowHeight(document.querySelectorAll('.page-wrapper .row-parent, footer .row-parent'), false, true);
2112			if (!isMobile) {
2113				initVideoComponent(document.body, '.uncode-video-container.video, .uncode-video-container.self-video');
2114			}
2115		}, 500);
2116	});
2117
2118	/**
2119	 * On DOM ready
2120	 */
2121	window.addEventListener("load", function(){
2122		if (!UNCODE.isMobile) {
2123			setTimeout(function() {
2124				window.dispatchEvent(UNCODE.boxEvent);
2125				Waypoint.refreshAll();
2126			}, 2000);
2127		}
2128		//repeat it for mobile since it changes layout on carousel after DOM loading
2129		if (UNCODE.isMobile) {
2130			kenburnsRowCol(bodyTop);
2131		}
2132		showHideScrollup(bodyTop);
2133		if (document.createEvent) { // W3C
2134		    var ev = document.createEvent('Event');
2135		    ev.initEvent('resize', true, true);
2136		    window.dispatchEvent(ev);
2137		} else { // IE
2138    		document.fireEvent('onresize');
2139		}
2140	}, false);
2141
2142	var UNCODE = {
2143		bodyTop: bodyTop,
2144		boxEvent: boxEvent,
2145		bodyBorder: bodyBorder,
2146		initBox: initBox,
2147		adminBarHeight: 0,
2148		menuHeight: 0,
2149		menuMobileHeight: 0,
2150		fixMenuHeight: fixMenuHeight,
2151		initHeader: initHeader,
2152		initRow: initRow,
2153		setRowHeight: setRowHeight,
2154		switchColorsMenu: switchColorsMenu,
2155		isMobile: isMobile,
2156		scrolling: false,
2157		menuHiding: false,
2158		menuOpened: false,
2159		menuMobileTriggerEvent: menuMobileTriggerEvent,
2160		mediaQuery: mediaQuery,
2161		initVideoComponent: initVideoComponent,
2162		hideMenu: hideMenu,
2163		wwidth: wwidth,
2164		wheight: wheight,
2165	};
2166	// transport
2167	if (typeof define === 'function' && define.amd) {
2168		// AMD
2169		define(UNCODE);
2170	} else {
2171		// browser global
2172		window.UNCODE = UNCODE;
2173	}
2174
2175	UNCODE.adaptive = function() {
2176		var images = new Array(),
2177			getImages = document.querySelectorAll('.adaptive-async:not(.adaptive-fetching)');
2178		for (var i = 0; i < getImages.length; i++) {
2179			var imageObj = {},
2180				el = getImages[i];
2181			classie.addClass(el, 'adaptive-fetching');
2182			imageObj.unique = el.getAttribute('data-uniqueid');
2183			imageObj.url = el.getAttribute('data-guid');
2184			imageObj.path = el.getAttribute('data-path');
2185			imageObj.singlew = el.getAttribute('data-singlew');
2186			imageObj.singleh = el.getAttribute('data-singleh');
2187			imageObj.origwidth = el.getAttribute('data-width');
2188			imageObj.origheight = el.getAttribute('data-height');
2189			imageObj.crop = el.getAttribute('data-crop');
2190			imageObj.fixed = el.getAttribute('data-fixed') == undefined ? null : el.getAttribute('data-fixed');
2191			imageObj.screen = window.uncodeScreen;
2192			imageObj.images = window.uncodeImages;
2193			images.push(imageObj);
2194		}
2195
2196		var post_data = {
2197			images: JSON.stringify(images),
2198			action: 'get_adaptive_async',
2199			nonce_adaptive_images: SiteParameters.nonce_adaptive_images
2200		};
2201
2202		if (images.length > 0) {
2203			var xhr = new XMLHttpRequest();
2204			xhr.open('POST', SiteParameters.ajax_url, true);
2205			xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
2206
2207			xhr.onreadystatechange = function() {
2208				if (xhr.readyState == XMLHttpRequest.DONE) {
2209					if (xhr.status == 200 && xhr.responseText) {
2210						var jsonResponse = JSON.parse(xhr.responseText);
2211
2212						if (jsonResponse.success && jsonResponse.data.images) {
2213							var images = jsonResponse.data.images;
2214
2215							for (var i = 0; i < images.length; i++) {
2216								var val = images[i],
2217									getImage = document.querySelectorAll('[data-uniqueid="'+val.unique+'"]');
2218								for (var j = 0; j < getImage.length; j++) {
2219									var attrScr = getImage[j].getAttribute('src'),
2220									replaceImg = new Image();
2221									replaceImg.source = attrScr;
2222									replaceImg.el = getImage[j];
2223
2224									classie.removeClass(getImage[j], 'adaptive-async');
2225									classie.removeClass(getImage[j], 'adaptive-fetching');
2226
2227									replaceImg.onload = function () {
2228
2229										var _this = this,
2230											parentNode = (_this.el).parentNode,
2231											placeH;
2232
2233										//Workaround for lazy-load flickering on Firefox
2234										if ( typeof parentNode.prepend == 'undefined') {
2235											if (_this.source !== null) {
2236												(_this.el).src = _this.src;
2237											} else {
2238												(_this.el).style.backgroundImage = 'url("'+_this.src+'")';
2239											}
2240											classie.addClass(_this.el, 'async-done');
2241										} else {
2242											if (_this.source !== null) {
2243												placeH = document.createElement("IMG");
2244												placeH.src = _this.src;
2245												placeH.style.position = 'absolute';
2246												placeH.style.opacity = '0';
2247											} else {
2248												placeH = document.createElement("DIV");
2249												placeH.setAttribute('style', _this.el.getAttribute('style'));
2250												placeH.setAttribute('class', _this.el.getAttribute('class'));
2251												placeH.style.backgroundImage = 'url("'+_this.src+'")';
2252												placeH.style.backgroundSize = 'cover';
2253												placeH.style.backgroundPosition = 'center';
2254												placeH.style.position = 'absolute';
2255												placeH.style.top = '0';
2256												placeH.style.width = '100%';
2257												placeH.style.height = '100%';
2258											}
2259
2260											parentNode.prepend(placeH);
2261
2262											requestTimeout(function(){
2263												if (_this.source !== null) {
2264													(_this.el).src = _this.src;
2265												} else {
2266													(_this.el).style.backgroundImage = 'url("'+_this.src+'")';
2267												}
2268												parentNode.removeChild(placeH);
2269												classie.addClass(_this.el, 'async-done');
2270											}, 250);
2271										}
2272									}
2273									replaceImg.src = val.url;
2274								}
2275							}
2276
2277						} else {
2278							console.log('There was an error: bad response');
2279						}
2280
2281					} else if (request.status == 400) {
2282						console.log('There was an error 400');
2283					} else {
2284						console.log('Something else other than 200 was returned');
2285					}
2286				}
2287			}
2288
2289			// Serialize our data
2290			var queryString = "",
2291				arrayLength = Object.keys(post_data).length,
2292				arrayCounter = 0;
2293
2294			for (var key in post_data) {
2295				queryString += key + "=" + post_data[key];
2296
2297				if (arrayCounter < arrayLength - 1) {
2298					queryString += "&";
2299				}
2300
2301				arrayCounter++;
2302			}
2303
2304			xhr.send(queryString);
2305		}
2306	};
2307
2308})(window);
2309
2310/**
2311 * vivus - JavaScript library to make drawing animation on SVG
2312 * @version v0.4.4
2313 * @link https://github.com/maxwellito/vivus
2314 * @license MIT
2315 */
2316
2317'use strict';
2318
2319(function () {
2320
2321  'use strict';
2322
2323/**
2324 * Pathformer
2325 * Beta version
2326 *
2327 * Take any SVG version 1.1 and transform
2328 * child elements to 'path' elements
2329 *
2330 * This code is purely forked from
2331 * https://github.com/Waest/SVGPathConverter
2332 */
2333
2334/**
2335 * Class constructor
2336 *
2337 * @param {DOM|String} element Dom element of the SVG or id of it
2338 */
2339function Pathformer(element) {
2340  // Test params
2341  if (typeof element === 'undefined') {
2342    throw new Error('Pathformer [constructor]: "element" parameter is required');
2343  }
2344
2345  // Set the element
2346  if (element.constructor === String) {
2347    element = document.getElementById(element);
2348    if (!element) {
2349      throw new Error('Pathformer [constructor]: "element" parameter is not related to an existing ID');
2350    }
2351  }
2352  if (element instanceof window.SVGElement ||
2353      element instanceof window.SVGGElement ||
2354      /^svg$/i.test(element.nodeName)) {
2355    this.el = element;
2356  } else {
2357    throw new Error('Pathformer [constructor]: "element" parameter must be a string or a SVGelement');
2358  }
2359
2360  // Start
2361  this.scan(element);
2362}
2363
2364/**
2365 * List of tags which can be transformed
2366 * to path elements
2367 *
2368 * @type {Array}
2369 */
2370Pathformer.prototype.TYPES = ['line', 'ellipse', 'circle', 'polygon', 'polyline', 'rect'];
2371
2372/**
2373 * List of attribute names which contain
2374 * data. This array list them to check if
2375 * they contain bad values, like percentage.
2376 *
2377 * @type {Array}
2378 */
2379Pathformer.prototype.ATTR_WATCH = ['cx', 'cy', 'points', 'r', 'rx', 'ry', 'x', 'x1', 'x2', 'y', '
vendor: 12,795 bytes, lines 2379-2780
2379y1', 'y2'];
2380
2381/**
2382 * Finds the elements compatible for transform
2383 * and apply the liked method
2384 *
2385 * @param  {object} options Object from the constructor
2386 */
2387Pathformer.prototype.scan = function (svg) {
2388  var fn, element, pathData, pathDom,
2389      elements = svg.querySelectorAll(this.TYPES.join(','));
2390
2391  for (var i = 0; i < elements.length; i++) {
2392    element = elements[i];
2393    fn = this[element.tagName.toLowerCase() + 'ToPath'];
2394    pathData = fn(this.parseAttr(element.attributes));
2395    pathDom = this.pathMaker(element, pathData);
2396    element.parentNode.replaceChild(pathDom, element);
2397  }
2398};
2399
2400
2401/**
2402 * Read `line` element to extract and transform
2403 * data, to make it ready for a `path` object.
2404 *
2405 * @param  {DOMelement} element Line element to transform
2406 * @return {object}             Data for a `path` element
2407 */
2408Pathformer.prototype.lineToPath = function (element) {
2409  var newElement = {},
2410      x1 = element.x1 || 0,
2411      y1 = element.y1 || 0,
2412      x2 = element.x2 || 0,
2413      y2 = element.y2 || 0;
2414
2415  newElement.d = 'M' + x1 + ',' + y1 + 'L' + x2 + ',' + y2;
2416  return newElement;
2417};
2418
2419/**
2420 * Read `rect` element to extract and transform
2421 * data, to make it ready for a `path` object.
2422 * The radius-border is not taken in charge yet.
2423 * (your help is more than welcomed)
2424 *
2425 * @param  {DOMelement} element Rect element to transform
2426 * @return {object}             Data for a `path` element
2427 */
2428Pathformer.prototype.rectToPath = function (element) {
2429  var newElement = {},
2430      x      = parseFloat(element.x)      || 0,
2431      y      = parseFloat(element.y)      || 0,
2432      width  = parseFloat(element.width)  || 0,
2433      height = parseFloat(element.height) || 0;
2434
2435  if (element.rx || element.ry) {
2436    var rx = parseInt(element.rx, 10) || -1,
2437        ry = parseInt(element.ry, 10) || -1;
2438    rx = Math.min(Math.max(rx < 0 ? ry : rx, 0), width/2);
2439    ry = Math.min(Math.max(ry < 0 ? rx : ry, 0), height/2);
2440
2441    newElement.d = 'M ' + (x + rx) + ',' + y + ' ' +
2442                   'L ' + (x + width - rx) + ',' + y + ' ' +
2443                   'A ' + rx + ',' + ry + ',0,0,1,' + (x + width) + ',' + (y + ry) + ' ' +
2444                   'L ' + (x + width) + ',' + (y + height - ry) + ' ' +
2445                   'A ' + rx + ',' + ry + ',0,0,1,' + (x + width - rx) + ',' + (y + height) + ' ' +
2446                   'L ' + (x + rx) + ',' + (y + height) + ' ' +
2447                   'A ' + rx + ',' + ry + ',0,0,1,' + x + ',' + (y + height - ry) + ' ' +
2448                   'L ' + x + ',' + (y + ry) + ' ' +
2449                   'A ' + rx + ',' + ry + ',0,0,1,' + (x + rx) + ',' + y;
2450  }
2451  else {
2452    newElement.d = 'M' + x + ' ' + y + ' ' +
2453                   'L' + (x + width) + ' ' + y + ' ' +
2454                   'L' + (x + width) + ' ' + (y + height) + ' ' +
2455                   'L' + x + ' ' + (y + height) + ' Z';
2456  }
2457  return newElement;
2458};
2459
2460/**
2461 * Read `polyline` element to extract and transform
2462 * data, to make it ready for a `path` object.
2463 *
2464 * @param  {DOMelement} element Polyline element to transform
2465 * @return {object}             Data for a `path` element
2466 */
2467Pathformer.prototype.polylineToPath = function (element) {
2468  var newElement = {},
2469      points = element.points.trim().split(' '),
2470      i, path;
2471
2472  // Reformatting if points are defined without commas
2473  if (element.points.indexOf(',') === -1) {
2474    var formattedPoints = [];
2475    for (i = 0; i < points.length; i+=2) {
2476      formattedPoints.push(points[i] + ',' + points[i+1]);
2477    }
2478    points = formattedPoints;
2479  }
2480
2481  // Generate the path.d value
2482  path = 'M' + points[0];
2483  for(i = 1; i < points.length; i++) {
2484    if (points[i].indexOf(',') !== -1) {
2485      path += 'L' + points[i];
2486    }
2487  }
2488  newElement.d = path;
2489  return newElement;
2490};
2491
2492/**
2493 * Read `polygon` element to extract and transform
2494 * data, to make it ready for a `path` object.
2495 * This method rely on polylineToPath, because the
2496 * logic is similar. The path created is just closed,
2497 * so it needs an 'Z' at the end.
2498 *
2499 * @param  {DOMelement} element Polygon element to transform
2500 * @return {object}             Data for a `path` element
2501 */
2502Pathformer.prototype.polygonToPath = function (element) {
2503  var newElement = Pathformer.prototype.polylineToPath(element);
2504
2505  newElement.d += 'Z';
2506  return newElement;
2507};
2508
2509/**
2510 * Read `ellipse` element to extract and transform
2511 * data, to make it ready for a `path` object.
2512 *
2513 * @param  {DOMelement} element ellipse element to transform
2514 * @return {object}             Data for a `path` element
2515 */
2516Pathformer.prototype.ellipseToPath = function (element) {
2517  var newElement = {},
2518      rx = parseFloat(element.rx) || 0,
2519      ry = parseFloat(element.ry) || 0,
2520      cx = parseFloat(element.cx) || 0,
2521      cy = parseFloat(element.cy) || 0,
2522      startX = cx - rx,
2523      startY = cy,
2524      endX = parseFloat(cx) + parseFloat(rx),
2525      endY = cy;
2526
2527  newElement.d = 'M' + startX + ',' + startY +
2528                 'A' + rx + ',' + ry + ' 0,1,1 ' + endX + ',' + endY +
2529                 'A' + rx + ',' + ry + ' 0,1,1 ' + startX + ',' + endY;
2530  return newElement;
2531};
2532
2533/**
2534 * Read `circle` element to extract and transform
2535 * data, to make it ready for a `path` object.
2536 *
2537 * @param  {DOMelement} element Circle element to transform
2538 * @return {object}             Data for a `path` element
2539 */
2540Pathformer.prototype.circleToPath = function (element) {
2541  var newElement = {},
2542      r  = parseFloat(element.r)  || 0,
2543      cx = parseFloat(element.cx) || 0,
2544      cy = parseFloat(element.cy) || 0,
2545      startX = cx - r,
2546      startY = cy,
2547      endX = parseFloat(cx) + parseFloat(r),
2548      endY = cy;
2549
2550  newElement.d =  'M' + startX + ',' + startY +
2551                  'A' + r + ',' + r + ' 0,1,1 ' + endX + ',' + endY +
2552                  'A' + r + ',' + r + ' 0,1,1 ' + startX + ',' + endY;
2553  return newElement;
2554};
2555
2556/**
2557 * Create `path` elements form original element
2558 * and prepared objects
2559 *
2560 * @param  {DOMelement} element  Original element to transform
2561 * @param  {object} pathData     Path data (from `toPath` methods)
2562 * @return {DOMelement}          Path element
2563 */
2564Pathformer.prototype.pathMaker = function (element, pathData) {
2565  var i, attr, pathTag = document.createElementNS('http://www.w3.org/2000/svg','path');
2566  for(i = 0; i < element.attributes.length; i++) {
2567    attr = element.attributes[i];
2568    if (this.ATTR_WATCH.indexOf(attr.name) === -1) {
2569      pathTag.setAttribute(attr.name, attr.value);
2570    }
2571  }
2572  for(i in pathData) {
2573    pathTag.setAttribute(i, pathData[i]);
2574  }
2575  return pathTag;
2576};
2577
2578/**
2579 * Parse attributes of a DOM element to
2580 * get an object of attribute => value
2581 *
2582 * @param  {NamedNodeMap} attributes Attributes object from DOM element to parse
2583 * @return {object}                  Object of attributes
2584 */
2585Pathformer.prototype.parseAttr = function (element) {
2586  var attr, output = {};
2587  for (var i = 0; i < element.length; i++) {
2588    attr = element[i];
2589    // Check if no data attribute contains '%', or the transformation is impossible
2590    if (this.ATTR_WATCH.indexOf(attr.name) !== -1 && attr.value.indexOf('%') !== -1) {
2591      throw new Error('Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into \'path\' tags. Please use \'viewBox\'.');
2592    }
2593    output[attr.name] = attr.value;
2594  }
2595  return output;
2596};
2597
2598  'use strict';
2599
2600var setupEnv, requestAnimFrame, cancelAnimFrame, parsePositiveInt;
2601
2602/**
2603 * Vivus
2604 * Beta version
2605 *
2606 * Take any SVG and make the animation
2607 * to give give the impression of live drawing
2608 *
2609 * This in more than just inspired from codrops
2610 * At that point, it's a pure fork.
2611 */
2612
2613/**
2614 * Class constructor
2615 * option structure
2616 *   type: 'delayed'|'sync'|'oneByOne'|'script' (to know if the items must be drawn synchronously or not, default: delayed)
2617 *   duration: <int> (in frames)
2618 *   start: 'inViewport'|'manual'|'autostart' (start automatically the animation, default: inViewport)
2619 *   delay: <int> (delay between the drawing of first and last path)
2620 *   dashGap <integer> whitespace extra margin between dashes
2621 *   pathTimingFunction <function> timing animation function for each path element of the SVG
2622 *   animTimingFunction <function> timing animation function for the complete SVG
2623 *   forceRender <boolean> force the browser to re-render all updated path items
2624 *   selfDestroy <boolean> removes all extra styling on the SVG, and leaves it as original
2625 *
2626 * The attribute 'type' is by default on 'delayed'.
2627 *  - 'delayed'
2628 *    all paths are draw at the same time but with a
2629 *    little delay between them before start
2630 *  - 'sync'
2631 *    all path are start and finish at the same time
2632 *  - 'oneByOne'
2633 *    only one path is draw at the time
2634 *    the end of the first one will trigger the draw
2635 *    of the next one
2636 *
2637 * All these values can be overwritten individually
2638 * for each path item in the SVG
2639 * The value of frames will always take the advantage of
2640 * the duration value.
2641 * If you fail somewhere, an error will be thrown.
2642 * Good luck.
2643 *
2644 * @constructor
2645 * @this {Vivus}
2646 * @param {DOM|String}   element  Dom element of the SVG or id of it
2647 * @param {Object}       options  Options about the animation
2648 * @param {Function}     callback Callback for the end of the animation
2649 */
2650function Vivus (element, options, callback) {
2651
2652  setupEnv();
2653
2654  // Setup
2655  this.isReady = false;
2656  this.setElement(element, options);
2657  this.setOptions(options);
2658  this.setCallback(callback);
2659
2660  if (this.isReady) {
2661    this.init();
2662  }
2663}
2664
2665/**
2666 * Timing functions
2667 **************************************
2668 *
2669 * Default functions to help developers.
2670 * It always take a number as parameter (between 0 to 1) then
2671 * return a number (between 0 and 1)
2672 */
2673Vivus.LINEAR          = function (x) {return x;};
2674Vivus.EASE            = function (x) {return -Math.cos(x * Math.PI) / 2 + 0.5;};
2675Vivus.EASE_OUT        = function (x) {return 1 - Math.pow(1-x, 3);};
2676Vivus.EASE_IN         = function (x) {return Math.pow(x, 3);};
2677Vivus.EASE_OUT_BOUNCE = function (x) {
2678  var base = -Math.cos(x * (0.5 * Math.PI)) + 1,
2679    rate = Math.pow(base,1.5),
2680    rateR = Math.pow(1 - x, 2),
2681    progress = -Math.abs(Math.cos(rate * (2.5 * Math.PI) )) + 1;
2682  return (1- rateR) + (progress * rateR);
2683};
2684
2685
2686/**
2687 * Setters
2688 **************************************
2689 */
2690
2691/**
2692 * Check and set the element in the instance
2693 * The method will not return anything, but will throw an
2694 * error if the parameter is invalid
2695 *
2696 * @param {DOM|String}   element  SVG Dom element or id of it
2697 */
2698Vivus.prototype.setElement = function (element, options) {
2699  var onLoad, self;
2700
2701  // Basic check
2702  if (typeof element === 'undefined') {
2703    throw new Error('Vivus [constructor]: "element" parameter is required');
2704  }
2705
2706  // Set the element
2707  if (element.constructor === String) {
2708    element = document.getElementById(element);
2709    if (!element) {
2710      throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID');
2711    }
2712  }
2713  this.parentEl = element;
2714
2715  // Load the SVG with XMLHttpRequest and extract the SVG
2716  if (options && options.file) {
2717    var self = this;
2718    onLoad = function (e) {
2719      var domSandbox = document.createElement('div');
2720      domSandbox.innerHTML = this.responseText;
2721
2722      var svgTag = domSandbox.querySelector('svg');
2723      if (!svgTag) {
2724        throw new Error('Vivus [load]: Cannot find the SVG in the loaded file : ' + options.file);
2725      }
2726
2727      self.el = svgTag
2728      self.el.setAttribute('width', '100%');
2729      self.el.setAttribute('height', '100%');
2730      self.parentEl.appendChild(self.el)
2731      self.isReady = true;
2732      self.init();
2733      self = null;
2734    }
2735
2736    var oReq = new window.XMLHttpRequest();
2737    oReq.addEventListener('load', onLoad);
2738    oReq.open('GET', options.file);
2739    oReq.send();
2740    return;
2741  }
2742
2743  switch (element.constructor) {
2744  case window.SVGSVGElement:
2745  case window.SVGElement:
2746  case window.SVGGElement:
2747    this.el = element;
2748    this.isReady = true;
2749    break;
2750
2751  case window.HTMLObjectElement:
2752    self = this;
2753    onLoad = function (e) {
2754      if (self.isReady) {
2755        return;
2756      }
2757      self.el = element.contentDocument && element.contentDocument.querySelector('svg');
2758      if (!self.el && e) {
2759        throw new Error('Vivus [constructor]: object loaded does not contain any SVG');
2760      }
2761      else if (self.el) {
2762        if (element.getAttribute('built-by-vivus')) {
2763          self.parentEl.insertBefore(self.el, element);
2764          self.parentEl.removeChild(element);
2765          self.el.setAttribute('width', '100%');
2766          self.el.setAttribute('height', '100%');
2767        }
2768        self.isReady = true;
2769        self.init();
2770        self = null;
2771      }
2772    };
2773
2774    if (!onLoad()) {
2775      element.addEventListener('load', onLoad);
2776    }
2777    break;
2778
2779  default:
2780    throw new Error('Vivus [constructor]: "element" parameter is not val
2780id (or miss the "file" attribute)');
2781  }
2782};
2783
2784/**
2785 * Set up user option to the instance
2786 * The method will not return anything, but will throw an
2787 * error if the parameter is invalid
2788 *
2789 * @param  {object} options Object from the constructor
2790 */
2791Vivus.prototype.setOptions = function (options) {
2792  var allowedTypes = ['delayed', 'sync', 'async', 'nsync', 'oneByOne', 'scenario', 'scenario-sync'];
2793  var allowedStarts =  ['inViewport', 'manual', 'autostart'];
2794
2795  // Basic check
2796  if (options !== undefined && options.constructor !== Object) {
2797    throw new Error('Vivus [constructor]: "options" parameter must be an object');
2798  }
2799  else {
2800    options = options || {};
2801  }
2802
2803  // Set the animation type
2804  if (options.type && allowedTypes.indexOf(options.type) === -1) {
2805    throw new Error('Vivus [constructor]: ' + options.type + ' is not an existing animation `type`');
2806  }
2807  else {
2808    this.type = options.type || allowedTypes[0];
2809  }
2810
2811  // Set the start type
2812  if (options.start && allowedStarts.indexOf(options.start) === -1) {
2813    throw new Error('Vivus [constructor]: ' + options.start + ' is not an existing `start` option');
2814  }
2815  else {
2816    this.start = options.start || allowedStarts[0];
2817  }
2818
2819  this.isIE         = (window.navigator.userAgent.indexOf('MSIE') !== -1 || window.navigator.userAgent.indexOf('Trident/') !== -1 || window.navigator.userAgent.indexOf('Edge/') !== -1 );
2820  this.duration     = parsePositiveInt(options.duration, 120);
2821  this.delay        = parsePositiveInt(options.delay, null);
2822  //Uncode addition
2823  this.delayStart   = parsePositiveInt(options.delayStart, null);
2824  //#END
2825  this.dashGap      = parsePositiveInt(options.dashGap, 1);
2826  this.forceRender  = options.hasOwnProperty('forceRender') ? !!options.forceRender : this.isIE;
2827  this.reverseStack = !!options.reverseStack;
2828  this.selfDestroy  = !!options.selfDestroy;
2829  this.onReady      = options.onReady;
2830  this.map          = [];
2831  this.frameLength  = this.currentFrame = this.delayUnit = this.speed = this.handle = null;
2832
2833  this.ignoreInvisible = options.hasOwnProperty('ignoreInvisible') ? !!options.ignoreInvisible : false;
2834
2835  this.animTimingFunction = options.animTimingFunction || Vivus.LINEAR;
2836  this.pathTimingFunction = options.pathTimingFunction || Vivus.LINEAR;
2837
2838  if (this.delay >= this.duration) {
2839    throw new Error('Vivus [constructor]: delay must be shorter than duration');
2840  }
2841};
2842
2843/**
2844 * Set up callback to the instance
2845 * The method will not return enything, but will throw an
2846 * error if the parameter is invalid
2847 *
2848 * @param  {Function} callback Callback for the animation end
2849 */
2850Vivus.prototype.setCallback = function (callback) {
2851  // Basic check
2852  if (!!callback && callback.constructor !== Function) {
2853    throw new Error('Vivus [constructor]: "callback" parameter must be a function');
2854  }
2855  this.callback = callback || function () {};
2856};
2857
2858
2859/**
2860 * Core
2861 **************************************
2862 */
2863
2864/**
2865 * Map the svg, path by path.
2866 * The method return nothing, it just fill the
2867 * `map` array. Each item in this array represent
2868 * a path element from the SVG, with informations for
2869 * the animation.
2870 *
2871 * ```
2872 * [
2873 *   {
2874 *     el: <DOMobj> the path element
2875 *     length: <number> length of the path line
2876 *     startAt: <number> time start of the path animation (in frames)
2877 *     duration: <number> path animation duration (in frames)
2878 *   },
2879 *   ...
2880 * ]
2881 * ```
2882 *
2883 */
2884Vivus.prototype.mapping = function () {
2885  var i, paths, path, pAttrs, pathObj, totalLength, lengthMeter, timePoint;
2886  timePoint = totalLength = lengthMeter = 0;
2887  paths = this.el.querySelectorAll('path');
2888
2889  for (i = 0; i < paths.length; i++) {
2890    path = paths[i];
2891    if (this.isInvisible(path)) {
2892      continue;
2893    }
2894    pathObj = {
2895      el: path,
2896      length: Math.ceil(path.getTotalLength())
2897    };
2898    // Test if the path length is correct
2899    if (isNaN(pathObj.length)) {
2900      if (window.console && console.warn) {
2901        console.warn('Vivus [mapping]: cannot retrieve a path element length', path);
2902      }
2903      continue;
2904    }
2905    this.map.push(pathObj);
2906    path.style.strokeDasharray  = pathObj.length + ' ' + (pathObj.length + this.dashGap * 2);
2907    path.style.strokeDashoffset = pathObj.length + this.dashGap;
2908    pathObj.length += this.dashGap;
2909    totalLength += pathObj.length;
2910
2911    this.renderPath(i);
2912  }
2913
2914  totalLength = totalLength === 0 ? 1 : totalLength;
2915  this.delay = this.delay === null ? this.duration / 3 : this.delay;
2916  this.delayUnit = this.delay / (paths.length > 1 ? paths.length - 1 : 1);
2917
2918  // Reverse stack if asked
2919  if (this.reverseStack) {
2920    this.map.reverse();
2921  }
2922
2923  for (i = 0; i < this.map.length; i++) {
2924    pathObj = this.map[i];
2925
2926    switch (this.type) {
2927    case 'delayed':
2928      pathObj.startAt = this.delayUnit * i;
2929      pathObj.duration = this.duration - this.delay;
2930      break;
2931
2932    case 'oneByOne':
2933      pathObj.startAt = lengthMeter / totalLength * this.duration;
2934      pathObj.duration = pathObj.length / totalLength * this.duration;
2935      break;
2936
2937    case 'sync':
2938    case 'async':
2939    case 'nsync':
2940      pathObj.startAt = 0;
2941      pathObj.duration = this.duration;
2942      break;
2943
2944    case 'scenario-sync':
2945      path = pathObj.el;
2946      pAttrs = this.parseAttr(path);
2947      pathObj.startAt = timePoint + (parsePositiveInt(pAttrs['data-delay'], this.delayUnit) || 0);
2948      pathObj.duration = parsePositiveInt(pAttrs['data-duration'], this.duration);
2949      timePoint = pAttrs['data-async'] !== undefined ? pathObj.startAt : pathObj.startAt + pathObj.duration;
2950      this.frameLength = Math.max(this.frameLength, (pathObj.startAt + pathObj.duration));
2951      break;
2952
2953    case 'scenario':
2954      path = pathObj.el;
2955      pAttrs = this.parseAttr(path);
2956      pathObj.startAt = parsePositiveInt(pAttrs['data-start'], this.delayUnit) || 0;
2957      pathObj.duration = parsePositiveInt(pAttrs['data-duration'], this.duration);
2958      this.frameLength = Math.max(this.frameLength, (pathObj.startAt + pathObj.duration));
2959      break;
2960    }
2961    lengthMeter += pathObj.length;
2962    this.frameLength = this.frameLength || this.duration;
2963  }
2964};
2965
2966/**
2967 * Interval method to draw the SVG from current
2968 * position of the animation. It update the value of
2969 * `currentFrame` and re-trace the SVG.
2970 *
2971 * It use this.handle to store the requestAnimationFrame
2972 * and clear it one the animation is stopped. So this
2973 * attribute can be used to know if the animation is
2974 * playing.
2975 *
2976 * Once the animation at the end, this method will
2977 * trigger the Vivus callback.
2978 *
2979 */
2980Vivus.prototype.drawer = function () {
2981  var self = this;
2982  this.currentFrame += this.speed;
2983
2984  if (this.currentFrame <= 0) {
2985    this.stop();
2986    this.reset();
2987  } else if (this.currentFrame >= this.frameLength) {
2988    this.stop();
2989    this.currentFrame = this.frameLength;
2990    this.trace();
vendor: 5,092 bytes, lines 2991-3177
2991    if (this.selfDestroy) {
2992      this.destroy();
2993    }
2994  } else {
2995    this.trace();
2996    this.handle = requestAnimFrame(function () {
2997      self.drawer();
2998    });
2999    return;
3000  }
3001
3002  this.callback(this);
3003  if (this.instanceCallback) {
3004    this.instanceCallback(this);
3005    this.instanceCallback = null;
3006  }
3007};
3008
3009/**
3010 * Draw the SVG at the current instant from the
3011 * `currentFrame` value. Here is where most of the magic is.
3012 * The trick is to use the `strokeDashoffset` style property.
3013 *
3014 * For optimisation reasons, a new property called `progress`
3015 * is added in each item of `map`. This one contain the current
3016 * progress of the path element. Only if the new value is different
3017 * the new value will be applied to the DOM element. This
3018 * method save a lot of resources to re-render the SVG. And could
3019 * be improved if the animation couldn't be played forward.
3020 *
3021 */
3022Vivus.prototype.trace = function () {
3023  var i, progress, path, currentFrame;
3024  currentFrame = this.animTimingFunction(this.currentFrame / this.frameLength) * this.frameLength;
3025  for (i = 0; i < this.map.length; i++) {
3026    path = this.map[i];
3027    progress = (currentFrame - path.startAt) / path.duration;
3028    progress = this.pathTimingFunction(Math.max(0, Math.min(1, progress)));
3029    if (path.progress !== progress) {
3030      path.progress = progress;
3031      path.el.style.strokeDashoffset = Math.floor(path.length * (1 - progress));
3032      this.renderPath(i);
3033    }
3034  }
3035};
3036
3037/**
3038 * Method forcing the browser to re-render a path element
3039 * from it's index in the map. Depending on the `forceRender`
3040 * value.
3041 * The trick is to replace the path element by it's clone.
3042 * This practice is not recommended because it's asking more
3043 * ressources, too much DOM manupulation..
3044 * but it's the only way to let the magic happen on IE.
3045 * By default, this fallback is only applied on IE.
3046 *
3047 * @param  {Number} index Path index
3048 */
3049Vivus.prototype.renderPath = function (index) {
3050  if (this.forceRender && this.map && this.map[index]) {
3051    var pathObj = this.map[index],
3052        newPath = pathObj.el.cloneNode(true);
3053    pathObj.el.parentNode.replaceChild(newPath, pathObj.el);
3054    pathObj.el = newPath;
3055  }
3056};
3057
3058/**
3059 * When the SVG object is loaded and ready,
3060 * this method will continue the initialisation.
3061 *
3062 * This this mainly due to the case of passing an
3063 * object tag in the constructor. It will wait
3064 * the end of the loading to initialise.
3065 *
3066 */
3067Vivus.prototype.init = function () {
3068  // Set object variables
3069  this.frameLength = 0;
3070  this.currentFrame = 0;
3071  this.map = [];
3072
3073  // Start
3074  new Pathformer(this.el);
3075  this.mapping();
3076  this.starter();
3077
3078  if (this.onReady) {
3079    this.onReady(this);
3080  }
3081};
3082
3083/**
3084 * Trigger to start of the animation.
3085 * Depending on the `start` value, a different script
3086 * will be applied.
3087 *
3088 * If the `start` value is not valid, an error will be thrown.
3089 * Even if technically, this is impossible.
3090 *
3091 */
3092Vivus.prototype.starter = function () {
3093  switch (this.start) {
3094  case 'manual':
3095    return;
3096
3097  case 'autostart':
3098    this.play();
3099    break;
3100
3101  case 'inViewport':
3102    var self = this,
3103    listener = function () {
3104      if (self.isInViewport(self.parentEl, 1)) {
3105        self.play();
3106        window.removeEventListener('scroll', listener);
3107        //Uncode addition
3108        window.removeEventListener('fp-slide-changed', listener);
3109        window.removeEventListener('fp-slide-scroll', listener);
3110        //#END
3111      }
3112    };
3113    window.addEventListener('scroll', listener);
3114    //Uncode addition
3115    window.addEventListener('fp-slide-changed', listener);
3116    window.addEventListener('fp-slide-scroll', listener);
3117    //#END
3118    listener();
3119    break;
3120  }
3121};
3122
3123
3124/**
3125 * Controls
3126 **************************************
3127 */
3128
3129/**
3130 * Get the current status of the animation between
3131 * three different states: 'start', 'progress', 'end'.
3132 * @return {string} Instance status
3133 */
3134Vivus.prototype.getStatus = function () {
3135  return this.currentFrame === 0 ? 'start' : this.currentFrame === this.frameLength ? 'end' : 'progress';
3136};
3137
3138/**
3139 * Reset the instance to the initial state : undraw
3140 * Be careful, it just reset the animation, if you're
3141 * playing the animation, this won't stop it. But just
3142 * make it start from start.
3143 *
3144 */
3145Vivus.prototype.reset = function () {
3146  return this.setFrameProgress(0);
3147};
3148
3149/**
3150 * Set the instance to the final state : drawn
3151 * Be careful, it just set the animation, if you're
3152 * playing the animation on rewind, this won't stop it.
3153 * But just make it start from the end.
3154 *
3155 */
3156Vivus.prototype.finish = function () {
3157  return this.setFrameProgress(1);
3158};
3159
3160/**
3161 * Set the level of progress of the drawing.
3162 *
3163 * @param {number} progress Level of progress to set
3164 */
3165Vivus.prototype.setFrameProgress = function (progress) {
3166  progress = Math.min(1, Math.max(0, progress));
3167  this.currentFrame = Math.round(this.frameLength * progress);
3168  this.trace();
3169  return this;
3170};
3171
3172/**
3173 * Play the animation at the desired speed.
3174 * Speed must be a valid number (no zero).
3175 * By default, the speed value is 1.
3176 * But a negative value is accepted to go forward.
3177 *
3178 * And works with float too.
3179 * But don't forget we are in JavaScript, se be nice
3180 * with him and give him a 1/2^x value.
3181 *
3182 * @param  {number} speed Animation speed [optional]
3183 */
3184Vivus.prototype.play = function (speed, callback) {
3185  this.instanceCallback = null;
3186
3187  if (speed && typeof speed === 'function') {
3188    this.instanceCallback = speed; // first parameter is actually the callback function
3189    speed = null;
3190  }
3191  else if (speed && typeof speed !== 'number') {
3192    throw new Error('Vivus [play]: invalid speed');
3193  }
3194  // if the first parameter wasn't the callback, check if the seconds was
3195  if (callback && typeof(callback) === 'function' && !this.instanceCallback) {
3196    this.instanceCallback = callback;
3197  }
3198
3199
3200  this.speed = speed || 1;
3201  //Uncode addition
3202  if (!this.handle) {
3203    var $this = this,
3204    delay = (this.delayStart != null) ? this.delayStart : 0;
3205    setTimeout(function() {
3206      $this.drawer();
3207    }, delay);
3208  }
3209  //#END
3210  return this;
3211};
3212
3213/**
3214 * Stop the current animation, if on progress.
3215 * Should not trigger any error.
3216 *
3217 */
3218Vivus.prototype.stop = function () {
3219  if (this.handle) {
3220    cancelAnimFrame(this.handle);
3221    this.handle = null;
3222  }
3223  return this;
3224};
3225
3226/**
3227 * Destroy the instance.
3228 * Remove all bad styling attributes on all
3229 * path tags
3230 *
3231 */
3232Vivus.prototype.destroy = function () {
3233  this.stop();
3234  var i, path;
3235  for (i = 0; i < this.map.length; i++) {
3236    path = this.map[i];
3237    path.el.style.strokeDashoffset = null;
3238    path.el.style.strokeDasharray = null;
3239    this.renderPath(i);
3240  }
3241};
3242
3243
3244/**
3245 * Utils methods
3246 * include methods from Codrops
3247 **************************************
3248 */
3249
3250/**
3251 * Method to best guess if a path should added into
3252 * the animation or not.
3253 *
3254 * 1. Use the `data-vivus-ignore` attribute if set
3255 * 2. Check if the instance must ignore invisible paths
3256 * 3. Check if the path is visible
3257 *
3258 * For now the visibility checking is unstable.
3259 * It will be used for a beta phase.
3260 *
3261 * Other improvments are planned. Like detecting
3262 * is the path got a stroke or a valid opacity.
3263 */
3264Vivus.prototype.isInvisible = function (el) {
3265  var rect,
3266    ignoreAttr = el.getAttribute('data-ignore');
3267
3268  if (ignoreAttr !== null) {
3269    return ignoreAttr !== 'false';
3270  }
3271
3272  if (this.ignoreInvisible) {
3273    rect = el.getBoundingClientRect();
3274    return !rect.width && !rect.height;
3275  }
3276  else {
3277    return false;
3278  }
3279};
3280
3281/**
3282 * Parse attributes of a DOM element to
3283 * get an object of {attributeName => attributeValue}
3284 *
3285 * @param  {object} element DOM element to parse
3286 * @return {object}         Object of attributes
3287 */
3288Vivus.prototype.parseAttr = function (element) {
3289  var attr, output = {};
3290  if (element && element.attributes) {
3291    for (var i = 0; i < element.attributes.length; i++) {
3292      attr = element.attributes[i];
3293      output[attr.name] = attr.value;
3294    }
3295  }
3296  return output;
3297};
3298
3299/**
3300 * Reply if an element is in the page viewport
3301 *
3302 * @param  {object} el Element to observe
3303 * @param  {number} h  Percentage of height
3304 * @return {boolean}
3305 */
3306Vivus.prototype.isInViewport = function (el, h) {
3307  var scrolled   = this.scrollY(),
3308    viewed       = scrolled + this.getViewportH(),
3309    elBCR        = el.getBoundingClientRect(),
3310    elHeight     = elBCR.height,
3311    elTop        = scrolled + elBCR.top,
3312    elBottom     = elTop + elHeight;
3313
3314  // if 0, the element is considered in the viewport as soon as it enters.
3315  // if 1, the element is considered in the viewport only when it's fully inside
3316  // value in percentage (1 >= h >= 0)
3317  h = h || 0;
3318
3319  return (elTop + elHeight * h) <= viewed && (elBottom) >= scrolled;
3320};
3321
3322
3323/**
3324 * Get the viewport height in pixels
3325 *
3326 * @return {integer} Viewport height
3327 */
3328Vivus.prototype.getViewportH = function () {
3329  var client = this.docElem.clientHeight,
3330    inner = window.innerHeight;
3331
3332  if (client < inner) {
3333    return inner;
3334  }
3335  else {
3336    return client;
3337  }
3338};
3339
3340/**
3341 * Get the page Y offset
3342 *
3343 * @return {integer} Page Y offset
3344 */
3345Vivus.prototype.scrollY = function () {
3346  return window.pageYOffset || this.docElem.scrollTop;
3347};
3348
3349setupEnv = function () {
3350
3351  if (Vivus.prototype.docElem) {
3352    return;
3353  }
3354
3355  /**
3356   * Alias for document element
3357   *
3358   * @type {DOMelement}
3359   */
3360  Vivus.prototype.docElem = window.document.documentElement;
3361
3362  /**
3363   * Alias for `requestAnimationFrame` or
3364   * `setTimeout` function for deprecated browsers.
3365   *
3366   */
3367  requestAnimFrame = (function () {
3368    return (
3369      window.requestAnimationFrame       ||
3370      window.webkitRequestAnimationFrame ||
3371      window.mozRequestAnimationFrame    ||
3372      window.oRequestAnimationFrame      ||
3373      window.msRequestAnimationFrame     ||
3374      function(/* function */ callback){
3375        return window.setTimeout(callback, 1000 / 60);
3376      }
3377    );
3378  })();
3379
3380  /**
3381   * Alias for `cancelAnimationFrame` or
3382   * `cancelTimeout` function for deprecated browsers.
3383   *
3384   */
3385  cancelAnimFrame = (function () {
3386    return (
3387      window.cancelAnimationFrame       ||
3388      window.webkitCancelAnimationFrame ||
3389      window.mozCancelAnimationFrame    ||
3390      window.oCancelAnimationFrame      ||
3391      window.msCancelAnimationFrame     ||
3392      function(id){
3393        return window.clearTimeout(id);
3394      }
3395    );
3396  })();
3397};
3398
3399/**
3400 * Parse string to integer.
3401 * If the number is not positive or null
3402 * the method will return the default value
3403 * or 0 if undefined
3404 *
3405 * @param {string} value String to parse
3406 * @param {*}
3406 defaultValue Value to return if the result parsed is invalid
3407 * @return {number}
3408 *
3409 */
3410parsePositiveInt = function (value, defaultValue) {
3411  var output = parseInt(value, 10);
3412  return (output >= 0) ? output : defaultValue;
3413};
3414
3415
3416  if (typeof define === 'function' && define.amd) {
3417    // AMD. Register as an anonymous module.
3418    define([], function() {
3419      return Vivus;
3420    });
3421  } else if (typeof exports === 'object') {
3422    // Node. Does not work with strict CommonJS, but
3423    // only CommonJS-like environments that support module.exports,
3424    // like Node.
3425    module.exports = Vivus;
3426  } else {
3427    // Browser globals
3428    window.Vivus = Vivus;
3429  }
3430
3431}());
3432
3433(function(global){var startY=0;var enabled=false;var supportsPassiveOption=false;try{var opts=Object.defineProperty({},"passive",{get:function(){supportsPassiveOption=true}});window.addEventListener("test",null,opts)}catch(e){}var handleTouchmove=function(evt){var el=evt.target;while(el!==document.body&&el!==document){var style=window.getComputedStyle(el);if(!style){break}if(el.nodeName==="INPUT"&&el.getAttribute("type")==="range"){return}var scrolling=style.getPropertyValue("-webkit-overflow-scrolling");var overflowY=style.getPropertyValue("overflow-y");var height=parseInt(style.getPropertyValue("height"),10);var isScrollable=scrolling==="touch"&&(overflowY==="auto"||overflowY==="scroll");var canScroll=el.scrollHeight>el.offsetHeight;if(isScrollable&&canScroll){var curY=evt.touches?evt.touches[0].screenY:evt.screenY;var isAtTop=startY<=curY&&el.scrollTop===0;var isAtBottom=startY>=curY&&el.scrollHeight-el.scrollTop===height;if(isAtTop||isAtBottom){evt.preventDefault()}return}el=el.parentNode}evt.preventDefault()};var handleTouchstart=function(evt){startY=evt.touches?evt.touches[0].screenY:evt.screenY};var enable=function(){window.addEventListener("touchstart",handleTouchstart,supportsPassiveOption?{passive:false}:false);window.addEventListener("touchmove",handleTouchmove,supportsPassiveOption?{passive:false}:false);enabled=true};var disable=function(){window.removeEventListener("touchstart",handleTouchstart,false);window.removeEventListener("touchmove",handleTouchmove,false);enabled=false};var isEnabled=function(){return enabled};var testDiv=document.createElement("div");document.documentElement.appendChild(testDiv);testDiv.style.WebkitOverflowScrolling="touch";var scrollSupport="getComputedStyle"in window&&window.getComputedStyle(testDiv)["-webkit-overflow-scrolling"]==="touch";document.documentElement.removeChild(testDiv);if(scrollSupport){enable()}var iNoBounce={enable:enable,disable:disable,isEnabled:isEnabled};if(typeof module!=="undefined"&&module.exports){module.exports=iNoBounce}if(typeof global.define==="function"){(function(define){define("iNoBounce",[],function(){return iNoBounce})})(global.define)}else{global.iNoBounce=iNoBounce}})(this);
3434iNoBounce.disable();

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.