/* Minification failed. Returning unminified contents.
(1,12-13): run-time error JS1195: Expected expression: )
(1,15-16): run-time error JS1195: Expected expression: >
(5,77-78): run-time error JS1195: Expected expression: >
(80,7-8): run-time error JS1002: Syntax error: }
(277,7-8): run-time error JS1002: Syntax error: }
(314,7-8): run-time error JS1002: Syntax error: }
(343,7-8): run-time error JS1002: Syntax error: }
(358,7-8): run-time error JS1002: Syntax error: }
(358,8-9): run-time error JS1197: Too many errors. The file might not be a JavaScript file: )
 */
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ([
/* 0 */,
/* 1 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_0__);
/*
Accordion dropdown
add the parent wrapper class to scope the accordion functionality
accordion(".wrapper");
used in global footer
*/
// debounce is used to wait until resizing stops


var accordion = function accordion(wrapper, breakpoint) {
  var wrap = wrapper; // Reset everything

  var accordionReset = function accordionReset() {
    //console.log("accordion reset");
    $(".altair-footer .accordion, .newsroom:not('.search') .content-wrapper .accordion").removeClass("active");
    $(".altair-footer .accordion .active, .newsroom:not('.search') .content-wrapper .accordion .active").removeClass("active");
    $(".altair-footer .altair-footer__about, .newsroom .content-wrapper .dropdown").removeClass("is-open");
  };

  var accordionSetup = function accordionSetup() {
    //console.log("accordion setup");
    if (windowWidth === undefined) {
      var windowWidth = window.innerWidth; // console.log(windowWidth);
    }

    if (windowWidth < breakpoint) {
      //console.log("wif "+windowWidth);
      $(wrap).find(".accordion").addClass("active");
      $(wrap + " [data-accordion]").off("click").on("click", function (e) {
        e.preventDefault(); // if the about heading is open add border below

        if ($(this).hasClass("about")) {
          $(this).parent().toggleClass('is-open');
        }

        var $panel = $(this).attr("data-accordion"); //console.log($panel);
        // is the item active?

        if ($(this).hasClass("active")) {
          //console.log($(this).attr("class") + "has active");
          $(this).removeClass("active");
          $(wrap + " " + $panel).removeClass("active");
        } else {
          // Reset everything
          //console.log("not active");
          $(wrap + " .accordion__content", wrap + " [data-accordion]").removeClass("active");
          $(this).toggleClass("active");
          $(wrap + " " + $panel).toggleClass("active");
        }
      }); //end check breakpoint
    } else {
      accordionReset();
    }
  }; // on load


  accordionReset();
  accordionSetup(); // on resize

  window.addEventListener("resize", lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default()(function () {
    if (!$(".newsroom").hasClass("search")) {
      accordionReset();
      accordionSetup();
    }
  }, 200));
};

window.accordion = accordion;

/***/ }),
/* 2 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var isObject = __webpack_require__(3),
    now = __webpack_require__(4),
    toNumber = __webpack_require__(7);

/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';

/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeMax = Math.max,
    nativeMin = Math.min;

/**
 * Creates a debounced function that delays invoking `func` until after `wait`
 * milliseconds have elapsed since the last time the debounced function was
 * invoked. The debounced function comes with a `cancel` method to cancel
 * delayed `func` invocations and a `flush` method to immediately invoke them.
 * Provide `options` to indicate whether `func` should be invoked on the
 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
 * with the last arguments provided to the debounced function. Subsequent
 * calls to the debounced function return the result of the last `func`
 * invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the debounced function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.debounce` and `_.throttle`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to debounce.
 * @param {number} [wait=0] The number of milliseconds to delay.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=false]
 *  Specify invoking on the leading edge of the timeout.
 * @param {number} [options.maxWait]
 *  The maximum time `func` is allowed to be delayed before it's invoked.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new debounced function.
 * @example
 *
 * // Avoid costly calculations while the window size is in flux.
 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
 *
 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
 * jQuery(element).on('click', _.debounce(sendMail, 300, {
 *   'leading': true,
 *   'trailing': false
 * }));
 *
 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
 * var source = new EventSource('/stream');
 * jQuery(source).on('message', debounced);
 *
 * // Cancel the trailing debounced invocation.
 * jQuery(window).on('popstate', debounced.cancel);
 */
function debounce(func, wait, options) {
  var lastArgs,
      lastThis,
      maxWait,
      result,
      timerId,
      lastCallTime,
      lastInvokeTime = 0,
      leading = false,
      maxing = false,
      trailing = true;

  if (typeof func != 'function') {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  wait = toNumber(wait) || 0;
  if (isObject(options)) {
    leading = !!options.leading;
    maxing = 'maxWait' in options;
    maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
    trailing = 'trailing' in options ? !!options.trailing : trailing;
  }

  function invokeFunc(time) {
    var args = lastArgs,
        thisArg = lastThis;

    lastArgs = lastThis = undefined;
    lastInvokeTime = time;
    result = func.apply(thisArg, args);
    return result;
  }

  function leadingEdge(time) {
    // Reset any `maxWait` timer.
    lastInvokeTime = time;
    // Start the timer for the trailing edge.
    timerId = setTimeout(timerExpired, wait);
    // Invoke the leading edge.
    return leading ? invokeFunc(time) : result;
  }

  function remainingWait(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime,
        timeWaiting = wait - timeSinceLastCall;

    return maxing
      ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
      : timeWaiting;
  }

  function shouldInvoke(time) {
    var timeSinceLastCall = time - lastCallTime,
        timeSinceLastInvoke = time - lastInvokeTime;

    // Either this is the first call, activity has stopped and we're at the
    // trailing edge, the system time has gone backwards and we're treating
    // it as the trailing edge, or we've hit the `maxWait` limit.
    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  }

  function timerExpired() {
    var time = now();
    if (shouldInvoke(time)) {
      return trailingEdge(time);
    }
    // Restart the timer.
    timerId = setTimeout(timerExpired, remainingWait(time));
  }

  function trailingEdge(time) {
    timerId = undefined;

    // Only invoke if we have `lastArgs` which means `func` has been
    // debounced at least once.
    if (trailing && lastArgs) {
      return invokeFunc(time);
    }
    lastArgs = lastThis = undefined;
    return result;
  }

  function cancel() {
    if (timerId !== undefined) {
      clearTimeout(timerId);
    }
    lastInvokeTime = 0;
    lastArgs = lastCallTime = lastThis = timerId = undefined;
  }

  function flush() {
    return timerId === undefined ? result : trailingEdge(now());
  }

  function debounced() {
    var time = now(),
        isInvoking = shouldInvoke(time);

    lastArgs = arguments;
    lastThis = this;
    lastCallTime = time;

    if (isInvoking) {
      if (timerId === undefined) {
        return leadingEdge(lastCallTime);
      }
      if (maxing) {
        // Handle invocations in a tight loop.
        clearTimeout(timerId);
        timerId = setTimeout(timerExpired, wait);
        return invokeFunc(lastCallTime);
      }
    }
    if (timerId === undefined) {
      timerId = setTimeout(timerExpired, wait);
    }
    return result;
  }
  debounced.cancel = cancel;
  debounced.flush = flush;
  return debounced;
}

module.exports = debounce;


/***/ }),
/* 3 */
/***/ ((module) => {

/**
 * Checks if `value` is the
 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
 * @example
 *
 * _.isObject({});
 * // => true
 *
 * _.isObject([1, 2, 3]);
 * // => true
 *
 * _.isObject(_.noop);
 * // => true
 *
 * _.isObject(null);
 * // => false
 */
function isObject(value) {
  var type = typeof value;
  return value != null && (type == 'object' || type == 'function');
}

module.exports = isObject;


/***/ }),
/* 4 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var root = __webpack_require__(5);

/**
 * Gets the timestamp of the number of milliseconds that have elapsed since
 * the Unix epoch (1 January 1970 00:00:00 UTC).
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Date
 * @returns {number} Returns the timestamp.
 * @example
 *
 * _.defer(function(stamp) {
 *   console.log(_.now() - stamp);
 * }, _.now());
 * // => Logs the number of milliseconds it took for the deferred invocation.
 */
var now = function() {
  return root.Date.now();
};

module.exports = now;


/***/ }),
/* 5 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var freeGlobal = __webpack_require__(6);

/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;

/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();

module.exports = root;


/***/ }),
/* 6 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;

module.exports = freeGlobal;


/***/ }),
/* 7 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var baseTrim = __webpack_require__(8),
    isObject = __webpack_require__(3),
    isSymbol = __webpack_require__(10);

/** Used as references for various `Number` constants. */
var NAN = 0 / 0;

/** Used to detect bad signed hexadecimal string values. */
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;

/** Used to detect binary string values. */
var reIsBinary = /^0b[01]+$/i;

/** Used to detect octal string values. */
var reIsOctal = /^0o[0-7]+$/i;

/** Built-in method references without a dependency on `root`. */
var freeParseInt = parseInt;

/**
 * Converts `value` to a number.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to process.
 * @returns {number} Returns the number.
 * @example
 *
 * _.toNumber(3.2);
 * // => 3.2
 *
 * _.toNumber(Number.MIN_VALUE);
 * // => 5e-324
 *
 * _.toNumber(Infinity);
 * // => Infinity
 *
 * _.toNumber('3.2');
 * // => 3.2
 */
function toNumber(value) {
  if (typeof value == 'number') {
    return value;
  }
  if (isSymbol(value)) {
    return NAN;
  }
  if (isObject(value)) {
    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
    value = isObject(other) ? (other + '') : other;
  }
  if (typeof value != 'string') {
    return value === 0 ? value : +value;
  }
  value = baseTrim(value);
  var isBinary = reIsBinary.test(value);
  return (isBinary || reIsOctal.test(value))
    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
    : (reIsBadHex.test(value) ? NAN : +value);
}

module.exports = toNumber;


/***/ }),
/* 8 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var trimmedEndIndex = __webpack_require__(9);

/** Used to match leading whitespace. */
var reTrimStart = /^\s+/;

/**
 * The base implementation of `_.trim`.
 *
 * @private
 * @param {string} string The string to trim.
 * @returns {string} Returns the trimmed string.
 */
function baseTrim(string) {
  return string
    ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
    : string;
}

module.exports = baseTrim;


/***/ }),
/* 9 */
/***/ ((module) => {

/** Used to match a single whitespace character. */
var reWhitespace = /\s/;

/**
 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
 * character of `string`.
 *
 * @private
 * @param {string} string The string to inspect.
 * @returns {number} Returns the index of the last non-whitespace character.
 */
function trimmedEndIndex(string) {
  var index = string.length;

  while (index-- && reWhitespace.test(string.charAt(index))) {}
  return index;
}

module.exports = trimmedEndIndex;


/***/ }),
/* 10 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var baseGetTag = __webpack_require__(11),
    isObjectLike = __webpack_require__(15);

/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';

/**
 * Checks if `value` is classified as a `Symbol` primitive or object.
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
 * @example
 *
 * _.isSymbol(Symbol.iterator);
 * // => true
 *
 * _.isSymbol('abc');
 * // => false
 */
