// source --> https://www.subterfuge.com/wp-content/plugins/cookie-law-info/legacy/public/js/cookie-law-info-public.js?ver=3.5.3 
var CLI_ACCEPT_COOKIE_NAME = (typeof CLI_ACCEPT_COOKIE_NAME !== 'undefined' ? CLI_ACCEPT_COOKIE_NAME : 'viewed_cookie_policy');
var CLI_PREFERENCE_COOKIE = (typeof CLI_PREFERENCE_COOKIE !== 'undefined' ? CLI_PREFERENCE_COOKIE : 'CookieLawInfoConsent');
var CLI_ACCEPT_COOKIE_EXPIRE = (typeof CLI_ACCEPT_COOKIE_EXPIRE !== 'undefined' ? CLI_ACCEPT_COOKIE_EXPIRE : 365);
var CLI_COOKIEBAR_AS_POPUP = (typeof CLI_COOKIEBAR_AS_POPUP !== 'undefined' ? CLI_COOKIEBAR_AS_POPUP : false);
var CLI_Cookie = {
	set: function (name, value, days) {
		var secure = "";
		if (true === Boolean(Cli_Data.secure_cookies)) {
			secure = ";secure";
		}
		if (days) {
			var date = new Date();
			date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
			var expires = "; expires=" + date.toGMTString();
		} else {
			var expires = "";
		}
		document.cookie = name + "=" + value + secure + expires + "; path=/";
		if (days < 1) {
			let host_name = window.location.hostname;
			document.cookie = name + "=" + value + expires + "; path=/; domain=." + host_name + ";";
			if (host_name.indexOf("www") != 1) {
				var host_name_withoutwww = host_name.replace('www', '');
				document.cookie = name + "=" + value + secure + expires + "; path=/; domain=" + host_name_withoutwww + ";";
			}
			host_name = host_name.substring(host_name.lastIndexOf(".", host_name.lastIndexOf(".") - 1));
			document.cookie = name + "=" + value + secure + expires + "; path=/; domain=" + host_name + ";";
		}
	},
	read: function (name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for (var i = 0; i < ca.length; i++) {
			var c = ca[i];
			while (c.charAt(0) == ' ') {
				c = c.substring(1, c.length);
			}
			if (c.indexOf(nameEQ) === 0) {
				return c.substring(nameEQ.length, c.length);
			}
		}
		return null;
	},
	erase: function (name) {
		this.set(name, "", -10);
	},
	exists: function (name) {
		return (this.read(name) !== null);
	},
	getallcookies: function () {
		var pairs = document.cookie.split(";");
		var cookieslist = {};
		for (var i = 0; i < pairs.length; i++) {
			var pair = pairs[i].split("=");
			cookieslist[(pair[0] + '').trim()] = unescape(pair[1]);
		}
		return cookieslist;
	}
}
var CLI =
{
	bar_config: {},
	showagain_config: {},
	allowedCategories: [],
	js_blocking_enabled: false,
	set: function (args) {
		if (typeof JSON.parse !== "function") {
			console.log("CookieLawInfo requires JSON.parse but your browser doesn't support it");
			return;
		}
		if (typeof args.settings !== 'object') {
			this.settings = JSON.parse(args.settings);
		} else {
			this.settings = args.settings;
		}
		this.js_blocking_enabled = Boolean(Cli_Data.js_blocking);
		this.settings = args.settings;
		this.bar_elm = jQuery(this.settings.notify_div_id);
		this.showagain_elm = jQuery(this.settings.showagain_div_id);
		this.settingsModal = jQuery('#cliSettingsPopup');

		/* buttons */
		this.main_button = jQuery('.cli-plugin-main-button');
		this.main_link = jQuery('.cli-plugin-main-link');
		this.reject_link = jQuery('.cookie_action_close_header_reject');
		this.delete_link = jQuery(".cookielawinfo-cookie-delete");
		this.settings_button = jQuery('.cli_settings_button');
		this.accept_all_button = jQuery('.wt-cli-accept-all-btn');
		if (this.settings.cookie_bar_as == 'popup') {
			CLI_COOKIEBAR_AS_POPUP = true;
		}
		this.mayBeSetPreferenceCookie();
		this.addStyleAttribute();
		this.configBar();
		this.toggleBar();
		this.attachDelete();
		this.attachEvents();
		this.configButtons();
		this.reviewConsent();
		var cli_hidebar_on_readmore = this.hideBarInReadMoreLink();
		if (Boolean(this.settings.scroll_close) === true && cli_hidebar_on_readmore === false) {
			window.addEventListener("scroll", CLI.closeOnScroll, false);
		}

	},
	hideBarInReadMoreLink: function () {
		if (Boolean(CLI.settings.button_2_hidebar) === true && this.main_link.length > 0 && this.main_link.hasClass('cli-minimize-bar')) {
			this.hideHeader();
			cliBlocker.cookieBar(false);
			this.showagain_elm.slideDown(this.settings.animate_speed_show);
			return true;
		}
		return false;
	},
	attachEvents: function () {
		jQuery(document).on(
			'click',
			'.wt-cli-privacy-btn',
			function (e) {
				e.preventDefault();
				CLI.accept_close();
				CLI.settingsPopUpClose();
			}
		);

		jQuery('.wt-cli-accept-btn').on(
			"click",
			function (e) {
				e.preventDefault();
				CLI.acceptRejectCookies(jQuery(this));
			});
		jQuery('.wt-cli-accept-all-btn').on(
			"click",
			function (e) {
				e.preventDefault();
				CLI.acceptRejectCookies(jQuery(this), 'accept');
			});
		jQuery('.wt-cli-reject-btn').on(
			"click",
			function (e) {
				e.preventDefault();
				CLI.acceptRejectCookies(jQuery(this), 'reject');
			});
		this.settingsPopUp();
		this.settingsTabbedAccordion();
		this.toggleUserPreferenceCheckBox();
		this.hideCookieBarOnClose();
		this.cookieLawInfoRunCallBacks();

	},
	acceptRejectCookies(element, action = 'custom') {
		var open_link = element[0].hasAttribute("href") && element.attr("href") != '#' ? true : false;
		var new_window = false;
		if (action == 'accept') {
			this.enableAllCookies();
			this.accept_close();
			new_window = CLI.settings.button_7_new_win ? true : false;

		} else if (action == 'reject') {
			this.disableAllCookies();
			this.reject_close();
			new_window = Boolean(this.settings.button_3_new_win) ? true : false;
		} else {
			this.accept_close();
			new_window = Boolean(this.settings.button_1_new_win) ? true : false;
		}
		if (open_link) {
			if (new_window) {
				window.open(element.attr("href"), '_blank');
			} else {
				window.location.href = element.attr("href");
			}
		}
	},
	toggleUserPreferenceCheckBox: function () {

		jQuery('.cli-user-preference-checkbox').each(
			function () {

				const categoryCookie = 'cookielawinfo-' + jQuery(this).attr('data-id');
				const categoryCookieValue = CLI_Cookie.read(categoryCookie);
				if (categoryCookieValue == null) {
					if (jQuery(this).is(':checked')) {
						CLI_Cookie.set(categoryCookie, 'yes', CLI_ACCEPT_COOKIE_EXPIRE);
					} else {
						CLI_Cookie.set(categoryCookie, 'no', CLI_ACCEPT_COOKIE_EXPIRE);
					}
				} else {
					if (categoryCookieValue == "yes") {
						jQuery(this).prop("checked", true);
					} else {
						jQuery(this).prop("checked", false);
					}

				}

			}
		);
		jQuery('.cli-user-preference-checkbox').on(
			"click",
			function (e) {
				var dataID = jQuery(this).attr('data-id');
				var currentToggleElm = jQuery('.cli-user-preference-checkbox[data-id=' + dataID + ']');
				if (jQuery(this).is(':checked')) {
					CLI_Cookie.set('cookielawinfo-' + dataID, 'yes', CLI_ACCEPT_COOKIE_EXPIRE);
					currentToggleElm.prop('checked', true);
				} else {
					CLI_Cookie.set('cookielawinfo-' + dataID, 'no', CLI_ACCEPT_COOKIE_EXPIRE);
					currentToggleElm.prop('checked', false);
				}
				CLI.checkCategories();
				CLI.generateConsent();
			}
		);

	},
	settingsPopUp: function () {
		jQuery(document).on(
			'click',
			'.cli_settings_button',
			function (e) {
				e.preventDefault();
				CLI.settingsModal.addClass("cli-show").css({ 'opacity': 0 }).animate({ 'opacity': 1 });
				CLI.settingsModal.removeClass('cli-blowup cli-out').addClass("cli-blowup");
				jQuery('body').addClass("cli-modal-open");
				jQuery(".cli-settings-overlay").addClass("cli-show");
				jQuery("#cookie-law-info-bar").css({ 'opacity': .1 });
				if (!jQuery('.cli-settings-mobile').is(':visible')) {
					CLI.settingsModal.find('.cli-nav-link:eq(0)').trigger("click");
				}
			}
		);
		jQuery('#cliModalClose').on(
			"click",
			function (e) {
				CLI.settingsPopUpClose();
			}
		);
		CLI.settingsModal.on(
			"click",
			function (e) {
				if (!(document.getElementsByClassName('cli-modal-dialog')[0].contains(e.target))) {
					CLI.settingsPopUpClose();
				}
			}
		);
		jQuery('.cli_enable_all_btn').on(
			"click",
			function (e) {
				var cli_toggle_btn = jQuery(this);
				var enable_text = cli_toggle_btn.attr('data-enable-text');
				var disable_text = cli_toggle_btn.attr('data-disable-text');
				if (cli_toggle_btn.hasClass('cli-enabled')) {
					CLI.disableAllCookies();
					cli_toggle_btn.html(enable_text);
				} else {
					CLI.enableAllCookies();
					cli_toggle_btn.html(disable_text);

				}
				jQuery(this).toggleClass('cli-enabled');
			}
		);

		this.privacyReadmore();
	},
	settingsTabbedAccordion: function () {
		jQuery(".cli-tab-header").on(
			"click",
			function (e) {
				if (!(jQuery(e.target).hasClass('cli-slider') || jQuery(e.target).hasClass('cli-user-preference-checkbox'))) {
					if (jQuery(this).hasClass("cli-tab-active")) {
						jQuery(this).removeClass("cli-tab-active");
						jQuery(this)
							.siblings(".cli-tab-content")
							.slideUp(200);

					} else {
						jQuery(".cli-tab-header").removeClass("cli-tab-active");
						jQuery(this).addClass("cli-tab-active");
						jQuery(".cli-tab-content").slideUp(200);
						jQuery(this)
							.siblings(".cli-tab-content")
							.slideDown(200);
					}
				}
			}
		);
	},
	settingsPopUpClose: function () {
		this.settingsModal.removeClass('cli-show');
		this.settingsModal.addClass('cli-out');
		jQuery('body').removeClass("cli-modal-open");
		jQuery(".cli-settings-overlay").removeClass("cli-show");
		jQuery("#cookie-law-info-bar").css({ 'opacity': 1 });
	},
	privacyReadmore: function () {
		var el = jQuery('.cli-privacy-content .cli-privacy-content-text');
		if (el.length > 0) {
			var clone = el.clone(),
				originalHtml = clone.html(),
				originalHeight = el.outerHeight(),
				Trunc = {
					addReadmore: function (textBlock) {
						if (textBlock.html().length > 250) {
							jQuery('.cli-privacy-readmore').show();
						} else {
							jQuery('.cli-privacy-readmore').hide();
						}
					},
					truncateText: function (textBlock) {
						var strippedText = jQuery('<div />').html(textBlock.html());
						strippedText.find('table').remove();
						textBlock.html(strippedText.html());
						const currentText = textBlock.text();
						if (currentText.trim().length > 250) {
							var newStr = currentText.substring(0, 250);
							textBlock.empty().html(newStr).append('...');
						}
					},
					replaceText: function (textBlock, original) {
						return textBlock.html(original);
					}

				};
			Trunc.addReadmore(el);
			Trunc.truncateText(el);
			jQuery('a.cli-privacy-readmore').on(
				"click",
				function (e) {
					e.preventDefault();
					if (jQuery('.cli-privacy-overview').hasClass('cli-collapsed')) {
						Trunc.truncateText(el);
						jQuery('.cli-privacy-overview').removeClass('cli-collapsed');
						el.css('height', '100%');
					} else {
						jQuery('.cli-privacy-overview').addClass('cli-collapsed');
						Trunc.replaceText(el, originalHtml);
					}

				}
			);
		}

	},
	attachDelete: function () {
		this.delete_link.on(
			"click",
			function (e) {
				CLI_Cookie.erase(CLI_ACCEPT_COOKIE_NAME);
				for (var k in Cli_Data.nn_cookie_ids) {
					CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]);
				}
				CLI.generateConsent();
				return false;
			}
		);

	},
	configButtons: function () {
		/*[cookie_button] */
		this.main_button.css('color', this.settings.button_1_link_colour);
		if (Boolean(this.settings.button_1_as_button)) {
			this.main_button.css('background-color', this.settings.button_1_button_colour);

			this.main_button.on(
				'mouseenter',
				function () {
					jQuery(this).css('background-color', CLI.settings.button_1_button_hover);
				}
			)
				.on(
					'mouseleave',
					function () {
						jQuery(this).css('background-color', CLI.settings.button_1_button_colour);
					}
				);
		}

		/* [cookie_link] */
		this.main_link.css('color', this.settings.button_2_link_colour);
		if (Boolean(this.settings.button_2_as_button)) {
			this.main_link.css('background-color', this.settings.button_2_button_colour);

			this.main_link.on(
				'mouseenter',
				function () {
					jQuery(this).css('background-color', CLI.settings.button_2_button_hover);
				}
			)
				.on(
					'mouseleave',
					function () {
						jQuery(this).css('background-color', CLI.settings.button_2_button_colour);
					}
				);

		}
		/* [cookie_reject] */
		this.reject_link.css('color', this.settings.button_3_link_colour);
		if (Boolean(this.settings.button_3_as_button)) {

			this.reject_link.css('background-color', this.settings.button_3_button_colour);
			this.reject_link.on(
				'mouseenter',
				function () {
					jQuery(this).css('background-color', CLI.settings.button_3_button_hover);
				}
			)
				.on(
					'mouseleave',
					function () {
						jQuery(this).css('background-color', CLI.settings.button_3_button_colour);
					}
				);
		}
		/* [cookie_settings] */
		this.settings_button.css('color', this.settings.button_4_link_colour);
		if (Boolean(this.settings.button_4_as_button)) {
			this.settings_button.css('background-color', this.settings.button_4_button_colour);
			this.settings_button.on(
				'mouseenter',
				function () {
					jQuery(this).css('background-color', CLI.settings.button_4_button_hover);
				}
			)
				.on(
					'mouseleave',
					function () {
						jQuery(this).css('background-color', CLI.settings.button_4_button_colour);
					}
				);
		}
		/* [cookie_accept_all] */
		this.accept_all_button.css('color', this.settings.button_7_link_colour);
		if (this.settings.button_7_as_button) {
			this.accept_all_button.css('background-color', this.settings.button_7_button_colour);
			this.accept_all_button.on(
				'mouseenter',
				function () {
					jQuery(this).css('background-color', CLI.settings.button_7_button_hover);
				}
			)
				.on(
					'mouseleave',
					function () {
						jQuery(this).css('background-color', CLI.settings.button_7_button_colour);
					}
				);
		}
	},
	toggleBar: function () {
		if (CLI_COOKIEBAR_AS_POPUP) {
			this.barAsPopUp(1);
		}
		if (CLI.settings.cookie_bar_as == 'widget') {
			this.barAsWidget(1);
		}
		if (!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) {
			this.displayHeader();
		} else {
			this.hideHeader();
		}
		if (Boolean(this.settings.show_once_yn)) {
			setTimeout(
				function () {
					CLI.close_header();
				},
				CLI.settings.show_once
			);
		}
		if (CLI.js_blocking_enabled === false) {
			if (Boolean(Cli_Data.ccpaEnabled) === true) {
				if (Cli_Data.ccpaType === 'ccpa' && Boolean(Cli_Data.ccpaBarEnabled) === false) {
					cliBlocker.cookieBar(false);
				}
			} else {
				jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove();
			}
		}

		this.showagain_elm.on(
			"click",
			function (e) {
				e.preventDefault();
				CLI.showagain_elm.slideUp(
					CLI.settings.animate_speed_hide,
					function () {
						CLI.bar_elm.slideDown(CLI.settings.animate_speed_show);
						if (CLI_COOKIEBAR_AS_POPUP) {
							CLI.showPopupOverlay();
						}
					}
				);
			}
		);
	},
	configShowAgain: function () {
		this.showagain_config = {
			'background-color': this.settings.background,
			'color': this.l1hs(this.settings.text),
			'position': 'fixed',
			'font-family': this.settings.font_family
		};
		if (Boolean(this.settings.border_on)) {
			var border_to_hide = 'border-' + this.settings.notify_position_vertical;
			this.showagain_config['border'] = '1px solid ' + this.l1hs(this.settings.border);
			this.showagain_config[border_to_hide] = 'none';
		}
		var cli_win = jQuery(window);
		var cli_winw = cli_win.width();
		var showagain_x_pos = this.settings.showagain_x_position;
		if (cli_winw < 300) {
			showagain_x_pos = 10;
			this.showagain_config.width = cli_winw - 20;
		} else {
			this.showagain_config.width = 'auto';
		}
		var cli_defw = cli_winw > 400 ? 500 : cli_winw - 20;
		if (CLI_COOKIEBAR_AS_POPUP) { /* cookie bar as popup */
			var sa_pos = this.settings.popup_showagain_position;
			var sa_pos_arr = sa_pos.split('-');
			if (sa_pos_arr[1] == 'left') {
				this.showagain_config.left = showagain_x_pos;
			} else if (sa_pos_arr[1] == 'right') {
				this.showagain_config.right = showagain_x_pos;
			}
			if (sa_pos_arr[0] == 'top') {
				this.showagain_config.top = 0;

			} else if (sa_pos_arr[0] == 'bottom') {
				this.showagain_config.bottom = 0;
			}
			this.bar_config['position'] = 'fixed';

		} else if (this.settings.cookie_bar_as == 'widget') {
			this.showagain_config.bottom = 0;
			if (this.settings.widget_position == 'left') {
				this.showagain_config.left = showagain_x_pos;
			} else if (this.settings.widget_position == 'right') {
				this.showagain_config.right = showagain_x_pos;
			}
		} else {
			if (this.settings.notify_position_vertical == "top") {
				this.showagain_config.top = '0';
			} else if (this.settings.notify_position_vertical == "bottom") {
				this.bar_config['position'] = 'fixed';
				this.bar_config['bottom'] = '0';
				this.showagain_config.bottom = '0';
			}
			if (this.settings.notify_position_horizontal == "left") {
				this.showagain_config.left = showagain_x_pos;
			} else if (this.settings.notify_position_horizontal == "right") {
				this.showagain_config.right = showagain_x_pos;
			}
		}
		this.showagain_elm.css(this.showagain_config);
	},
	configBar: function () {
		this.bar_config = {
			'background-color': this.settings.background,
			'color': this.settings.text,
			'font-family': this.settings.font_family
		};
		if (this.settings.notify_position_vertical == "top") {
			this.bar_config['top'] = '0';
			if (Boolean(this.settings.header_fix) === true) {
				this.bar_config['position'] = 'fixed';
			}
		} else {
			this.bar_config['bottom'] = '0';
		}
		this.configShowAgain();
		this.bar_elm.css(this.bar_config).hide();
	},
	l1hs: function (str) {
		if (str.charAt(0) == "#") {
			str = str.substring(1, str.length);
		} else {
			return "#" + str;
		}
		return this.l1hs(str);
	},
	close_header: function () {
		CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME, 'yes', CLI_ACCEPT_COOKIE_EXPIRE);
		this.hideHeader();
	},
	accept_close: function () {
		this.hidePopupOverlay();
		this.generateConsent();
		this.cookieLawInfoRunCallBacks();

		CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME, 'yes', CLI_ACCEPT_COOKIE_EXPIRE);
		if (Boolean(this.settings.notify_animate_hide)) {
			if (CLI.js_blocking_enabled === true) {
				this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts);
			} else {
				this.bar_elm.slideUp(this.settings.animate_speed_hide);
			}

		} else {
			if (CLI.js_blocking_enabled === true) {
				this.bar_elm.hide(0, cliBlocker.runScripts);

			} else {
				this.bar_elm.hide();
			}
		}
		if (Boolean(this.settings.showagain_tab)) {
			this.showagain_elm.slideDown(this.settings.animate_speed_show);
		}
		if (Boolean(this.settings.accept_close_reload) === true) {
			this.reload_current_page();
		}
		return false;
	},
	reject_close: function () {
		this.hidePopupOverlay();
		this.generateConsent();
		this.cookieLawInfoRunCallBacks();
		for (var k in Cli_Data.nn_cookie_ids) {
			CLI_Cookie.erase(Cli_Data.nn_cookie_ids[k]);
		}
		CLI_Cookie.set(CLI_ACCEPT_COOKIE_NAME, 'no', CLI_ACCEPT_COOKIE_EXPIRE);

		if (Boolean(this.settings.notify_animate_hide)) {
			if (CLI.js_blocking_enabled === true) {

				this.bar_elm.slideUp(this.settings.animate_speed_hide, cliBlocker.runScripts);

			} else {

				this.bar_elm.slideUp(this.settings.animate_speed_hide);
			}

		} else {
			if (CLI.js_blocking_enabled === true) {

				this.bar_elm.hide(cliBlocker.runScripts);

			} else {

				this.bar_elm.hide();

			}

		}
		if (Boolean(this.settings.showagain_tab)) {
			this.showagain_elm.slideDown(this.settings.animate_speed_show);
		}
		if (Boolean(this.settings.reject_close_reload) === true) {
			this.reload_current_page();
		}
		return false;
	},
	reload_current_page: function () {

		window.location.reload(true);
	},
	closeOnScroll: function () {
		if (window.pageYOffset > 100 && !CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)) {
			CLI.accept_close();
			if (Boolean(CLI.settings.scroll_close_reload) === true) {
				window.location.reload();
			}
			window.removeEventListener("scroll", CLI.closeOnScroll, false);
		}
	},
	displayHeader: function () {
		if (Boolean(this.settings.notify_animate_show)) {
			this.bar_elm.slideDown(this.settings.animate_speed_show);
		} else {
			this.bar_elm.show();
		}
		this.showagain_elm.hide();
		if (CLI_COOKIEBAR_AS_POPUP) {
			this.showPopupOverlay();
		}
	},
	hideHeader: function () {
		if (Boolean(this.settings.showagain_tab)) {
			if (Boolean(this.settings.notify_animate_show)) {
				this.showagain_elm.slideDown(this.settings.animate_speed_show);
			} else {
				this.showagain_elm.show();
			}
		} else {
			this.showagain_elm.hide();
		}
		this.bar_elm.slideUp(this.settings.animate_speed_show);
		this.hidePopupOverlay();
	},
	hidePopupOverlay: function () {
		jQuery('body').removeClass("cli-barmodal-open");
		jQuery(".cli-popupbar-overlay").removeClass("cli-show");
	},
	showPopupOverlay: function () {
		if (this.bar_elm.length) {
			if (Boolean(this.settings.popup_overlay)) {
				jQuery('body').addClass("cli-barmodal-open");
				jQuery(".cli-popupbar-overlay").addClass("cli-show");
			}
		}

	},
	barAsWidget: function (a) {
		var cli_elm = this.bar_elm;
		cli_elm.attr('data-cli-type', 'widget');
		var cli_win = jQuery(window);
		var cli_winh = cli_win.height() - 40;
		var cli_winw = cli_win.width();
		var cli_defw = cli_winw > 400 ? 300 : cli_winw - 30;
		cli_elm.css(
			{
				'width': cli_defw, 'height': 'auto', 'max-height': cli_winh, 'overflow': 'auto', 'position': 'fixed', 'box-sizing': 'border-box'
			}
		);
		if (this.checkifStyleAttributeExist() === false) {
			cli_elm.css({ 'padding': '25px 15px' });
		}
		if (this.settings.widget_position == 'left') {
			cli_elm.css(
				{
					'left': '15px', 'right': 'auto', 'bottom': '15px', 'top': 'auto'
				}
			);
		} else {
			cli_elm.css(
				{
					'left': 'auto', 'right': '15px', 'bottom': '15px', 'top': 'auto'
				}
			);
		}
		if (a) {
			this.setResize();
		}
	},
	barAsPopUp: function (a) {
		if (typeof cookie_law_info_bar_as_popup === 'function') {
			return false;
		}
		var cli_elm = this.bar_elm;
		cli_elm.attr('data-cli-type', 'popup');
		var cli_win = jQuery(window);
		var cli_winh = cli_win.height() - 40;
		var cli_winw = cli_win.width();
		var cli_defw = cli_winw > 700 ? 500 : cli_winw - 20;

		cli_elm.css(
			{
				'width': cli_defw, 'height': 'auto', 'max-height': cli_winh, 'bottom': '', 'top': '50%', 'left': '50%', 'margin-left': (cli_defw / 2) * -1, 'margin-top': '-100px', 'overflow': 'auto'
			}
		).addClass('cli-bar-popup cli-modal-content');
		if (this.checkifStyleAttributeExist() === false) {
			cli_elm.css({ 'padding': '25px 15px' });
		}
		const cli_h = cli_elm.height();
		cli_elm.css({ 'top': '50%', 'margin-top': ((cli_h / 2) + 30) * -1 });
		setTimeout(
			function () {
				cli_elm.css(
					{
						'bottom': ''
					}
				);
			},
			100
		);
		if (a) {
			this.setResize();
		}
	},
	setResize: function () {
		var resizeTmr = null;
		jQuery(window).resize(
			function () {
				clearTimeout(resizeTmr);
				resizeTmr = setTimeout(
					function () {
						if (CLI_COOKIEBAR_AS_POPUP) {
							CLI.barAsPopUp();
						}
						if (CLI.settings.cookie_bar_as == 'widget') {
							CLI.barAsWidget();
						}
						CLI.configShowAgain();
					},
					500
				);
			}
		);
	},
	enableAllCookies: function () {

		jQuery('.cli-user-preference-checkbox').each(
			function () {
				var cli_chkbox_elm = jQuery(this);
				var cli_chkbox_data_id = cli_chkbox_elm.attr('data-id');
				if (cli_chkbox_data_id != 'checkbox-necessary') {
					cli_chkbox_elm.prop('checked', true);
					CLI_Cookie.set('cookielawinfo-' + cli_chkbox_data_id, 'yes', CLI_ACCEPT_COOKIE_EXPIRE);
				}
			}
		);
	},
	disableAllCookies: function () {
		jQuery('.cli-user-preference-checkbox').each(
			function () {

				var cli_chkbox_elm = jQuery(this);
				var cli_chkbox_data_id = cli_chkbox_elm.attr('data-id');
				const cliCategorySlug = cli_chkbox_data_id.replace('checkbox-', '');
				if (Cli_Data.strictlyEnabled.indexOf(cliCategorySlug) === -1) {
					cli_chkbox_elm.prop('checked', false);
					CLI_Cookie.set('cookielawinfo-' + cli_chkbox_data_id, 'no', CLI_ACCEPT_COOKIE_EXPIRE);
				}
			}
		);
	},
	hideCookieBarOnClose: function () {
		jQuery(document).on(
			'click',
			'.cli_cookie_close_button',
			function (e) {
				e.preventDefault();
				var elm = jQuery(this);
				if (Cli_Data.ccpaType === 'ccpa') {
					CLI.enableAllCookies();
				}
				CLI.accept_close();
			}
		);
	},
	checkCategories: function () {
		var cliAllowedCategories = [];
		var cli_categories = {};
		jQuery('.cli-user-preference-checkbox').each(
			function () {
				var status = false;
				const cli_chkbox_elm = jQuery(this);
				let cli_chkbox_data_id = cli_chkbox_elm.attr('data-id');
				cli_chkbox_data_id = cli_chkbox_data_id.replace('checkbox-', '');
				const cli_chkbox_data_id_trimmed = cli_chkbox_data_id.replace('-', '_')
				if (jQuery(cli_chkbox_elm).is(':checked')) {
					status = true;
					cliAllowedCategories.push(cli_chkbox_data_id);
				}

				cli_categories[cli_chkbox_data_id_trimmed] = status;
			}
		);
		CLI.allowedCategories = cliAllowedCategories;
	},
	cookieLawInfoRunCallBacks: function () {
		this.checkCategories();
		if (CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == 'yes') {
			if ("function" == typeof CookieLawInfo_Accept_Callback) {
				CookieLawInfo_Accept_Callback();
			}
		}
	},
	generateConsent: function () {
		var preferenceCookie = CLI_Cookie.read(CLI_PREFERENCE_COOKIE);
		let cliConsent = {};
		if (preferenceCookie !== null) {
			cliConsent = window.atob(preferenceCookie);
			cliConsent = JSON.parse(cliConsent);
		}
		cliConsent.ver = Cli_Data.consentVersion;
		jQuery('.cli-user-preference-checkbox').each(
			function () {
				let categoryVal = '';
				let cli_chkbox_data_id = jQuery(this).attr('data-id');
				cli_chkbox_data_id = cli_chkbox_data_id.replace('checkbox-', '');
				if (jQuery(this).is(':checked')) {
					categoryVal = true;
				} else {
					categoryVal = false;
				}
				cliConsent[cli_chkbox_data_id] = categoryVal;
			}
		);
		cliConsent = JSON.stringify(cliConsent);
		cliConsent = window.btoa(cliConsent);
		CLI_Cookie.set(CLI_PREFERENCE_COOKIE, cliConsent, CLI_ACCEPT_COOKIE_EXPIRE);
	},
	addStyleAttribute: function () {
		var bar = this.bar_elm;
		var styleClass = '';
		if (jQuery(bar).find('.cli-bar-container').length > 0) {
			styleClass = jQuery('.cli-bar-container').attr('class');
			styleClass = styleClass.replace('cli-bar-container', '');
			styleClass = styleClass.trim();
			jQuery(bar).attr('data-cli-style', styleClass);
		}
	},
	getParameterByName: function (name, url) {
		if (!url) {
			url = window.location.href;
		}
		name = name.replace(/[\[\]]/g, '\\$&');
		var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
			results = regex.exec(url);
		if (!results) {
			return null;
		}
		if (!results[2]) {
			return '';
		}
		return decodeURIComponent(results[2].replace(/\+/g, ' '));
	},
	CookieLawInfo_Callback: function (enableBar, enableBlocking) {
		enableBar = typeof enableBar !== 'undefined' ? enableBar : true;
		enableBlocking = typeof enableBlocking !== 'undefined' ? enableBlocking : true;
		if (CLI.js_blocking_enabled === true && Boolean(Cli_Data.custom_integration) === true) {
			cliBlocker.cookieBar(enableBar);
			cliBlocker.runScripts(enableBlocking);
		}
	},
	checkifStyleAttributeExist: function () {
		var exist = false;
		var attr = this.bar_elm.attr('data-cli-style');
		if (typeof attr !== typeof undefined && attr !== false) {
			exist = true;
		}
		return exist;
	},
	reviewConsent: function () {
		jQuery(document).on(
			'click',
			'.cli_manage_current_consent,.wt-cli-manage-consent-link',
			function () {
				CLI.displayHeader();
			}
		);
	},
	mayBeSetPreferenceCookie: function () {
		if (CLI.getParameterByName('cli_bypass') === "1") {
			CLI.generateConsent();
		}
	}
}
var cliBlocker =
{
	blockingStatus: true,
	scriptsLoaded: false,
	ccpaEnabled: false,
	ccpaRegionBased: false,
	ccpaApplicable: false,
	ccpaBarEnabled: false,
	cliShowBar: true,
	isBypassEnabled: CLI.getParameterByName('cli_bypass'),
	checkPluginStatus: function (callbackA, callbackB) {
		this.ccpaEnabled = Boolean(Cli_Data.ccpaEnabled);
		this.ccpaRegionBased = Boolean(Cli_Data.ccpaRegionBased);
		this.ccpaBarEnabled = Boolean(Cli_Data.ccpaBarEnabled);

		if (Boolean(Cli_Data.custom_integration) === true) {
			callbackA(false);
		} else {
			if (this.ccpaEnabled === true) {
				this.ccpaApplicable = true;
				if (Cli_Data.ccpaType === 'ccpa') {
					if (this.ccpaBarEnabled !== true) {
						this.cliShowBar = false;
						this.blockingStatus = false;
					}
				}
			} else {
				jQuery('.wt-cli-ccpa-opt-out,.wt-cli-ccpa-checkbox,.wt-cli-ccpa-element').remove();
			}
			if (cliBlocker.isBypassEnabled === "1") {
				cliBlocker.blockingStatus = false;
			}
			callbackA(this.cliShowBar);
			callbackB(this.blockingStatus);
		}

	},
	cookieBar: function (showbar) {
		showbar = typeof showbar !== 'undefined' ? showbar : true;
		cliBlocker.cliShowBar = showbar;
		if (cliBlocker.cliShowBar === false) {
			CLI.bar_elm.hide();
			CLI.showagain_elm.hide();
			CLI.settingsModal.removeClass('cli-blowup cli-out');
			CLI.hidePopupOverlay();
			jQuery(".cli-settings-overlay").removeClass("cli-show");
		} else {
			if (!CLI_Cookie.exists(CLI_ACCEPT_COOKIE_NAME)) {
				CLI.displayHeader();
			} else {
				CLI.hideHeader();
			}
		}
	},
	removeCookieByCategory: function () {

		if (cliBlocker.blockingStatus === true) {
			if (CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) !== null) {
				var non_necessary_cookies = Cli_Data.non_necessary_cookies;
				for (var key in non_necessary_cookies) {
					const currentCategory = key;
					if (CLI.allowedCategories.indexOf(currentCategory) === -1) {
						var nonNecessaryCookies = non_necessary_cookies[currentCategory];
						for (var i = 0; i < nonNecessaryCookies.length; i++) {
							if (CLI_Cookie.read(nonNecessaryCookies[i]) !== null) {
								CLI_Cookie.erase(nonNecessaryCookies[i]);
							}

						}
					}
				}
			}
		}
	},
	runScripts: function (blocking) {
		blocking = typeof blocking !== 'undefined' ? blocking : true;
		cliBlocker.blockingStatus = blocking;
		var genericFuncs =
		{

			renderByElement: function (callback) {
				cliScriptFuncs.renderScripts();
				callback();
				cliBlocker.scriptsLoaded = true;
			},

		};
		var cliScriptFuncs =
		{
			// trigger DOMContentLoaded
			scriptsDone: function () {
				if (typeof Cli_Data.triggerDomRefresh !== 'undefined') {
					if (Boolean(Cli_Data.triggerDomRefresh) === true) {
						var DOMContentLoadedEvent = document.createEvent('Event')
						DOMContentLoadedEvent.initEvent('DOMContentLoaded', true, true)
						window.document.dispatchEvent(DOMContentLoadedEvent);
					}
				}
			},
			seq: function (arr, callback, index) {
				// first call, without an index
				if (typeof index === 'undefined') {
					index = 0
				}

				arr[index](
					function () {
						index++
						if (index === arr.length) {
							callback()
						} else {
							cliScriptFuncs.seq(arr, callback, index)
						}
					}
				)
			},
			/* script runner */
			insertScript: function ($script, callback) {
				var s = '';
				var scriptType = $script.getAttribute('data-cli-script-type');
				var elementPosition = $script.getAttribute('data-cli-element-position');
				var isBlock = $script.getAttribute('data-cli-block');
				var s = document.createElement('script');
				var ccpaOptedOut = cliBlocker.ccpaOptedOut();
				s.type = 'text/plain';
				if ($script.async) {
					s.async = $script.async;
				}
				if ($script.defer) {
					s.defer = $script.defer;
				}
				if ($script.src) {
					s.onload = callback
					s.onerror = callback
					s.src = $script.src
				} else {
					s.textContent = $script.innerText
				}
				var attrs = jQuery($script).prop("attributes");
				for (var ii = 0; ii < attrs.length; ++ii) {
					if (attrs[ii].nodeName !== 'id') {
						s.setAttribute(attrs[ii].nodeName, attrs[ii].value);
					}
				}
				if (cliBlocker.blockingStatus === true) {

					if ((CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == 'yes' && CLI.allowedCategories.indexOf(scriptType) !== -1)) {
						s.setAttribute('data-cli-consent', 'accepted');
						s.type = 'text/javascript';
					}
					if (cliBlocker.ccpaApplicable === true) {
						if (ccpaOptedOut === true || CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME) == null) {
							s.type = 'text/plain';
						}
					}
				} else {
					s.type = 'text/javascript';
				}

				if ($script.type != s.type) {
					if (elementPosition === 'head') {
						document.head.appendChild(s);
					} else {
						document.body.appendChild(s);
					}
					if (!$script.src) {
						callback()
					}
					$script.parentNode.removeChild($script);

				} else {

					callback();
				}
			},
			renderScripts: function () {
				var $scripts = document.querySelectorAll('script[data-cli-class="cli-blocker-script"]');
				if ($scripts.length > 0) {
					var runList = []
					var typeAttr
					Array.prototype.forEach.call(
						$scripts,
						function ($script) {
							// only run script tags without the type attribute
							// or with a javascript mime attribute value
							typeAttr = $script.getAttribute('type')
							runList.push(
								function (callback) {
									cliScriptFuncs.insertScript($script, callback)
								}
							)
						}
					)
					cliScriptFuncs.seq(runList, cliScriptFuncs.scriptsDone);
				}
			}
		};
		genericFuncs.renderByElement(cliBlocker.removeCookieByCategory);
	},
	ccpaOptedOut: function () {
		var ccpaOptedOut = false;
		var preferenceCookie = CLI_Cookie.read(CLI_PREFERENCE_COOKIE);
		if (preferenceCookie !== null) {
			let cliConsent = window.atob(preferenceCookie);
			cliConsent = JSON.parse(cliConsent);
			if (typeof cliConsent.ccpaOptout !== 'undefined') {
				ccpaOptedOut = cliConsent.ccpaOptout;
			}
		}
		return ccpaOptedOut;
	}
}
jQuery(document).ready(
	function () {
		if (typeof cli_cookiebar_settings != 'undefined') {
			CLI.set(
				{
					settings: cli_cookiebar_settings
				}
			);
			if (CLI.js_blocking_enabled === true) {
				cliBlocker.checkPluginStatus(cliBlocker.cookieBar, cliBlocker.runScripts);
			}
		}
	}
);
// source --> https://www.subterfuge.com/wp-content/plugins/supercarousel/public/js/supercarouselmerged.js?ver=3.0.0 
/*jquery.supercarousel*/
/*
 * jQuery Super Carousel Plugin v3.0
 * Copyright (C) 2017 Taraprasad Swain
 * Author URL: http://www.taraprasad.com
 * Plugin URL: http://www.supercarousel.com
 */