function isSymbol(value) {
  return typeof value == 'symbol' ||
    (isObjectLike(value) && baseGetTag(value) == symbolTag);
}

module.exports = isSymbol;


/***/ }),
/* 11 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var Symbol = __webpack_require__(12),
    getRawTag = __webpack_require__(13),
    objectToString = __webpack_require__(14);

/** `Object#toString` result references. */
var nullTag = '[object Null]',
    undefinedTag = '[object Undefined]';

/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;

/**
 * The base implementation of `getTag` without fallbacks for buggy environments.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the `toStringTag`.
 */
function baseGetTag(value) {
  if (value == null) {
    return value === undefined ? undefinedTag : nullTag;
  }
  return (symToStringTag && symToStringTag in Object(value))
    ? getRawTag(value)
    : objectToString(value);
}

module.exports = baseGetTag;


/***/ }),
/* 12 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var root = __webpack_require__(5);

/** Built-in value references. */
var Symbol = root.Symbol;

module.exports = Symbol;


/***/ }),
/* 13 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var Symbol = __webpack_require__(12);

/** Used for built-in method references. */
var objectProto = Object.prototype;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;

/**
 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
 *
 * @private
 * @param {*} value The value to query.
 * @returns {string} Returns the raw `toStringTag`.
 */
function getRawTag(value) {
  var isOwn = hasOwnProperty.call(value, symToStringTag),
      tag = value[symToStringTag];

  try {
    value[symToStringTag] = undefined;
    var unmasked = true;
  } catch (e) {}

  var result = nativeObjectToString.call(value);
  if (unmasked) {
    if (isOwn) {
      value[symToStringTag] = tag;
    } else {
      delete value[symToStringTag];
    }
  }
  return result;
}

module.exports = getRawTag;


/***/ }),
/* 14 */
/***/ ((module) => {

/** Used for built-in method references. */
var objectProto = Object.prototype;

/**
 * Used to resolve the
 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
 * of values.
 */
var nativeObjectToString = objectProto.toString;

/**
 * Converts `value` to a string using `Object.prototype.toString`.
 *
 * @private
 * @param {*} value The value to convert.
 * @returns {string} Returns the converted string.
 */
function objectToString(value) {
  return nativeObjectToString.call(value);
}

module.exports = objectToString;


/***/ }),
/* 15 */
/***/ ((module) => {

/**
 * Checks if `value` is object-like. A value is object-like if it's not `null`
 * and has a `typeof` result of "object".
 *
 * @static
 * @memberOf _
 * @since 4.0.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
 * @example
 *
 * _.isObjectLike({});
 * // => true
 *
 * _.isObjectLike([1, 2, 3]);
 * // => true
 *
 * _.isObjectLike(_.noop);
 * // => false
 *
 * _.isObjectLike(null);
 * // => false
 */
function isObjectLike(value) {
  return value != null && typeof value == 'object';
}

module.exports = isObjectLike;


/***/ }),
/* 16 */,
/* 17 */,
/* 18 */,
/* 19 */,
/* 20 */
/***/ (() => {

// Build the mobile menu from the desktop menu html as Sitefinity's visual builder isn't conducive to a separate mobile navigation template.
(function () {
  var headerItems = document.querySelectorAll('.altair-header #ml-menu + .container .navbar-primary .navbar__item');

  if (!headerItems) {
    return;
  }

  var subMenus = [];
  var mobileMenuMarkup = '<ul id="menu-0" class="menu__level" data-menu="main" role="menu" aria-label="All">';
  headerItems.forEach(function (item, index) {
    var parentItem = item.querySelectorAll('.btn-text')[0];
    var subItems = item.querySelector('.navbarmenu__content');

    if (!parentItem) {
      return;
    }

    if (subItems) {
      // Keep track of sub menu items so those menus can be created after main navigation is created.
      var thirdLevelLabel = item.querySelectorAll('.navbarmenu__subhead');

      if (thirdLevelLabel.length) {
        // If there are 3 levels of submenus, get the 2nd level labels and third level links.
        subMenus.push({
          menu: "submenu-".concat(index),
          items: thirdLevelLabel,
          label: parentItem.innerText,
          level: 2,
          hasThirdLevel: true
        });
        thirdLevelLabel.forEach(function (level, levelIndex) {
          subMenus.push({
            menu: "submenu-".concat(index, "-").concat(levelIndex),
            items: level.parentNode.querySelectorAll('a'),
            label: level.innerText,
            level: 3
          });
        });
      } else {
        // If no third level construct normal submenu
        subMenus.push({
          menu: "submenu-".concat(index),
          items: subItems.querySelectorAll('a'),
          label: parentItem.innerText,
          level: 2
        });
      }
    }

    mobileMenuMarkup += "\n            <li id=\"mobile-item-".concat(index, "\" class=\"menu__item\" role=\"menuitem\">\n                <a ").concat(subItems ? "data-submenu=\"submenu-".concat(index, "\"") : '', " class=\"menu__link menu__link--primary\" href=\"").concat(parentItem.getAttribute('href'), "\" target=\"").concat(parentItem.getAttribute('target') || '_self', "\">\n                   ").concat(parentItem.innerHTML, "\n                </a>\n            </li>\n            ");
  }); // Get secondary/util navigation items. Add to mobile menu markup.

  var secondaryMenu = document.querySelectorAll('.altair-header .navbar-secondary > li > a');

  if (secondaryMenu.length) {
    secondaryMenu.forEach(function (secondary) {
      mobileMenuMarkup += "\n                <li class=\"menu__item\" role=\"menuitem\">\n                    <a class=\"menu__link menu__link--secondary\" href=\"".concat(secondary.getAttribute('href'), "\" target=\"").concat(secondary.getAttribute('target'), "\">").concat(secondary.innerHTML, "</a>\n                </li>\n                ");
    });
  } // Get language dropdown toggle. Add to mobile menu markup.


  var cultureMenu = document.querySelector('.altair-header .dropdown.language');

  if (cultureMenu) {
    mobileMenuMarkup += "\n            <li class=\"menu__item\" role=\"menuitem\">\n                <a class=\"menu__link menu__link--secondary\" data-submenu=\"submenu-lang\" aria-owns=\"submenu-lang\" href=\"https://www.altair.com/\" target=\"_self\">".concat(cultureMenu.querySelector('.dropdown__toggle').innerText, "</a>\n            </li>\n            ");
  }

  mobileMenuMarkup += '</ul>'; // Create sub menu wrappers.

  subMenus.forEach(function (menu) {
    mobileMenuMarkup += "<ul id=\"".concat(menu.menu, "\" class=\"menu__level\" data-menu=\"").concat(menu.menu, "\" role=\"menu\" aria-label=\"").concat(menu.label, "\">");
    menu.items.forEach(function (item, itemIndex) {
      mobileMenuMarkup += "\n            <li class=\"menu__item menu__level-".concat(menu.level, "\" role=\"menuitem\">\n                <a ").concat(menu.hasThirdLevel ? "data-submenu=\"".concat(menu.menu, "-").concat(itemIndex, "\"") : '', " class=\"menu__link ").concat(menu.level == 3 ? '' : 'menu__link--primary', " ").concat(item.getAttribute('class'), "\" href=\"").concat(item.getAttribute('href'), "\" target=\"").concat(item.getAttribute('target') || '_self', "\">").concat(item.innerHTML, "</a>\n            </li>\n            ");
    });
    mobileMenuMarkup += '</ul>';
  }); // Create language select as sub menu.

  if (cultureMenu) {
    var cultures = document.querySelector('.altair-header .dropdown.language .dropdown__content ul').innerHTML;
    mobileMenuMarkup += "\n        <ul id=\"submenu-lang\" class=\"menu__level\" data-menu=\"submenu-lang\" role=\"menu\" aria-label=\"Languages\">\n            ".concat(cultures, "\n        </ul>\n        ");
  }

  var templateTarget = document.querySelector('#ml-menu .menu__wrap');

  if (templateTarget) {
    templateTarget.innerHTML = mobileMenuMarkup;
  }
})();

/***/ }),
/* 21 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__);
//throttle is used to limit times a function is ran
 // debounce is used to wait until resizing stops

 // Browser detection

var is_opera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
var is_Edge = navigator.userAgent.indexOf("Edge") > -1;
var is_chrome = !!window.chrome && !is_opera && !is_Edge;
var is_explorer = typeof document !== 'undefined' && !!document.documentMode && !is_Edge;
var is_firefox = typeof window.InstallTrigger !== 'undefined';
var is_safari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // Usage:
//if (is_safari) alert('Safari');

function isiPhone() {
  return navigator.platform.indexOf("iPhone") != -1 || navigator.platform.indexOf("iPod") != -1;
} //if (isiPhone())


var adjustDropdownTop = function adjustDropdownTop() {
  // wait .5s for secondary nav css transition to stop before getting height
  //console.log("adjust header top padding");
  var currentPadding = $('body').css('padding-top');
  currentPadding = parseInt(currentPadding, 10);
  var headerHeight = $('.altair-header').height();
  var paddingDifference = Math.abs(currentPadding - headerHeight);
  $('.navbarmenu__content').css('opacity', 0);
  setTimeout(function () {
    $('.navbarmenu__content').css("top", $('.altair-header').height() - 1);
  }, 500);
  setTimeout(function () {
    $('.navbarmenu__content').css('opacity', 1);
  }, 1000); // dropdown adjustment is set allow menu to be seen
  //$(".navbarmenu__content").css("visibility","visible");

  $(".navbarmenu__content").addClass("show");
};

var setMobileMenuWrapHeight = function setMobileMenuWrapHeight() {
  // polyfill for css vh to remove browser chrome
  if (isMobile() == true) {
    var setHeight = function setHeight() {
      $('.menu .menu__wrap ul').height(liveArea);
      prevPageHeight = liveArea; //console.log("liveArea " + liveArea);
      //console.log("prevPageHeight " + prevPageHeight);
    };

    var prevPageHeight = 0; // subtract 100 to account for breadcrumb at top and top padding

    var liveArea = $('.menu__wrap').innerHeight() - 100; // are you an iphone?

    if (isiPhone()) {
      if (is_safari) {
        liveArea = liveArea - 120; //console.log("is safari" + liveArea);
      }

      if (is_chrome) {
        liveArea = liveArea - 90; //console.log("is chrome" + liveArea);
      }
    } else {
      if (is_safari) {
        liveArea = liveArea - 80; //console.log("is safari" + liveArea);
      }

      if (is_chrome) {
        liveArea = liveArea - 50; //console.log("is chrome" + liveArea);
      }
    }

    if (liveArea != prevPageHeight) {
      setHeight();
    }
  }
};

var getWindowWidth = function getWindowWidth() {
  window.scrollbarWidth = window.innerWidth - $(document).width();
  window.windowWidth = window.outerWidth - scrollbarWidth;
};

var isMobile = function isMobile() {
  if (window.windowWidth < 1280) {
    return true;
  } else {
    return false;
  }
};

var setupMobileNav = function setupMobileNav() {
  var menuEl = document.getElementById('ml-menu'),
      mlmenu = new MLMenu(menuEl, {
    // breadcrumbsCtrl : true, // show breadcrumbs
    initialBreadcrumb: 'Home',
    // initial breadcrumb text
    backCtrl: true,
    // show back button
    itemsDelayInterval: 60 // delay between each menu item sliding animation
    //onItemClick: loadDummyData // callback: item that doesn´t have a submenu gets clicked - onItemClick([event], [inner HTML of the clicked item])

  }); // mobile menu toggle

  var openMenuCtrl = document.querySelector('.action--open'),
      closeMenuCtrl = document.querySelector('.action--close');
  openMenuCtrl.addEventListener('click', openMenu);
  closeMenuCtrl.addEventListener('click', closeMenu);

  function openMenu() {
    classie.add(menuEl, 'menu--open');
    closeMenuCtrl.focus();
    $('body').toggleClass('nav-open');
  }

  function closeMenu() {
    classie.remove(menuEl, 'menu--open');
    openMenuCtrl.focus();
    $('body').toggleClass('nav-open');
  } // close menu when language is selected


  $("#submenu-6").click(function () {
    closeMenu();
  });
  $(".navbar-brand__toggle").fadeTo(200, 1);
};

var setupHeaderAlert = function setupHeaderAlert() {
  // moved cookie check out of setTimeout and set css if cookie is found
  if (document.cookie.match('header-alert')) {
    $('#cookie-bar').css({
      "display": "none"
    });
  } else {
    //console.log("show alert");
    $.cookieBar();
  }

  setTimeout(function () {
    adjustDropdownTop(); //console.log("header alert init");
  }, 500); // when the cookie bar is dismmised need to adjust menu position

  $(".cookie-bar__btn").click(function () {
    adjustDropdownTop();
  });
};

var headerFooterInit = function headerFooterInit() {
  if (document.querySelector('.navbar-primary')) {
    //dom loaded
    getWindowWidth();
    isMobile();
    adjustDropdownTop();
    setupHeaderAlert();
    setupMobileNav();
    setMobileMenuWrapHeight();
  }

  window.accordion(".altair-footer", 800);
}; // make headerFooterInit available in window


window.headerFooterInit = headerFooterInit; // On Document Loaded

$(document).ready(function () {
  if (document.querySelector('.navbar-primary')) {
    getWindowWidth();
    isMobile();
    adjustDropdownTop();
    setupMobileNav();
    setupHeaderAlert();
  }
}); // On Window load

window.addEventListener('load', function () {
  //need to readjust width after page is loaded 
  if (document.querySelector('.navbar-primary')) {
    setMobileMenuWrapHeight();
    window.accordion(".altair-footer", 800);
  }
}); // window is resized

window.addEventListener("resize", lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(function () {
  if (document.querySelector('.navbar-primary')) {
    getWindowWidth();
    adjustDropdownTop();
    isMobile();
    setMobileMenuWrapHeight();
  }
}, 100)); //device orientation change

window.addEventListener("orientationchange", lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(function () {
  //console.log("device orientation change");
  if (document.querySelector('.navbar-primary')) {
    isMobile();
    setMobileMenuWrapHeight();
  }
}, 100)); //throttled scroll

window.addEventListener("scroll", lodash_throttle__WEBPACK_IMPORTED_MODULE_0___default()(function () {
  if (!$("body").hasClass("search-results")) {
    $('.altair-header .dropdown').removeClass("is-open");
  }

  $('body').addClass("scrolling");
  setTimeout(function () {
    $('body').removeClass("scrolling");
  }, 500);
  adjustDropdownTop();
}, 500)); // no throttle scroll - hide the secondary nav on scroll

$(window).scroll(function () {
  var isHomePageRedesign = $("body").hasClass("scrolled-away") || $("body").hasClass("scrolled-back");

  if (!isHomePageRedesign) {
    //console.log('is not homepage')
    if ($(window).scrollTop() > 0 && $(window).scrollTop() > 131) {
      $('body, .altair-header, .navbar-secondary, .cookie-bar').addClass("scroll");
    } else {
      $('body, .altair-header, .navbar-secondary, .cookie-bar').removeClass("scroll");
    }
  } else {//console.log('is homepage')
  }
});

/***/ }),
/* 22 */
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var debounce = __webpack_require__(2),
    isObject = __webpack_require__(3);

/** Error message constants. */
var FUNC_ERROR_TEXT = 'Expected a function';

/**
 * Creates a throttled function that only invokes `func` at most once per
 * every `wait` milliseconds. The throttled function comes with a `cancel`
 * method to cancel delayed `func` invocations and a `flush` method to
 * immediately invoke them. Provide `options` to indicate whether `func`
 * should be invoked on the leading and/or trailing edge of the `wait`
 * timeout. The `func` is invoked with the last arguments provided to the
 * throttled function. Subsequent calls to the throttled function return the
 * result of the last `func` invocation.
 *
 * **Note:** If `leading` and `trailing` options are `true`, `func` is
 * invoked on the trailing edge of the timeout only if the throttled function
 * is invoked more than once during the `wait` timeout.
 *
 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
 *
 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
 * for details over the differences between `_.throttle` and `_.debounce`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Function
 * @param {Function} func The function to throttle.
 * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
 * @param {Object} [options={}] The options object.
 * @param {boolean} [options.leading=true]
 *  Specify invoking on the leading edge of the timeout.
 * @param {boolean} [options.trailing=true]
 *  Specify invoking on the trailing edge of the timeout.
 * @returns {Function} Returns the new throttled function.
 * @example
 *
 * // Avoid excessively updating the position while scrolling.
 * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
 *
 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
 * jQuery(element).on('click', throttled);
 *
 * // Cancel the trailing throttled invocation.
 * jQuery(window).on('popstate', throttled.cancel);
 */
function throttle(func, wait, options) {
  var leading = true,
      trailing = true;

  if (typeof func != 'function') {
    throw new TypeError(FUNC_ERROR_TEXT);
  }
  if (isObject(options)) {
    leading = 'leading' in options ? !!options.leading : leading;
    trailing = 'trailing' in options ? !!options.trailing : trailing;
  }
  return debounce(func, wait, {
    'leading': leading,
    'maxWait': wait,
    'trailing': trailing
  });
}

module.exports = throttle;


/***/ }),
/* 23 */
/***/ (() => {

// Select all elements with the class 'SearchTB'
var searchTriggers = document.querySelectorAll('.SearchTB');
var searchInput;
var searchHolder = document.querySelector('.altair-header .search'); // Debounce function to limit the rate at which the scroll event handler is called

function debounce(func, wait) {
  var timeout;
  return function () {
    var context = this,
        args = arguments;
    clearTimeout(timeout);
    timeout = setTimeout(function () {
      return func.apply(context, args);
    }, wait);
  };
}

var disableScrollHandler = false; // Flag to disable scroll handler
// check if the device has touch support

function isMobileDevice() {
  return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
} // Add a focus event listener to each element


searchTriggers.forEach(function (searchTrigger) {
  searchTrigger.addEventListener('focus', function () {
    if (isMobileDevice()) {
      disableScrollHandler = true; // Exit if scroll handler is disabled
    }

    if (window.windowWidth < 1280) {
      searchInput = document.querySelector('.search .SearchTB__mob');
      var searchInputW = document.querySelector('.navbar').offsetWidth;
      searchHolder.classList.toggle('active');
      searchHolder.style.backgroundColor = '#FFF';
      searchInputW = searchInputW - 40;
      searchInput.style.transition = 'width 0.5s ease-out';
      searchInput.style.width = searchInputW + 'px';
      var closeBtn = document.querySelector('.close.close_mob');
      closeBtn.classList.remove('hide');
    } else {
      searchInput = document.querySelector('.search .SearchTB__dsk');
      var fieldWidth = document.querySelector('.navbar-secondary').offsetWidth;
      searchInput.style.transition = 'width 0.5s ease-out';
      searchInput.style.width = fieldWidth + 'px';

      var _closeBtn = searchTrigger.closest('.search').querySelector('.close');

      _closeBtn.classList.remove('hide');
    }
  });

  function handleScroll() {
    if (isMobileDevice()) {
      if (disableScrollHandler) return; // Exit if scroll handler is disabled
    }

    if (window.innerWidth < 1280) {
      searchInput = document.querySelector('.search .SearchTB__mob');
    } else {
      searchInput = document.querySelector('.search .SearchTB__dsk');
    }

    searchInput.blur(); // Remove focus from the search input
  }

  window.addEventListener('scroll', debounce(handleScroll, 100)); // Use Blur event to reset search input field

  searchTrigger.addEventListener('blur', function () {
    if (isMobileDevice()) {
      disableScrollHandler = false; // renable scroll handler when input loses focus
    }

    if (window.windowWidth < 1280) {
      searchInput = document.querySelector('.search .SearchTB__mob');
      searchHolder.classList.remove('active');
      searchHolder.style.backgroundColor = 'transparent';
    } else {
      searchInput = document.querySelector('.search .SearchTB__dsk');
    }

    var closeBtn = searchTrigger.closest('.search').querySelector('.close');
    searchInput.removeAttribute('style'); // Reset the width

    closeBtn.classList.add('hide');
  });
});

/***/ }),
/* 24 */
/***/ (() => {

// Toggle dropdown menu on click of trigger element
$(".dropdown__toggle").on("click touch", function () {
  $(this).closest(".dropdown").toggleClass("is-open");
}); // Hide dropdown menu on click outside

$(document).on("click touch", function (event) {
  // clicked a link inside a dropdown
  if ($(event.target).parent().parent().parent().hasClass("dropdown__content")) {
    $(event.target).closest(".dropdown").removeClass("is-open");
  } else if (!$(event.target).closest(".dropdown").length) {
    // clicked anywhere outside dropdown
    $(".dropdown").removeClass("is-open");
  }
});

/***/ }),
/* 25 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(22);
/* harmony import */ var lodash_throttle__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_throttle__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_1__);
// throttle is used to limit times a function is ran
 // debounce is used to wait until resizing stops