!function(jQuery){jQuery.fn.supercarousel=function(customOptions){var $this=this,$$=jQuery(this),$wrap,navlockid=null,autoplayid=null,locknav=!1,oldWindowWidth,superWrapXPos,superWrapYPos,ishidden=0,swipeid=!1,perPage=0,totalPages=1,currentPage=0,sucar=jQuery.fn.supercarousel,df=sucar.defaults,slides=[],currentSlide=0,totalSlides=0,sliderWidth=0,cssObj={},cssImgObj={},options,resetOptions=function(){if(options=jQuery.extend({},df,customOptions),$wrap){if(options.slideGap=parseInt(options.slideGap),$wrap.width()>=options.desktopMinWidth?"visible"==options.respDesktop?options.visible=options.desktopVisible:"fixwidth"==options.respDesktop?options.itemWidth=options.desktopWidth:"fixheight"==options.respDesktop&&(options.itemHeight=options.desktopHeight):$wrap.width()>=options.laptopMinWidth?"visible"==options.respLaptop?options.visible=options.laptopVisible:"fixwidth"==options.respLaptop?options.itemWidth=options.laptopWidth:"fixheight"==options.respLaptop&&(options.itemHeight=options.laptopHeight):$wrap.width()>=options.tabletMinWidth?"visible"==options.respTablet?options.visible=options.tabletVisible:"fixwidth"==options.respTablet?options.itemWidth=options.tabletWidth:"fixheight"==options.respTablet&&(options.itemHeight=options.tabletHeight):$wrap.width()<options.tabletMinWidth&&("visible"==options.respMobile?options.visible=options.mobileVisible:"fixwidth"==options.respMobile?options.itemWidth=options.mobileWidth:"fixheight"==options.respMobile&&(options.itemHeight=options.mobileHeight)),options.customrespby.length>0)for(var e=0;e<options.customrespby.length;e++)if(""!=options.customrespmin[e]&&""!=options.customrespmax[e]&&!isNaN(options.customrespmin[e])&&!isNaN(options.customrespmax[e])&&$wrap.width()>Number(options.customrespmin[e])&&$wrap.width()<Number(options.customrespmax[e])){"visible"!=options.customrespby[e]||isNaN(options.customrespvisible[e])?"fixwidth"!=options.customrespby[e]||isNaN(options.customrespwidth[e])?"fixheight"!=options.customrespby[e]||isNaN(options.customrespheight[e])||(options.itemHeight=Number(options.customrespheight[e])):options.itemWidth=Number(options.customrespwidth[e]):options.visible=Number(options.customrespvisible[e]);break}$$.find(">div img.super_image").length&&(options.type="image")}},createSuperCarousel=function(){if($$.wrap('<div class="supercarousel_wrapper"></div>').css({display:"block",visibility:"visible"}),$wrap=$$.parent()){var e=$$.html();$$.prepend(e),$$.append(e),removeUnwantedTags(),totalSlides=$$.children().length/3,resetOptions(),checkLightBox(),disableLinks(),options.onload($$),$wrap.height(800),checkNavigation(),resetSlides(),setTimeout(function(){resetSlides()},500)}},removeUnwantedTags=function(){$$.find(">").not("div").remove()},setLockNavTimeout=function(){null!=navlockid&&clearTimeout(navlockid),locknav=!0},clearLockNavTimeout=function(){clearTimeout(navlockid),navlockid=setTimeout(function(){clearInterval(autoplayid),locknav=!1,checkAutoPlay()},100)},disableLinks=function(){if(options.onslideclick&&""!=options.onslideclick)return $$.find(">div a").click(function(e){e.preventDefault()}),void $$.find(">div").click(function(event){event.preventDefault(),eval(options.onslideclick+"(this);")});$$.find(">div a").click(function(e){jQuery(e.target).hasClass("superswipe")&&e.preventDefault()})},checkLightBox=function(){if($wrap&&(!options.onslideclick||""==options.onslideclick)){getRandomInt(1e5,999999),$$.find(">div").length;$$.find(">div a.superlight").superLightBox({mediaCaption:"data-caption"})}},getRandomInt=function(e,t){return Math.floor(Math.random()*(t-e))+e},resetSlides=function(){$wrap&&(resetOptions(),checkParams(),resetStyleObj(),resetSlidePositions(),calculateTotalPages(),resetPagination(),resetWrapHeight(),gotoPage(currentPage),$$.stop(!0,!0))},checkNavigation=function(){1==options.nextPrev&&($wrap.parent().find(".supernext").click(function(e){e.preventDefault(),(currentPage<totalPages-1||options.circular)&&gotoPage(currentPage+1)}).css({display:"block"}),$wrap.parent().find(".superprev").click(function(e){e.preventDefault(),(currentPage>0||options.circular)&&gotoPage(currentPage-1)}).css({display:"block"}),options.arrowsOut&&$wrap.parent().addClass("supercarousel_arrowsout")),options.swipe&&$this.registerSwipe(),options.keys&&jQuery("body").keyup(function(e){49==e.keyCode?gotoPage(0):50==e.keyCode?gotoPage(1):51==e.keyCode?gotoPage(2):52==e.keyCode?gotoPage(3):53==e.keyCode?gotoPage(4):54==e.keyCode?gotoPage(5):55==e.keyCode?gotoPage(6):56==e.keyCode?gotoPage(7):57==e.keyCode?gotoPage(8):58==e.keyCode?gotoPage(9):37==e.keyCode?gotoPage(currentPage-1):39==e.keyCode?gotoPage(currentPage+1):38==e.keyCode?gotoPage(currentPage-1):40==e.keyCode&&gotoPage(currentPage+1)}),options.mouseWheel&&$wrap.bind("mousewheel",function(e,t){$wrap.ismouseover()&&(gotoPage(t>0?currentPage-1:currentPage+1),e.preventDefault())})},getPageByDistance=function(e){var t=currentPage,i=-calculateNewLeft(t)-e;if(e>0){for(;-calculateNewLeft(t)>i&&(!(t>=totalPages)||options.circular);)t++;if(t>=totalPages&&!options.circular)return totalPages-1}else{for(;-calculateNewLeft(t)<i&&(!(t<=0)||options.circular);)t--;if(t<=0&&!options.circular)return 0}return t},superCarouselSwipe=function(e,t){var i={swipe:function(e){},swipeLeft:function(e){},swipeRight:function(e){},swipeUp:function(e){},swipeDown:function(e){},swipeStart:function(e){},swipeEnd:function(e,t){}},o=jQuery.extend({},i,t),s=new Object;s.sX=0,s.sY=0,s.eX=0,s.eY=0;var n="";e.on("touchstart",function(e){var t=e.originalEvent.touches[0];s.sX=t.screenX,s.sY=t.screenY,o.swipeStart(s)}),e.on("touchmove",function(e){var t=e.originalEvent.touches[0];s.eX=t.screenX,s.eY=t.screenY,o.swipe(s)}),e.on("touchend",function(e){jQuery(window).width(),jQuery(window).height();""!=(n=s.eX>s.sX?"r":"l")&&("l"==n?o.swipeLeft(s):"r"==n?o.swipeRight(s):"u"==n?o.swipeUp(s):"d"==n&&o.swipeDown(s)),o.swipeEnd(s,n),n=""})};$this.registerSwipe=function(){options.swipe&&superCarouselSwipe($wrap,{swipeStart:function(e){superWrapXPos=$$.position().left,superWrapYPos=jQuery(window).scrollTop()},swipe:function(e){var t=-sliderWidth,i=-2*sliderWidth+$wrap.width(),o=e.eX-e.sX+superWrapXPos,s=e.sY-e.eY+superWrapYPos;s<0&&(s=0),o>t&&!options.circular?o=t:o<i&&!options.circular&&(o=i),$$.stop(!0,!0).css({left:o})},swipeEnd:function(e,t){var i=Math.abs(e.eX-e.sX);if(i>.2*$wrap.width()){if("r"==t){o=getPageByDistance(-i);gotoPage(currentPage>0||options.circular?o:currentPage)}else if("l"==t){var o=getPageByDistance(i);gotoPage(currentPage<totalPages-1||options.circular?o:currentPage)}}else $$.animate({left:-calculateNewLeft(currentPage)})}})};var removeSuperSwipeClass=function(e){swipeid=setTimeout(function(){jQuery(e.target).removeClass("superswipe")},500)},checkAutoScroll=function(){if($wrap&&"1"==options.autoscroll){options.effect="slide","up"!=options.direction&&"down"!=options.direction||(options.direction="left");var e,t,i=calculateNewLeft(0),o=!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/),s=-1!=navigator.appVersion.indexOf("Win"),n=1;o&&s&&(n=4),"left"==options.direction?(e=-2*i,t="-="+options.scrollspeed*n+"px"):(e=-i,i*=2,$$.css({left:-i}),t="+="+options.scrollspeed*n+"px"),checkSuperTimeout(i,t,e)}},checkSuperTimeout=function(e,t,i){setTimeout(function(){locknav||options.pauseOver&&$wrap.ismouseover()?checkSuperTimeout(e,t,i):($$.css({left:t}),Math.abs(i)-Math.abs(e)<$wrap.width()&&(e=calculateNewLeft(0),"left"==options.direction?i=-2*e:(i=-e,e*=2)),"left"==options.direction?$$.position().left<i&&$$.css({left:-e}):$$.position().left>i&&$$.css({left:-e}),checkSuperTimeout(e,t,i))},options.scrollinterval)},checkAutoPlay=function(){$wrap&&options.auto&&!options.autoscroll&&(autoplayid=setInterval(function(){locknav||(options.pauseOver?$wrap.ismouseover()||autoPlay():autoPlay())},options.pauseTime))},autoPlay=function(){"left"==options.direction||"down"==options.direction?gotoPage(currentPage+1):"right"!=options.direction&&"up"!=options.direction||gotoPage(currentPage-1)},resetPagination=function(){if(options.paging)for($wrap.parent().find(".pagination").html(""),m=0;m<totalPages;m++){var e=jQuery('<a href="#"><span>'+(m+1)+"</span></a>").click(function(e){e.preventDefault(),gotoPage(jQuery(this).index())});$wrap.parent().find(".pagination").append(e)}},gotoPage=function(e){locknav||(e>=totalPages&&!options.circular?gotoPage(0):e<0&&!options.circular?gotoPage(totalPages-1):(options.onchange($$,currentPage,totalPages),e!=totalPages-1||options.circular||""==options.next?""!=options.next&&jQuery(options.next).hasClass("disabled")&&jQuery(options.next).removeClass("disabled"):jQuery(options.next).addClass("disabled"),0!=e||options.circular||""==options.prev?""!=options.prev&&jQuery(options.prev).hasClass("disabled")&&jQuery(options.prev).removeClass("disabled"):jQuery(options.prev).addClass("disabled"),currentPage=e,"slide"==options.effect?"left"==options.direction||"right"==options.direction?slideHorizontal():"up"!=options.direction&&"down"!=options.direction||slideVertical():"focus"==options.effect?slideFocusHorizontal():"fade"==options.effect&&slideFadeIn(),options.paging&&$wrap.parent().find(".pagination").find(">a:eq("+currentPage+")").length>0&&($wrap.parent().find(".pagination").find(">a").removeClass("selected"),$wrap.parent().find(".pagination").find(">a:eq("+currentPage+")").addClass("selected"))))},calculateNewLeft=function(e){var t;if(!$wrap)return 0;if(options.step>0){var i=e*options.step+totalSlides;i<0?i=0:i>$$.find(">div").length-1&&(i=totalSlides),t=$$.find(">div:eq("+i+")").position().left}else t=e*$wrap.outerWidth(!1),t+=sliderWidth;options.circular||-t<(o=-2*sliderWidth+$wrap.outerWidth(!1))&&(t=-o);var o=-2*sliderWidth,s=-1*sliderWidth+$wrap.outerWidth(!1);return s>0&&(s=0),-t<=o&&currentPage>0?(t=-o,currentPage=0):-t>=s&&currentPage<0&&(t=-s,currentPage=totalPages-1),t},slideFadeIn=function(){var e=calculateNewLeft(currentPage);setLockNavTimeout();var t=$$.clone().css({position:"absolute",display:"none",zIndex:0,left:-e,top:$$.position().top}).appendTo($wrap);t.fadeIn(options.easingTime,options.easing,function(){$$.css({left:-e}),t.remove(),clearLockNavTimeout();var i=-2*sliderWidth,o=-1*sliderWidth+$wrap.outerWidth(!1);o>0&&(o=0),-e<=i?$$.css({left:-e+sliderWidth}):-e>=o&&$$.css({left:-e-sliderWidth})})},slideVertical=function(){var e=calculateNewLeft(currentPage);if(setLockNavTimeout(),"up"==options.direction)if(-e<$$.position().left)t=1;else t=-1;else if("down"==options.direction)if(-e<$$.position().left)t=-1;else var t=1;var i=$$.clone().css({position:"absolute",zIndex:0,left:-e,top:$$.position().top+$wrap.outerHeight(!0)*t}).appendTo($wrap);i.stop(!0,!0).animate({top:$$.position().top},options.easingTime,options.easing,function(){$$.css({left:-e}),i.remove(),clearLockNavTimeout();var t=-2*sliderWidth,o=-1*sliderWidth+$wrap.outerWidth(!1);o>0&&(o=0),-e<=t?$$.css({left:-e+sliderWidth}):-e>=o&&$$.css({left:-e-sliderWidth})})},slideFocusHorizontal=function(){var e=calculateNewLeft(currentPage),t=currentPage*options.step+totalSlides;$$.find(">div").removeClass("focus"),$$.find(">div:eq("+t+")").addClass("focus"),$$.find(">div:eq("+(t+totalSlides)+")").addClass("focus"),$$.find(">div:eq("+(t-totalSlides)+")").addClass("focus");var i=$$.find(">div:eq("+t+")").width()/2-$wrap.width()/2;e+=i,setLockNavTimeout(),$$.stop(!0,!0).animate({left:-e},options.easingTime,options.easing,function(){clearLockNavTimeout();var t=-2*sliderWidth-i,o=-1*sliderWidth-i+$wrap.outerWidth(!1);o>0&&(o=0),-e<=t?$$.css({left:-e+sliderWidth}):-e>=o&&$$.css({left:-e-sliderWidth})}),resetWrapHeight()},slideHorizontal=function(){var e=calculateNewLeft(currentPage);setLockNavTimeout(),$$.stop(!0,!0).animate({left:-e},options.easingTime,options.easing,function(){clearLockNavTimeout();var t=-2*sliderWidth,i=-1*sliderWidth+$wrap.outerWidth(!1);i>0&&(i=0),-e<=t?$$.css({left:-e+sliderWidth}):-e>=i&&$$.css({left:-e-sliderWidth})}),resetWrapHeight()},checkParams=function(){options.step>totalSlides&&(options.step=totalSlides),options.visible&&(options.step>options.visible||0==options.step)&&(options.step=options.visible)},resetStyleObj=function(){$$.removeClass("superfixheight"),options.visible?(cssObj={width:getVisibleSlideWidth(),height:"auto"},cssImgObj={width:"100%",height:"auto"}):""!=options.itemWidth?(cssObj={width:options.itemWidth,height:"auto"},cssImgObj={width:"100%",height:"auto"}):""!=options.itemHeight&&(cssObj={width:"auto",height:"auto"},cssImgObj={width:"auto",height:options.itemHeight},$$.addClass("superfixheight")),$$.find(">div").css(cssObj),checkImageCarousel()},calculateTotalPages=function(){var e=$$.find(">div:last");if(sliderWidth=(e.position().left+e.outerWidth(!1))/3,!$wrap)return 0;if(options.step>0){if(options.visible&&1==options.visible)return void(totalPages=totalSlides);if(options.visible&&options.visible>1)return void((totalPages=(totalSlides-(options.visible-options.step))/options.step)<1&&(totalPages=1));for(var t=-1*calculateNewLeft((totalPages=1)-1),i=-2*sliderWidth+$wrap.outerWidth(!1);t>i;)t=-1*calculateNewLeft(++totalPages-1)}else totalPages=Math.ceil(sliderWidth/$wrap.outerWidth(!1))},resetSlidePositions=function(){$$.find(">div").each(function(){$ele=jQuery(this),""!=options.itemHeight&&"image"==options.type&&$ele.width($ele.find(".super_image").width()),$ele.prev().length>0?$ele.css({left:$ele.prev().position().left+$ele.prev().outerWidth(!1)+options.slideGap}):$ele.css({left:0})})},resetWrapHeight=function(){if(options.autoHeight&&options.step>0){var e,t=currentPage*options.step+totalSlides;if(options.visible)e=$$.find(">div").slice(t,t+options.visible).superMaxHeightElement().outerHeight(!0);else if(options.itemWidth){var i=Math.ceil($wrap.width()/options.itemWidth);e=$$.find(">div").slice(t,t+i).superMaxHeightElement().outerHeight(!0)}else e=$$.find(">div:eq("+t+")").outerHeight(!0);$wrap.stop(!0,!0).animate({height:e+1},700,"swing",function(){})}else{var o=0;for(k=totalSlides;k<2*totalSlides;k++)(t=$$.children(":eq("+k+")")).outerHeight(!0)>o&&(o=t.outerHeight(!0));$wrap&&$wrap.height(o+1)}},checkImageCarousel=function(){"image"==options.type&&$$.find("img").css(cssImgObj)},getVisibleSlides=function(){return options.visible?options.visible:""!=options.itemWidth?Math.ceil($wrap.width()/options.itemWidth):0},getVisibleSlideWidth=function(){return $wrap?Math.ceil(($wrap.width()-(options.visible-1)*options.slideGap)/options.visible):0},delayReset=function(){setTimeout(function(){resetSlides()},500)},registerHiddenCarousel=function(){setInterval(function(){$wrap.parent().is(":visible")?1==ishidden&&(delayReset(),ishidden=0):ishidden=1},500)},isIE=function(e,t){var i=jQuery('<div style="display:none;"/>').appendTo(jQuery("body"));i.html("\x3c!--[if "+(t||"")+" IE "+(e||"")+"]><a>&nbsp;</a><![endif]--\x3e");var o=i.find("a").length;return i.remove(),o},checkIsHidden=function(){options.superhidden&&registerHiddenCarousel()};return oldWindowWidth=jQuery(window).width(),jQuery(window).resize(function(){jQuery(window).width()!=oldWindowWidth&&(resetSlides(),oldWindowWidth=jQuery(window).width())}),$$.find("img").length?$$.imagesLoaded(function(){createSuperCarousel(),checkAutoPlay(),checkAutoScroll(),checkIsHidden()}):(createSuperCarousel(),checkAutoPlay(),checkAutoScroll(),checkIsHidden()),$this};var opts=jQuery.fn.supercarousel;opts.defaults={source:"Image",itemWidth:"",itemHeight:"",desktopMinWidth:1200,laptopMinWidth:992,tabletMinWidth:450,mobileMinWidth:0,direction:"left",effect:"slide",respDesktop:"visible",desktopVisible:"5",desktopWidth:"400",desktopHeight:"400",respLaptop:"visible",laptopVisible:"3",laptopWidth:"300",laptopHeight:"300",respTablet:"visible",tabletVisible:"2",tabletWidth:"200",tabletHeight:"200",respMobile:"visible",mobileVisible:"1",mobileWidth:"200",mobileHeight:"200",customrespmin:[],customrespmax:[],customrespby:[],customrespvisible:[],customrespwidth:[],customrespheight:[],arrowsOut:!1,slideGap:5,step:1,type:"content",auto:!1,autoscroll:!1,scrollspeed:1,scrollinterval:10,autoHeight:!1,easing:"swing",easingTime:700,pauseTime:1e3,pauseOver:!0,next:"",prev:"",paging:!1,circular:!1,mouseWheel:!1,swipe:!1,keys:!1,superhidden:!1,carouselid:0,onchange:function(e,t,i){},onload:function(e){}}}(jQuery),jQuery.fn.superMaxHeightElement=function(){var e=null,t=0;return this.each(function(){var i=jQuery(this).height();i>t&&(t=i,e=jQuery(this))}),e},jQuery(window).load(function(){jQuery(".supercrsl").each(function(){var e=jQuery(this).data("carouseloptions");if(e){var t=["desktopVisible","desktopWidth","desktopHeight","laptopVisible","laptopWidth","laptopHeight","tabletVisible","tabletWidth","tabletHeight","mobileVisible","mobileWidth","mobileHeight","easingTime","step","pauseTime","scrollspeed","slideGap"],i=["auto","pauseOver","autoscroll","autoHeight","nextPrev","arrowsOut","circular","mouseWheel","swipe","keys","superhidden","paging"];for(var o in t)e[t[o]]=parseInt(e[t[o]]);for(var o in i)e[i[o]]=1==parseInt(e[i[o]]);jQuery(this).find(".supercarousel").supercarousel(e)}})}),jQuery.expr[":"].hiddenByParent=function(e){return jQuery(e).parents("*:not(:visible)").length};