if (document.querySelector('.buy-try-links ')) {
  // get browser width
  var getWidth = function getWidth() {
    return Math.max(document.body.scrollWidth, document.documentElement.scrollWidth, document.body.offsetWidth, document.documentElement.offsetWidth, document.documentElement.clientWidth);
  }; // set button to header if page is less that 530px


  var setButtonTop = function setButtonTop() {
    if (getWidth() <= 529) {
      var altairHeader = document.querySelector('.altair-header').clientHeight;
      divStickyButtons.classList.add("prod-button-stick");
      divStickyButtons.style.top = "".concat(altairHeader, "px"); // more accurate than divStickyButtons

      var divStickyButtonsHeight = document.querySelector('#divStickyButtons .btn').clientHeight;
      prodHero.style.marginTop = "".concat(divStickyButtonsHeight, "px");
    } else {
      divStickyButtons.classList.remove("prod-button-stick");
      divStickyButtons.style.removeProperty('top');
      prodHero.style.removeProperty('margin-top');
    }
  }; // stick button to header on pageload funtion at bottom for window resize


  var setButtonBottom = function setButtonBottom() {
    // run on screens larger than 530
    if (getWidth() >= 530) {
      var altairHeader = document.querySelector('.altair-header').clientHeight;

      if (divStickyButtons) {
        var stickyButtonYPos = divStickyButtons.getBoundingClientRect().top;

        if (stickyButtonYPos <= altairHeader) {
          divStickyButtons.classList.add("prod-button-stick");
        }
      }
    }
  };

  var unSetButton = function unSetButton() {
    // run on screens larger than 530
    if (getWidth() >= 530) {
      var altairHeader = document.querySelector('.altair-header').clientHeight;

      if (prodSidebar) {
        var prodSidebarYPos = prodSidebar.getBoundingClientRect().top;

        if (prodSidebarYPos >= altairHeader && divStickyButtons.classList.contains("prod-button-stick")) {
          divStickyButtons.classList.remove("prod-button-stick");
        }
      }
    }
  }; // check browser width on resize 


  var checkBrowserWidth = function checkBrowserWidth() {
    window.addEventListener('resize', lodash_debounce__WEBPACK_IMPORTED_MODULE_1___default()(function () {
      setButtonTop();
    }, 300));
  };

  var checkScroll = function checkScroll() {
    var scrollPos = 0;
    window.addEventListener('scroll', lodash_throttle__WEBPACK_IMPORTED_MODULE_0___default()(function () {
      // move button to top if cookiebanner is present on scroll
      setButtonTop();

      if (document.body.getBoundingClientRect().top > scrollPos) {
        unSetButton();
      } else {
        setButtonBottom();
      }

      scrollPos = document.body.getBoundingClientRect().top;
    }, 300));
  };

  // create vars for header, hero and button
  console.log('links are ready');
  var divStickyButtons = document.querySelector('#divStickyButtons');
  var prodSidebar = document.querySelector('.product-overview__sidebar');
  var prodHero = document.querySelector('.hero');
  setButtonTop(); // get header size and reset button position once cookiebar is removed

  if (document.querySelector('#cookie-bar')) {
    document.querySelector(".cookie-bar__btn").onclick = function () {
      document.querySelector('#cookie-bar').style.display = 'none';
      setButtonTop();
    };
  }

  checkBrowserWidth();
  checkScroll();
}

/***/ }),
/* 26 */
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
/* harmony import */ var lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_debounce__WEBPACK_IMPORTED_MODULE_0__);
// debounce is used to wait until resizing stops


if (document.querySelector('.hero__product')) {
  var addAutoplay = function addAutoplay() {
    if (window.innerWidth > 799) {
      // check if autoplay is set
      var isAutoplay = videoLocation.hasAttribute('autoplay');

      if (!isAutoplay) {
        videoLocation.setAttribute('autoplay', 'autoplay');
        videoLocation.load();
      }
    }

    ;
  }; // run once on load


  // check browser width on resize and run autopl
  var checkBrowserWidth = function checkBrowserWidth() {
    window.addEventListener('resize', lodash_debounce__WEBPACK_IMPORTED_MODULE_0___default()(function () {
      console.log('browser resized');
      addAutoplay(); // set videoLoaded to true after addAutoplay function runs

      var videoLoaded = true;
    }, 300));
  }; // checkBrowserWidth only runs until video gets loaded


  // get window width onLoad    
  var videoLocation = document.querySelector("#hero-vid"); // video set to false on load

  var videoLoaded = false;
  addAutoplay();

  if (!videoLoaded) {
    checkBrowserWidth();
  }
}

/***/ }),
/* 27 */
/***/ (() => {

(function () {
  var gridViewChange = function gridViewChange() {
    var gridBtn = $('.RL-grid-view-btn');
    var listBtn = $('.RL-list-view-btn');
    var list = $('.RL-cards');
    gridBtn.on('click', function (e) {
      e.preventDefault();
      gridBtn.addClass('active');
      listBtn.removeClass('active');
      list.removeClass('RL-list-view');
      list.addClass('RL-grid-view');
    });
    listBtn.on('click', function (e) {
      e.preventDefault();
      listBtn.addClass('active');
      gridBtn.removeClass('active');
      list.addClass('RL-list-view');
      list.removeClass('RL-grid-view');
    });
  };

  gridViewChange();
})();

/***/ }),
/* 28 */
/***/ (() => {

(function () {
  $(document).ready(function () {
    if ($.fn.owlCarousel) {
      $(".hp-hero .owl-carousel").owlCarousel({
        loop: false,
        mobileFirst: true,
        lazyload: true,
        dragEndSpeed: 500,
        nav: false,
        margin: 10,
        dots: true,
        dotsContainer: '.dot__holder',
        items: 1,
        dotClass: "owl-dot owl-dot__blue-dark",
        responsive: {
          0: {
            mouseDrag: true
          },
          800: {
            mouseDrag: false
          }
        }
      });
      $('.cta-carousel .owl-carousel').owlCarousel({
        loop: false,
        lazyload: true,
        autoHeightClass: 'owl-height',
        mouseDrag: false,
        nav: false,
        margin: 10,
        dots: false,
        items: 1,
        dotClass: "owl-dot owl-dot__blue-lite",
        navText: ["<div class='nav-btn prev-slide'></div>", "<div class='nav-btn next-slide'></div>"],
        responsive: {
          0: {
            nav: true
          },
          500: {
            nav: false,
            dots: true
          }
        }
      });
      $('.locations-carousel .owl-carousel').owlCarousel({
        dots: false,
        arrows: true,
        adaptiveHeight: false,
        centerMode: false,
        mobileFirst: true,
        items: 1,
        infinite: false,
        margin: 16,
        nav: true,
        navText: ['<div class="nav-btn prev-slide"><svg xmlns="http://www.w3.org/2000/svg" width="120" height="226"><g class="slider-arrow" data-name="Group 510"><path data-name="Rectangle 193" d="M0 0h120v226H0z"/><path data-name="Icon feather-chevron-right" d="M45.5 141.943l29.722-29.721L45.5 82.5" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/></g></svg></div>', '<div class="nav-btn next-slide"><svg xmlns="http://www.w3.org/2000/svg" width="120" height="226"><g class="slider-arrow" data-name="Group 510"><path data-name="Rectangle 193" d="M0 0h120v226H0z"/><path data-name="Icon feather-chevron-right" d="M45.5 141.943l29.722-29.721L45.5 82.5" fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="4"/></g></svg></div>'],
        stagePadding: 36,
        responsive: {
          800: {
            items: 2,
            stagePadding: 70
          },
          1010: {
            stagePadding: 100,
            items: 3
          }
        }
      });
      $('.culture-carousel .owl-carousel').owlCarousel({
        loop: true,
        margin: 10,
        nav: false,
        responsive: {
          0: {
            items: 1
          }
        }
      });
      $('.quote-carousel .owl-carousel').owlCarousel({
        loop: false,
        lazyload: true,
        nav: false,
        mouseDrag: false,
        margin: 10,
        dots: false,
        dotsContainer: '.dot-holder',
        items: 1,
        dotClass: "owl-dot owl-dot__blue-lite",
        navText: ["<div class='nav-btn prev-slide'></div>", "<div class='nav-btn next-slide'></div>"],
        responsive: {
          0: {
            nav: true
          },
          500: {
            nav: false,
            dots: true
          }
        }
      });
      $('.quote-carousel .owl-dot').click(function () {
        owl.trigger('to.owl.carousel', [$(this).index(), 300]);
      });

      if ($('.single-quotes .owl-carousel').length) {
        var owlTestimonials = $('.single-quotes .owl-carousel');

        (function ($) {
          $.fn.shuffle = function () {
            var allElems = this.get(),
                getRandom = function getRandom(max) {
              return Math.floor(Math.random() * max);
            },
                shuffled = $.map(allElems, function () {
              var random = getRandom(allElems.length),
                  randEl = $(allElems[random]).clone(true)[0];
              allElems.splice(random, 1);
              return randEl;
            });

            this.each(function (i) {
              $(this).replaceWith($(shuffled[i]));
            });
            return $(shuffled);
          };
        })(jQuery);

        $(".single-quotes .owl-carousel .single-quotes__item").shuffle();
        owlTestimonials.owlCarousel({
          dots: true,
          dotClass: "owl-dot owl-dot__blue-dark",
          arrows: false,
          adaptiveHeight: false,
          centerMode: false,
          mobileFirst: true,
          items: 1,
          infinite: false
        });
      }

      $(".multi-quotes .owl-carousel").owlCarousel({
        dots: true,
        dotClass: "owl-dot owl-dot__blue-dark",
        arrows: false,
        adaptiveHeight: false,
        centerMode: false,
        mobileFirst: true,
        items: 1,
        infinite: false
      });
    }

    if ($('.product-slider').length) {
      $('.product-slider').slick({
        slidesToShow: 3,
        dots: true,
        infinite: false,
        responsive: [{
          breakpoint: 800,
          settings: {
            slidesToShow: 2
          }
        }, {
          breakpoint: 600,
          settings: {
            slidesToShow: 1,
            arrows: false
          }
        }]
      });
      $('.product-slider .fancybox').fancybox({
        prevEffect: 'fade',
        nextEffect: 'fade'
      });
    }
  });
})();

/***/ }),
/* 29 */
/***/ (() => {

/**
 * Handle current selection on the secondary nav on the product detail pages.
 */
var nav = document.getElementById('secondary-nav');
var secondaryNavToggle = document.querySelector('.caret-arrow');

(function () {
  if (nav) {
    try {
      nav.querySelectorAll('a').forEach(function (link) {
        var href = link.getAttribute('href').toLowerCase();

        if (href.endsWith(window.location.pathname)) {
          link.classList.add('current');
        }
      });
    } catch (ex) {
      console.warn('Could not set current secondary nav item');
    }
  }
})();

var navContainer = document.querySelector('#secondary-nav .container');
var subMenu = document.querySelector('.secondary-links');

if (nav) {
  var menuToggleChange = function menuToggleChange() {
    if (window.innerWidth > 799 && subMenu.clientHeight > 21) {
      navContainer.classList.add('lgToggle');
      subMenu.classList.add('lgToggle');
    }
  };

  secondaryNavToggle.addEventListener('click', function () {
    nav.classList.toggle('closed');
  });
  addEventListener("resize", function (event) {
    menuToggleChange();
  }); // Initial check

  menuToggleChange();
}

/***/ }),
/* 30 */
/***/ (() => {

(function () {
  function pageLoad() {
    if (!document.querySelector('.product-resources')) {
      return;
    }

    $(function () {
      TruncateSupportCard();
    });
    $(window).on('resize', function () {
      TruncateSupportCard();
    }); // switch between grid and list views on Support landing page  

    $('.grid-view-btn').on('click', function () {
      $('.list-view-btn').removeClass('active');
      $(this).addClass('active');
      $('.support-items').removeClass('list-view').addClass('grid-view');
      TruncateSupportCard(57);
    });
    $('.list-view-btn').on('click', function () {
      $('.grid-view-btn').removeClass('active');
      $(this).addClass('active');
      $('.support-items').removeClass('grid-view').addClass('list-view');
      TruncateSupportCard(115);
    });
  }

  function TruncateSupportCard(height) {
    if (!height) {
      if ($(window).width() < 1025 && $('.support-items').hasClass('grid-view')) {
        height = 57;
      } else {
        height = 115;
      }
    }

    $('.support-card p').dotdotdot({
      watch: "window",
      height: height
    });
  }

  pageLoad();
})();

/***/ }),
/* 31 */
/***/ (() => {

// Get the image and the div elements
var compareDiv = document.querySelector('.page-cta__image-bleed .row__medium-5');
var comapareImage = document.querySelector('.page-cta__image-bleed .row__medium-7');

if (compareDiv) {
  // Function to check if div is taller than image
  var checkSize = function checkSize() {
    if (compareDiv.offsetHeight > comapareImage.offsetHeight) {
      // Hide the image and set the screenWidthAtHide variable
      comapareImage.setAttribute('style', 'display: none;');
      compareDiv.setAttribute('style', 'padding-bottom: 2.5rem; padding-top: 2.5rem;  width: 100%');
    }

    if (window.innerWidth <= 799) {
      // Show the image if it was previously hidden and the screen width hasn't changed
      compareDiv.removeAttribute('style');
      comapareImage.removeAttribute('style');
    }
  }; // Call the checkSize function on page load and on window resize


  // Set initial values for variables
  var screenWidthAtHide = null;
  var imageHidden = false;
  window.addEventListener("load", checkSize);
  window.addEventListener("resize", checkSize);
}

/***/ })
/******/ 	]);
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	(() => {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	(() => {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = (exports) => {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _modules_mobileMenu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
/* harmony import */ var _modules_mobileMenu__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_modules_mobileMenu__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _modules_accordion__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
/* harmony import */ var _modules_header_footer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(21);
/* harmony import */ var _modules_headerSearchField__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23);
/* harmony import */ var _modules_headerSearchField__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_modules_headerSearchField__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _modules_dropdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(24);
/* harmony import */ var _modules_dropdown__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_modules_dropdown__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _modules_buttonStickScroll__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(25);
/* harmony import */ var _modules_heroVideos__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(26);
/* harmony import */ var _modules_resourceLibrary__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(27);
/* harmony import */ var _modules_resourceLibrary__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_modules_resourceLibrary__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _modules_carousels__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(28);
/* harmony import */ var _modules_carousels__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_modules_carousels__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _modules_secondaryNav__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(29);
/* harmony import */ var _modules_secondaryNav__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_modules_secondaryNav__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _modules_product_resource__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(30);
/* harmony import */ var _modules_product_resource__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_modules_product_resource__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _modules_compareHeightToImage__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(31);
/* harmony import */ var _modules_compareHeightToImage__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_modules_compareHeightToImage__WEBPACK_IMPORTED_MODULE_11__);












})();

/******/ })()
;;
/* CONTENTS */
/* ----------------------------------------- */
/* CUSTOM SCRIPTS */

/* CUSTOM SCRIPTS */
/* ----------------------------------------- */

/* JQUERY ACTUAL V1.0.9 */
/* ----------------------------------------- */
/*! Copyright 2012, Ben Lin (http://dreamerslab.com/)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Version: 1.0.19
 *
 * Requires: jQuery >= 1.2.3
 */
(function (a) {
    if (typeof define === "function" && define.amd) {
        define(["jquery"], a);
    } else { a(jQuery); }
}(function (a) {
    a.fn.addBack = a.fn.addBack || a.fn.andSelf; a.fn.extend({
        actual: function (b, l) {
            if (!this[b]) {
                throw '$.actual => The jQuery method "' + b + '" you called does not exist';
            } var f = { absolute: false, clone: false, includeMargin: false, display: "block" }; var i = a.extend(f, l); var e = this.eq(0); var h, j; if (i.clone === true) {
                h = function () {
                    var m = "position: absolute !important; top: -1000 !important; ";
                    e = e.clone().attr("style", m).appendTo("body");
                }; j = function () { e.remove(); };
            } else {
                var g = []; var d = ""; var c; h = function () {
                    c = e.parents().addBack().filter(":hidden");
                    d += "visibility: hidden !important; display: " + i.display + " !important; "; if (i.absolute === true) { d += "position: absolute !important; "; } c.each(function () {
                        var m = a(this);
                        var n = m.attr("style"); g.push(n); m.attr("style", n ? n + ";" + d : d);
                    });
                }; j = function () {
                    c.each(function (m) {
                        var o = a(this); var n = g[m]; if (n === undefined) {
                            o.removeAttr("style");
                        } else { o.attr("style", n); }
                    });
                };
            } h(); var k = /(outer)/.test(b) ? e[b](i.includeMargin) : e[b](); j(); return k;
        }
    });
}));

//navigation scripting
$(window).on("load", function () {

});

$(window).on("resize", function () {
    //for max height dropdown descriptions
    $(".drop.white span").css("height", "auto");

    $(".drop.white").each(function () {
        var maxHeight = -1;
        $(this).children("span").each(function () {
            var test = $(this).actual("height");
            if ($(this).actual("height") > maxHeight) {
                maxHeight = $(this).actual("height");
            }
        });
        $(this).children("span").height(maxHeight);
    });
}).trigger("resize");