/*jquery.easing*/
jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(n,e,t,u,a){return jQuery.easing[jQuery.easing.def](n,e,t,u,a)},easeInQuad:function(n,e,t,u,a){return u*(e/=a)*e+t},easeOutQuad:function(n,e,t,u,a){return-u*(e/=a)*(e-2)+t},easeInOutQuad:function(n,e,t,u,a){return(e/=a/2)<1?u/2*e*e+t:-u/2*(--e*(e-2)-1)+t},easeInCubic:function(n,e,t,u,a){return u*(e/=a)*e*e+t},easeOutCubic:function(n,e,t,u,a){return u*((e=e/a-1)*e*e+1)+t},easeInOutCubic:function(n,e,t,u,a){return(e/=a/2)<1?u/2*e*e*e+t:u/2*((e-=2)*e*e+2)+t},easeInQuart:function(n,e,t,u,a){return u*(e/=a)*e*e*e+t},easeOutQuart:function(n,e,t,u,a){return-u*((e=e/a-1)*e*e*e-1)+t},easeInOutQuart:function(n,e,t,u,a){return(e/=a/2)<1?u/2*e*e*e*e+t:-u/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(n,e,t,u,a){return u*(e/=a)*e*e*e*e+t},easeOutQuint:function(n,e,t,u,a){return u*((e=e/a-1)*e*e*e*e+1)+t},easeInOutQuint:function(n,e,t,u,a){return(e/=a/2)<1?u/2*e*e*e*e*e+t:u/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(n,e,t,u,a){return-u*Math.cos(e/a*(Math.PI/2))+u+t},easeOutSine:function(n,e,t,u,a){return u*Math.sin(e/a*(Math.PI/2))+t},easeInOutSine:function(n,e,t,u,a){return-u/2*(Math.cos(Math.PI*e/a)-1)+t},easeInExpo:function(n,e,t,u,a){return 0==e?t:u*Math.pow(2,10*(e/a-1))+t},easeOutExpo:function(n,e,t,u,a){return e==a?t+u:u*(1-Math.pow(2,-10*e/a))+t},easeInOutExpo:function(n,e,t,u,a){return 0==e?t:e==a?t+u:(e/=a/2)<1?u/2*Math.pow(2,10*(e-1))+t:u/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(n,e,t,u,a){return-u*(Math.sqrt(1-(e/=a)*e)-1)+t},easeOutCirc:function(n,e,t,u,a){return u*Math.sqrt(1-(e=e/a-1)*e)+t},easeInOutCirc:function(n,e,t,u,a){return(e/=a/2)<1?-u/2*(Math.sqrt(1-e*e)-1)+t:u/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(n,e,t,u,a){var r=1.70158,i=0,s=u;if(0==e)return t;if(1==(e/=a))return t+u;if(i||(i=.3*a),s<Math.abs(u)){s=u;r=i/4}else r=i/(2*Math.PI)*Math.asin(u/s);return-s*Math.pow(2,10*(e-=1))*Math.sin((e*a-r)*(2*Math.PI)/i)+t},easeOutElastic:function(n,e,t,u,a){var r=1.70158,i=0,s=u;if(0==e)return t;if(1==(e/=a))return t+u;if(i||(i=.3*a),s<Math.abs(u)){s=u;r=i/4}else r=i/(2*Math.PI)*Math.asin(u/s);return s*Math.pow(2,-10*e)*Math.sin((e*a-r)*(2*Math.PI)/i)+u+t},easeInOutElastic:function(n,e,t,u,a){var r=1.70158,i=0,s=u;if(0==e)return t;if(2==(e/=a/2))return t+u;if(i||(i=a*(.3*1.5)),s<Math.abs(u)){s=u;r=i/4}else r=i/(2*Math.PI)*Math.asin(u/s);return e<1?s*Math.pow(2,10*(e-=1))*Math.sin((e*a-r)*(2*Math.PI)/i)*-.5+t:s*Math.pow(2,-10*(e-=1))*Math.sin((e*a-r)*(2*Math.PI)/i)*.5+u+t},easeInBack:function(n,e,t,u,a,r){return void 0==r&&(r=1.70158),u*(e/=a)*e*((r+1)*e-r)+t},easeOutBack:function(n,e,t,u,a,r){return void 0==r&&(r=1.70158),u*((e=e/a-1)*e*((r+1)*e+r)+1)+t},easeInOutBack:function(n,e,t,u,a,r){return void 0==r&&(r=1.70158),(e/=a/2)<1?u/2*(e*e*((1+(r*=1.525))*e-r))+t:u/2*((e-=2)*e*((1+(r*=1.525))*e+r)+2)+t},easeInBounce:function(n,e,t,u,a){return u-jQuery.easing.easeOutBounce(n,a-e,0,u,a)+t},easeOutBounce:function(n,e,t,u,a){return(e/=a)<1/2.75?u*(7.5625*e*e)+t:e<2/2.75?u*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?u*(7.5625*(e-=2.25/2.75)*e+.9375)+t:u*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easeInOutBounce:function(n,e,t,u,a){return e<a/2?.5*jQuery.easing.easeInBounce(n,2*e,0,u,a)+t:.5*jQuery.easing.easeOutBounce(n,2*e-a,0,u,a)+.5*u+t}});

/*jquery.easing.compatibility*/
jQuery.extend(jQuery.easing,{easeIn:function(e,t,i,o,s){return jQuery.easing.easeInQuad(e,t,i,o,s)},easeOut:function(e,t,i,o,s){return jQuery.easing.easeOutQuad(e,t,i,o,s)},easeInOut:function(e,t,i,o,s){return jQuery.easing.easeInOutQuad(e,t,i,o,s)},expoin:function(e,t,i,o,s){return jQuery.easing.easeInExpo(e,t,i,o,s)},expoout:function(e,t,i,o,s){return jQuery.easing.easeOutExpo(e,t,i,o,s)},expoinout:function(e,t,i,o,s){return jQuery.easing.easeInOutExpo(e,t,i,o,s)},bouncein:function(e,t,i,o,s){return jQuery.easing.easeInBounce(e,t,i,o,s)},bounceout:function(e,t,i,o,s){return jQuery.easing.easeOutBounce(e,t,i,o,s)},bounceinout:function(e,t,i,o,s){return jQuery.easing.easeInOutBounce(e,t,i,o,s)},elasin:function(e,t,i,o,s){return jQuery.easing.easeInElastic(e,t,i,o,s)},elasout:function(e,t,i,o,s){return jQuery.easing.easeOutElastic(e,t,i,o,s)},elasinout:function(e,t,i,o,s){return jQuery.easing.easeInOutElastic(e,t,i,o,s)},backin:function(e,t,i,o,s){return jQuery.easing.easeInBack(e,t,i,o,s)},backout:function(e,t,i,o,s){return jQuery.easing.easeOutBack(e,t,i,o,s)},backinout:function(e,t,i,o,s){return jQuery.easing.easeInOutBack(e,t,i,o,s)}});

/*jquery.feedify*/
(function(e){e.extend({feedify:function(t,n){var r={lt:{regex:/(<)/g,template:"&lt;"},gt:{regex:/(>)/g,template:"&gt;"},dq:{regex:/(")/g,template:"&quot;"},sq:{regex:/(')/g,template:"&#x27;"},link:{regex:/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,template:'<a href="$1">$1</a>'},user:{regex:/((?:^|[^a-zA-Z0-9_!#$%&*@＠]|RT:?))([@＠])([a-zA-Z0-9_]{1,20})(\/[a-zA-Z][a-zA-Z0-9_-]{0,24})?/g,template:'$1<a href="http://twitter.com/#!/$3$4">@$3$4</a>'},hash:{regex:/(^|\s)#(\w+)/g,template:'$1<a href="http://twitter.com/#!/search?q=%23$2">#$2</a>'},email:{regex:/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi,template:'<a href="mailto:$1">$1</a>'}};var i=e.extend(r,n);e.each(i,function(e,n){t=t.replace(n.regex,n.template)});return t}})})(jQuery);

/*jquery.framerate*/
jQuery.fn.framerate=function(e){var t=jQuery.extend({framerate:30,logframes:!1},e),r=Math.floor(1e3/t.framerate);jQuery.extend(jQuery.fx.prototype,{custom:function(e,t,i){function n(e){return s.step(e)}this.startTime=(new Date).getTime(),this.start=e,this.end=t,this.unit=i||this.unit||"px",this.now=this.start,this.pos=this.state=0;var s=this;n.elem=this.elem,void 0===jQuery.timerId&&(jQuery.timerId=!1),n()&&jQuery.timers.push(n)&&!jQuery.timerId&&(jQuery.timerId=setInterval(jQuery.fx.tick,r))}});var i=(new Date).getTime();jQuery.extend(jQuery.fx,{tick:function(){if(t.logframes){var e=(new Date).getTime();console.log(Math.floor(1e3/(e-i))),i=e}for(var r=jQuery.timers,n=0;n<r.length;n++)r[n]()||r.splice(n--,1);r.length||jQuery.fx.stop()},stop:function(){clearInterval(jQuery.timerId),jQuery.timerId=null}})};

/*jquery.ismouseover*/
!function(t){t.mlp={x:0,y:0},t(function(){t(this).mousemove(function(t){jQuery.mlp={x:t.pageX,y:t.pageY}})}),t.fn.ismouseover=function(e){var o=!1;return this.eq(0).each(function(){var e=t(this),n=e.offset();o=n.left<=t.mlp.x&&n.left+e.outerWidth()>t.mlp.x&&n.top<=t.mlp.y&&n.top+e.outerHeight()>t.mlp.y}),o}}(jQuery);

/*jquery.mousewheel*/
!function(e){function t(t){var n=t||window.event,i=[].slice.call(arguments,1),l=0,s=0,o=0;return t=e.event.fix(n),t.type="mousewheel",n.wheelDelta&&(l=n.wheelDelta/120),n.detail&&(l=-n.detail/3),o=l,void 0!==n.axis&&n.axis===n.HORIZONTAL_AXIS&&(o=0,s=-1*l),void 0!==n.wheelDeltaY&&(o=n.wheelDeltaY/120),void 0!==n.wheelDeltaX&&(s=-1*n.wheelDeltaX/120),i.unshift(t,l,s,o),(e.event.dispatch||e.event.handle).apply(this,i)}var n=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var i=n.length;i;)e.event.fixHooks[n[--i]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=n.length;e;)this.addEventListener(n[--e],t,!1);else this.onmousewheel=t},teardown:function(){if(this.removeEventListener)for(var e=n.length;e;)this.removeEventListener(n[--e],t,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery);

/*jquery.superlightbox*/
jQuery.fn.superLightBox=function(e){var i,r,t,l,s={gallery:!0,swipe:!0,keyboard:!0,closeOutClick:!0,videopreviewurl:"images/video-preview.jpg",galleryThumbnailWidth:100,galleryThumbanilGap:1,maxZoom:3,mediaAttribute:"href",mediaCaption:"data-superlightcaption"},o=[],u=[],n=[],a=[],p=0,h=0,g=0,d=jQuery.extend({},s,e);d.keyboard&&jQuery(document).keyup(function(e){jQuery(".superlightboxcontainer").length&&jQuery(".superlightboxcontainer").hasClass(l)&&(e.preventDefault(),27==e.keyCode?v():37==e.keyCode||38==e.keyCode?w(i-1):39!=e.keyCode&&40!=e.keyCode||w(i+1))}),jQuery(window).resize(function(){jQuery(".superlightboxcontainer").length&&jQuery(".superlightboxcontainer").hasClass(l)&&(m(),_())});var c=function(e){var r=e.attr("href");if(o.indexOf(r)>-1){i=o.indexOf(r),jQuery(".superlightboxcontainer").length&&jQuery(".superlightboxcontainer").remove(),jQuery("body").append(L());var t='<div class="superlightbox_slide"></div>';jQuery(".superlightbox_slider").append(t),jQuery(".superlightbox_slider").append(t),jQuery(".superlightbox_slider").append(t),d.gallery&&o.length>1&&y(),jQuery(".superlightboxcontainer").fadeIn(),f(),w(i)}},y=function(){var e="";for(var i in o)e+=x(o[i],i);jQuery(".superlightbox_gallery_wrapper").append(e);var r=0;jQuery(".superlightbox_gallery_wrapper > div").each(function(e){var i=e*d.galleryThumbnailWidth+e*d.galleryThumbanilGap;r=i,jQuery(this).css({left:i})}),r+=d.galleryThumbnailWidth,jQuery(".superlightbox_gallery_wrapper").width(r)},b=function(e){if(jQuery(".superlightboxcontainer").length){var i=jQuery(window).width();if(jQuery(".superlightbox_gallery_wrapper").width()>i){var r=parseInt(jQuery(".superlightbox_gallery_wrapper").position().left)-e*i,t=-jQuery(".superlightbox_gallery_wrapper").width()+i;r<t?r=t:r>0&&(r=0),jQuery(".superlightbox_gallery_wrapper").animate({left:r},d.easingTime,function(){})}}},_=function(){if(jQuery(".superlightboxcontainer").length&&d.gallery){if(jQuery(window).width()>jQuery(".superlightbox_gallery_wrapper").width()){var e=(jQuery(window).width()-jQuery(".superlightbox_gallery_wrapper").width())/2;jQuery(".superlightbox_gallery_wrapper").css({left:e})}else jQuery(".superlightbox_gallery_wrapper").css({left:0});jQuery(".superlightbox_gallery_wrapper").is(":visible")?jQuery(".superlightbox_gallery_nav").show():jQuery(".superlightbox_gallery_nav").hide()}},x=function(e,i){var r=Z(e),t="",l="";return"image"==r?t=e:"youtube"==r?(t=W(e),l=" superlightbox_video"+S(e)):"vimeo"==r&&(t=d.videopreviewurl,O(e),l=" superlightbox_video"+q(e)),'<div class="superlightbox_thumb'+i+l+'" style="background-image: url(\''+t+"')\"></div>"},v=function(){if(jQuery(".superlightboxcontainer").length){var e=jQuery(".superlightbox_slide"+i);e.length&&e.addClass("superlightbox_remove"),jQuery(".superlightboxcontainer").fadeOut("slow",function(){jQuery(this).remove()})}},f=function(){jQuery(".superlightboxcontainer").length&&(jQuery(".superlightbox_close").click(function(){v()}),d.closeOutClick&&jQuery(".superlightbox_slider").click(function(e){"IMG"!=e.target.nodeName&&v()}),jQuery(".superlightbox_prev").click(function(){w(i-1)}),jQuery(".superlightbox_next").click(function(){w(i+1)}),d.gallery&&(jQuery(".superlightbox_gallery_button").click(function(){jQuery(this).hasClass("superlightbox_gallery_open")?(jQuery(this).removeClass("superlightbox_gallery_open"),jQuery(this).addClass("superlightbox_gallery_close"),jQuery(".superlightbox_gallery_wrapper").slideDown(),jQuery(".superlightbox_slider").addClass("superlightbox_gallery_visible"),_()):(jQuery(this).removeClass("superlightbox_gallery_close"),jQuery(this).addClass("superlightbox_gallery_open"),jQuery(".superlightbox_gallery_wrapper").slideUp(),jQuery(".superlightbox_gallery_nav").hide(),jQuery(".superlightbox_slider").removeClass("superlightbox_gallery_visible"))}),jQuery(".superlightbox_gallery_prev").click(function(){b(-1)}),jQuery(".superlightbox_gallery_next").click(function(){b(1)}),jQuery(".superlightbox_gallery_wrapper > div").click(function(){w(jQuery(this).index())}),d.swipe&&z(".superlightbox_gallery_wrapper",{swipeStart:function(e){p=jQuery(".superlightbox_gallery_wrapper").position().left},swipe:function(e){jQuery(window).width();jQuery(".superlightbox_gallery_wrapper").css({left:e.eX-e.sX+p})},swipeEnd:function(e,i){Math.abs(e.sX),Math.abs(e.eX);var r=jQuery(window).width(),t=jQuery(".superlightbox_gallery_wrapper").width();if(r>t){var l=(r-t)/2;jQuery(".superlightbox_gallery_wrapper").animate({left:l},d.easingTime)}else jQuery(".superlightbox_gallery_wrapper").position().left>0?jQuery(".superlightbox_gallery_wrapper").animate({left:0},d.easingTime):jQuery(".superlightbox_gallery_wrapper").position().left<-t+r&&jQuery(".superlightbox_gallery_wrapper").animate({left:-t+r},d.easingTime)}})),d.swipe&&z(".superlightbox_wrapper",{pinchImage:".superlightbox_slider > div:eq(1) img",maxZoom:d.maxZoom,pinchZoom:function(e){jQuery(".superlightbox_slider > div:eq(1) img").css(e)},pinchZoomStart:function(e){jQuery(".superlightbox_slider").addClass("superlightbox_sliding")},pinchZoomEnd:function(e){jQuery(".superlightbox_slider").removeClass("superlightbox_sliding"),X()},swipeStart:function(e){jQuery(".superlightbox_slider").addClass("superlightbox_sliding")},swipe:function(e){var i=jQuery(window).width();jQuery(".superlightbox_slider").css({left:-i+e.eX-e.sX})},swipeEnd:function(e,r){var t=Math.abs(e.sX)-Math.abs(e.eX),l=.2*(s=jQuery(window).width());if(Math.abs(t)>l)w(t>0?i+1:i-1);else{var s=jQuery(window).width();jQuery(".superlightbox_slider").animate({left:-s},d.easingTime,function(){jQuery(".superlightbox_slider").removeClass("superlightbox_sliding")})}}}))},w=function(e){var l="right";e<i&&(l="left"),e<0||e==o.length-1?(e=o.length-1,r=e-1,t=0):e>=o.length||0==e?(e=0,r=o.length-1,t=1):(r=e-1,t=e+1);var s,u=Y(e),n=1;e!=i?("left"==l?(s=jQuery(".superlightbox_slider > div:first"),n=-1):s=jQuery(".superlightbox_slider > div:last"),s.hasClass("superlightbox_slide"+e)||(s.replaceWith(u),k(e),X()),j(n),i=e):0==jQuery(".superlightbox_slider > div.superlightbox_slide"+e).length&&(jQuery(".superlightbox_slider > div:first").replaceWith(Y(r)),jQuery(".superlightbox_slider > div:eq(1)").replaceWith(u),jQuery(".superlightbox_slider > div:last").replaceWith(Y(t)),k(r),k(e),k(t),X())},j=function(e){if(jQuery(".superlightboxcontainer").length&&3==jQuery(".superlightbox_slider > div").length){var i=jQuery(window).width(),r=0;e>0&&(r=-2*i),jQuery(".superlightbox_slider").addClass("superlightbox_sliding"),jQuery(".superlightbox_slider").animate({left:r},d.easingTime,Q)}},Q=function(){var e=".superlightbox_slider > .superlightbox_slide"+i,l=".superlightbox_slider > .superlightbox_slide"+t,s=".superlightbox_slider > .superlightbox_slide"+r;jQuery(".superlightbox_slider > div").not(e+","+l+","+s).remove(),jQuery(e).length>1&&(0==jQuery(".superlightbox_slider").position().left?jQuery(e+":last").remove():jQuery(e+":first").remove()),jQuery(s).length>1&&jQuery(s+":last").remove(),jQuery(l).length>1&&jQuery(l+":first").remove(),jQuery(".superlightbox_slider > div:first").hasClass("superlightbox_slide"+r)||(jQuery(s).remove(),jQuery(".superlightbox_slider").prepend(Y(r)),k(r)),jQuery(".superlightbox_slider > div:last").hasClass("superlightbox_slide"+t)||(jQuery(l).remove(),jQuery(".superlightbox_slider").append(Y(t)),k(t)),jQuery(".superlightbox_slider").removeClass("superlightbox_sliding"),X(),C(i)},m=function(){C(r),C(i),C(t),X()},C=function(e){if(jQuery(".superlightboxcontainer").length){var r=jQuery(window).height(),t=jQuery(window).width();if(n[e]){e==i&&(g=0,h=0);var l=jQuery(".superlightbox_slide"+e),s=n[e],o=a[e],u=parseInt(s*t),p=parseInt(o*r);u>r?(l.find("img").css({height:r,width:p,left:"50%",top:"50%"}),jQuery(".superlightbox_slide"+e).find(".superlightbox_caption").length&&jQuery(".superlightbox_slide"+e).find(".superlightbox_caption").css({"max-width":p})):(l.find("img").css({width:t,height:u,left:"50%",top:"50%"}),jQuery(".superlightbox_slide"+e).find(".superlightbox_caption").length&&jQuery(".superlightbox_slide"+e).find(".superlightbox_caption").css({"max-width":t}))}else jQuery(".superlightbox_slide"+e).find(".superlightbox_embed_wrapper").length&&(jQuery(".superlightbox_slide"+e).find(".superlightbox_embed_wrapper").css({"max-width":parseInt(1.77*r)}),jQuery(".superlightbox_slide"+e).find(".superlightbox_caption").length&&jQuery(".superlightbox_slide"+e).find(".superlightbox_caption").css({"max-width":parseInt(1.77*r)}))}},X=function(){var e=jQuery(window).width();jQuery(".superlightbox_slider > div").each(function(i){jQuery(this).css({left:i*e,width:e})}),jQuery(".superlightbox_slider").css({left:-e,width:3*e})},Y=function(e){if(!o[e])return"";var i,r=o[e],t=Z(r);return"image"==t?i='<div class="superlightbox_slide superlightbox_slide'+e+' superloading">':"youtube"==t?(i='<div class="superlightbox_slide superlightbox_slide_video superlightbox_slide'+e+'">',i+=T(r)):"vimeo"==t&&(i='<div class="superlightbox_slide superlightbox_slide_video superlightbox_slide'+e+'">',i+=D(r)),""!=u[e]&&(i+='<div class="superlightbox_caption">'+u[e]+"</div>"),i+="</div>"},k=function(e){var i=o[e];if("image"==Z(i)){var r=new Image;r.superindex=e,r.onload=E,r.src=i}else C(e)},E=function(){if(void 0!==this.superindex&&jQuery(".superlightbox_slide"+this.superindex).length){var e=jQuery(".superlightbox_slide"+this.superindex),i="";""!=u[this.superindex]&&(i='<div class="superlightbox_caption">'+u[this.superindex]+"</div>"),e.html('<img src="'+this.src+'" />'+i),n[this.superindex]=this.naturalHeight/this.naturalWidth,a[this.superindex]=this.naturalWidth/this.naturalHeight,C(this.superindex),setTimeout(function(){e.removeClass("superloading")},800)}},Z=function(e){var i=e.split(".").reverse()[0].toLowerCase();return jQuery.inArray(i,["jpg","jpeg","png","gif"])>-1?"image":M(e)?"youtube":I(e)?"vimeo":""},I=function(e){var i=/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i.exec(e);return i&&i[1]},M=function(e){var i=/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9_\-]+)/i.exec(e);return i&&i[1]},T=function(e){return'<div class="superlightbox_embed_wrapper"><div class="superlightbox_embed"><iframe width="560" height="315" src="//www.youtube.com/embed/'+S(e)+'" frameborder="0" allowfullscreen></iframe></div></div>'},S=function(e){var i=e.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);return null!=i?i[1]:""},W=function(e){return"https://img.youtube.com/vi/"+S(e)+"/0.jpg"},D=function(e){var i=/(?:http?s?:\/\/)?(?:www\.)?(?:vimeo\.com)\/?(\S+)/g;if(i.test(e))var e=e.replace(i,'<div class="superlightbox_embed_wrapper"><div class="superlightbox_embed"><iframe width="420" height="345" src="//player.vimeo.com/video/$1" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe></div></div>');return e},O=function(e){var i=q(e);jQuery.ajax({type:"GET",url:"http://vimeo.com/api/v2/video/"+i+".json",jsonp:"callback",dataType:"jsonp",success:function(e){if(jQuery(".superlightbox_video"+e[0].id).length){var i=e[0].thumbnail_large;jQuery(".superlightbox_video"+e[0].id).css({"background-image":"url('"+i+"')"})}}})},q=function(e){var i=e.match(/^.+vimeo.com\/(.*\/)?([^#\?]*)/);return i?i[2]||i[1]:null},L=function(){return'<div class="superlightboxcontainer '+l+'" style="display:none;"><a href="javascript: void(0);" class="superlightbox_close"></a><div class="superlightbox_wrapper"><div class="superlightbox_slider"></div></div><div class="superlightbox_gallery"><a href="javascript: void(0);" class="superlightbox_gallery_button superlightbox_gallery_open"></a><a href="javascript: void(0);" class="superlightbox_gallery_nav superlightbox_gallery_prev" style="display: none;"></a><a href="javascript: void(0);" class="superlightbox_gallery_nav superlightbox_gallery_next" style="display: none;"></a><div class="superlightbox_gallery_wrapper" style="display: none;"></div></div><a href="javascript: void(0);" class="superlightbox_prev"></a><a href="javascript: void(0);" class="superlightbox_next"></a></div>'},z=function(e,i){var r={pinchImage:"",pinchZoom:function(e){},pinchZoomStart:function(){},pinchZoomEnd:function(){},swipe:function(e){},swipeLeft:function(e){},swipeRight:function(e){},swipeUp:function(e){},swipeDown:function(e){},swipeStart:function(e){},swipeEnd:function(e,i){},maxZoom:3},t=jQuery.extend({},r,i),l=new Object,s=!1,o=!1;l.sX=0,l.sY=0,l.eX=0,l.eY=0;var u,n,a,p,d,c,y,b,_,x,v,f,w,j,Q,m,C,X,Y,k,E,Z,I,M,T,S,W,D,O=20,q=40,L="",z=1,A=0,G=0,U=h,B=g,H=jQuery(e);H.on("touchstart",function(e){if(1==e.originalEvent.touches.length){s=!0,o=!1;var i=e.originalEvent.touches[0];l.sX=i.screenX,l.sY=i.clientY,1==z?t.swipeStart(l):t.pinchZoomStart()}else if(2==e.originalEvent.touches.length){s=!1,o=!0;var r=jQuery(window).width()/2,d=jQuery(window).height()/2;0==h&&0==h&&(h=jQuery(t.pinchImage).width(),g=jQuery(t.pinchImage).height(),z=1,A=r-(U=h),G=d-(B=g)),u=e.originalEvent.touches[0].clientX,n=e.originalEvent.touches[0].clientY,a=e.originalEvent.touches[1].clientX,p=e.originalEvent.touches[1].clientY,W=((C=(u+a)/2)-A)/U,D=((X=(n+p)/2)-G)/B,_=Math.sqrt(Math.pow(a-u,2)+Math.pow(p-n,2)),t.pinchZoomStart()}}),H.on("touchmove",function(e){if(e.preventDefault(),s){var i=e.originalEvent.touches[0];l.eX=i.screenX,l.eY=i.clientY,z>1?((r={}).left=A+U+(l.eX-l.sX),r.top=G+B+(l.eY-l.sY),t.pinchZoom(r)):t.swipe(l)}else if(o){d=e.originalEvent.touches[0].clientX,c=e.originalEvent.touches[0].clientY,y=e.originalEvent.touches[1].clientX,b=e.originalEvent.touches[1].clientY,x=Math.sqrt(Math.pow(y-d,2)+Math.pow(b-c,2)),T=(E=(U-(j=h*(f=(v=x/_)*z)))*W)+(I=-C+(Y=(d+y)/2)),S=(Z=(B-(w=g*f))*D)+(M=-X+(k=(c+b)/2)),Q=parseInt(A+T),m=parseInt(G+S);var r={};r.left=Q+j,r.top=m+w,r.width=j,r.height=w,t.pinchZoom(r)}}),H.on("touchend",function(e){if(s){if(z>1)return A+=l.eX-l.sX,void(G+=l.eY-l.sY);var i=jQuery(window).width(),r=jQuery(window).height();O=.1*i,q=.1*r,(l.eX-O>l.sX||l.eX+O<l.sX)&&l.eY<l.sY+50&&l.sY>l.eY-50&&(L=l.eX>l.sX?"l":"r"),(l.eY-q>l.sY||l.eY+q<l.sY)&&l.eX<l.sX+40&&l.sX>l.eX-40&&(L=l.eY>l.sY?"d":"u"),""!=L&&("l"==L?t.swipeLeft(l):"r"==L?t.swipeRight(l):"u"==L?t.swipeUp(l):"d"==L&&t.swipeDown(l)),t.swipeEnd(l,L),L=""}else if(o){var u=jQuery(window).width()/2,n=jQuery(window).height()/2;if(f<1)f=1,(a={}).left="50%",a.top="50%",a.width=h,a.height=g,t.pinchZoom(a),Q=u-h,m=n-g,j=h,w=g;else if(f>t.maxZoom){f=t.maxZoom,T=(E=(U-(j=h*f))*W)+(I=-C+Y),S=(Z=(B-(w=g*f))*D)+(M=-X+k),Q=parseInt(A+T),m=parseInt(G+S);var a={};a.left=Q+j,a.top=m+w,a.width=j,a.height=w,t.pinchZoom(a)}A=Q,G=m,U=j,B=w,z=f,t.pinchZoomEnd()}s=!1,o=!1}),H.on("touchcancel",function(e){s=!1,o=!1})};return l=function(e,i){i=i||"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(var r="",t=0;t<e;t++){var l=Math.floor(Math.random()*i.length);r+=i.substring(l,l+1)}return r}(10),this.each(function(){var e=jQuery(this),i=e.attr(d.mediaAttribute);if(jQuery.inArray(i,o)<0){o.push(i);var r=void 0!==e.attr(d.mediaCaption)?e.attr(d.mediaCaption):"";u.push(r)}e.click(function(e){e.preventDefault(),c(jQuery(this))})})},jQuery(document).ready(function(){jQuery(".supergallery").length&&jQuery(".supergallery").superLightBox({mediaCaption:"data-caption"})});