$(document).ready(function () {

    $(window).on('load resize', function () {
        //$('.product-workflow .wistia-wrapper').add('.product-whats-new .wistia-wrapper').add('.product-features .wistia-wrapper').each( function() {
        $('.wistia-wrapper').each(function () {
            var $this = $(this);
            var w = $this.width();
            $this.height(w * 0.5625);
        });
    });


    if ($('.buy-try-links').length > 1) {
        $('.buy-try-links').eq(1).hide();
    }


    $(window).on('scroll', function () {
        var secNav = $('#secondary-nav');
        var queryString;
        if (secNav.length > 0) {
            var vs = window.scrollY;
            if (vs > 0) {
                sessionStorage.setItem('vs', vs.toString());
            } else {
                sessionStorage.removeItem('vs');
            }
        }

    });


    var truncateHeight;

    //hover over one element, affect another
    $("#home li .drop > a").hover(
        function () {
            var index = $(this).index();
            $(this).closest("li").find(".nav-pics img").hide().eq(index).show();
            $(this).closest("li").find(".drop.white span").hide().eq(index).css("display", "inline-block");
        }
    );

    $(".icon.search").on("click", function () {
        $("#searchbox, #for-search").addClass("opened");
    });

    $(".sb-search-close").on("click", function () {
        $("#searchbox").removeClass("opened");

        setTimeout(function () {
            $("#for-search").removeClass("opened");
        }, 320);
    });

    var navEnter;
    $("#home nav li").mouseover(function () {
        var underlay = $(this).closest("li").find(".dropdown").height();
        //console.log("underlay " + underlay);
        var $nav = $(this);

        navEnter = setTimeout(function () {
            if ($(this).find(".drop.white").length !== 0 && $(window).width() > 1200) {
                $("#underlay").addClass("white");
            } else {
                $("#underlay").removeClass("white");
            }

            if (underlay == null) {
                underlay = 0;
            }

            $("#underlay").show().height(underlay);
            $("#home nav li").removeClass("current");
            $nav.addClass("current");
        }, 250);
    });
    // reduced timeout by half 01/08/2020 dsg
    var navTimer;
    $("#home nav li, #underlay").mouseleave(function () {
        clearTimeout(navEnter);
        navTimer = setTimeout(closeNav, 250);
    }).mouseenter(function () {
        clearTimeout(navTimer);
    });

    function openNav() {

    }

    function closeNav() {
        $("#underlay").removeClass("white").hide();
        $("#home nav li").removeClass("current");
    }

    $(".journal h3, .spot-03 h3, .spot-04 h3, .half-txt h1, .half-txt h2, .third-txt h1, .third-txt h2, .consult-stories span").dotdotdot({
        watch: "window"
    });

    $('.support-items-holder div.support-card p').dotdotdot({
        watch: "window",
        height: 114
    });
    

    var initialTap = false;
    var getValue = 0;

    //wistia activation from carousel
    $(".wistia-vid").on("click", function (e) {
        $("#pager, #pager a, #stories h2, #stories .captions.current, #stories .overlay, .stories-link.current").hide();
        $("#altair-carousel li:eq(0) .wistia_embed").fadeTo(0, 1);

        //2018.08.16 //added conditional
        if ($("body").hasClass("default")) {
            $(this).hide();
        }

        var wistiaId = $(this).data('wistia_id');
        if (wistiaId === undefined) {
            wistiaId = $(this).data('id');
        }
        var video = Wistia.api(wistiaId);
        video.play();
        e.preventDefault();
    });


    $("#stories .wistia_embed").each(function () {
        var cssClass = $(this).attr('class');
        var match = /wistia_async_(\w{10})/.exec(cssClass);
        if (match !== null) {
            var id = match[1];
            window._wq = window._wq || [];
            window._wq.push({
                id: id,
                onHasData: function (video) {
                    video.bind("play", function () {
                        //console.log("The video is playing.");
                    });
                    video.bind("pause", function () {
                        //console.log("The video was just paused!");
                        $(this.container).hide();
                        $("#pager, #pager a, #stories h2, #stories .captions.current, #stories .overlay, .stories-link.current").fadeIn(360);
                        $("#stories .overlay, .stories-link.current").show();
                    });
                    video.bind("end", function () {
                        //console.log("The video has ended.");
                        $(this.container).hide();
                        $("#pager, #pager a, #stories h2, #stories .captions.current, #stories .overlay, .stories-link.current").fadeIn(360);
                        $("#stories .overlay, .stories-link.current").show();
                    });
                }
            });
        }
    });


    //hammer touch elements for carousel
    $(".pager a").each(function () {
        var mc = new Hammer(this);
        mc.on("tap", function () {
            initialTap = true;
            return false;
        });
    });

    $(".stories-link").each(function () {
        var mc = new Hammer(this);
        mc.on("swipeleft", function () {
            if (currentPage === 3) {
                getValue = 0;
            } else {
                getValue = currentPage + 1;
            }
            $("#altair-carousel").trigger("slideTo", [getValue]);
            return false;
        });

        mc.on("swiperight", function () {
            if (currentPage === 0) {
                getValue = 3;
            } else {
                getValue = currentPage - 1;
            }
            $("#altair-carousel").trigger("slideTo", [getValue]);
            return false;
        });
    });

    //touch pagination fix on mobile, applied in css
    function is_touch_device() {
        return 'ontouchstart' in window        // works on most browsers 
            || navigator.maxTouchPoints;       // works on IE10/11 and Surface
    }

    if (is_touch_device()) {
        $("html").addClass('touch');
    } else {
        $("html").addClass('no-touch');
    }

    /* MOBILE ONLY - NAVIGATION TOGGLE */
    /* ----------------------------------------- */
    $("#mobile-toggler").on("click", function () {
        window.scrollTo(0, 0);
        $(this).toggleClass("open");
        $("#mobile-menu").toggleClass("menu-opened");
        $("body").toggleClass("active-nav");
    });

    $(".root-menu").on("click", function () {
        $(this).toggleClass("open");
        $(this).next().stop().slideToggle(400);
        return false;
    });

    /* LOCATION SELECTION */
    /* ----------------------------------------- */
    if ($("select#locale-selector").length) {
        $("select#locale-selector").prop("selectedIndex", 0);
    }

    $("select#locale-selector").on('change', function () {
        $(".locale").hide();

        var locValue = this.value;

        if (locValue === 0 || locValue === 1) {
            $(".locale").show();
        } else {
            $(".locale." + locValue).show();
        }
    });

    /* ABOUT PROFILES */
    /* ----------------------------------------- */
    var profileSelect;
    var member;
    var myOffset;

    function revert() {
        setTimeout(function () {
            $(".member").removeClass("deactivated");
        }, 600);
    }

    function showNav() {
        setTimeout(function () {
            $("html, body").stop(true, true).animate({
                scrollTop: $(".profiles.current").offset().top - 82
            }, "slow");

            $(".btn-back, .btn-next, .btn-close").fadeIn(320);
        }, 500);
    }

    if ($("#interior").hasClass("about")) {
        $(".member").on("click", function () {
            member = $(this).index();
            console.log(member);

            $(".btn-back, .btn-next, .btn-close").hide();
            profileSelect = $(this).closest(".staff").next(".profiles").find(".detailed-profile").length;

            $(this).closest(".staff").next(".profiles").find(".detailed-profile").hide();
            $(this).closest(".staff").next(".profiles").find(".detailed-profile:eq(" + member + ")").show();
            //hide and show

            $(".profiles").removeClass("current");
            $(this).closest(".staff").next(".profiles").addClass("current");

            showNav();
        });

        $(".btn-back").on("click", function () {
            member = member - 1;
            console.log(member);

            if (member >= 0) {
                $(".detailed-profile").hide();
                $(this).nextAll(".detailed-profile:eq(" + member + ")").fadeIn();
            } else {
                $(".member").addClass("deactivated");
                $(".profiles").removeClass("current");
                $(".btn-back, .btn-next, .btn-close").hide();

                if ($(this).closest(".profiles").prevAll(".profiles").length) {
                    $(this).closest(".profiles").prevAll(".profiles").first().addClass("current");
                    $(this).closest(".profiles").prevAll(".profiles").first().find(".detailed-profile").last().show();
                    profileSelect = $(this).closest(".profiles").prevAll(".profiles").first().find(".detailed-profile").length;
                    console.log("number of profiles is " + profileSelect);
                } else {
                    $(".profiles").last().addClass("current");
                    $(".profiles").last().find(".detailed-profile").last().show();
                    profileSelect = $(".profiles").last().find(".detailed-profile").length;
                    console.log("number of profiles is " + profileSelect);
                }
                member = profileSelect - 1;
                showNav();
                revert();
            }
        });

        $(".btn-next").on("click", function () {
            member = member + 1;
            console.log(member);

            if (member < profileSelect) {
                $(".detailed-profile").hide();
                $(this).nextAll(".detailed-profile:eq(" + member + ")").fadeIn();
            } else {
                $(".member").addClass("activated");
                $(".profiles").removeClass("current");
                $(".btn-back, .btn-next, .btn-close").hide();

                if ($(this).closest(".profiles").nextAll(".profiles").length) {
                    $(this).closest(".profiles").nextAll(".profiles").first().addClass("current");
                    $(this).closest(".profiles").nextAll(".profiles").first().find(".detailed-profile").first().show();
                    profileSelect = $(this).closest(".profiles").nextAll(".profiles").first().find(".detailed-profile").length;
                    //console.log("number of profiles is "+profileSelect);
                } else {
                    $(".profiles").first().addClass("current");
                    $(".profiles").first().find(".detailed-profile").first().show();
                    profileSelect = $(".profiles").first().find(".detailed-profile").length;
                    //console.log("number of profiles is "+profileSelect);
                }

                member = 0;
                showNav();
                revert();
            }
        });

        //close all profiles
        $(".btn-close").on("click", function () {
            $(".profiles").removeClass("current");
            $(".btn-back, .btn-next, .btn-close").hide();
            revert();
        });
    }

    /* STEPS CUSTOM IMG SLIDER */
    /* ----------------------------------------- */
    var stepLength;
    var stepClicked = 0;
    var stepPrevious = 0;
    var stepSwiped;

    stepLength = $("#staffing-pager span").length;
    stepLength = stepLength - 1;

    function stepUpdater() {
        //console.log(stepPrevious + " : " + stepClicked);
        if (stepPrevious !== stepClicked) {
            $("#staffing-pager span").removeClass("current");
            $("#staffing-pager span:eq(" + stepClicked + ")").addClass("current");

            $("#staffing-slider li:eq(" + stepPrevious + ") video").get(0).pause();
            $("#staffing-slider li:eq(" + stepPrevious + ") video").get(0).currentTime = 0;

            $("#staffing-slider li").hide();
            $("#staffing-slider li:eq(" + stepClicked + ")").fadeIn(500, function () {
                if ($(window).width() > 1024) {
                    $("#staffing-slider li:eq(" + stepClicked + ") video").get(0).play();
                }
            });

            stepPrevious = stepClicked;
        }
    }

    $("#staffing-pager span").on("click", function () {
        stepClicked = $(this).index();
        stepClicked = stepClicked - 1;
        //console.log("step clicked: "+stepClicked);
        stepUpdater();
    });

    $("#staffing-pager .staff-left").on("click", function () {
        if (stepClicked < 1) {
            stepClicked = stepLength;
        } else {
            stepClicked--;
        }
        stepUpdater();
    });

    $("#staffing-pager .staff-right").on("click", function () {
        if (stepClicked > stepLength - 1) {
            stepClicked = 0;
        } else {
            stepClicked++;
        }
        stepUpdater();
    });

    //last video functionality
    $("#staffing-slider li:eq(5) video").on("ended", function () {
        stepClicked = 0;
        stepUpdater();
    });

    $("#staffing-slider li").each(function () {
        stepSwiped = new Hammer(this);

        stepSwiped.on("swipeleft", function () {
            if ($(window).width() < 1025) {
                if (stepClicked > stepLength - 1) {
                    stepClicked = 0;
                } else {
                    stepClicked++;
                }
                stepUpdater();
                return false;
            }
        });

        stepSwiped.on("swiperight", function () {
            if ($(window).width() < 1025) {
                if (stepClicked < 1) {
                    stepClicked = stepLength;
                } else {
                    stepClicked--;
                }
                stepUpdater();
                return false;
            }
        });
    });

    //initial page load play
    if ($("#staffing-engage").length) {
        var distance = $("#staffing-engage").offset().top - 100,
            $window = $(window);
        var initi;
        playStep();

        $window.scroll(function () {
            //console.log($window.scrollTop() +" : "+ distance);
            if ($(window).width() > 1024 && initialPlay === false) {
                playStep();
            }
        });
    }
    alPlay = false;

    //console.log($window.scrollTop() +" : "+ distance);
    function playStep() {
        if ($window.scrollTop() >= distance && $window.scrollTop() < 2100) {
            //console.log("at the top");
            if ($(window).width() > 1024 && initialPlay === false) {
                initialPlay = true;
                $("#staffing-slider li:eq(0) video").get(0).play();
            }
        }
    }

    /* CONSULTING AUTOMATION COMPONENT */
    /* ----------------------------------------- */
    $(".component-list > div").on("click", function () {
        if (!$(this).next().hasClass("opened")) {
            $(".component-list ul, .component-list > div").removeClass("opened");
        }
        $(this).toggleClass("opened");
        $(this).next().toggleClass("opened");
    });

    var loadedData = $(".component-list ul:eq(0) li:eq(0)").data("item");

    $(".component-list").on("click", "li", function (event) {
        if ($("#component .component-vids").is(":visible")) {
            var dataItem = $(this).data("item");
            //console.log("Loaded Data: " + loadedData);
            //console.log("Data item: " + dataItem);

            if (dataItem !== loadedData) {
                $("#component .component-list li").removeClass("selected");
                $(this).addClass("selected");

                $(".component-desc, .component-vids img").hide();
                $(".component-desc[data-txt='" + dataItem + "']").show();
                $(".component-desc[data-txt='" + dataItem + "'] .players img").show();
                $(".component-vids img[data-image='" + dataItem + "']").fadeIn(350);
                loadedData = dataItem;
            }
        }
    });

    //checks for empty video elements //add 08202018
    function wistiaRemoval() {
        $("#component .component-desc .wistia_embed").each(function () {
            if (!$(this).children(".wistia_click_to_play").length) {
                $(this).closest(".component-desc").addClass("without-wistia");
                $(this).parent().addClass("hidden");
            }
        });
    }

    setTimeout(wistiaRemoval, 3000);

    /* PARTNER PORTAL SCRIPTS */
    $(".datepicker").datepicker();

    function mobileSettings() {
        if ($("#mobile-toggler").is(":visible")) {
            mobileOffset = 0;
            if (targetedSteps.length == 16) {
                splicedSteps = [];
                splicedSteps = targetedSteps.splice(0, 8);
            }
        } else {
            mobileOffset = 205;
            if (targetedSteps.length == 8) {
                targetedSteps.splice(0, 0, splicedSteps);
            }
        }
    }

    if (document.getElementById("partner-main")) {
        //next line is for test, comment out for production
        //localStorage.removeItem("flagFirstVisit");

        var mobileOffset;
        var targetedSteps = ["#step2", "#step3", "#step4", "#step5", "#step6", "#step7", "#step8", "#cphSymbols_divSettings", "#mobi2", "#mobi3", "#mobi4", "#mobi5", "#mobi6", "#mobi7", "#mobi8", "#mobi9"];
        var splicedSteps = [];

        mobileSettings();

        var portalUser = localStorage.getItem("flagFirstVisit");

        if (portalUser == null) {
            localStorage.setItem("flagFirstVisit", "yes");
            portalUser = localStorage.getItem("flagFirstVisit");
            var intro = introJs().setOptions({
                showBullets: false,
                showProgress: true,
                steps: [
                    {
                        intro: "Welcome! Within this portal, you will find the tools necessary to help advance sales opportunities, learn more about our solutions, get the latest solution updates and have access to the materials you need to effectively support your end-users."
                    },
                    {
                        element: targetedSteps[0],
                        intro: "The Resource Library contains four primary categories from pre-sales, sales and training/support while providing quick access to creative assets such as logos, event banners, advertisements and brand guidelines for the various products."
                    },
                    {
                        element: targetedSteps[1],
                        intro: "Featured Resources are highlights of our latest content including our latest presentation materials, reseller webinars, events and sales/training content."
                    },
                    {
                        element: targetedSteps[2],
                        intro: "Get the latest news feed from Altair from our live news feed and blog. Please feel free to promote and share our blog content on your live feeds as well."
                    },
                    {
                        element: targetedSteps[3],
                        intro: "Channel Partners in good standing with Altair may learn more about our co-marketing or Marketing Development Funds program as well as request for funds to run a co-Marketing activity."
                    },
                    {
                        element: targetedSteps[4],
                        intro: "Get certified to demonstrate your technical know-how and sales skills."
                    },
                    {
                        element: targetedSteps[5],
                        intro: "If you're a Sales user for your organization, you may access your leads, opportunities and sales-related records via the SalesForce Community Platform."
                    },
                    {
                        element: targetedSteps[6],
                        intro: "View the latest end-user and prospect events that will feature Altair solutions across the world. You can also view upcoming end-user and reseller webinars."
                    },
                    {
                        element: targetedSteps[7],
                        intro: "Update information regarding your account, your password and if you're the designated Admin contact for your organization, you may update your company profile information here."
                    }
                ]
            });

            //repositions step number symbol
            intro.onafterchange(function () {
                if (this._currentStep >= 4) {
                    //post step 4
                    $(".introjs-helperNumberLayer").addClass("nav");
                } else {
                    $(".introjs-helperNumberLayer").removeClass("nav");
                }
            });
            //allows for smooth scrolling (desktop only)
            intro.onchange(function (targetElement) {
                mobileSettings();

                //disables button behavior
                if (this._currentStep == 0) {
                    //setup for intro.js
                    $("body").addClass("static");
                    return false;
                }

                if (this._currentStep > 0) {
                    $("body").addClass("mobile");
                } else {
                    $("body").removeClass("mobile");
                }

                if (this._currentStep > 3) {
                    if ($("#mobile-toggler").is(":visible") && !$("#mobile-toggler").hasClass("open")) {
                        $("#mobile-toggler").trigger("click");
                        $("body").addClass("nav-is-active");
                    }

                    if (this._currentStep > 6) {
                        $("body").addClass("nav-is-elevated");
                    } else {
                        $("body").removeClass("nav-is-elevated");
                    }
                } else if (this._currentStep < 4) {
                    if ($("#mobile-toggler").is(":visible") && $("#mobile-toggler").hasClass("open")) {
                        $("#mobile-toggler").trigger("click");
                        $("body").removeClass("nav-is-active");
                    }
                }

                if (this._currentStep > 0) {
                    $("html, body").stop().animate({
                        scrollTop: $(targetedSteps[this._currentStep - 1]).offset().top - mobileOffset
                    }, 500, "swing");
                }
            });
            //enables button behavior
            intro.onexit(function () {
                $("body").removeClass("static mobile nav-is-active nav-is-elevated");

                //remove mobile nav if open
                if ($("#mobile-toggler").is(":visible") && $("#mobile-toggler").hasClass("open")) {
                    $("#mobile-toggler").trigger("click");
                }
                return false;
            });

            intro.start();
        }
    }

    /* ----------------------------------------- */
    /* 	EVERYTHING BELOW ARE SCRIPTS */
    /*	FROM PREVIOUS BUILD (2013)   */
    /* ----------------------------------------- */

    /* STRUCTURE SECTION */
    /* ----------------------------------------- */
    $(".branch").mouseenter(function () {
        var myBranch = $(this).index();
        myBranch++;
        console.log("My Branch is " + myBranch);

        $(".overview").css({ "display": "none" });
        $(".overview:eq(" + myBranch + ")").css({ "display": "table" });
    });

    $("#structure").mouseleave(function () {
        $(".overview").css({ "display": "none" });
        $(".overview:eq(0)").css({ "display": "table" });
    });

    /* JQUERY CAROUFREDSEL V6.2.1 */
    /* ----------------------------------------- 
     * Removed 04/25/2022 dgreve
    if ($("#techs ul").find("li").length <= 3) {
        $("#techs ul").carouFredSel(false);

        //toggle functionality
        $("#techs li").click(function () {
            var getValue = $(this).index(); //sets value 

            console.log("This index is " + getValue);

            $("#interior #banner > a").hide();
            $("#interior #banner .desc").css({ "z-index": "-1", "opacity": "0" });
            $("#interior #banner > a").eq(getValue).show();
            $("#interior #banner .desc").eq(getValue).css({ "z-index": "1", "opacity": "1" });
        });
    } else {
        $("#techs ul").carouFredSel({
            auto: { play: false },
            pagination: "#techs .pagination",
            scroll: {
                duration: 320,
                easing: "easeOutQuint",
                pauseOnHover: true,
                items: 1,
                onBefore: function () {
                    //get the current position using the triggerHandler-method
                    var pos = $("#techs ul").triggerHandler("currentPosition");
                    //alert( "The carousel is at item number " + pos );
                    $("#interior #banner > a").hide();
                    $("#interior #banner .desc").css({ "z-index": "-1", "opacity": "0" });
                    $("#interior #banner > a").eq(pos).show();
                    $("#interior #banner .desc").eq(pos).css({ "z-index": "1", "opacity": "1" });
                }
            },
            items: {
                minimum: 3
            },
            prev: {
                button: "#prev1",
                duration: 400
            },
            next: {
                button: "#next1",
                duration: 400
            },
            mousewheel: false,
            swipe: {
                onMouse: false,
                onTouch: true
            }
        }).find("li").click(function () {
            var deviation = 0;
            $("#techs ul").trigger("slideTo", [$(this), deviation]);
        });
    }

    $("#videos ul").carouFredSel({
        auto: false,
        scroll: {
            easing: "easeOutQuint",
            items: 3
        },
        prev: {
            button: "#prev1",
            duration: 400
        },
        next: {
            button: "#next1",
            duration: 400
        },
        mousewheel: false,
        swipe: {
            onMouse: false,
            onTouch: true
        }
    });
    */

    //Concept to Reality Carousel
    /**
    Removed 04 / 25 / 2022 dgreve
    $("#scrollID ul").carouFredSel({
        auto: false,
        circular: false,
        infinite: false,
        scroll: {
            easing: "easeOutQuint",
            items: 4
        },
        prev: {
            button: "#prev1",
            duration: 320
        },
        next: {
            button: "#next1",
            duration: 320
        },
        mousewheel: false,
        swipe: {
            onMouse: false,
            onTouch: true
        }
    });

    **/

    /* PRODUCT IMAGERY NAVIGATION CODE */
    /* ----------------------------------------- */
    $(".menu_hover_item").hover(function () {
        $('#top_nav_product_image').attr('src', $(this).attr('thumbnail'));
        //$('#top_nav_product_name').text($(this).text());
        $('#top_nav_product_description').html($(this).attr('data-title').replace('\n', '<br />'));
    });
    $(".menu_hover_item1").hover(function () {
        $('#top_nav_product_image1').attr('src', $(this).attr('thumbnail'));
        //$('#top_nav_product_name').text($(this).text());
        $('#top_nav_product_description1').html($(this).attr('data-title').replace('\n', '<br />'));
    });

    /* C2R FUNCTIONALITY */
    /* ----------------------------------------- */
    $(".sm_image .expand").mouseenter(function () {
        var elem = $(this).index();
        $(this).stop().animate({ height: 140, width: 210 }, 200);
        $(this).parent().stop().animate({ height: 140, width: 210 }, 200);
    });

    $(".sm_image .expand").mouseleave(function () {
        var elem = $(this).index();
        $(this).stop().animate({ height: 90, width: 135 }, 200);
        $(this).parent().stop().animate({ height: 90, width: 135 }, 200);
    });

    $('.expand_trigger').click(function (e) {
        e.preventDefault();
        var expand_div = $(this).next('div');
        if (expand_div.is(':hidden')) {
            expand_div.slideDown(500);
        } else {
            expand_div.slideUp(500);
        }
    });

    // Accept Cookie check
    var acceptcookie = getCookie('acceptcookie');
    if (acceptcookie !== 'yes') {
        $('#accept_cookie').show('slide', { direction: 'down' });
        $('#accept_cookie div.accept').click(function () {
            setCookie('acceptcookie', 'yes', 365);
            $('#accept_cookie').hide('slide', { direction: 'down' });
        });
    }
    //if (typeof (hbspt) != 'undefined') {
    //    hbspt.forms.create({
    //        css: '',
    //        cssClass: '',
    //        portalId: '47251',
    //        formId: '2eb43dee-c8c0-4ad7-a38d-b128a13e9083',
    //        target: '#footer_form',
    //        onFormReady: function ($form, ctx) {
    //            $form.find('input[type=submit]').val(SubscribeNow).change();
    //        }
    //    });
    //}

    $('.dotdotdot-115').dotdotdot({
        witch: 'window',
        height: 115
    });

    SetFigure($('figure.responsive'));

    $('.crop-background-image').each(function () {
        var image = $(this).data('background-image');
        var croppedImage = GetCroppedJpgUrl($(this), image);
        $(this).css("background-image", "url('" + croppedImage + "')");
    });

    var utm_source = getParameterByName('utm_source');
    var utm_medium = getParameterByName('utm_medium');
    var utm_campaign = getParameterByName('utm_campaign');
    var utm_content = getParameterByName('utm_content');
    var utm_term = getParameterByName('utm_term');
    if (utm_source) {
        setCookie('utm_source', utm_source);
    }
    if (utm_medium) {
        setCookie('utm_medium', utm_medium);
    }
    if (utm_campaign) {
        setCookie('utm_campaign', utm_campaign);
    }
    if (utm_content) {
        setCookie('utm_content', utm_content);
    }
    if (utm_term) {
        setCookie('utm_term', utm_term);
    }
    utm_source = getCookie('utm_source');
    utm_medium = getCookie('utm_medium');
    utm_campaign = getCookie('utm_campaign');
    utm_content = getCookie('utm_content');
    utm_term = getCookie('utm_term');
    $('a[href*="https://web.altair.com"]').prop('href', function () {
        var url = new URL($(this).prop('href'));
        if (url.search) {
            url.search += "&";
        }
        url.search += "utm_source=" + utm_source + "&utm_medium=" + utm_medium + "&utm_campaign=" + utm_campaign + "&utm_content=" + utm_content + "&utm_term=" + utm_term;
        $(this).prop('href', url.toString());
    });
});

function ScaleCropImage($image) {

    var originalWidth = $image.width();
    var originalHeight = $image.height();
    var originalRatio = originalHeight / originalWidth;
    $image.width('auto');
    $image.height('auto');
    var width = $image.width();
    var height = $image.height();
    var ratio = height / width;

    if (width > originalWidth && height > originalHeight) {
        $image.css('position', 'absolute');
        var left = Math.floor((width - originalWidth) / 2);
        var top = Math.floor((height - originalHeight) / 2);
        if (ratio > originalRatio) {
            $image.width(originalWidth);
        }
        else if (ratio < originalRatio) {
            $image.height(originalHeight);
        }
        else {
            $image.width(originalWidth);
            $image.height(originalHeight);
        }
        //$image.width(width);
        //$image.height(height);
        //$image.css('position', 'absolute');
        //$image.css('left', -left);
        //$image.css('top', -top);
    }
    else {
        $image.width(originalWidth);
        $image.height(originalHeight);
        $image.css('position', 'relative');
        $image.css('left', '');
        $image.css('top', '');
    }
}

function GetCroppedJpgUrl($container, imageUrl) {
    if ($container === null || $container.length === 0 || imageUrl === null || imageUrl === '') {
        return null;
    }
    if (imageUrl.indexOf('?') > 0) {
        return imageUrl;
    }
    var height = $container.height();
    var width = $container.width();
    var croppedImageUrl = imageUrl + "?height=" + height + "&width=" + width + "&mode=crop&format=jpg";
    return croppedImageUrl;
}

function AddScript(src) {
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = src;
    var head = document.getElementsByTagName('head')[0];
    head.appendChild(script);
}

//video carousel scripts 2017
//wistia.com/doc/player-api
//targeted Wistia video
var antiquated = "initial"; //old clicked vid
var currentVid; 			//new clicked vid

window._wq = window._wq || [];
_wq.push({
    id: "_all", onReady: function (video) {
        //console.log("This will run for every video on the page. Right now I'm on this one:", video);

        //sets variable
        // var seeked = false;

        // function pauseWistia() {
        // 	if (seeked == false) {
        //$("#pager, #pager a, #stories h2, #stories .captions.current, #stories .overlay, .stories-link.current").fadeIn(360);
        // 		$("#stories .overlay, .stories-link.current").show();
        // 	} else {
        // 		seeked = false;
        // 	}
        // }

        //played functionality
        //   video.bind("play", function() {
        //   	seeked = false;

        //       //assigns currentVid value
        //       currentVid = video.hashedId();

        //       //"initial" checks if this is not the first video clicked
        //       if(antiquated !== "initial") { 
        //       	if(antiquated !== currentVid) {
        //       		var vid = Wistia.api(antiquated);
        //       		//seeked = true;
        //       		vid.pause();
        //       	} else {
        //       		//console.log("both values are equal");
        //       	}
        //       } 

        //       //assigns as antiquated for new vid clicks
        //       antiquated = currentVid;
        //       return video.unbind();
        //   });

        //   //paused functionality
        //   video.bind("pause", pauseWistia);

        //   //this bypasses the Wistia bug of activating pause behavior on seek
        //   video.bind("seek", function(currentTime, lastTime) {
        // 		seeked = true;
        //});

        //end of video functionality
        //  video.bind("end", function() {
        //      //console.log("The video has ended");
        //      $("#pager, #pager a, #stories h2, #stories .captions.current, #stories .overlay, .stories-link.current").fadeIn(360);
        //      $("#stories .overlay, .stories-link.current").show();
        //      $("#altair-carousel li:eq(0) .wistia_embed").fadeTo(500, 0);


        //      //$("div.wistia_async_"+currentVid).fadeTo(500, 0);
        //$("a.from-feature, a.from-feature + .overlay").show();
        //  });
    }
});

// Taken from https://css-tricks.com/NetMag/FluidWidthVideo/Article-FluidWidthVideo.php
function FixYouTubeSize() {

    // Find all YouTube videos
    var $allVideos = $("iframe[src^='//www.youtube.com']"),

        // The element that is fluid width
        $fluidEl = $("body");
    // Figure out and save aspect ratio for each video
    $allVideos.each(function () {

        $(this)
            .data('aspectRatio', this.height / this.width)

            // and remove the hard coded width/height
            .removeAttr('height')
            .removeAttr('width');

    });

    // When the window is resized
    $(window).resize(function () {

        var newWidth = $fluidEl.width();

        // Resize all videos according to their own aspect ratio
        $allVideos.each(function () {

            var $el = $(this);
            $el
                .width(newWidth)
                .height(newWidth * $el.data('aspectRatio'));

        });

        // Kick off one resize to fix all videos on page load
    }).resize();
}

function Search(q) {
    var cx = "007202928960993375146:4bruyaxydmi";
    var cof = "FORID:9";
    var ie = "UTF-8";
    var as_sitesearch = location.hostname;
    if (as_sitesearch.indexOf("mediag.com") >= 0 || as_sitesearch === "webpreview.altair.com") {
        as_sitesearch = "www.altair.com";
    }
    window.location.href = "SearchResults.aspx?cx=" + cx + "&cof=" + cof + "&ie=" + ie + "&q=" + q + "%20site:" + as_sitesearch;
}

// Source: https://www.w3schools.com/js/js_cookies.asp
function setCookie(cname, cvalue, exdays) {
    var d = new Date();
    d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);
    var expires = "expires=" + d.toUTCString();
    document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
    var name = cname + "=";
    var decodedCookie = decodeURIComponent(document.cookie);
    var ca = decodedCookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) === ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(name) === 0) {
            return c.substring(name.length, c.length);
        }
    }
    return "";
}

function SetBackgroundImageOrVideo($element, image, video) {
    var croppedImage = GetCroppedJpgUrl($element, image);
    if (window.innerWidth > 450) {
        if (video != '') {
            $element.prepend('<video autoplay loop muted poster="' + croppedImage + '"><source src="' + video + '" type="video/mp4"></video>');
        } else {
            $element.addClass('bkgImg');
            $element.css({ 'background': 'url("' + croppedImage + '") 50% 50% no-repeat', 'background-size': 'cover' });
        }
    } else {
        $element.addClass('no-video');
        $element.css({ 'background': 'url("' + croppedImage + '") 50% 50% no-repeat', 'background-size': 'cover' });
    }

}

// From http://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
    return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}

// Modified from https://developers.hubspot.com/docs/methods/forms/submit_form_v3
function SubmitHubSpotV3(formID, json, $container) {
    var portalID = 47251;
    // Create the new request 
    var xhr = new XMLHttpRequest();
    var url = 'https://api.hsforms.com/submissions/v3/integration/submit/' + portalID + '/' + formID;
    var final_data = JSON.stringify(json);

    xhr.open('POST', url);
    // Sets the value of the 'Content-Type' HTTP request headers to 'application/json'
    xhr.setRequestHeader('Content-type', 'application/json');

    xhr.onreadystatechange = function () {
        if (xhr.readyState === 4 && xhr.status === 200) {
            console.log(xhr.responseText);
            try {
                var responseJSON = JSON.parse(xhr.responseText);
                if ($container && responseJSON.inlineMessage) {
                    $container.html('<div class="submitted-message">' + responseJSON.inlineMessage + '</div>');
                }
                else if (responseJSON.redirectUri) {
                    location.href = responseJSON.redirectUri;
                }
            } catch (e) {
                console.error(e);
            }
        } else if (xhr.readyState === 4 && xhr.status === 400) {
            console.error(xhr.responseText); // Returns a 400 error the submission is rejected.          
        } else if (xhr.readyState === 4 && xhr.status === 403) {
            console.error(xhr.responseText); // Returns a 403 error if the portal isn't allowed to post submissions.           
        } else if (xhr.readyState === 4 && xhr.status === 404) {
            console.error(xhr.responseText); //Returns a 404 error if the formGuid isn't found     
        }
    };


    // Sends the request 
    xhr.send(final_data);
}

function Subscribe(form) {
    var email = form.email.value;
    if (validateEmail(email)) {
        var fields = [];
        var $inputs = $(form).find('.hs-input');
        for (var i = 0; i < $inputs.length; i++) {
            fields.push({ "name": $inputs[i].name, "value": $inputs[i].value });
        }
        var data = {
            //"submittedAt": new Date().getTime(),
            "fields": fields,
            "context": {
                "hutk": getCookie('hubspotutk') // include this parameter and set it to the hubspotutk cookie value to enable cookie tracking on your submission
            }
        };
        var communications = [];
        var $consents = $inputs.filter('.legal-consent');
        for (var j = 0; j < $consents.length; j++) {
            var $consent = $consents.eq(j);
            communications.push({
                "value": $consent.val() === 'true',
                "subscriptionTypeId": Number($consent.data("subscriptiontypeid")),
                "text": $consent.data("text")
            });
        }
        if (communications.length > 0) {
            data["legalConsentOptions"] = {
                "consent": {
                    "consentToProcess": true,
                    "text": "Altair is committed to protecting your privacy, and weï¿½ll only use your personal information to provide the products and services you requested. From time to time, Altair and our resellers would like to contact you about our products and services. If you show interest in a Partner product, we may provide your personal information to partners involved in the Altair Partner Alliance Program.",
                    "communications": communications
                }
            };
        }
        SubmitHubSpotV3(form.id, data, $('#footer_form'));
    }
    else {
        alert(email + ' is an invalid email.');
    }
}

function validateEmail(email) {
    var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    return re.test(String(email).toLowerCase());
}

/**
 * Uses data on each of the $elements to set image.
 * @param {any} $elements - jquery elements
 */
function SetFigure($elements) {
    $elements.each(function () {
        var isMobile = $(this).is('.mobile-device');
        var desktopImage = $(this).data('desktopimage');
        var mobileImage = $(this).data('mobileimage');
        var alternateText = $(this).data('alternatetext');
        var imageType = $(this).data('imagetype');
        if (imageType === 'BackgroundImage') {
            SetBackgroundImage(isMobile, $(this), desktopImage, mobileImage);
        }
        else {
            SetImage(isMobile, $(this), desktopImage, mobileImage, alternateText);
        }
    });
}

/**
 * Adds image or mobileImage to $element.
 * @param {boolean} isMobile - if the browser is a mobile device
 * @param {object} $element - jquery element
 * @param {string} image - large image src
 * @param {string} mobileImage - small image src
 * @param {string} imageAlt - alternate text for image or mobileImage
 */
function SetImage(isMobile, $element, image, mobileImage, imageAlt) {
    if (mobileImage && (isMobile || window.innerWidth <= 520)) {
        $element.prepend('<img class="mobile" src="' + mobileImage + '" alt="' + imageAlt + '" />');
    } else {
        $element.prepend('<img src="' + image + '" alt="' + imageAlt + '" />');
    }
}

/**
 * Sets image or mobileImage as background-image of $element.
 * @param {boolean} isMobile - if the browser is a mobile device
 * @param {object} $element - jquery element
 * @param {string} image - large image src
 * @param {string} mobileImage - small image src
 */
function SetBackgroundImage(isMobile, $element, image, mobileImage) {
    if (mobileImage && (isMobile || window.innerWidth <= 520)) {
        $element.css('background-image', "url('" + mobileImage + "')");
    } else {
        $element.css('background-image', "url('" + image + "')");
    }
}

function isEmpty(str) {
    return (!str || 0 === str.trim().length);
};
