/* Minification failed. Returning unminified contents.
(10311,3539-3540): run-time error JS1010: Expected identifier: .
(10311,3539-3540): run-time error JS1195: Expected expression: .
(10311,4691-4692): run-time error JS1010: Expected identifier: .
(10311,4691-4692): run-time error JS1195: Expected expression: .
 */
/**
 * Copyright 2016 Google Inc. All Rights Reserved.
 *
 * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.
 *
 *  https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
 *
 */
(function() {
'use strict';

// Exit early if we're not running in a browser.
if (typeof window !== 'object') {
  return;
}

// Exit early if all IntersectionObserver and IntersectionObserverEntry
// features are natively supported.
if ('IntersectionObserver' in window &&
    'IntersectionObserverEntry' in window &&
    'intersectionRatio' in window.IntersectionObserverEntry.prototype) {

  // Minimal polyfill for Edge 15's lack of `isIntersecting`
  // See: https://github.com/w3c/IntersectionObserver/issues/211
  if (!('isIntersecting' in window.IntersectionObserverEntry.prototype)) {
    Object.defineProperty(window.IntersectionObserverEntry.prototype,
      'isIntersecting', {
      get: function () {
        return this.intersectionRatio > 0;
      }
    });
  }
  return;
}


/**
 * A local reference to the document.
 */
var document = window.document;


/**
 * An IntersectionObserver registry. This registry exists to hold a strong
 * reference to IntersectionObserver instances currently observing a target
 * element. Without this registry, instances without another reference may be
 * garbage collected.
 */
var registry = [];


/**
 * Creates the global IntersectionObserverEntry constructor.
 * https://w3c.github.io/IntersectionObserver/#intersection-observer-entry
 * @param {Object} entry A dictionary of instance properties.
 * @constructor
 */
function IntersectionObserverEntry(entry) {
  this.time = entry.time;
  this.target = entry.target;
  this.rootBounds = entry.rootBounds;
  this.boundingClientRect = entry.boundingClientRect;
  this.intersectionRect = entry.intersectionRect || getEmptyRect();
  this.isIntersecting = !!entry.intersectionRect;

  // Calculates the intersection ratio.
  var targetRect = this.boundingClientRect;
  var targetArea = targetRect.width * targetRect.height;
  var intersectionRect = this.intersectionRect;
  var intersectionArea = intersectionRect.width * intersectionRect.height;

  // Sets intersection ratio.
  if (targetArea) {
    // Round the intersection ratio to avoid floating point math issues:
    // https://github.com/w3c/IntersectionObserver/issues/324
    this.intersectionRatio = Number((intersectionArea / targetArea).toFixed(4));
  } else {
    // If area is zero and is intersecting, sets to 1, otherwise to 0
    this.intersectionRatio = this.isIntersecting ? 1 : 0;
  }
}


/**
 * Creates the global IntersectionObserver constructor.
 * https://w3c.github.io/IntersectionObserver/#intersection-observer-interface
 * @param {Function} callback The function to be invoked after intersection
 *     changes have queued. The function is not invoked if the queue has
 *     been emptied by calling the `takeRecords` method.
 * @param {Object=} opt_options Optional configuration options.
 * @constructor
 */
function IntersectionObserver(callback, opt_options) {

  var options = opt_options || {};

  if (typeof callback != 'function') {
    throw new Error('callback must be a function');
  }

  if (options.root && options.root.nodeType != 1) {
    throw new Error('root must be an Element');
  }

  // Binds and throttles `this._checkForIntersections`.
  this._checkForIntersections = throttle(
      this._checkForIntersections.bind(this), this.THROTTLE_TIMEOUT);

  // Private properties.
  this._callback = callback;
  this._observationTargets = [];
  this._queuedEntries = [];
  this._rootMarginValues = this._parseRootMargin(options.rootMargin);

  // Public properties.
  this.thresholds = this._initThresholds(options.threshold);
  this.root = options.root || null;
  this.rootMargin = this._rootMarginValues.map(function(margin) {
    return margin.value + margin.unit;
  }).join(' ');
}


/**
 * The minimum interval within which the document will be checked for
 * intersection changes.
 */
IntersectionObserver.prototype.THROTTLE_TIMEOUT = 100;


/**
 * The frequency in which the polyfill polls for intersection changes.
 * this can be updated on a per instance basis and must be set prior to
 * calling `observe` on the first target.
 */
IntersectionObserver.prototype.POLL_INTERVAL = 100;

/**
 * Use a mutation observer on the root element
 * to detect intersection changes.
 */
IntersectionObserver.prototype.USE_MUTATION_OBSERVER = true;


/**
 * Starts observing a target element for intersection changes based on
 * the thresholds values.
 * @param {Element} target The DOM element to observe.
 */
IntersectionObserver.prototype.observe = function(target) {
  var isTargetAlreadyObserved = this._observationTargets.some(function(item) {
    return item.element == target;
  });

  if (isTargetAlreadyObserved) {
    return;
  }

  if (!(target && target.nodeType == 1)) {
    throw new Error('target must be an Element');
  }

  this._registerInstance();
  this._observationTargets.push({element: target, entry: null});
  this._monitorIntersections();
  this._checkForIntersections();
};


/**
 * Stops observing a target element for intersection changes.
 * @param {Element} target The DOM element to observe.
 */
IntersectionObserver.prototype.unobserve = function(target) {
  this._observationTargets =
      this._observationTargets.filter(function(item) {

    return item.element != target;
  });
  if (!this._observationTargets.length) {
    this._unmonitorIntersections();
    this._unregisterInstance();
  }
};


/**
 * Stops observing all target elements for intersection changes.
 */
IntersectionObserver.prototype.disconnect = function() {
  this._observationTargets = [];
  this._unmonitorIntersections();
  this._unregisterInstance();
};


/**
 * Returns any queue entries that have not yet been reported to the
 * callback and clears the queue. This can be used in conjunction with the
 * callback to obtain the absolute most up-to-date intersection information.
 * @return {Array} The currently queued entries.
 */
IntersectionObserver.prototype.takeRecords = function() {
  var records = this._queuedEntries.slice();
  this._queuedEntries = [];
  return records;
};


/**
 * Accepts the threshold value from the user configuration object and
 * returns a sorted array of unique threshold values. If a value is not
 * between 0 and 1 and error is thrown.
 * @private
 * @param {Array|number=} opt_threshold An optional threshold value or
 *     a list of threshold values, defaulting to [0].
 * @return {Array} A sorted list of unique and valid threshold values.
 */
IntersectionObserver.prototype._initThresholds = function(opt_threshold) {
  var threshold = opt_threshold || [0];
  if (!Array.isArray(threshold)) threshold = [threshold];

  return threshold.sort().filter(function(t, i, a) {
    if (typeof t != 'number' || isNaN(t) || t < 0 || t > 1) {
      throw new Error('threshold must be a number between 0 and 1 inclusively');
    }
    return t !== a[i - 1];
  });
};


/**
 * Accepts the rootMargin value from the user configuration object
 * and returns an array of the four margin values as an object containing
 * the value and unit properties. If any of the values are not properly
 * formatted or use a unit other than px or %, and error is thrown.
 * @private
 * @param {string=} opt_rootMargin An optional rootMargin value,
 *     defaulting to '0px'.
 * @return {Array<Object>} An array of margin objects with the keys
 *     value and unit.
 */
IntersectionObserver.prototype._parseRootMargin = function(opt_rootMargin) {
  var marginString = opt_rootMargin || '0px';
  var margins = marginString.split(/\s+/).map(function(margin) {
    var parts = /^(-?\d*\.?\d+)(px|%)$/.exec(margin);
    if (!parts) {
      throw new Error('rootMargin must be specified in pixels or percent');
    }
    return {value: parseFloat(parts[1]), unit: parts[2]};
  });

  // Handles shorthand.
  margins[1] = margins[1] || margins[0];
  margins[2] = margins[2] || margins[0];
  margins[3] = margins[3] || margins[1];

  return margins;
};


/**
 * Starts polling for intersection changes if the polling is not already
 * happening, and if the page's visibility state is visible.
 * @private
 */
IntersectionObserver.prototype._monitorIntersections = function() {
  if (!this._monitoringIntersections) {
    this._monitoringIntersections = true;

    // If a poll interval is set, use polling instead of listening to
    // resize and scroll events or DOM mutations.
    if (this.POLL_INTERVAL) {
      this._monitoringInterval = setInterval(
          this._checkForIntersections, this.POLL_INTERVAL);
    }
    else {
      addEvent(window, 'resize', this._checkForIntersections, true);
      addEvent(document, 'scroll', this._checkForIntersections, true);

      if (this.USE_MUTATION_OBSERVER && 'MutationObserver' in window) {
        this._domObserver = new MutationObserver(this._checkForIntersections);
        this._domObserver.observe(document, {
          attributes: true,
          childList: true,
          characterData: true,
          subtree: true
        });
      }
    }
  }
};


/**
 * Stops polling for intersection changes.
 * @private
 */
IntersectionObserver.prototype._unmonitorIntersections = function() {
  if (this._monitoringIntersections) {
    this._monitoringIntersections = false;

    clearInterval(this._monitoringInterval);
    this._monitoringInterval = null;

    removeEvent(window, 'resize', this._checkForIntersections, true);
    removeEvent(document, 'scroll', this._checkForIntersections, true);

    if (this._domObserver) {
      this._domObserver.disconnect();
      this._domObserver = null;
    }
  }
};


/**
 * Scans each observation target for intersection changes and adds them
 * to the internal entries queue. If new entries are found, it
 * schedules the callback to be invoked.
 * @private
 */
IntersectionObserver.prototype._checkForIntersections = function() {
  var rootIsInDom = this._rootIsInDom();
  var rootRect = rootIsInDom ? this._getRootRect() : getEmptyRect();

  this._observationTargets.forEach(function(item) {
    var target = item.element;
    var targetRect = getBoundingClientRect(target);
    var rootContainsTarget = this._rootContainsTarget(target);
    var oldEntry = item.entry;
    var intersectionRect = rootIsInDom && rootContainsTarget &&
        this._computeTargetAndRootIntersection(target, rootRect);

    var newEntry = item.entry = new IntersectionObserverEntry({
      time: now(),
      target: target,
      boundingClientRect: targetRect,
      rootBounds: rootRect,
      intersectionRect: intersectionRect
    });

    if (!oldEntry) {
      this._queuedEntries.push(newEntry);
    } else if (rootIsInDom && rootContainsTarget) {
      // If the new entry intersection ratio has crossed any of the
      // thresholds, add a new entry.
      if (this._hasCrossedThreshold(oldEntry, newEntry)) {
        this._queuedEntries.push(newEntry);
      }
    } else {
      // If the root is not in the DOM or target is not contained within
      // root but the previous entry for this target had an intersection,
      // add a new record indicating removal.
      if (oldEntry && oldEntry.isIntersecting) {
        this._queuedEntries.push(newEntry);
      }
    }
  }, this);

  if (this._queuedEntries.length) {
    this._callback(this.takeRecords(), this);
  }
};


/**
 * Accepts a target and root rect computes the intersection between then
 * following the algorithm in the spec.
 * TODO(philipwalton): at this time clip-path is not considered.
 * https://w3c.github.io/IntersectionObserver/#calculate-intersection-rect-algo
 * @param {Element} target The target DOM element
 * @param {Object} rootRect The bounding rect of the root after being
 *     expanded by the rootMargin value.
 * @return {?Object} The final intersection rect object or undefined if no
 *     intersection is found.
 * @private
 */
IntersectionObserver.prototype._computeTargetAndRootIntersection =
    function(target, rootRect) {

  // If the element isn't displayed, an intersection can't happen.
  if (window.getComputedStyle(target).display == 'none') return;

  var targetRect = getBoundingClientRect(target);
  var intersectionRect = targetRect;
  var parent = getParentNode(target);
  var atRoot = false;

  while (!atRoot) {
    var parentRect = null;
    var parentComputedStyle = parent.nodeType == 1 ?
        window.getComputedStyle(parent) : {};

    // If the parent isn't displayed, an intersection can't happen.
    if (parentComputedStyle.display == 'none') return;

    if (parent == this.root || parent == document) {
      atRoot = true;
      parentRect = rootRect;
    } else {
      // If the element has a non-visible overflow, and it's not the <body>
      // or <html> element, update the intersection rect.
      // Note: <body> and <html> cannot be clipped to a rect that's not also
      // the document rect, so no need to compute a new intersection.
      if (parent != document.body &&
          parent != document.documentElement &&
          parentComputedStyle.overflow != 'visible') {
        parentRect = getBoundingClientRect(parent);
      }
    }

    // If either of the above conditionals set a new parentRect,
    // calculate new intersection data.
    if (parentRect) {
      intersectionRect = computeRectIntersection(parentRect, intersectionRect);

      if (!intersectionRect) break;
    }
    parent = getParentNode(parent);
  }
  return intersectionRect;
};


/**
 * Returns the root rect after being expanded by the rootMargin value.
 * @return {Object} The expanded root rect.
 * @private
 */
IntersectionObserver.prototype._getRootRect = function() {
  var rootRect;
  if (this.root) {
    rootRect = getBoundingClientRect(this.root);
  } else {
    // Use <html>/<body> instead of window since scroll bars affect size.
    var html = document.documentElement;
    var body = document.body;
    rootRect = {
      top: 0,
      left: 0,
      right: html.clientWidth || body.clientWidth,
      width: html.clientWidth || body.clientWidth,
      bottom: html.clientHeight || body.clientHeight,
      height: html.clientHeight || body.clientHeight
    };
  }
  return this._expandRectByRootMargin(rootRect);
};


/**
 * Accepts a rect and expands it by the rootMargin value.
 * @param {Object} rect The rect object to expand.
 * @return {Object} The expanded rect.
 * @private
 */
IntersectionObserver.prototype._expandRectByRootMargin = function(rect) {
  var margins = this._rootMarginValues.map(function(margin, i) {
    return margin.unit == 'px' ? margin.value :
        margin.value * (i % 2 ? rect.width : rect.height) / 100;
  });
  var newRect = {
    top: rect.top - margins[0],
    right: rect.right + margins[1],
    bottom: rect.bottom + margins[2],
    left: rect.left - margins[3]
  };
  newRect.width = newRect.right - newRect.left;
  newRect.height = newRect.bottom - newRect.top;

  return newRect;
};


/**
 * Accepts an old and new entry and returns true if at least one of the
 * threshold values has been crossed.
 * @param {?IntersectionObserverEntry} oldEntry The previous entry for a
 *    particular target element or null if no previous entry exists.
 * @param {IntersectionObserverEntry} newEntry The current entry for a
 *    particular target element.
 * @return {boolean} Returns true if a any threshold has been crossed.
 * @private
 */
IntersectionObserver.prototype._hasCrossedThreshold =
    function(oldEntry, newEntry) {

  // To make comparing easier, an entry that has a ratio of 0
  // but does not actually intersect is given a value of -1
  var oldRatio = oldEntry && oldEntry.isIntersecting ?
      oldEntry.intersectionRatio || 0 : -1;
  var newRatio = newEntry.isIntersecting ?
      newEntry.intersectionRatio || 0 : -1;

  // Ignore unchanged ratios
  if (oldRatio === newRatio) return;

  for (var i = 0; i < this.thresholds.length; i++) {
    var threshold = this.thresholds[i];

    // Return true if an entry matches a threshold or if the new ratio
    // and the old ratio are on the opposite sides of a threshold.
    if (threshold == oldRatio || threshold == newRatio ||
        threshold < oldRatio !== threshold < newRatio) {
      return true;
    }
  }
};


/**
 * Returns whether or not the root element is an element and is in the DOM.
 * @return {boolean} True if the root element is an element and is in the DOM.
 * @private
 */
IntersectionObserver.prototype._rootIsInDom = function() {
  return !this.root || containsDeep(document, this.root);
};


/**
 * Returns whether or not the target element is a child of root.
 * @param {Element} target The target element to check.
 * @return {boolean} True if the target element is a child of root.
 * @private
 */
IntersectionObserver.prototype._rootContainsTarget = function(target) {
  return containsDeep(this.root || document, target);
};


/**
 * Adds the instance to the global IntersectionObserver registry if it isn't
 * already present.
 * @private
 */
IntersectionObserver.prototype._registerInstance = function() {
  if (registry.indexOf(this) < 0) {
    registry.push(this);
  }
};


/**
 * Removes the instance from the global IntersectionObserver registry.
 * @private
 */
IntersectionObserver.prototype._unregisterInstance = function() {
  var index = registry.indexOf(this);
  if (index != -1) registry.splice(index, 1);
};


/**
 * Returns the result of the performance.now() method or null in browsers
 * that don't support the API.
 * @return {number} The elapsed time since the page was requested.
 */
function now() {
  return window.performance && performance.now && performance.now();
}


/**
 * Throttles a function and delays its execution, so it's only called at most
 * once within a given time period.
 * @param {Function} fn The function to throttle.
 * @param {number} timeout The amount of time that must pass before the
 *     function can be called again.
 * @return {Function} The throttled function.
 */
function throttle(fn, timeout) {
  var timer = null;
  return function () {
    if (!timer) {
      timer = setTimeout(function() {
        fn();
        timer = null;
      }, timeout);
    }
  };
}


/**
 * Adds an event handler to a DOM node ensuring cross-browser compatibility.
 * @param {Node} node The DOM node to add the event handler to.
 * @param {string} event The event name.
 * @param {Function} fn The event handler to add.
 * @param {boolean} opt_useCapture Optionally adds the even to the capture
 *     phase. Note: this only works in modern browsers.
 */
function addEvent(node, event, fn, opt_useCapture) {
  if (typeof node.addEventListener == 'function') {
    node.addEventListener(event, fn, opt_useCapture || false);
  }
  else if (typeof node.attachEvent == 'function') {
    node.attachEvent('on' + event, fn);
  }
}


/**
 * Removes a previously added event handler from a DOM node.
 * @param {Node} node The DOM node to remove the event handler from.
 * @param {string} event The event name.
 * @param {Function} fn The event handler to remove.
 * @param {boolean} opt_useCapture If the event handler was added with this
 *     flag set to true, it should be set to true here in order to remove it.
 */
function removeEvent(node, event, fn, opt_useCapture) {
  if (typeof node.removeEventListener == 'function') {
    node.removeEventListener(event, fn, opt_useCapture || false);
  }
  else if (typeof node.detatchEvent == 'function') {
    node.detatchEvent('on' + event, fn);
  }
}


/**
 * Returns the intersection between two rect objects.
 * @param {Object} rect1 The first rect.
 * @param {Object} rect2 The second rect.
 * @return {?Object} The intersection rect or undefined if no intersection
 *     is found.
 */
function computeRectIntersection(rect1, rect2) {
  var top = Math.max(rect1.top, rect2.top);
  var bottom = Math.min(rect1.bottom, rect2.bottom);
  var left = Math.max(rect1.left, rect2.left);
  var right = Math.min(rect1.right, rect2.right);
  var width = right - left;
  var height = bottom - top;

  return (width >= 0 && height >= 0) && {
    top: top,
    bottom: bottom,
    left: left,
    right: right,
    width: width,
    height: height
  };
}


/**
 * Shims the native getBoundingClientRect for compatibility with older IE.
 * @param {Element} el The element whose bounding rect to get.
 * @return {Object} The (possibly shimmed) rect of the element.
 */
function getBoundingClientRect(el) {
  var rect;

  try {
    rect = el.getBoundingClientRect();
  } catch (err) {
    // Ignore Windows 7 IE11 "Unspecified error"
    // https://github.com/w3c/IntersectionObserver/pull/205
  }

  if (!rect) return getEmptyRect();

  // Older IE
  if (!(rect.width && rect.height)) {
    rect = {
      top: rect.top,
      right: rect.right,
      bottom: rect.bottom,
      left: rect.left,
      width: rect.right - rect.left,
      height: rect.bottom - rect.top
    };
  }
  return rect;
}


/**
 * Returns an empty rect object. An empty rect is returned when an element
 * is not in the DOM.
 * @return {Object} The empty rect.
 */
function getEmptyRect() {
  return {
    top: 0,
    bottom: 0,
    left: 0,
    right: 0,
    width: 0,
    height: 0
  };
}

/**
 * Checks to see if a parent element contains a child element (including inside
 * shadow DOM).
 * @param {Node} parent The parent element.
 * @param {Node} child The child element.
 * @return {boolean} True if the parent node contains the child node.
 */
function containsDeep(parent, child) {
  var node = child;
  while (node) {
    if (node == parent) return true;

    node = getParentNode(node);
  }
  return false;
}


/**
 * Gets the parent node of an element or its host element if the parent node
 * is a shadow root.
 * @param {Node} node The node whose parent to get.
 * @return {Node|null} The parent node or null if no parent exists.
 */
function getParentNode(node) {
  var parent = node.parentNode;

  if (parent && parent.nodeType == 11 && parent.host) {
    // If the parent is a shadow root, return the host element.
    return parent.host;
  }

  if (parent && parent.assignedSlot) {
    // If the parent is distributed in a <slot>, return the parent of a slot.
    return parent.assignedSlot.parentNode;
  }

  return parent;
}


// Exposes the constructors globally.
window.IntersectionObserver = IntersectionObserver;
window.IntersectionObserverEntry = IntersectionObserverEntry;

}());;
/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;

return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fa=/ jQuery\d+="(?:null|\d+)"/g,ga=new RegExp("<(?:"+ea+")[\\s/>]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/<tbody/i,la=/<|&#?\w+;/,ma=/<(?:script|style|link)/i,na=/checked\s*(?:[^=]|=\s*.checked.)/i,oa=/^$|\/(?:java|ecma)script/i,pa=/^true\/(.*)/,qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ra={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?"<table>"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){
return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
;
/*! jQuery UI - v1.10.4 - 2015-07-10
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.sortable.js, jquery.ui.slider.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */

(function (e, t) { function i(t, i) { var n, a, o, r = t.nodeName.toLowerCase(); return "area" === r ? (n = t.parentNode, a = n.name, t.href && a && "map" === n.nodeName.toLowerCase() ? (o = e("img[usemap=#" + a + "]")[0], !!o && s(o)) : !1) : (/input|select|textarea|button|object/.test(r) ? !t.disabled : "a" === r ? t.href || i : i) && s(t) } function s(t) { return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function () { return "hidden" === e.css(this, "visibility") }).length } var n = 0, a = /^ui-id-\d+$/; e.ui = e.ui || {}, e.extend(e.ui, { version: "1.10.4", keyCode: { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38 } }), e.fn.extend({ focus: function (t) { return function (i, s) { return "number" == typeof i ? this.each(function () { var t = this; setTimeout(function () { e(t).focus(), s && s.call(t) }, i) }) : t.apply(this, arguments) } }(e.fn.focus), scrollParent: function () { var t; return t = e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? this.parents().filter(function () { return /(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x")) }).eq(0) : this.parents().filter(function () { return /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x")) }).eq(0), /fixed/.test(this.css("position")) || !t.length ? e(document) : t }, zIndex: function (i) { if (i !== t) return this.css("zIndex", i); if (this.length) for (var s, n, a = e(this[0]) ; a.length && a[0] !== document;) { if (s = a.css("position"), ("absolute" === s || "relative" === s || "fixed" === s) && (n = parseInt(a.css("zIndex"), 10), !isNaN(n) && 0 !== n)) return n; a = a.parent() } return 0 }, uniqueId: function () { return this.each(function () { this.id || (this.id = "ui-id-" + ++n) }) }, removeUniqueId: function () { return this.each(function () { a.test(this.id) && e(this).removeAttr("id") }) } }), e.extend(e.expr[":"], { data: e.expr.createPseudo ? e.expr.createPseudo(function (t) { return function (i) { return !!e.data(i, t) } }) : function (t, i, s) { return !!e.data(t, s[3]) }, focusable: function (t) { return i(t, !isNaN(e.attr(t, "tabindex"))) }, tabbable: function (t) { var s = e.attr(t, "tabindex"), n = isNaN(s); return (n || s >= 0) && i(t, !n) } }), e("<a>").outerWidth(1).jquery || e.each(["Width", "Height"], function (i, s) { function n(t, i, s, n) { return e.each(a, function () { i -= parseFloat(e.css(t, "padding" + this)) || 0, s && (i -= parseFloat(e.css(t, "border" + this + "Width")) || 0), n && (i -= parseFloat(e.css(t, "margin" + this)) || 0) }), i } var a = "Width" === s ? ["Left", "Right"] : ["Top", "Bottom"], o = s.toLowerCase(), r = { innerWidth: e.fn.innerWidth, innerHeight: e.fn.innerHeight, outerWidth: e.fn.outerWidth, outerHeight: e.fn.outerHeight }; e.fn["inner" + s] = function (i) { return i === t ? r["inner" + s].call(this) : this.each(function () { e(this).css(o, n(this, i) + "px") }) }, e.fn["outer" + s] = function (t, i) { return "number" != typeof t ? r["outer" + s].call(this, t) : this.each(function () { e(this).css(o, n(this, t, !0, i) + "px") }) } }), e.fn.addBack || (e.fn.addBack = function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) }), e("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function (t) { return function (i) { return arguments.length ? t.call(this, e.camelCase(i)) : t.call(this) } }(e.fn.removeData)), e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.support.selectstart = "onselectstart" in document.createElement("div"), e.fn.extend({ disableSelection: function () { return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (e) { e.preventDefault() }) }, enableSelection: function () { return this.unbind(".ui-disableSelection") } }), e.extend(e.ui, { plugin: { add: function (t, i, s) { var n, a = e.ui[t].prototype; for (n in s) a.plugins[n] = a.plugins[n] || [], a.plugins[n].push([i, s[n]]) }, call: function (e, t, i) { var s, n = e.plugins[t]; if (n && e.element[0].parentNode && 11 !== e.element[0].parentNode.nodeType) for (s = 0; n.length > s; s++) e.options[n[s][0]] && n[s][1].apply(e.element, i) } }, hasScroll: function (t, i) { if ("hidden" === e(t).css("overflow")) return !1; var s = i && "left" === i ? "scrollLeft" : "scrollTop", n = !1; return t[s] > 0 ? !0 : (t[s] = 1, n = t[s] > 0, t[s] = 0, n) } }) })(jQuery); (function (e, t) { var i = 0, s = Array.prototype.slice, n = e.cleanData; e.cleanData = function (t) { for (var i, s = 0; null != (i = t[s]) ; s++) try { e(i).triggerHandler("remove") } catch (a) { } n(t) }, e.widget = function (i, s, n) { var a, o, r, h, l = {}, u = i.split(".")[0]; i = i.split(".")[1], a = u + "-" + i, n || (n = s, s = e.Widget), e.expr[":"][a.toLowerCase()] = function (t) { return !!e.data(t, a) }, e[u] = e[u] || {}, o = e[u][i], r = e[u][i] = function (e, i) { return this._createWidget ? (arguments.length && this._createWidget(e, i), t) : new r(e, i) }, e.extend(r, o, { version: n.version, _proto: e.extend({}, n), _childConstructors: [] }), h = new s, h.options = e.widget.extend({}, h.options), e.each(n, function (i, n) { return e.isFunction(n) ? (l[i] = function () { var e = function () { return s.prototype[i].apply(this, arguments) }, t = function (e) { return s.prototype[i].apply(this, e) }; return function () { var i, s = this._super, a = this._superApply; return this._super = e, this._superApply = t, i = n.apply(this, arguments), this._super = s, this._superApply = a, i } }(), t) : (l[i] = n, t) }), r.prototype = e.widget.extend(h, { widgetEventPrefix: o ? h.widgetEventPrefix || i : i }, l, { constructor: r, namespace: u, widgetName: i, widgetFullName: a }), o ? (e.each(o._childConstructors, function (t, i) { var s = i.prototype; e.widget(s.namespace + "." + s.widgetName, r, i._proto) }), delete o._childConstructors) : s._childConstructors.push(r), e.widget.bridge(i, r) }, e.widget.extend = function (i) { for (var n, a, o = s.call(arguments, 1), r = 0, h = o.length; h > r; r++) for (n in o[r]) a = o[r][n], o[r].hasOwnProperty(n) && a !== t && (i[n] = e.isPlainObject(a) ? e.isPlainObject(i[n]) ? e.widget.extend({}, i[n], a) : e.widget.extend({}, a) : a); return i }, e.widget.bridge = function (i, n) { var a = n.prototype.widgetFullName || i; e.fn[i] = function (o) { var r = "string" == typeof o, h = s.call(arguments, 1), l = this; return o = !r && h.length ? e.widget.extend.apply(null, [o].concat(h)) : o, r ? this.each(function () { var s, n = e.data(this, a); return n ? e.isFunction(n[o]) && "_" !== o.charAt(0) ? (s = n[o].apply(n, h), s !== n && s !== t ? (l = s && s.jquery ? l.pushStack(s.get()) : s, !1) : t) : e.error("no such method '" + o + "' for " + i + " widget instance") : e.error("cannot call methods on " + i + " prior to initialization; " + "attempted to call method '" + o + "'") }) : this.each(function () { var t = e.data(this, a); t ? t.option(o || {})._init() : e.data(this, a, new n(o, this)) }), l } }, e.Widget = function () { }, e.Widget._childConstructors = [], e.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "<div>", options: { disabled: !1, create: null }, _createWidget: function (t, s) { s = e(s || this.defaultElement || this)[0], this.element = e(s), this.uuid = i++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = e.widget.extend({}, this.options, this._getCreateOptions(), t), this.bindings = e(), this.hoverable = e(), this.focusable = e(), s !== this && (e.data(s, this.widgetFullName, this), this._on(!0, this.element, { remove: function (e) { e.target === s && this.destroy() } }), this.document = e(s.style ? s.ownerDocument : s.document || s), this.window = e(this.document[0].defaultView || this.document[0].parentWindow)), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init() }, _getCreateOptions: e.noop, _getCreateEventData: e.noop, _create: e.noop, _init: e.noop, destroy: function () { this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus") }, _destroy: e.noop, widget: function () { return this.element }, option: function (i, s) { var n, a, o, r = i; if (0 === arguments.length) return e.widget.extend({}, this.options); if ("string" == typeof i) if (r = {}, n = i.split("."), i = n.shift(), n.length) { for (a = r[i] = e.widget.extend({}, this.options[i]), o = 0; n.length - 1 > o; o++) a[n[o]] = a[n[o]] || {}, a = a[n[o]]; if (i = n.pop(), 1 === arguments.length) return a[i] === t ? null : a[i]; a[i] = s } else { if (1 === arguments.length) return this.options[i] === t ? null : this.options[i]; r[i] = s } return this._setOptions(r), this }, _setOptions: function (e) { var t; for (t in e) this._setOption(t, e[t]); return this }, _setOption: function (e, t) { return this.options[e] = t, "disabled" === e && (this.widget().toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !!t).attr("aria-disabled", t), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")), this }, enable: function () { return this._setOption("disabled", !1) }, disable: function () { return this._setOption("disabled", !0) }, _on: function (i, s, n) { var a, o = this; "boolean" != typeof i && (n = s, s = i, i = !1), n ? (s = a = e(s), this.bindings = this.bindings.add(s)) : (n = s, s = this.element, a = this.widget()), e.each(n, function (n, r) { function h() { return i || o.options.disabled !== !0 && !e(this).hasClass("ui-state-disabled") ? ("string" == typeof r ? o[r] : r).apply(o, arguments) : t } "string" != typeof r && (h.guid = r.guid = r.guid || h.guid || e.guid++); var l = n.match(/^(\w+)\s*(.*)$/), u = l[1] + o.eventNamespace, d = l[2]; d ? a.delegate(d, u, h) : s.bind(u, h) }) }, _off: function (e, t) { t = (t || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, e.unbind(t).undelegate(t) }, _delay: function (e, t) { function i() { return ("string" == typeof e ? s[e] : e).apply(s, arguments) } var s = this; return setTimeout(i, t || 0) }, _hoverable: function (t) { this.hoverable = this.hoverable.add(t), this._on(t, { mouseenter: function (t) { e(t.currentTarget).addClass("ui-state-hover") }, mouseleave: function (t) { e(t.currentTarget).removeClass("ui-state-hover") } }) }, _focusable: function (t) { this.focusable = this.focusable.add(t), this._on(t, { focusin: function (t) { e(t.currentTarget).addClass("ui-state-focus") }, focusout: function (t) { e(t.currentTarget).removeClass("ui-state-focus") } }) }, _trigger: function (t, i, s) { var n, a, o = this.options[t]; if (s = s || {}, i = e.Event(i), i.type = (t === this.widgetEventPrefix ? t : this.widgetEventPrefix + t).toLowerCase(), i.target = this.element[0], a = i.originalEvent) for (n in a) n in i || (i[n] = a[n]); return this.element.trigger(i, s), !(e.isFunction(o) && o.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented()) } }, e.each({ show: "fadeIn", hide: "fadeOut" }, function (t, i) { e.Widget.prototype["_" + t] = function (s, n, a) { "string" == typeof n && (n = { effect: n }); var o, r = n ? n === !0 || "number" == typeof n ? i : n.effect || i : t; n = n || {}, "number" == typeof n && (n = { duration: n }), o = !e.isEmptyObject(n), n.complete = a, n.delay && s.delay(n.delay), o && e.effects && e.effects.effect[r] ? s[t](n) : r !== t && s[r] ? s[r](n.duration, n.easing, a) : s.queue(function (i) { e(this)[t](), a && a.call(s[0]), i() }) } }) })(jQuery); (function (e) { var t = !1; e(document).mouseup(function () { t = !1 }), e.widget("ui.mouse", { version: "1.10.4", options: { cancel: "input,textarea,button,select,option", distance: 1, delay: 0 }, _mouseInit: function () { var t = this; this.element.bind("mousedown." + this.widgetName, function (e) { return t._mouseDown(e) }).bind("click." + this.widgetName, function (i) { return !0 === e.data(i.target, t.widgetName + ".preventClickEvent") ? (e.removeData(i.target, t.widgetName + ".preventClickEvent"), i.stopImmediatePropagation(), !1) : undefined }), this.started = !1 }, _mouseDestroy: function () { this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate) }, _mouseDown: function (i) { if (!t) { this._mouseStarted && this._mouseUp(i), this._mouseDownEvent = i; var s = this, n = 1 === i.which, a = "string" == typeof this.options.cancel && i.target.nodeName ? e(i.target).closest(this.options.cancel).length : !1; return n && !a && this._mouseCapture(i) ? (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () { s.mouseDelayMet = !0 }, this.options.delay)), this._mouseDistanceMet(i) && this._mouseDelayMet(i) && (this._mouseStarted = this._mouseStart(i) !== !1, !this._mouseStarted) ? (i.preventDefault(), !0) : (!0 === e.data(i.target, this.widgetName + ".preventClickEvent") && e.removeData(i.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function (e) { return s._mouseMove(e) }, this._mouseUpDelegate = function (e) { return s._mouseUp(e) }, e(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), i.preventDefault(), t = !0, !0)) : !0 } }, _mouseMove: function (t) { return e.ui.ie && (!document.documentMode || 9 > document.documentMode) && !t.button ? this._mouseUp(t) : this._mouseStarted ? (this._mouseDrag(t), t.preventDefault()) : (this._mouseDistanceMet(t) && this._mouseDelayMet(t) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, t) !== !1, this._mouseStarted ? this._mouseDrag(t) : this._mouseUp(t)), !this._mouseStarted) }, _mouseUp: function (t) { return e(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, t.target === this._mouseDownEvent.target && e.data(t.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(t)), !1 }, _mouseDistanceMet: function (e) { return Math.max(Math.abs(this._mouseDownEvent.pageX - e.pageX), Math.abs(this._mouseDownEvent.pageY - e.pageY)) >= this.options.distance }, _mouseDelayMet: function () { return this.mouseDelayMet }, _mouseStart: function () { }, _mouseDrag: function () { }, _mouseStop: function () { }, _mouseCapture: function () { return !0 } }) })(jQuery); (function (e) { function t(e, t, i) { return e > t && t + i > e } function i(e) { return /left|right/.test(e.css("float")) || /inline|table-cell/.test(e.css("display")) } e.widget("ui.sortable", e.ui.mouse, { version: "1.10.4", widgetEventPrefix: "sort", ready: !1, options: { appendTo: "parent", axis: !1, connectWith: !1, containment: !1, cursor: "auto", cursorAt: !1, dropOnEmpty: !0, forcePlaceholderSize: !1, forceHelperSize: !1, grid: !1, handle: !1, helper: "original", items: "> *", opacity: !1, placeholder: !1, revert: !1, scroll: !0, scrollSensitivity: 20, scrollSpeed: 20, scope: "default", tolerance: "intersect", zIndex: 1e3, activate: null, beforeStop: null, change: null, deactivate: null, out: null, over: null, receive: null, remove: null, sort: null, start: null, stop: null, update: null }, _create: function () { var e = this.options; this.containerCache = {}, this.element.addClass("ui-sortable"), this.refresh(), this.floating = this.items.length ? "x" === e.axis || i(this.items[0].item) : !1, this.offset = this.element.offset(), this._mouseInit(), this.ready = !0 }, _destroy: function () { this.element.removeClass("ui-sortable ui-sortable-disabled"), this._mouseDestroy(); for (var e = this.items.length - 1; e >= 0; e--) this.items[e].item.removeData(this.widgetName + "-item"); return this }, _setOption: function (t, i) { "disabled" === t ? (this.options[t] = i, this.widget().toggleClass("ui-sortable-disabled", !!i)) : e.Widget.prototype._setOption.apply(this, arguments) }, _mouseCapture: function (t, i) { var s = null, n = !1, a = this; return this.reverting ? !1 : this.options.disabled || "static" === this.options.type ? !1 : (this._refreshItems(t), e(t.target).parents().each(function () { return e.data(this, a.widgetName + "-item") === a ? (s = e(this), !1) : undefined }), e.data(t.target, a.widgetName + "-item") === a && (s = e(t.target)), s ? !this.options.handle || i || (e(this.options.handle, s).find("*").addBack().each(function () { this === t.target && (n = !0) }), n) ? (this.currentItem = s, this._removeCurrentsFromItems(), !0) : !1 : !1) }, _mouseStart: function (t, i, s) { var n, a, o = this.options; if (this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(t), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, e.extend(this.offset, { click: { left: t.pageX - this.offset.left, top: t.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }), this.helper.css("position", "absolute"), this.cssPosition = this.helper.css("position"), this.originalPosition = this._generatePosition(t), this.originalPageX = t.pageX, this.originalPageY = t.pageY, o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt), this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }, this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), o.containment && this._setContainment(), o.cursor && "auto" !== o.cursor && (a = this.document.find("body"), this.storedCursor = a.css("cursor"), a.css("cursor", o.cursor), this.storedStylesheet = e("<style>*{ cursor: " + o.cursor + " !important; }</style>").appendTo(a)), o.opacity && (this.helper.css("opacity") && (this._storedOpacity = this.helper.css("opacity")), this.helper.css("opacity", o.opacity)), o.zIndex && (this.helper.css("zIndex") && (this._storedZIndex = this.helper.css("zIndex")), this.helper.css("zIndex", o.zIndex)), this.scrollParent[0] !== document && "HTML" !== this.scrollParent[0].tagName && (this.overflowOffset = this.scrollParent.offset()), this._trigger("start", t, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(), !s) for (n = this.containers.length - 1; n >= 0; n--) this.containers[n]._trigger("activate", t, this._uiHash(this)); return e.ui.ddmanager && (e.ui.ddmanager.current = this), e.ui.ddmanager && !o.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t), this.dragging = !0, this.helper.addClass("ui-sortable-helper"), this._mouseDrag(t), !0 }, _mouseDrag: function (t) { var i, s, n, a, o = this.options, r = !1; for (this.position = this._generatePosition(t), this.positionAbs = this._convertPositionTo("absolute"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== document && "HTML" !== this.scrollParent[0].tagName ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - t.pageY < o.scrollSensitivity ? this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop + o.scrollSpeed : t.pageY - this.overflowOffset.top < o.scrollSensitivity && (this.scrollParent[0].scrollTop = r = this.scrollParent[0].scrollTop - o.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - t.pageX < o.scrollSensitivity ? this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft + o.scrollSpeed : t.pageX - this.overflowOffset.left < o.scrollSensitivity && (this.scrollParent[0].scrollLeft = r = this.scrollParent[0].scrollLeft - o.scrollSpeed)) : (t.pageY - e(document).scrollTop() < o.scrollSensitivity ? r = e(document).scrollTop(e(document).scrollTop() - o.scrollSpeed) : e(window).height() - (t.pageY - e(document).scrollTop()) < o.scrollSensitivity && (r = e(document).scrollTop(e(document).scrollTop() + o.scrollSpeed)), t.pageX - e(document).scrollLeft() < o.scrollSensitivity ? r = e(document).scrollLeft(e(document).scrollLeft() - o.scrollSpeed) : e(window).width() - (t.pageX - e(document).scrollLeft()) < o.scrollSensitivity && (r = e(document).scrollLeft(e(document).scrollLeft() + o.scrollSpeed))), r !== !1 && e.ui.ddmanager && !o.dropBehaviour && e.ui.ddmanager.prepareOffsets(this, t)), this.positionAbs = this._convertPositionTo("absolute"), this.options.axis && "y" === this.options.axis || (this.helper[0].style.left = this.position.left + "px"), this.options.axis && "x" === this.options.axis || (this.helper[0].style.top = this.position.top + "px"), i = this.items.length - 1; i >= 0; i--) if (s = this.items[i], n = s.item[0], a = this._intersectsWithPointer(s), a && s.instance === this.currentContainer && n !== this.currentItem[0] && this.placeholder[1 === a ? "next" : "prev"]()[0] !== n && !e.contains(this.placeholder[0], n) && ("semi-dynamic" === this.options.type ? !e.contains(this.element[0], n) : !0)) { if (this.direction = 1 === a ? "down" : "up", "pointer" !== this.options.tolerance && !this._intersectsWithSides(s)) break; this._rearrange(t, s), this._trigger("change", t, this._uiHash()); break } return this._contactContainers(t), e.ui.ddmanager && e.ui.ddmanager.drag(this, t), this._trigger("sort", t, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1 }, _mouseStop: function (t, i) { if (t) { if (e.ui.ddmanager && !this.options.dropBehaviour && e.ui.ddmanager.drop(this, t), this.options.revert) { var s = this, n = this.placeholder.offset(), a = this.options.axis, o = {}; a && "x" !== a || (o.left = n.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft)), a && "y" !== a || (o.top = n.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop)), this.reverting = !0, e(this.helper).animate(o, parseInt(this.options.revert, 10) || 500, function () { s._clear(t) }) } else this._clear(t, i); return !1 } }, cancel: function () { if (this.dragging) { this._mouseUp({ target: null }), "original" === this.options.helper ? this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") : this.currentItem.show(); for (var t = this.containers.length - 1; t >= 0; t--) this.containers[t]._trigger("deactivate", null, this._uiHash(this)), this.containers[t].containerCache.over && (this.containers[t]._trigger("out", null, this._uiHash(this)), this.containers[t].containerCache.over = 0) } return this.placeholder && (this.placeholder[0].parentNode && this.placeholder[0].parentNode.removeChild(this.placeholder[0]), "original" !== this.options.helper && this.helper && this.helper[0].parentNode && this.helper.remove(), e.extend(this, { helper: null, dragging: !1, reverting: !1, _noFinalSort: null }), this.domPosition.prev ? e(this.domPosition.prev).after(this.currentItem) : e(this.domPosition.parent).prepend(this.currentItem)), this }, serialize: function (t) { var i = this._getItemsAsjQuery(t && t.connected), s = []; return t = t || {}, e(i).each(function () { var i = (e(t.item || this).attr(t.attribute || "id") || "").match(t.expression || /(.+)[\-=_](.+)/); i && s.push((t.key || i[1] + "[]") + "=" + (t.key && t.expression ? i[1] : i[2])) }), !s.length && t.key && s.push(t.key + "="), s.join("&") }, toArray: function (t) { var i = this._getItemsAsjQuery(t && t.connected), s = []; return t = t || {}, i.each(function () { s.push(e(t.item || this).attr(t.attribute || "id") || "") }), s }, _intersectsWith: function (e) { var t = this.positionAbs.left, i = t + this.helperProportions.width, s = this.positionAbs.top, n = s + this.helperProportions.height, a = e.left, o = a + e.width, r = e.top, h = r + e.height, l = this.offset.click.top, u = this.offset.click.left, d = "x" === this.options.axis || s + l > r && h > s + l, c = "y" === this.options.axis || t + u > a && o > t + u, p = d && c; return "pointer" === this.options.tolerance || this.options.forcePointerForContainers || "pointer" !== this.options.tolerance && this.helperProportions[this.floating ? "width" : "height"] > e[this.floating ? "width" : "height"] ? p : t + this.helperProportions.width / 2 > a && o > i - this.helperProportions.width / 2 && s + this.helperProportions.height / 2 > r && h > n - this.helperProportions.height / 2 }, _intersectsWithPointer: function (e) { var i = "x" === this.options.axis || t(this.positionAbs.top + this.offset.click.top, e.top, e.height), s = "y" === this.options.axis || t(this.positionAbs.left + this.offset.click.left, e.left, e.width), n = i && s, a = this._getDragVerticalDirection(), o = this._getDragHorizontalDirection(); return n ? this.floating ? o && "right" === o || "down" === a ? 2 : 1 : a && ("down" === a ? 2 : 1) : !1 }, _intersectsWithSides: function (e) { var i = t(this.positionAbs.top + this.offset.click.top, e.top + e.height / 2, e.height), s = t(this.positionAbs.left + this.offset.click.left, e.left + e.width / 2, e.width), n = this._getDragVerticalDirection(), a = this._getDragHorizontalDirection(); return this.floating && a ? "right" === a && s || "left" === a && !s : n && ("down" === n && i || "up" === n && !i) }, _getDragVerticalDirection: function () { var e = this.positionAbs.top - this.lastPositionAbs.top; return 0 !== e && (e > 0 ? "down" : "up") }, _getDragHorizontalDirection: function () { var e = this.positionAbs.left - this.lastPositionAbs.left; return 0 !== e && (e > 0 ? "right" : "left") }, refresh: function (e) { return this._refreshItems(e), this.refreshPositions(), this }, _connectWith: function () { var e = this.options; return e.connectWith.constructor === String ? [e.connectWith] : e.connectWith }, _getItemsAsjQuery: function (t) { function i() { r.push(this) } var s, n, a, o, r = [], h = [], l = this._connectWith(); if (l && t) for (s = l.length - 1; s >= 0; s--) for (a = e(l[s]), n = a.length - 1; n >= 0; n--) o = e.data(a[n], this.widgetFullName), o && o !== this && !o.options.disabled && h.push([e.isFunction(o.options.items) ? o.options.items.call(o.element) : e(o.options.items, o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), o]); for (h.push([e.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : e(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]), s = h.length - 1; s >= 0; s--) h[s][0].each(i); return e(r) }, _removeCurrentsFromItems: function () { var t = this.currentItem.find(":data(" + this.widgetName + "-item)"); this.items = e.grep(this.items, function (e) { for (var i = 0; t.length > i; i++) if (t[i] === e.item[0]) return !1; return !0 }) }, _refreshItems: function (t) { this.items = [], this.containers = [this]; var i, s, n, a, o, r, h, l, u = this.items, d = [[e.isFunction(this.options.items) ? this.options.items.call(this.element[0], t, { item: this.currentItem }) : e(this.options.items, this.element), this]], c = this._connectWith(); if (c && this.ready) for (i = c.length - 1; i >= 0; i--) for (n = e(c[i]), s = n.length - 1; s >= 0; s--) a = e.data(n[s], this.widgetFullName), a && a !== this && !a.options.disabled && (d.push([e.isFunction(a.options.items) ? a.options.items.call(a.element[0], t, { item: this.currentItem }) : e(a.options.items, a.element), a]), this.containers.push(a)); for (i = d.length - 1; i >= 0; i--) for (o = d[i][1], r = d[i][0], s = 0, l = r.length; l > s; s++) h = e(r[s]), h.data(this.widgetName + "-item", o), u.push({ item: h, instance: o, width: 0, height: 0, left: 0, top: 0 }) }, refreshPositions: function (t) { this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset()); var i, s, n, a; for (i = this.items.length - 1; i >= 0; i--) s = this.items[i], s.instance !== this.currentContainer && this.currentContainer && s.item[0] !== this.currentItem[0] || (n = this.options.toleranceElement ? e(this.options.toleranceElement, s.item) : s.item, t || (s.width = n.outerWidth(), s.height = n.outerHeight()), a = n.offset(), s.left = a.left, s.top = a.top); if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this); else for (i = this.containers.length - 1; i >= 0; i--) a = this.containers[i].element.offset(), this.containers[i].containerCache.left = a.left, this.containers[i].containerCache.top = a.top, this.containers[i].containerCache.width = this.containers[i].element.outerWidth(), this.containers[i].containerCache.height = this.containers[i].element.outerHeight(); return this }, _createPlaceholder: function (t) { t = t || this; var i, s = t.options; s.placeholder && s.placeholder.constructor !== String || (i = s.placeholder, s.placeholder = { element: function () { var s = t.currentItem[0].nodeName.toLowerCase(), n = e("<" + s + ">", t.document[0]).addClass(i || t.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper"); return "tr" === s ? t.currentItem.children().each(function () { e("<td>&#160;</td>", t.document[0]).attr("colspan", e(this).attr("colspan") || 1).appendTo(n) }) : "img" === s && n.attr("src", t.currentItem.attr("src")), i || n.css("visibility", "hidden"), n }, update: function (e, n) { (!i || s.forcePlaceholderSize) && (n.height() || n.height(t.currentItem.innerHeight() - parseInt(t.currentItem.css("paddingTop") || 0, 10) - parseInt(t.currentItem.css("paddingBottom") || 0, 10)), n.width() || n.width(t.currentItem.innerWidth() - parseInt(t.currentItem.css("paddingLeft") || 0, 10) - parseInt(t.currentItem.css("paddingRight") || 0, 10))) } }), t.placeholder = e(s.placeholder.element.call(t.element, t.currentItem)), t.currentItem.after(t.placeholder), s.placeholder.update(t, t.placeholder) }, _contactContainers: function (s) { var n, a, o, r, h, l, u, d, c, p, f = null, m = null; for (n = this.containers.length - 1; n >= 0; n--) if (!e.contains(this.currentItem[0], this.containers[n].element[0])) if (this._intersectsWith(this.containers[n].containerCache)) { if (f && e.contains(this.containers[n].element[0], f.element[0])) continue; f = this.containers[n], m = n } else this.containers[n].containerCache.over && (this.containers[n]._trigger("out", s, this._uiHash(this)), this.containers[n].containerCache.over = 0); if (f) if (1 === this.containers.length) this.containers[m].containerCache.over || (this.containers[m]._trigger("over", s, this._uiHash(this)), this.containers[m].containerCache.over = 1); else { for (o = 1e4, r = null, p = f.floating || i(this.currentItem), h = p ? "left" : "top", l = p ? "width" : "height", u = this.positionAbs[h] + this.offset.click[h], a = this.items.length - 1; a >= 0; a--) e.contains(this.containers[m].element[0], this.items[a].item[0]) && this.items[a].item[0] !== this.currentItem[0] && (!p || t(this.positionAbs.top + this.offset.click.top, this.items[a].top, this.items[a].height)) && (d = this.items[a].item.offset()[h], c = !1, Math.abs(d - u) > Math.abs(d + this.items[a][l] - u) && (c = !0, d += this.items[a][l]), o > Math.abs(d - u) && (o = Math.abs(d - u), r = this.items[a], this.direction = c ? "up" : "down")); if (!r && !this.options.dropOnEmpty) return; if (this.currentContainer === this.containers[m]) return; r ? this._rearrange(s, r, null, !0) : this._rearrange(s, null, this.containers[m].element, !0), this._trigger("change", s, this._uiHash()), this.containers[m]._trigger("change", s, this._uiHash(this)), this.currentContainer = this.containers[m], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[m]._trigger("over", s, this._uiHash(this)), this.containers[m].containerCache.over = 1 } }, _createHelper: function (t) { var i = this.options, s = e.isFunction(i.helper) ? e(i.helper.apply(this.element[0], [t, this.currentItem])) : "clone" === i.helper ? this.currentItem.clone() : this.currentItem; return s.parents("body").length || e("parent" !== i.appendTo ? i.appendTo : this.currentItem[0].parentNode)[0].appendChild(s[0]), s[0] === this.currentItem[0] && (this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") }), (!s[0].style.width || i.forceHelperSize) && s.width(this.currentItem.width()), (!s[0].style.height || i.forceHelperSize) && s.height(this.currentItem.height()), s }, _adjustOffsetFromHelper: function (t) { "string" == typeof t && (t = t.split(" ")), e.isArray(t) && (t = { left: +t[0], top: +t[1] || 0 }), "left" in t && (this.offset.click.left = t.left + this.margins.left), "right" in t && (this.offset.click.left = this.helperProportions.width - t.right + this.margins.left), "top" in t && (this.offset.click.top = t.top + this.margins.top), "bottom" in t && (this.offset.click.top = this.helperProportions.height - t.bottom + this.margins.top) }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var t = this.offsetParent.offset(); return "absolute" === this.cssPosition && this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) && (t.left += this.scrollParent.scrollLeft(), t.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && e.ui.ie) && (t = { top: 0, left: 0 }), { top: t.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: t.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) } }, _getRelativeOffset: function () { if ("relative" === this.cssPosition) { var e = this.currentItem.position(); return { top: e.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: e.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft() } } return { top: 0, left: 0 } }, _cacheMargins: function () { this.margins = { left: parseInt(this.currentItem.css("marginLeft"), 10) || 0, top: parseInt(this.currentItem.css("marginTop"), 10) || 0 } }, _cacheHelperProportions: function () { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() } }, _setContainment: function () { var t, i, s, n = this.options; "parent" === n.containment && (n.containment = this.helper[0].parentNode), ("document" === n.containment || "window" === n.containment) && (this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, e("document" === n.containment ? document : window).width() - this.helperProportions.width - this.margins.left, (e("document" === n.containment ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]), /^(document|window|parent)$/.test(n.containment) || (t = e(n.containment)[0], i = e(n.containment).offset(), s = "hidden" !== e(t).css("overflow"), this.containment = [i.left + (parseInt(e(t).css("borderLeftWidth"), 10) || 0) + (parseInt(e(t).css("paddingLeft"), 10) || 0) - this.margins.left, i.top + (parseInt(e(t).css("borderTopWidth"), 10) || 0) + (parseInt(e(t).css("paddingTop"), 10) || 0) - this.margins.top, i.left + (s ? Math.max(t.scrollWidth, t.offsetWidth) : t.offsetWidth) - (parseInt(e(t).css("borderLeftWidth"), 10) || 0) - (parseInt(e(t).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, i.top + (s ? Math.max(t.scrollHeight, t.offsetHeight) : t.offsetHeight) - (parseInt(e(t).css("borderTopWidth"), 10) || 0) - (parseInt(e(t).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top]) }, _convertPositionTo: function (t, i) { i || (i = this.position); var s = "absolute" === t ? 1 : -1, n = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, a = /(html|body)/i.test(n[0].tagName); return { top: i.top + this.offset.relative.top * s + this.offset.parent.top * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : a ? 0 : n.scrollTop()) * s, left: i.left + this.offset.relative.left * s + this.offset.parent.left * s - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : a ? 0 : n.scrollLeft()) * s } }, _generatePosition: function (t) { var i, s, n = this.options, a = t.pageX, o = t.pageY, r = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && e.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, h = /(html|body)/i.test(r[0].tagName); return "relative" !== this.cssPosition || this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0] || (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (t.pageX - this.offset.click.left < this.containment[0] && (a = this.containment[0] + this.offset.click.left), t.pageY - this.offset.click.top < this.containment[1] && (o = this.containment[1] + this.offset.click.top), t.pageX - this.offset.click.left > this.containment[2] && (a = this.containment[2] + this.offset.click.left), t.pageY - this.offset.click.top > this.containment[3] && (o = this.containment[3] + this.offset.click.top)), n.grid && (i = this.originalPageY + Math.round((o - this.originalPageY) / n.grid[1]) * n.grid[1], o = this.containment ? i - this.offset.click.top >= this.containment[1] && i - this.offset.click.top <= this.containment[3] ? i : i - this.offset.click.top >= this.containment[1] ? i - n.grid[1] : i + n.grid[1] : i, s = this.originalPageX + Math.round((a - this.originalPageX) / n.grid[0]) * n.grid[0], a = this.containment ? s - this.offset.click.left >= this.containment[0] && s - this.offset.click.left <= this.containment[2] ? s : s - this.offset.click.left >= this.containment[0] ? s - n.grid[0] : s + n.grid[0] : s)), { top: o - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : h ? 0 : r.scrollTop()), left: a - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : h ? 0 : r.scrollLeft()) } }, _rearrange: function (e, t, i, s) { i ? i[0].appendChild(this.placeholder[0]) : t.item[0].parentNode.insertBefore(this.placeholder[0], "down" === this.direction ? t.item[0] : t.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1; var n = this.counter; this._delay(function () { n === this.counter && this.refreshPositions(!s) }) }, _clear: function (e, t) { function i(e, t, i) { return function (s) { i._trigger(e, s, t._uiHash(t)) } } this.reverting = !1; var s, n = []; if (!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null, this.helper[0] === this.currentItem[0]) { for (s in this._storedCSS) ("auto" === this._storedCSS[s] || "static" === this._storedCSS[s]) && (this._storedCSS[s] = ""); this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") } else this.currentItem.show(); for (this.fromOutside && !t && n.push(function (e) { this._trigger("receive", e, this._uiHash(this.fromOutside)) }), !this.fromOutside && this.domPosition.prev === this.currentItem.prev().not(".ui-sortable-helper")[0] && this.domPosition.parent === this.currentItem.parent()[0] || t || n.push(function (e) { this._trigger("update", e, this._uiHash()) }), this !== this.currentContainer && (t || (n.push(function (e) { this._trigger("remove", e, this._uiHash()) }), n.push(function (e) { return function (t) { e._trigger("receive", t, this._uiHash(this)) } }.call(this, this.currentContainer)), n.push(function (e) { return function (t) { e._trigger("update", t, this._uiHash(this)) } }.call(this, this.currentContainer)))), s = this.containers.length - 1; s >= 0; s--) t || n.push(i("deactivate", this, this.containers[s])), this.containers[s].containerCache.over && (n.push(i("out", this, this.containers[s])), this.containers[s].containerCache.over = 0); if (this.storedCursor && (this.document.find("body").css("cursor", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css("opacity", this._storedOpacity), this._storedZIndex && this.helper.css("zIndex", "auto" === this._storedZIndex ? "" : this._storedZIndex), this.dragging = !1, this.cancelHelperRemoval) { if (!t) { for (this._trigger("beforeStop", e, this._uiHash()), s = 0; n.length > s; s++) n[s].call(this, e); this._trigger("stop", e, this._uiHash()) } return this.fromOutside = !1, !1 } if (t || this._trigger("beforeStop", e, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null, !t) { for (s = 0; n.length > s; s++) n[s].call(this, e); this._trigger("stop", e, this._uiHash()) } return this.fromOutside = !1, !0 }, _trigger: function () { e.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel() }, _uiHash: function (t) { var i = t || this; return { helper: i.helper, placeholder: i.placeholder || e([]), position: i.position, originalPosition: i.originalPosition, offset: i.positionAbs, item: i.currentItem, sender: t ? t.element : null } } }) })(jQuery); (function (e) { var t = 5; e.widget("ui.slider", e.ui.mouse, { version: "1.10.4", widgetEventPrefix: "slide", options: { animate: !1, distance: 0, max: 100, min: 0, orientation: "horizontal", range: !1, step: 1, value: 0, values: null, change: null, slide: null, start: null, stop: null }, _create: function () { this._keySliding = !1, this._mouseSliding = !1, this._animateOff = !0, this._handleIndex = null, this._detectOrientation(), this._mouseInit(), this.element.addClass("ui-slider ui-slider-" + this.orientation + " ui-widget" + " ui-widget-content" + " ui-corner-all"), this._refresh(), this._setOption("disabled", this.options.disabled), this._animateOff = !1 }, _refresh: function () { this._createRange(), this._createHandles(), this._setupEvents(), this._refreshValue() }, _createHandles: function () { var t, i, s = this.options, n = this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"), a = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>", o = []; for (i = s.values && s.values.length || 1, n.length > i && (n.slice(i).remove(), n = n.slice(0, i)), t = n.length; i > t; t++) o.push(a); this.handles = n.add(e(o.join("")).appendTo(this.element)), this.handle = this.handles.eq(0), this.handles.each(function (t) { e(this).data("ui-slider-handle-index", t) }) }, _createRange: function () { var t = this.options, i = ""; t.range ? (t.range === !0 && (t.values ? t.values.length && 2 !== t.values.length ? t.values = [t.values[0], t.values[0]] : e.isArray(t.values) && (t.values = t.values.slice(0)) : t.values = [this._valueMin(), this._valueMin()]), this.range && this.range.length ? this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({ left: "", bottom: "" }) : (this.range = e("<div></div>").appendTo(this.element), i = "ui-slider-range ui-widget-header ui-corner-all"), this.range.addClass(i + ("min" === t.range || "max" === t.range ? " ui-slider-range-" + t.range : ""))) : (this.range && this.range.remove(), this.range = null) }, _setupEvents: function () { var e = this.handles.add(this.range).filter("a"); this._off(e), this._on(e, this._handleEvents), this._hoverable(e), this._focusable(e) }, _destroy: function () { this.handles.remove(), this.range && this.range.remove(), this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"), this._mouseDestroy() }, _mouseCapture: function (t) { var i, s, n, a, o, r, h, l, u = this, d = this.options; return d.disabled ? !1 : (this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }, this.elementOffset = this.element.offset(), i = { x: t.pageX, y: t.pageY }, s = this._normValueFromMouse(i), n = this._valueMax() - this._valueMin() + 1, this.handles.each(function (t) { var i = Math.abs(s - u.values(t)); (n > i || n === i && (t === u._lastChangedValue || u.values(t) === d.min)) && (n = i, a = e(this), o = t) }), r = this._start(t, o), r === !1 ? !1 : (this._mouseSliding = !0, this._handleIndex = o, a.addClass("ui-state-active").focus(), h = a.offset(), l = !e(t.target).parents().addBack().is(".ui-slider-handle"), this._clickOffset = l ? { left: 0, top: 0 } : { left: t.pageX - h.left - a.width() / 2, top: t.pageY - h.top - a.height() / 2 - (parseInt(a.css("borderTopWidth"), 10) || 0) - (parseInt(a.css("borderBottomWidth"), 10) || 0) + (parseInt(a.css("marginTop"), 10) || 0) }, this.handles.hasClass("ui-state-hover") || this._slide(t, o, s), this._animateOff = !0, !0)) }, _mouseStart: function () { return !0 }, _mouseDrag: function (e) { var t = { x: e.pageX, y: e.pageY }, i = this._normValueFromMouse(t); return this._slide(e, this._handleIndex, i), !1 }, _mouseStop: function (e) { return this.handles.removeClass("ui-state-active"), this._mouseSliding = !1, this._stop(e, this._handleIndex), this._change(e, this._handleIndex), this._handleIndex = null, this._clickOffset = null, this._animateOff = !1, !1 }, _detectOrientation: function () { this.orientation = "vertical" === this.options.orientation ? "vertical" : "horizontal" }, _normValueFromMouse: function (e) { var t, i, s, n, a; return "horizontal" === this.orientation ? (t = this.elementSize.width, i = e.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)) : (t = this.elementSize.height, i = e.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0)), s = i / t, s > 1 && (s = 1), 0 > s && (s = 0), "vertical" === this.orientation && (s = 1 - s), n = this._valueMax() - this._valueMin(), a = this._valueMin() + s * n, this._trimAlignValue(a) }, _start: function (e, t) { var i = { handle: this.handles[t], value: this.value() }; return this.options.values && this.options.values.length && (i.value = this.values(t), i.values = this.values()), this._trigger("start", e, i) }, _slide: function (e, t, i) { var s, n, a; this.options.values && this.options.values.length ? (s = this.values(t ? 0 : 1), 2 === this.options.values.length && this.options.range === !0 && (0 === t && i > s || 1 === t && s > i) && (i = s), i !== this.values(t) && (n = this.values(), n[t] = i, a = this._trigger("slide", e, { handle: this.handles[t], value: i, values: n }), s = this.values(t ? 0 : 1), a !== !1 && this.values(t, i))) : i !== this.value() && (a = this._trigger("slide", e, { handle: this.handles[t], value: i }), a !== !1 && this.value(i)) }, _stop: function (e, t) { var i = { handle: this.handles[t], value: this.value() }; this.options.values && this.options.values.length && (i.value = this.values(t), i.values = this.values()), this._trigger("stop", e, i) }, _change: function (e, t) { if (!this._keySliding && !this._mouseSliding) { var i = { handle: this.handles[t], value: this.value() }; this.options.values && this.options.values.length && (i.value = this.values(t), i.values = this.values()), this._lastChangedValue = t, this._trigger("change", e, i) } }, value: function (e) { return arguments.length ? (this.options.value = this._trimAlignValue(e), this._refreshValue(), this._change(null, 0), undefined) : this._value() }, values: function (t, i) { var s, n, a; if (arguments.length > 1) return this.options.values[t] = this._trimAlignValue(i), this._refreshValue(), this._change(null, t), undefined; if (!arguments.length) return this._values(); if (!e.isArray(arguments[0])) return this.options.values && this.options.values.length ? this._values(t) : this.value(); for (s = this.options.values, n = arguments[0], a = 0; s.length > a; a += 1) s[a] = this._trimAlignValue(n[a]), this._change(null, a); this._refreshValue() }, _setOption: function (t, i) { var s, n = 0; switch ("range" === t && this.options.range === !0 && ("min" === i ? (this.options.value = this._values(0), this.options.values = null) : "max" === i && (this.options.value = this._values(this.options.values.length - 1), this.options.values = null)), e.isArray(this.options.values) && (n = this.options.values.length), e.Widget.prototype._setOption.apply(this, arguments), t) { case "orientation": this._detectOrientation(), this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-" + this.orientation), this._refreshValue(); break; case "value": this._animateOff = !0, this._refreshValue(), this._change(null, 0), this._animateOff = !1; break; case "values": for (this._animateOff = !0, this._refreshValue(), s = 0; n > s; s += 1) this._change(null, s); this._animateOff = !1; break; case "min": case "max": this._animateOff = !0, this._refreshValue(), this._animateOff = !1; break; case "range": this._animateOff = !0, this._refresh(), this._animateOff = !1 } }, _value: function () { var e = this.options.value; return e = this._trimAlignValue(e) }, _values: function (e) { var t, i, s; if (arguments.length) return t = this.options.values[e], t = this._trimAlignValue(t); if (this.options.values && this.options.values.length) { for (i = this.options.values.slice(), s = 0; i.length > s; s += 1) i[s] = this._trimAlignValue(i[s]); return i } return [] }, _trimAlignValue: function (e) { if (this._valueMin() >= e) return this._valueMin(); if (e >= this._valueMax()) return this._valueMax(); var t = this.options.step > 0 ? this.options.step : 1, i = (e - this._valueMin()) % t, s = e - i; return 2 * Math.abs(i) >= t && (s += i > 0 ? t : -t), parseFloat(s.toFixed(5)) }, _valueMin: function () { return this.options.min }, _valueMax: function () { return this.options.max }, _refreshValue: function () { var t, i, s, n, a, o = this.options.range, r = this.options, h = this, l = this._animateOff ? !1 : r.animate, u = {}; this.options.values && this.options.values.length ? this.handles.each(function (s) { i = 100 * ((h.values(s) - h._valueMin()) / (h._valueMax() - h._valueMin())), u["horizontal" === h.orientation ? "left" : "bottom"] = i + "%", e(this).stop(1, 1)[l ? "animate" : "css"](u, r.animate), h.options.range === !0 && ("horizontal" === h.orientation ? (0 === s && h.range.stop(1, 1)[l ? "animate" : "css"]({ left: i + "%" }, r.animate), 1 === s && h.range[l ? "animate" : "css"]({ width: i - t + "%" }, { queue: !1, duration: r.animate })) : (0 === s && h.range.stop(1, 1)[l ? "animate" : "css"]({ bottom: i + "%" }, r.animate), 1 === s && h.range[l ? "animate" : "css"]({ height: i - t + "%" }, { queue: !1, duration: r.animate }))), t = i }) : (s = this.value(), n = this._valueMin(), a = this._valueMax(), i = a !== n ? 100 * ((s - n) / (a - n)) : 0, u["horizontal" === this.orientation ? "left" : "bottom"] = i + "%", this.handle.stop(1, 1)[l ? "animate" : "css"](u, r.animate), "min" === o && "horizontal" === this.orientation && this.range.stop(1, 1)[l ? "animate" : "css"]({ width: i + "%" }, r.animate), "max" === o && "horizontal" === this.orientation && this.range[l ? "animate" : "css"]({ width: 100 - i + "%" }, { queue: !1, duration: r.animate }), "min" === o && "vertical" === this.orientation && this.range.stop(1, 1)[l ? "animate" : "css"]({ height: i + "%" }, r.animate), "max" === o && "vertical" === this.orientation && this.range[l ? "animate" : "css"]({ height: 100 - i + "%" }, { queue: !1, duration: r.animate })) }, _handleEvents: { keydown: function (i) { var s, n, a, o, r = e(i.target).data("ui-slider-handle-index"); switch (i.keyCode) { case e.ui.keyCode.HOME: case e.ui.keyCode.END: case e.ui.keyCode.PAGE_UP: case e.ui.keyCode.PAGE_DOWN: case e.ui.keyCode.UP: case e.ui.keyCode.RIGHT: case e.ui.keyCode.DOWN: case e.ui.keyCode.LEFT: if (i.preventDefault(), !this._keySliding && (this._keySliding = !0, e(i.target).addClass("ui-state-active"), s = this._start(i, r), s === !1)) return } switch (o = this.options.step, n = a = this.options.values && this.options.values.length ? this.values(r) : this.value(), i.keyCode) { case e.ui.keyCode.HOME: a = this._valueMin(); break; case e.ui.keyCode.END: a = this._valueMax(); break; case e.ui.keyCode.PAGE_UP: a = this._trimAlignValue(n + (this._valueMax() - this._valueMin()) / t); break; case e.ui.keyCode.PAGE_DOWN: a = this._trimAlignValue(n - (this._valueMax() - this._valueMin()) / t); break; case e.ui.keyCode.UP: case e.ui.keyCode.RIGHT: if (n === this._valueMax()) return; a = this._trimAlignValue(n + o); break; case e.ui.keyCode.DOWN: case e.ui.keyCode.LEFT: if (n === this._valueMin()) return; a = this._trimAlignValue(n - o) } this._slide(i, r, a) }, click: function (e) { e.preventDefault() }, keyup: function (t) { var i = e(t.target).data("ui-slider-handle-index"); this._keySliding && (this._keySliding = !1, this._stop(t, i), this._change(t, i), e(t.target).removeClass("ui-state-active")) } } }) })(jQuery);;
/*!
 * Bootstrap v3.3.5 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */

/*!
 * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=95c625ec094e7c72e2a3)
 * Config saved to config.json and https://gist.github.com/95c625ec094e7c72e2a3
 */
if (typeof jQuery === 'undefined') {
  throw new Error('Bootstrap\'s JavaScript requires jQuery')
}
+function ($) {
  'use strict';
  var version = $.fn.jquery.split(' ')[0].split('.')
  if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) {
    throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')
  }
}(jQuery);

/* ========================================================================
 * Bootstrap: dropdown.js v3.3.5
 * http://getbootstrap.com/javascript/#dropdowns
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */


+function ($) {
  'use strict';

  // DROPDOWN CLASS DEFINITION
  // =========================

  var backdrop = '.dropdown-backdrop'
  var toggle   = '[data-toggle="dropdown"]'
  var Dropdown = function (element) {
    $(element).on('click.bs.dropdown', this.toggle)
  }

  Dropdown.VERSION = '3.3.5'

  function getParent($this) {
    var selector = $this.attr('data-target')

    if (!selector) {
      selector = $this.attr('href')
      selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
    }

    var $parent = selector && $(selector)

    return $parent && $parent.length ? $parent : $this.parent()
  }

  function clearMenus(e) {
    if (e && e.which === 3) return
    $(backdrop).remove()
    $(toggle).each(function () {
      var $this         = $(this)
      var $parent       = getParent($this)
      var relatedTarget = { relatedTarget: this }

      if (!$parent.hasClass('open')) return

      if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return

      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))

      if (e.isDefaultPrevented()) return

      $this.attr('aria-expanded', 'false')
      $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
    })
  }

  Dropdown.prototype.toggle = function (e) {
    var $this = $(this)

    if ($this.is('.disabled, :disabled')) return

    var $parent  = getParent($this)
    var isActive = $parent.hasClass('open')

    clearMenus()

    if (!isActive) {
      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
        // if mobile we use a backdrop because click events don't delegate
        $(document.createElement('div'))
          .addClass('dropdown-backdrop')
          .insertAfter($(this))
          .on('click', clearMenus)
      }

      var relatedTarget = { relatedTarget: this }
      $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))

      if (e.isDefaultPrevented()) return

      $this
        .trigger('focus')
        .attr('aria-expanded', 'true')

      $parent
        .toggleClass('open')
        .trigger('shown.bs.dropdown', relatedTarget)
    }

    return false
  }

  Dropdown.prototype.keydown = function (e) {
    if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return

    var $this = $(this)

    e.preventDefault()
    e.stopPropagation()

    if ($this.is('.disabled, :disabled')) return

    var $parent  = getParent($this)
    var isActive = $parent.hasClass('open')

    if (!isActive && e.which != 27 || isActive && e.which == 27) {
      if (e.which == 27) $parent.find(toggle).trigger('focus')
      return $this.trigger('click')
    }

    var desc = ' li:not(.disabled):visible a'
    var $items = $parent.find('.dropdown-menu' + desc)

    if (!$items.length) return

    var index = $items.index(e.target)

    if (e.which == 38 && index > 0)                 index--         // up
    if (e.which == 40 && index < $items.length - 1) index++         // down
    if (!~index)                                    index = 0

    $items.eq(index).trigger('focus')
  }


  // DROPDOWN PLUGIN DEFINITION
  // ==========================

  function Plugin(option) {
    return this.each(function () {
      var $this = $(this)
      var data  = $this.data('bs.dropdown')

      if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
      if (typeof option == 'string') data[option].call($this)
    })
  }

  var old = $.fn.dropdown

  $.fn.dropdown             = Plugin
  $.fn.dropdown.Constructor = Dropdown


  // DROPDOWN NO CONFLICT
  // ====================

  $.fn.dropdown.noConflict = function () {
    $.fn.dropdown = old
    return this
  }


  // APPLY TO STANDARD DROPDOWN ELEMENTS
  // ===================================

  $(document)
    .on('click.bs.dropdown.data-api', clearMenus)
    .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
    .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
    .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
    .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown)

}(jQuery);

/* ========================================================================
 * Bootstrap: modal.js v3.3.5
 * http://getbootstrap.com/javascript/#modals
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */


+function ($) {
  'use strict';

  // MODAL CLASS DEFINITION
  // ======================

  var Modal = function (element, options) {
    this.options             = options
    this.$body               = $(document.body)
    this.$element            = $(element)
    this.$dialog             = this.$element.find('.modal-dialog')
    this.$backdrop           = null
    this.isShown             = null
    this.originalBodyPad     = null
    this.scrollbarWidth      = 0
    this.ignoreBackdropClick = false

    if (this.options.remote) {
      this.$element
        .find('.modal-content')
        .load(this.options.remote, $.proxy(function () {
          this.$element.trigger('loaded.bs.modal')
        }, this))
    }
  }

  Modal.VERSION  = '3.3.5'

  Modal.TRANSITION_DURATION = 300
  Modal.BACKDROP_TRANSITION_DURATION = 150

  Modal.DEFAULTS = {
    backdrop: true,
    keyboard: true,
    show: true
  }

  Modal.prototype.toggle = function (_relatedTarget) {
    return this.isShown ? this.hide() : this.show(_relatedTarget)
  }

  Modal.prototype.show = function (_relatedTarget) {
    var that = this
    var e    = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })

    this.$element.trigger(e)

    if (this.isShown || e.isDefaultPrevented()) return

    this.isShown = true

    this.checkScrollbar()
    this.setScrollbar()
    this.$body.addClass('modal-open')

    this.escape()
    this.resize()

    this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))

    this.$dialog.on('mousedown.dismiss.bs.modal', function () {
      that.$element.one('mouseup.dismiss.bs.modal', function (e) {
        if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true
      })
    })

    this.backdrop(function () {
      var transition = $.support.transition && that.$element.hasClass('fade')

      if (!that.$element.parent().length) {
        that.$element.appendTo(that.$body) // don't move modals dom position
      }

      that.$element
        .show()
        .scrollTop(0)

      that.adjustDialog()

      if (transition) {
        that.$element[0].offsetWidth // force reflow
      }

      that.$element.addClass('in')

      that.enforceFocus()

      var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })

      transition ?
        that.$dialog // wait for modal to slide in
          .one('bsTransitionEnd', function () {
            that.$element.trigger('focus').trigger(e)
          })
          .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
        that.$element.trigger('focus').trigger(e)
    })
  }

  Modal.prototype.hide = function (e) {
    if (e) e.preventDefault()

    e = $.Event('hide.bs.modal')

    this.$element.trigger(e)

    if (!this.isShown || e.isDefaultPrevented()) return

    this.isShown = false

    this.escape()
    this.resize()

    $(document).off('focusin.bs.modal')

    this.$element
      .removeClass('in')
      .off('click.dismiss.bs.modal')
      .off('mouseup.dismiss.bs.modal')

    this.$dialog.off('mousedown.dismiss.bs.modal')

    $.support.transition && this.$element.hasClass('fade') ?
      this.$element
        .one('bsTransitionEnd', $.proxy(this.hideModal, this))
        .emulateTransitionEnd(Modal.TRANSITION_DURATION) :
      this.hideModal()
  }

  Modal.prototype.enforceFocus = function () {
    $(document)
      .off('focusin.bs.modal') // guard against infinite focus loop
      .on('focusin.bs.modal', $.proxy(function (e) {
        if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
          this.$element.trigger('focus')
        }
      }, this))
  }

  Modal.prototype.escape = function () {
    if (this.isShown && this.options.keyboard) {
      this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) {
        e.which == 27 && this.hide()
      }, this))
    } else if (!this.isShown) {
      this.$element.off('keydown.dismiss.bs.modal')
    }
  }

  Modal.prototype.resize = function () {
    if (this.isShown) {
      $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this))
    } else {
      $(window).off('resize.bs.modal')
    }
  }

  Modal.prototype.hideModal = function () {
    var that = this
    this.$element.hide()
    this.backdrop(function () {
      that.$body.removeClass('modal-open')
      that.resetAdjustments()
      that.resetScrollbar()
      that.$element.trigger('hidden.bs.modal')
    })
  }

  Modal.prototype.removeBackdrop = function () {
    this.$backdrop && this.$backdrop.remove()
    this.$backdrop = null
  }

  Modal.prototype.backdrop = function (callback) {
    var that = this
    var animate = this.$element.hasClass('fade') ? 'fade' : ''

    if (this.isShown && this.options.backdrop) {
      var doAnimate = $.support.transition && animate

      this.$backdrop = $(document.createElement('div'))
        .addClass('modal-backdrop ' + animate)
        .appendTo(this.$body)

      this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
        if (this.ignoreBackdropClick) {
          this.ignoreBackdropClick = false
          return
        }
        if (e.target !== e.currentTarget) return
        this.options.backdrop == 'static'
          ? this.$element[0].focus()
          : this.hide()
      }, this))

      if (doAnimate) this.$backdrop[0].offsetWidth // force reflow

      this.$backdrop.addClass('in')

      if (!callback) return

      doAnimate ?
        this.$backdrop
          .one('bsTransitionEnd', callback)
          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
        callback()

    } else if (!this.isShown && this.$backdrop) {
      this.$backdrop.removeClass('in')

      var callbackRemove = function () {
        that.removeBackdrop()
        callback && callback()
      }
      $.support.transition && this.$element.hasClass('fade') ?
        this.$backdrop
          .one('bsTransitionEnd', callbackRemove)
          .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) :
        callbackRemove()

    } else if (callback) {
      callback()
    }
  }

  // these following methods are used to handle overflowing modals

  Modal.prototype.handleUpdate = function () {
    this.adjustDialog()
  }

  Modal.prototype.adjustDialog = function () {
    var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight

    this.$element.css({
      paddingLeft:  !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '',
      paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : ''
    })
  }

  Modal.prototype.resetAdjustments = function () {
    this.$element.css({
      paddingLeft: '',
      paddingRight: ''
    })
  }

  Modal.prototype.checkScrollbar = function () {
    var fullWindowWidth = window.innerWidth
    if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8
      var documentElementRect = document.documentElement.getBoundingClientRect()
      fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left)
    }
    this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth
    this.scrollbarWidth = this.measureScrollbar()
  }

  Modal.prototype.setScrollbar = function () {
    var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10)
    this.originalBodyPad = document.body.style.paddingRight || ''
    if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
  }

  Modal.prototype.resetScrollbar = function () {
    this.$body.css('padding-right', this.originalBodyPad)
  }

  Modal.prototype.measureScrollbar = function () { // thx walsh
    var scrollDiv = document.createElement('div')
    scrollDiv.className = 'modal-scrollbar-measure'
    this.$body.append(scrollDiv)
    var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
    this.$body[0].removeChild(scrollDiv)
    return scrollbarWidth
  }


  // MODAL PLUGIN DEFINITION
  // =======================

  function Plugin(option, _relatedTarget) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.modal')
      var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)

      if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
      if (typeof option == 'string') data[option](_relatedTarget)
      else if (options.show) data.show(_relatedTarget)
    })
  }

  var old = $.fn.modal

  $.fn.modal             = Plugin
  $.fn.modal.Constructor = Modal


  // MODAL NO CONFLICT
  // =================

  $.fn.modal.noConflict = function () {
    $.fn.modal = old
    return this
  }


  // MODAL DATA-API
  // ==============

  $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
    var $this   = $(this)
    var href    = $this.attr('href')
    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7
    var option  = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())

    if ($this.is('a')) e.preventDefault()

    $target.one('show.bs.modal', function (showEvent) {
      if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown
      $target.one('hidden.bs.modal', function () {
        $this.is(':visible') && $this.trigger('focus')
      })
    })
    Plugin.call($target, option, this)
  })

}(jQuery);

/* ========================================================================
 * Bootstrap: tooltip.js v3.3.5
 * http://getbootstrap.com/javascript/#tooltip
 * Inspired by the original jQuery.tipsy by Jason Frame
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */


+function ($) {
  'use strict';

  // TOOLTIP PUBLIC CLASS DEFINITION
  // ===============================

  var Tooltip = function (element, options) {
    this.type       = null
    this.options    = null
    this.enabled    = null
    this.timeout    = null
    this.hoverState = null
    this.$element   = null
    this.inState    = null

    this.init('tooltip', element, options)
  }

  Tooltip.VERSION  = '3.3.5'

  Tooltip.TRANSITION_DURATION = 150

  Tooltip.DEFAULTS = {
    animation: true,
    placement: 'top',
    selector: false,
    template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
    trigger: 'hover focus',
    title: '',
    delay: 0,
    html: false,
    container: false,
    viewport: {
      selector: 'body',
      padding: 0
    }
  }

  Tooltip.prototype.init = function (type, element, options) {
    this.enabled   = true
    this.type      = type
    this.$element  = $(element)
    this.options   = this.getOptions(options)
    this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport))
    this.inState   = { click: false, hover: false, focus: false }

    if (this.$element[0] instanceof document.constructor && !this.options.selector) {
      throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!')
    }

    var triggers = this.options.trigger.split(' ')

    for (var i = triggers.length; i--;) {
      var trigger = triggers[i]

      if (trigger == 'click') {
        this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
      } else if (trigger != 'manual') {
        var eventIn  = trigger == 'hover' ? 'mouseenter' : 'focusin'
        var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'

        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
      }
    }

    this.options.selector ?
      (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
      this.fixTitle()
  }

  Tooltip.prototype.getDefaults = function () {
    return Tooltip.DEFAULTS
  }

  Tooltip.prototype.getOptions = function (options) {
    options = $.extend({}, this.getDefaults(), this.$element.data(), options)

    if (options.delay && typeof options.delay == 'number') {
      options.delay = {
        show: options.delay,
        hide: options.delay
      }
    }

    return options
  }

  Tooltip.prototype.getDelegateOptions = function () {
    var options  = {}
    var defaults = this.getDefaults()

    this._options && $.each(this._options, function (key, value) {
      if (defaults[key] != value) options[key] = value
    })

    return options
  }

  Tooltip.prototype.enter = function (obj) {
    var self = obj instanceof this.constructor ?
      obj : $(obj.currentTarget).data('bs.' + this.type)

    if (!self) {
      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
      $(obj.currentTarget).data('bs.' + this.type, self)
    }

    if (obj instanceof $.Event) {
      self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true
    }

    if (self.tip().hasClass('in') || self.hoverState == 'in') {
      self.hoverState = 'in'
      return
    }

    clearTimeout(self.timeout)

    self.hoverState = 'in'

    if (!self.options.delay || !self.options.delay.show) return self.show()

    self.timeout = setTimeout(function () {
      if (self.hoverState == 'in') self.show()
    }, self.options.delay.show)
  }

  Tooltip.prototype.isInStateTrue = function () {
    for (var key in this.inState) {
      if (this.inState[key]) return true
    }

    return false
  }

  Tooltip.prototype.leave = function (obj) {
    var self = obj instanceof this.constructor ?
      obj : $(obj.currentTarget).data('bs.' + this.type)

    if (!self) {
      self = new this.constructor(obj.currentTarget, this.getDelegateOptions())
      $(obj.currentTarget).data('bs.' + this.type, self)
    }

    if (obj instanceof $.Event) {
      self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false
    }

    if (self.isInStateTrue()) return

    clearTimeout(self.timeout)

    self.hoverState = 'out'

    if (!self.options.delay || !self.options.delay.hide) return self.hide()

    self.timeout = setTimeout(function () {
      if (self.hoverState == 'out') self.hide()
    }, self.options.delay.hide)
  }

  Tooltip.prototype.show = function () {
    var e = $.Event('show.bs.' + this.type)

    if (this.hasContent() && this.enabled) {
      this.$element.trigger(e)

      var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0])
      if (e.isDefaultPrevented() || !inDom) return
      var that = this

      var $tip = this.tip()

      var tipId = this.getUID(this.type)

      this.setContent()
      $tip.attr('id', tipId)
      this.$element.attr('aria-describedby', tipId)

      if (this.options.animation) $tip.addClass('fade')

      var placement = typeof this.options.placement == 'function' ?
        this.options.placement.call(this, $tip[0], this.$element[0]) :
        this.options.placement

      var autoToken = /\s?auto?\s?/i
      var autoPlace = autoToken.test(placement)
      if (autoPlace) placement = placement.replace(autoToken, '') || 'top'

      $tip
        .detach()
        .css({ top: 0, left: 0, display: 'block' })
        .addClass(placement)
        .data('bs.' + this.type, this)

      this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
      this.$element.trigger('inserted.bs.' + this.type)

      var pos          = this.getPosition()
      var actualWidth  = $tip[0].offsetWidth
      var actualHeight = $tip[0].offsetHeight

      if (autoPlace) {
        var orgPlacement = placement
        var viewportDim = this.getPosition(this.$viewport)

        placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top'    :
                    placement == 'top'    && pos.top    - actualHeight < viewportDim.top    ? 'bottom' :
                    placement == 'right'  && pos.right  + actualWidth  > viewportDim.width  ? 'left'   :
                    placement == 'left'   && pos.left   - actualWidth  < viewportDim.left   ? 'right'  :
                    placement

        $tip
          .removeClass(orgPlacement)
          .addClass(placement)
      }

      var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)

      this.applyPlacement(calculatedOffset, placement)

      var complete = function () {
        var prevHoverState = that.hoverState
        that.$element.trigger('shown.bs.' + that.type)
        that.hoverState = null

        if (prevHoverState == 'out') that.leave(that)
      }

      $.support.transition && this.$tip.hasClass('fade') ?
        $tip
          .one('bsTransitionEnd', complete)
          .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
        complete()
    }
  }

  Tooltip.prototype.applyPlacement = function (offset, placement) {
    var $tip   = this.tip()
    var width  = $tip[0].offsetWidth
    var height = $tip[0].offsetHeight

    // manually read margins because getBoundingClientRect includes difference
    var marginTop = parseInt($tip.css('margin-top'), 10)
    var marginLeft = parseInt($tip.css('margin-left'), 10)

    // we must check for NaN for ie 8/9
    if (isNaN(marginTop))  marginTop  = 0
    if (isNaN(marginLeft)) marginLeft = 0

    offset.top  += marginTop
    offset.left += marginLeft

    // $.fn.offset doesn't round pixel values
    // so we use setOffset directly with our own function B-0
    $.offset.setOffset($tip[0], $.extend({
      using: function (props) {
        $tip.css({
          top: Math.round(props.top),
          left: Math.round(props.left)
        })
      }
    }, offset), 0)

    $tip.addClass('in')

    // check to see if placing tip in new offset caused the tip to resize itself
    var actualWidth  = $tip[0].offsetWidth
    var actualHeight = $tip[0].offsetHeight

    if (placement == 'top' && actualHeight != height) {
      offset.top = offset.top + height - actualHeight
    }

    var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight)

    if (delta.left) offset.left += delta.left
    else offset.top += delta.top

    var isVertical          = /top|bottom/.test(placement)
    var arrowDelta          = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight
    var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'

    $tip.offset(offset)
    this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
  }

  Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) {
    this.arrow()
      .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%')
      .css(isVertical ? 'top' : 'left', '')
  }

  Tooltip.prototype.setContent = function () {
    var $tip  = this.tip()
    var title = this.getTitle()

    $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
    $tip.removeClass('fade in top bottom left right')
  }

  Tooltip.prototype.hide = function (callback) {
    var that = this
    var $tip = $(this.$tip)
    var e    = $.Event('hide.bs.' + this.type)

    function complete() {
      if (that.hoverState != 'in') $tip.detach()
      that.$element
        .removeAttr('aria-describedby')
        .trigger('hidden.bs.' + that.type)
      callback && callback()
    }

    this.$element.trigger(e)

    if (e.isDefaultPrevented()) return

    $tip.removeClass('in')

    $.support.transition && $tip.hasClass('fade') ?
      $tip
        .one('bsTransitionEnd', complete)
        .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
      complete()

    this.hoverState = null

    return this
  }

  Tooltip.prototype.fixTitle = function () {
    var $e = this.$element
    if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') {
      $e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
    }
  }

  Tooltip.prototype.hasContent = function () {
    return this.getTitle()
  }

  Tooltip.prototype.getPosition = function ($element) {
    $element   = $element || this.$element

    var el     = $element[0]
    var isBody = el.tagName == 'BODY'

    var elRect    = el.getBoundingClientRect()
    if (elRect.width == null) {
      // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
      elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top })
    }
    var elOffset  = isBody ? { top: 0, left: 0 } : $element.offset()
    var scroll    = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() }
    var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null

    return $.extend({}, elRect, scroll, outerDims, elOffset)
  }

  Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
    return placement == 'bottom' ? { top: pos.top + pos.height,   left: pos.left + pos.width / 2 - actualWidth / 2 } :
           placement == 'top'    ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
           placement == 'left'   ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
        /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }

  }

  Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) {
    var delta = { top: 0, left: 0 }
    if (!this.$viewport) return delta

    var viewportPadding = this.options.viewport && this.options.viewport.padding || 0
    var viewportDimensions = this.getPosition(this.$viewport)

    if (/right|left/.test(placement)) {
      var topEdgeOffset    = pos.top - viewportPadding - viewportDimensions.scroll
      var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight
      if (topEdgeOffset < viewportDimensions.top) { // top overflow
        delta.top = viewportDimensions.top - topEdgeOffset
      } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow
        delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
      }
    } else {
      var leftEdgeOffset  = pos.left - viewportPadding
      var rightEdgeOffset = pos.left + viewportPadding + actualWidth
      if (leftEdgeOffset < viewportDimensions.left) { // left overflow
        delta.left = viewportDimensions.left - leftEdgeOffset
      } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow
        delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
      }
    }

    return delta
  }

  Tooltip.prototype.getTitle = function () {
    var title
    var $e = this.$element
    var o  = this.options

    title = $e.attr('data-original-title')
      || (typeof o.title == 'function' ? o.title.call($e[0]) :  o.title)

    return title
  }

  Tooltip.prototype.getUID = function (prefix) {
    do prefix += ~~(Math.random() * 1000000)
    while (document.getElementById(prefix))
    return prefix
  }

  Tooltip.prototype.tip = function () {
    if (!this.$tip) {
      this.$tip = $(this.options.template)
      if (this.$tip.length != 1) {
        throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
      }
    }
    return this.$tip
  }

  Tooltip.prototype.arrow = function () {
    return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
  }

  Tooltip.prototype.enable = function () {
    this.enabled = true
  }

  Tooltip.prototype.disable = function () {
    this.enabled = false
  }

  Tooltip.prototype.toggleEnabled = function () {
    this.enabled = !this.enabled
  }

  Tooltip.prototype.toggle = function (e) {
    var self = this
    if (e) {
      self = $(e.currentTarget).data('bs.' + this.type)
      if (!self) {
        self = new this.constructor(e.currentTarget, this.getDelegateOptions())
        $(e.currentTarget).data('bs.' + this.type, self)
      }
    }

    if (e) {
      self.inState.click = !self.inState.click
      if (self.isInStateTrue()) self.enter(self)
      else self.leave(self)
    } else {
      self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
    }
  }

  Tooltip.prototype.destroy = function () {
    var that = this
    clearTimeout(this.timeout)
    this.hide(function () {
      that.$element.off('.' + that.type).removeData('bs.' + that.type)
      if (that.$tip) {
        that.$tip.detach()
      }
      that.$tip = null
      that.$arrow = null
      that.$viewport = null
    })
  }


  // TOOLTIP PLUGIN DEFINITION
  // =========================

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.tooltip')
      var options = typeof option == 'object' && option

      if (!data && /destroy|hide/.test(option)) return
      if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  var old = $.fn.tooltip

  $.fn.tooltip             = Plugin
  $.fn.tooltip.Constructor = Tooltip


  // TOOLTIP NO CONFLICT
  // ===================

  $.fn.tooltip.noConflict = function () {
    $.fn.tooltip = old
    return this
  }

}(jQuery);

/* ========================================================================
 * Bootstrap: popover.js v3.3.5
 * http://getbootstrap.com/javascript/#popovers
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */


+function ($) {
  'use strict';

  // POPOVER PUBLIC CLASS DEFINITION
  // ===============================

  var Popover = function (element, options) {
    this.init('popover', element, options)
  }

  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')

  Popover.VERSION  = '3.3.5'

  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
    placement: 'right',
    trigger: 'click',
    content: '',
    template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
  })


  // NOTE: POPOVER EXTENDS tooltip.js
  // ================================

  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)

  Popover.prototype.constructor = Popover

  Popover.prototype.getDefaults = function () {
    return Popover.DEFAULTS
  }

  Popover.prototype.setContent = function () {
    var $tip    = this.tip()
    var title   = this.getTitle()
    var content = this.getContent()

    $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
    $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events
      this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
    ](content)

    $tip.removeClass('fade top bottom left right in')

    // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
    // this manually by checking the contents.
    if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
  }

  Popover.prototype.hasContent = function () {
    return this.getTitle() || this.getContent()
  }

  Popover.prototype.getContent = function () {
    var $e = this.$element
    var o  = this.options

    return $e.attr('data-content')
      || (typeof o.content == 'function' ?
            o.content.call($e[0]) :
            o.content)
  }

  Popover.prototype.arrow = function () {
    return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
  }


  // POPOVER PLUGIN DEFINITION
  // =========================

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.popover')
      var options = typeof option == 'object' && option

      if (!data && /destroy|hide/.test(option)) return
      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  var old = $.fn.popover

  $.fn.popover             = Plugin
  $.fn.popover.Constructor = Popover


  // POPOVER NO CONFLICT
  // ===================

  $.fn.popover.noConflict = function () {
    $.fn.popover = old
    return this
  }

}(jQuery);

/* ========================================================================
 * Bootstrap: affix.js v3.3.5
 * http://getbootstrap.com/javascript/#affix
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */


+function ($) {
  'use strict';

  // AFFIX CLASS DEFINITION
  // ======================

  var Affix = function (element, options) {
    this.options = $.extend({}, Affix.DEFAULTS, options)

    this.$target = $(this.options.target)
      .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
      .on('click.bs.affix.data-api',  $.proxy(this.checkPositionWithEventLoop, this))

    this.$element     = $(element)
    this.affixed      = null
    this.unpin        = null
    this.pinnedOffset = null

    this.checkPosition()
  }

  Affix.VERSION  = '3.3.5'

  Affix.RESET    = 'affix affix-top affix-bottom'

  Affix.DEFAULTS = {
    offset: 0,
    target: window
  }

  Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) {
    var scrollTop    = this.$target.scrollTop()
    var position     = this.$element.offset()
    var targetHeight = this.$target.height()

    if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false

    if (this.affixed == 'bottom') {
      if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'
      return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom'
    }

    var initializing   = this.affixed == null
    var colliderTop    = initializing ? scrollTop : position.top
    var colliderHeight = initializing ? targetHeight : height

    if (offsetTop != null && scrollTop <= offsetTop) return 'top'
    if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'

    return false
  }

  Affix.prototype.getPinnedOffset = function () {
    if (this.pinnedOffset) return this.pinnedOffset
    this.$element.removeClass(Affix.RESET).addClass('affix')
    var scrollTop = this.$target.scrollTop()
    var position  = this.$element.offset()
    return (this.pinnedOffset = position.top - scrollTop)
  }

  Affix.prototype.checkPositionWithEventLoop = function () {
    setTimeout($.proxy(this.checkPosition, this), 1)
  }

  Affix.prototype.checkPosition = function () {
    if (!this.$element.is(':visible')) return

    var height       = this.$element.height()
    var offset       = this.options.offset
    var offsetTop    = offset.top
    var offsetBottom = offset.bottom
    var scrollHeight = Math.max($(document).height(), $(document.body).height())

    if (typeof offset != 'object')         offsetBottom = offsetTop = offset
    if (typeof offsetTop == 'function')    offsetTop    = offset.top(this.$element)
    if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)

    var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom)

    if (this.affixed != affix) {
      if (this.unpin != null) this.$element.css('top', '')

      var affixType = 'affix' + (affix ? '-' + affix : '')
      var e         = $.Event(affixType + '.bs.affix')

      this.$element.trigger(e)

      if (e.isDefaultPrevented()) return

      this.affixed = affix
      this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null

      this.$element
        .removeClass(Affix.RESET)
        .addClass(affixType)
        .trigger(affixType.replace('affix', 'affixed') + '.bs.affix')
    }

    if (affix == 'bottom') {
      this.$element.offset({
        top: scrollHeight - height - offsetBottom
      })
    }
  }


  // AFFIX PLUGIN DEFINITION
  // =======================

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.affix')
      var options = typeof option == 'object' && option

      if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  var old = $.fn.affix

  $.fn.affix             = Plugin
  $.fn.affix.Constructor = Affix


  // AFFIX NO CONFLICT
  // =================

  $.fn.affix.noConflict = function () {
    $.fn.affix = old
    return this
  }


  // AFFIX DATA-API
  // ==============

  $(window).on('load', function () {
    $('[data-spy="affix"]').each(function () {
      var $spy = $(this)
      var data = $spy.data()

      data.offset = data.offset || {}

      if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom
      if (data.offsetTop    != null) data.offset.top    = data.offsetTop

      Plugin.call($spy, data)
    })
  })

}(jQuery);

/* ========================================================================
 * Bootstrap: collapse.js v3.3.5
 * http://getbootstrap.com/javascript/#collapse
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */


+function ($) {
  'use strict';

  // COLLAPSE PUBLIC CLASS DEFINITION
  // ================================

  var Collapse = function (element, options) {
    this.$element      = $(element)
    this.options       = $.extend({}, Collapse.DEFAULTS, options)
    this.$trigger      = $('[data-toggle="collapse"][href="#' + element.id + '"],' +
                           '[data-toggle="collapse"][data-target="#' + element.id + '"]')
    this.transitioning = null

    if (this.options.parent) {
      this.$parent = this.getParent()
    } else {
      this.addAriaAndCollapsedClass(this.$element, this.$trigger)
    }

    if (this.options.toggle) this.toggle()
  }

  Collapse.VERSION  = '3.3.5'

  Collapse.TRANSITION_DURATION = 350

  Collapse.DEFAULTS = {
    toggle: true
  }

  Collapse.prototype.dimension = function () {
    var hasWidth = this.$element.hasClass('width')
    return hasWidth ? 'width' : 'height'
  }

  Collapse.prototype.show = function () {
    if (this.transitioning || this.$element.hasClass('in')) return

    var activesData
    var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing')

    if (actives && actives.length) {
      activesData = actives.data('bs.collapse')
      if (activesData && activesData.transitioning) return
    }

    var startEvent = $.Event('show.bs.collapse')
    this.$element.trigger(startEvent)
    if (startEvent.isDefaultPrevented()) return

    if (actives && actives.length) {
      Plugin.call(actives, 'hide')
      activesData || actives.data('bs.collapse', null)
    }

    var dimension = this.dimension()

    this.$element
      .removeClass('collapse')
      .addClass('collapsing')[dimension](0)
      .attr('aria-expanded', true)

    this.$trigger
      .removeClass('collapsed')
      .attr('aria-expanded', true)

    this.transitioning = 1

    var complete = function () {
      this.$element
        .removeClass('collapsing')
        .addClass('collapse in')[dimension]('')
      this.transitioning = 0
      this.$element
        .trigger('shown.bs.collapse')
    }

    if (!$.support.transition) return complete.call(this)

    var scrollSize = $.camelCase(['scroll', dimension].join('-'))

    this.$element
      .one('bsTransitionEnd', $.proxy(complete, this))
      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
  }

  Collapse.prototype.hide = function () {
    if (this.transitioning || !this.$element.hasClass('in')) return

    var startEvent = $.Event('hide.bs.collapse')
    this.$element.trigger(startEvent)
    if (startEvent.isDefaultPrevented()) return

    var dimension = this.dimension()

    this.$element[dimension](this.$element[dimension]())[0].offsetHeight

    this.$element
      .addClass('collapsing')
      .removeClass('collapse in')
      .attr('aria-expanded', false)

    this.$trigger
      .addClass('collapsed')
      .attr('aria-expanded', false)

    this.transitioning = 1

    var complete = function () {
      this.transitioning = 0
      this.$element
        .removeClass('collapsing')
        .addClass('collapse')
        .trigger('hidden.bs.collapse')
    }

    if (!$.support.transition) return complete.call(this)

    this.$element
      [dimension](0)
      .one('bsTransitionEnd', $.proxy(complete, this))
      .emulateTransitionEnd(Collapse.TRANSITION_DURATION)
  }

  Collapse.prototype.toggle = function () {
    this[this.$element.hasClass('in') ? 'hide' : 'show']()
  }

  Collapse.prototype.getParent = function () {
    return $(this.options.parent)
      .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]')
      .each($.proxy(function (i, element) {
        var $element = $(element)
        this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
      }, this))
      .end()
  }

  Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) {
    var isOpen = $element.hasClass('in')

    $element.attr('aria-expanded', isOpen)
    $trigger
      .toggleClass('collapsed', !isOpen)
      .attr('aria-expanded', isOpen)
  }

  function getTargetFromTrigger($trigger) {
    var href
    var target = $trigger.attr('data-target')
      || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7

    return $(target)
  }


  // COLLAPSE PLUGIN DEFINITION
  // ==========================

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.collapse')
      var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)

      if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false
      if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  var old = $.fn.collapse

  $.fn.collapse             = Plugin
  $.fn.collapse.Constructor = Collapse


  // COLLAPSE NO CONFLICT
  // ====================

  $.fn.collapse.noConflict = function () {
    $.fn.collapse = old
    return this
  }


  // COLLAPSE DATA-API
  // =================

  $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) {
    var $this   = $(this)

    if (!$this.attr('data-target')) e.preventDefault()

    var $target = getTargetFromTrigger($this)
    var data    = $target.data('bs.collapse')
    var option  = data ? 'toggle' : $this.data()

    Plugin.call($target, option)
  })

}(jQuery);

/* ========================================================================
 * Bootstrap: scrollspy.js v3.3.5
 * http://getbootstrap.com/javascript/#scrollspy
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */


+function ($) {
  'use strict';

  // SCROLLSPY CLASS DEFINITION
  // ==========================

  function ScrollSpy(element, options) {
    this.$body          = $(document.body)
    this.$scrollElement = $(element).is(document.body) ? $(window) : $(element)
    this.options        = $.extend({}, ScrollSpy.DEFAULTS, options)
    this.selector       = (this.options.target || '') + ' .nav li > a'
    this.offsets        = []
    this.targets        = []
    this.activeTarget   = null
    this.scrollHeight   = 0

    this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this))
    this.refresh()
    this.process()
  }

  ScrollSpy.VERSION  = '3.3.5'

  ScrollSpy.DEFAULTS = {
    offset: 10
  }

  ScrollSpy.prototype.getScrollHeight = function () {
    return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight)
  }

  ScrollSpy.prototype.refresh = function () {
    var that          = this
    var offsetMethod  = 'offset'
    var offsetBase    = 0

    this.offsets      = []
    this.targets      = []
    this.scrollHeight = this.getScrollHeight()

    if (!$.isWindow(this.$scrollElement[0])) {
      offsetMethod = 'position'
      offsetBase   = this.$scrollElement.scrollTop()
    }

    this.$body
      .find(this.selector)
      .map(function () {
        var $el   = $(this)
        var href  = $el.data('target') || $el.attr('href')
        var $href = /^#./.test(href) && $(href)

        return ($href
          && $href.length
          && $href.is(':visible')
          && [[$href[offsetMethod]().top + offsetBase, href]]) || null
      })
      .sort(function (a, b) { return a[0] - b[0] })
      .each(function () {
        that.offsets.push(this[0])
        that.targets.push(this[1])
      })
  }

  ScrollSpy.prototype.process = function () {
    var scrollTop    = this.$scrollElement.scrollTop() + this.options.offset
    var scrollHeight = this.getScrollHeight()
    var maxScroll    = this.options.offset + scrollHeight - this.$scrollElement.height()
    var offsets      = this.offsets
    var targets      = this.targets
    var activeTarget = this.activeTarget
    var i

    if (this.scrollHeight != scrollHeight) {
      this.refresh()
    }

    if (scrollTop >= maxScroll) {
      return activeTarget != (i = targets[targets.length - 1]) && this.activate(i)
    }

    if (activeTarget && scrollTop < offsets[0]) {
      this.activeTarget = null
      return this.clear()
    }

    for (i = offsets.length; i--;) {
      activeTarget != targets[i]
        && scrollTop >= offsets[i]
        && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1])
        && this.activate(targets[i])
    }
  }

  ScrollSpy.prototype.activate = function (target) {
    this.activeTarget = target

    this.clear()

    var selector = this.selector +
      '[data-target="' + target + '"],' +
      this.selector + '[href="' + target + '"]'

    var active = $(selector)
      .parents('li')
      .addClass('active')

    if (active.parent('.dropdown-menu').length) {
      active = active
        .closest('li.dropdown')
        .addClass('active')
    }

    active.trigger('activate.bs.scrollspy')
  }

  ScrollSpy.prototype.clear = function () {
    $(this.selector)
      .parentsUntil(this.options.target, '.active')
      .removeClass('active')
  }


  // SCROLLSPY PLUGIN DEFINITION
  // ===========================

  function Plugin(option) {
    return this.each(function () {
      var $this   = $(this)
      var data    = $this.data('bs.scrollspy')
      var options = typeof option == 'object' && option

      if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
      if (typeof option == 'string') data[option]()
    })
  }

  var old = $.fn.scrollspy

  $.fn.scrollspy             = Plugin
  $.fn.scrollspy.Constructor = ScrollSpy


  // SCROLLSPY NO CONFLICT
  // =====================

  $.fn.scrollspy.noConflict = function () {
    $.fn.scrollspy = old
    return this
  }


  // SCROLLSPY DATA-API
  // ==================

  $(window).on('load.bs.scrollspy.data-api', function () {
    $('[data-spy="scroll"]').each(function () {
      var $spy = $(this)
      Plugin.call($spy, $spy.data())
    })
  })

}(jQuery);

/* ========================================================================
 * Bootstrap: transition.js v3.3.5
 * http://getbootstrap.com/javascript/#transitions
 * ========================================================================
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */


+function ($) {
  'use strict';

  // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
  // ============================================================

  function transitionEnd() {
    var el = document.createElement('bootstrap')

    var transEndEventNames = {
      WebkitTransition : 'webkitTransitionEnd',
      MozTransition    : 'transitionend',
      OTransition      : 'oTransitionEnd otransitionend',
      transition       : 'transitionend'
    }

    for (var name in transEndEventNames) {
      if (el.style[name] !== undefined) {
        return { end: transEndEventNames[name] }
      }
    }

    return false // explicit for ie8 (  ._.)
  }

  // http://blog.alexmaccaw.com/css-transitions
  $.fn.emulateTransitionEnd = function (duration) {
    var called = false
    var $el = this
    $(this).one('bsTransitionEnd', function () { called = true })
    var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
    setTimeout(callback, duration)
    return this
  }

  $(function () {
    $.support.transition = transitionEnd()

    if (!$.support.transition) return

    $.event.special.bsTransitionEnd = {
      bindType: $.support.transition.end,
      delegateType: $.support.transition.end,
      handle: function (e) {
        if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
      }
    }
  })

}(jQuery);
;
/*
     _ _      _       _
 ___| (_) ___| | __  (_)___
/ __| | |/ __| |/ /  | / __|
\__ \ | | (__|   < _ | \__ \
|___/_|_|\___|_|\_(_)/ |___/
                   |__/

 Version: 1.8.1
  Author: Ken Wheeler
 Website: http://kenwheeler.github.io
    Docs: http://kenwheeler.github.io/slick
    Repo: http://github.com/kenwheeler/slick
  Issues: http://github.com/kenwheeler/slick/issues

 */
/* SHS- modified -e.prototype.buildDots = function() {
        var e, t, o = this;
        if(o.slideCount < 2) {				o.options.dots=  false;			}
*/
/*
 * Match Heights jQuery Plugin
 * 
 * Version 1.7.2 (Updated 7/31/2013)
 * Copyright (c) 2010-2013 Mike Avello
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */
/**
 * Copyright (c) 2007-2015 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
 * Licensed under MIT
 * @author Ariel Flesler
 * @version 2.1.2
 */

/**
 * Extend jquery with a scrollspy plugin.
 * This watches the window scroll and fires events when elements are scrolled into viewport.
 *
 * throttle() and getTime() taken from Underscore.js
 * https://github.com/jashkenas/underscore
 *
 * @author Copyright 2013 John Smart
 * @license https://raw.github.com/thesmart/jquery-scrollspy/master/LICENSE
 * @see https://github.com/thesmart
 * @version 0.1.2
 */
/*
* rwdImageMaps jQuery plugin v1.5
* Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize
* Copyright (c) 2013 Matt Stow
* https://github.com/stowball/jQuery-rwdImageMaps
* http://mattstow.com
* Licensed under the MIT license */
/* ============================================================
 * bootstrap-portfilter.js for Bootstrap v2.3.1
 * https://github.com/geedmo/portfilter
 * ============================================================ */

!function (t) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], t) : "undefined" != typeof exports ? module.exports = t(require("jquery")) : t(jQuery) }(function (t) { "use strict"; var e, i = window.Slick || {}; (e = 0, i = function (i, s) { var o, n = this; n.defaults = { accessibility: !0, adaptiveHeight: !1, appendArrows: t(i), appendDots: t(i), arrows: !0, asNavFor: null, prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', autoplay: !1, autoplaySpeed: 3e3, centerMode: !1, centerPadding: "50px", cssEase: "ease", customPaging: function (e, i) { return t('<button type="button" />').text(i + 1) }, dots: !1, dotsClass: "slick-dots", draggable: !0, easing: "linear", edgeFriction: .35, fade: !1, focusOnSelect: !1, focusOnChange: !1, infinite: !0, initialSlide: 0, lazyLoad: "ondemand", mobileFirst: !1, pauseOnHover: !0, pauseOnFocus: !0, pauseOnDotsHover: !0, respondTo: "window", responsive: null, rows: 1, rtl: !1, slide: "", slidesPerRow: 1, slidesToShow: 1, slidesToScroll: 1, speed: 500, swipe: !0, swipeToSlide: !1, touchMove: !0, touchThreshold: 5, useCSS: !0, useTransform: !0, variableWidth: !1, vertical: !1, verticalSwiping: !1, waitForAnimate: !0, zIndex: 1e3 }, n.initials = { animating: !1, dragging: !1, autoPlayTimer: null, currentDirection: 0, currentLeft: null, currentSlide: 0, direction: 1, $dots: null, listWidth: null, listHeight: null, loadIndex: 0, $nextArrow: null, $prevArrow: null, scrolling: !1, slideCount: null, slideWidth: null, $slideTrack: null, $slides: null, sliding: !1, slideOffset: 0, swipeLeft: null, swiping: !1, $list: null, touchObject: {}, transformsEnabled: !1, unslicked: !1 }, t.extend(n, n.initials), n.activeBreakpoint = null, n.animType = null, n.animProp = null, n.breakpoints = [], n.breakpointSettings = [], n.cssTransitions = !1, n.focussed = !1, n.interrupted = !1, n.hidden = "hidden", n.paused = !0, n.positionProp = null, n.respondTo = null, n.rowCount = 1, n.shouldClick = !0, n.$slider = t(i), n.$slidesCache = null, n.transformType = null, n.transitionType = null, n.visibilityChange = "visibilitychange", n.windowWidth = 0, n.windowTimer = null, o = t(i).data("slick") || {}, n.options = t.extend({}, n.defaults, s, o), n.currentSlide = n.options.initialSlide, n.originalSettings = n.options, void 0 !== document.mozHidden ? (n.hidden = "mozHidden", n.visibilityChange = "mozvisibilitychange") : void 0 !== document.webkitHidden && (n.hidden = "webkitHidden", n.visibilityChange = "webkitvisibilitychange"), n.autoPlay = t.proxy(n.autoPlay, n), n.autoPlayClear = t.proxy(n.autoPlayClear, n), n.autoPlayIterator = t.proxy(n.autoPlayIterator, n), n.changeSlide = t.proxy(n.changeSlide, n), n.clickHandler = t.proxy(n.clickHandler, n), n.selectHandler = t.proxy(n.selectHandler, n), n.setPosition = t.proxy(n.setPosition, n), n.swipeHandler = t.proxy(n.swipeHandler, n), n.dragHandler = t.proxy(n.dragHandler, n), n.keyHandler = t.proxy(n.keyHandler, n), n.instanceUid = e++ , n.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/, n.registerBreakpoints(), n.init(!0) }).prototype.activateADA = function () { this.$slideTrack.find(".slick-active").attr({ "aria-hidden": "false" }).find("a, input, button, select").attr({ tabindex: "0" }) }, i.prototype.addSlide = i.prototype.slickAdd = function (e, i, s) { var o = this; if ("boolean" == typeof i) s = i, i = null; else if (i < 0 || i >= o.slideCount) return !1; o.unload(), "number" == typeof i ? 0 === i && 0 === o.$slides.length ? t(e).appendTo(o.$slideTrack) : s ? t(e).insertBefore(o.$slides.eq(i)) : t(e).insertAfter(o.$slides.eq(i)) : !0 === s ? t(e).prependTo(o.$slideTrack) : t(e).appendTo(o.$slideTrack), o.$slides = o.$slideTrack.children(this.options.slide), o.$slideTrack.children(this.options.slide).detach(), o.$slideTrack.append(o.$slides), o.$slides.each(function (e, i) { t(i).attr("data-slick-index", e) }), o.$slidesCache = o.$slides, o.reinit() }, i.prototype.animateHeight = function () { var t = this; if (1 === t.options.slidesToShow && !0 === t.options.adaptiveHeight && !1 === t.options.vertical) { var e = t.$slides.eq(t.currentSlide).outerHeight(!0); t.$list.animate({ height: e }, t.options.speed) } }, i.prototype.animateSlide = function (e, i) { var s = {}, o = this; o.animateHeight(), !0 === o.options.rtl && !1 === o.options.vertical && (e = -e), !1 === o.transformsEnabled ? !1 === o.options.vertical ? o.$slideTrack.animate({ left: e }, o.options.speed, o.options.easing, i) : o.$slideTrack.animate({ top: e }, o.options.speed, o.options.easing, i) : !1 === o.cssTransitions ? (!0 === o.options.rtl && (o.currentLeft = -o.currentLeft), t({ animStart: o.currentLeft }).animate({ animStart: e }, { duration: o.options.speed, easing: o.options.easing, step: function (t) { t = Math.ceil(t), !1 === o.options.vertical ? (s[o.animType] = "translate(" + t + "px, 0px)", o.$slideTrack.css(s)) : (s[o.animType] = "translate(0px," + t + "px)", o.$slideTrack.css(s)) }, complete: function () { i && i.call() } })) : (o.applyTransition(), e = Math.ceil(e), !1 === o.options.vertical ? s[o.animType] = "translate3d(" + e + "px, 0px, 0px)" : s[o.animType] = "translate3d(0px," + e + "px, 0px)", o.$slideTrack.css(s), i && setTimeout(function () { o.disableTransition(), i.call() }, o.options.speed)) }, i.prototype.getNavTarget = function () { var e = this.options.asNavFor; return e && null !== e && (e = t(e).not(this.$slider)), e }, i.prototype.asNavFor = function (e) { var i = this.getNavTarget(); null !== i && "object" == typeof i && i.each(function () { var i = t(this).slick("getSlick"); i.unslicked || i.slideHandler(e, !0) }) }, i.prototype.applyTransition = function (t) { var e = this, i = {}; !1 === e.options.fade ? i[e.transitionType] = e.transformType + " " + e.options.speed + "ms " + e.options.cssEase : i[e.transitionType] = "opacity " + e.options.speed + "ms " + e.options.cssEase, !1 === e.options.fade ? e.$slideTrack.css(i) : e.$slides.eq(t).css(i) }, i.prototype.autoPlay = function () { var t = this; t.autoPlayClear(), t.slideCount > t.options.slidesToShow && (t.autoPlayTimer = setInterval(t.autoPlayIterator, t.options.autoplaySpeed)) }, i.prototype.autoPlayClear = function () { this.autoPlayTimer && clearInterval(this.autoPlayTimer) }, i.prototype.autoPlayIterator = function () { var t = this, e = t.currentSlide + t.options.slidesToScroll; t.paused || t.interrupted || t.focussed || (!1 === t.options.infinite && (1 === t.direction && t.currentSlide + 1 === t.slideCount - 1 ? t.direction = 0 : 0 === t.direction && (e = t.currentSlide - t.options.slidesToScroll, t.currentSlide - 1 == 0 && (t.direction = 1))), t.slideHandler(e)) }, i.prototype.buildArrows = function () { var e = this; !0 === e.options.arrows && (e.$prevArrow = t(e.options.prevArrow).addClass("slick-arrow"), e.$nextArrow = t(e.options.nextArrow).addClass("slick-arrow"), e.slideCount > e.options.slidesToShow ? (e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), e.htmlExpr.test(e.options.prevArrow) && e.$prevArrow.prependTo(e.options.appendArrows), e.htmlExpr.test(e.options.nextArrow) && e.$nextArrow.appendTo(e.options.appendArrows), !0 !== e.options.infinite && e.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true")) : e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({ "aria-disabled": "true", tabindex: "-1" })) }, i.prototype.buildDots = function () { var e, i, s = this; if (s.slideCount < 2 && (s.options.dots = !1), !0 === s.options.dots) { for (s.$slider.addClass("slick-dotted"), i = t("<ul />").addClass(s.options.dotsClass), e = 0; e <= s.getDotCount(); e += 1)i.append(t("<li />").append(s.options.customPaging.call(this, s, e))); s.$dots = i.appendTo(s.options.appendDots), s.$dots.find("li").first().addClass("slick-active") } }, i.prototype.buildOut = function () { var e = this; e.$slides = e.$slider.children(e.options.slide + ":not(.slick-cloned)").addClass("slick-slide"), e.slideCount = e.$slides.length, e.$slides.each(function (e, i) { t(i).attr("data-slick-index", e).data("originalStyling", t(i).attr("style") || "") }), e.$slider.addClass("slick-slider"), e.$slideTrack = 0 === e.slideCount ? t('<div class="slick-track"/>').appendTo(e.$slider) : e.$slides.wrapAll('<div class="slick-track"/>').parent(), e.$list = e.$slideTrack.wrap('<div class="slick-list"/>').parent(), e.$slideTrack.css("opacity", 0), !0 !== e.options.centerMode && !0 !== e.options.swipeToSlide || (e.options.slidesToScroll = 1), t("img[data-lazy]", e.$slider).not("[src]").addClass("slick-loading"), e.setupInfinite(), e.buildArrows(), e.buildDots(), e.updateDots(), e.setSlideClasses("number" == typeof e.currentSlide ? e.currentSlide : 0), !0 === e.options.draggable && e.$list.addClass("draggable") }, i.prototype.buildRows = function () { var t, e, i, s, o, n, a, l = this; if (s = document.createDocumentFragment(), n = l.$slider.children(), l.options.rows > 1) { for (a = l.options.slidesPerRow * l.options.rows, o = Math.ceil(n.length / a), t = 0; t < o; t++) { var r = document.createElement("div"); for (e = 0; e < l.options.rows; e++) { var d = document.createElement("div"); for (i = 0; i < l.options.slidesPerRow; i++) { var c = t * a + (e * l.options.slidesPerRow + i); n.get(c) && d.appendChild(n.get(c)) } r.appendChild(d) } s.appendChild(r) } l.$slider.empty().append(s), l.$slider.children().children().children().css({ width: 100 / l.options.slidesPerRow + "%", display: "inline-block" }) } }, i.prototype.checkResponsive = function (e, i) { var s, o, n, a = this, l = !1, r = a.$slider.width(), d = window.innerWidth || t(window).width(); if ("window" === a.respondTo ? n = d : "slider" === a.respondTo ? n = r : "min" === a.respondTo && (n = Math.min(d, r)), a.options.responsive && a.options.responsive.length && null !== a.options.responsive) { o = null; for (s in a.breakpoints) a.breakpoints.hasOwnProperty(s) && (!1 === a.originalSettings.mobileFirst ? n < a.breakpoints[s] && (o = a.breakpoints[s]) : n > a.breakpoints[s] && (o = a.breakpoints[s])); null !== o ? null !== a.activeBreakpoint ? (o !== a.activeBreakpoint || i) && (a.activeBreakpoint = o, "unslick" === a.breakpointSettings[o] ? a.unslick(o) : (a.options = t.extend({}, a.originalSettings, a.breakpointSettings[o]), !0 === e && (a.currentSlide = a.options.initialSlide), a.refresh(e)), l = o) : (a.activeBreakpoint = o, "unslick" === a.breakpointSettings[o] ? a.unslick(o) : (a.options = t.extend({}, a.originalSettings, a.breakpointSettings[o]), !0 === e && (a.currentSlide = a.options.initialSlide), a.refresh(e)), l = o) : null !== a.activeBreakpoint && (a.activeBreakpoint = null, a.options = a.originalSettings, !0 === e && (a.currentSlide = a.options.initialSlide), a.refresh(e), l = o), e || !1 === l || a.$slider.trigger("breakpoint", [a, l]) } }, i.prototype.changeSlide = function (e, i) { var s, o, n = this, a = t(e.currentTarget); switch (a.is("a") && e.preventDefault(), a.is("li") || (a = a.closest("li")), s = n.slideCount % n.options.slidesToScroll != 0 ? 0 : (n.slideCount - n.currentSlide) % n.options.slidesToScroll, e.data.message) { case "previous": o = 0 === s ? n.options.slidesToScroll : n.options.slidesToShow - s, n.slideCount > n.options.slidesToShow && n.slideHandler(n.currentSlide - o, !1, i); break; case "next": o = 0 === s ? n.options.slidesToScroll : s, n.slideCount > n.options.slidesToShow && n.slideHandler(n.currentSlide + o, !1, i); break; case "index": var l = 0 === e.data.index ? 0 : e.data.index || a.index() * n.options.slidesToScroll; n.slideHandler(n.checkNavigable(l), !1, i), a.children().trigger("focus"); break; default: return } }, i.prototype.checkNavigable = function (t) { var e, i; if (i = 0, t > (e = this.getNavigableIndexes())[e.length - 1]) t = e[e.length - 1]; else for (var s in e) { if (t < e[s]) { t = i; break } i = e[s] } return t }, i.prototype.cleanUpEvents = function () { var e = this; e.options.dots && null !== e.$dots && (t("li", e.$dots).off("click.slick", e.changeSlide).off("mouseenter.slick", t.proxy(e.interrupt, e, !0)).off("mouseleave.slick", t.proxy(e.interrupt, e, !1)), !0 === e.options.accessibility && e.$dots.off("keydown.slick", e.keyHandler)), e.$slider.off("focus.slick blur.slick"), !0 === e.options.arrows && e.slideCount > e.options.slidesToShow && (e.$prevArrow && e.$prevArrow.off("click.slick", e.changeSlide), e.$nextArrow && e.$nextArrow.off("click.slick", e.changeSlide), !0 === e.options.accessibility && (e.$prevArrow && e.$prevArrow.off("keydown.slick", e.keyHandler), e.$nextArrow && e.$nextArrow.off("keydown.slick", e.keyHandler))), e.$list.off("touchstart.slick mousedown.slick", e.swipeHandler), e.$list.off("touchmove.slick mousemove.slick", e.swipeHandler), e.$list.off("touchend.slick mouseup.slick", e.swipeHandler), e.$list.off("touchcancel.slick mouseleave.slick", e.swipeHandler), e.$list.off("click.slick", e.clickHandler), t(document).off(e.visibilityChange, e.visibility), e.cleanUpSlideEvents(), !0 === e.options.accessibility && e.$list.off("keydown.slick", e.keyHandler), !0 === e.options.focusOnSelect && t(e.$slideTrack).children().off("click.slick", e.selectHandler), t(window).off("orientationchange.slick.slick-" + e.instanceUid, e.orientationChange), t(window).off("resize.slick.slick-" + e.instanceUid, e.resize), t("[draggable!=true]", e.$slideTrack).off("dragstart", e.preventDefault), t(window).off("load.slick.slick-" + e.instanceUid, e.setPosition) }, i.prototype.cleanUpSlideEvents = function () { var e = this; e.$list.off("mouseenter.slick", t.proxy(e.interrupt, e, !0)), e.$list.off("mouseleave.slick", t.proxy(e.interrupt, e, !1)) }, i.prototype.cleanUpRows = function () { var t; this.options.rows > 1 && ((t = this.$slides.children().children()).removeAttr("style"), this.$slider.empty().append(t)) }, i.prototype.clickHandler = function (t) { !1 === this.shouldClick && (t.stopImmediatePropagation(), t.stopPropagation(), t.preventDefault()) }, i.prototype.destroy = function (e) { var i = this; i.autoPlayClear(), i.touchObject = {}, i.cleanUpEvents(), t(".slick-cloned", i.$slider).detach(), i.$dots && i.$dots.remove(), i.$prevArrow && i.$prevArrow.length && (i.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), i.htmlExpr.test(i.options.prevArrow) && i.$prevArrow.remove()), i.$nextArrow && i.$nextArrow.length && (i.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), i.htmlExpr.test(i.options.nextArrow) && i.$nextArrow.remove()), i.$slides && (i.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function () { t(this).attr("style", t(this).data("originalStyling")) }), i.$slideTrack.children(this.options.slide).detach(), i.$slideTrack.detach(), i.$list.detach(), i.$slider.append(i.$slides)), i.cleanUpRows(), i.$slider.removeClass("slick-slider"), i.$slider.removeClass("slick-initialized"), i.$slider.removeClass("slick-dotted"), i.unslicked = !0, e || i.$slider.trigger("destroy", [i]) }, i.prototype.disableTransition = function (t) { var e = {}; e[this.transitionType] = "", !1 === this.options.fade ? this.$slideTrack.css(e) : this.$slides.eq(t).css(e) }, i.prototype.fadeSlide = function (t, e) { var i = this; !1 === i.cssTransitions ? (i.$slides.eq(t).css({ zIndex: i.options.zIndex }), i.$slides.eq(t).animate({ opacity: 1 }, i.options.speed, i.options.easing, e)) : (i.applyTransition(t), i.$slides.eq(t).css({ opacity: 1, zIndex: i.options.zIndex }), e && setTimeout(function () { i.disableTransition(t), e.call() }, i.options.speed)) }, i.prototype.fadeSlideOut = function (t) { var e = this; !1 === e.cssTransitions ? e.$slides.eq(t).animate({ opacity: 0, zIndex: e.options.zIndex - 2 }, e.options.speed, e.options.easing) : (e.applyTransition(t), e.$slides.eq(t).css({ opacity: 0, zIndex: e.options.zIndex - 2 })) }, i.prototype.filterSlides = i.prototype.slickFilter = function (t) { var e = this; null !== t && (e.$slidesCache = e.$slides, e.unload(), e.$slideTrack.children(this.options.slide).detach(), e.$slidesCache.filter(t).appendTo(e.$slideTrack), e.reinit()) }, i.prototype.focusHandler = function () { var e = this; e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick", "*", function (i) { i.stopImmediatePropagation(); var s = t(this); setTimeout(function () { e.options.pauseOnFocus && (e.focussed = s.is(":focus"), e.autoPlay()) }, 0) }) }, i.prototype.getCurrent = i.prototype.slickCurrentSlide = function () { return this.currentSlide }, i.prototype.getDotCount = function () { var t = this, e = 0, i = 0, s = 0; if (!0 === t.options.infinite) if (t.slideCount <= t.options.slidesToShow)++s; else for (; e < t.slideCount;)++s, e = i + t.options.slidesToScroll, i += t.options.slidesToScroll <= t.options.slidesToShow ? t.options.slidesToScroll : t.options.slidesToShow; else if (!0 === t.options.centerMode) s = t.slideCount; else if (t.options.asNavFor) for (; e < t.slideCount;)++s, e = i + t.options.slidesToScroll, i += t.options.slidesToScroll <= t.options.slidesToShow ? t.options.slidesToScroll : t.options.slidesToShow; else s = 1 + Math.ceil((t.slideCount - t.options.slidesToShow) / t.options.slidesToScroll); return s - 1 }, i.prototype.getLeft = function (t) { var e, i, s, o, n = this, a = 0; return n.slideOffset = 0, i = n.$slides.first().outerHeight(!0), !0 === n.options.infinite ? (n.slideCount > n.options.slidesToShow && (n.slideOffset = n.slideWidth * n.options.slidesToShow * -1, o = -1, !0 === n.options.vertical && !0 === n.options.centerMode && (2 === n.options.slidesToShow ? o = -1.5 : 1 === n.options.slidesToShow && (o = -2)), a = i * n.options.slidesToShow * o), n.slideCount % n.options.slidesToScroll != 0 && t + n.options.slidesToScroll > n.slideCount && n.slideCount > n.options.slidesToShow && (t > n.slideCount ? (n.slideOffset = (n.options.slidesToShow - (t - n.slideCount)) * n.slideWidth * -1, a = (n.options.slidesToShow - (t - n.slideCount)) * i * -1) : (n.slideOffset = n.slideCount % n.options.slidesToScroll * n.slideWidth * -1, a = n.slideCount % n.options.slidesToScroll * i * -1))) : t + n.options.slidesToShow > n.slideCount && (n.slideOffset = (t + n.options.slidesToShow - n.slideCount) * n.slideWidth, a = (t + n.options.slidesToShow - n.slideCount) * i), n.slideCount <= n.options.slidesToShow && (n.slideOffset = 0, a = 0), !0 === n.options.centerMode && n.slideCount <= n.options.slidesToShow ? n.slideOffset = n.slideWidth * Math.floor(n.options.slidesToShow) / 2 - n.slideWidth * n.slideCount / 2 : !0 === n.options.centerMode && !0 === n.options.infinite ? n.slideOffset += n.slideWidth * Math.floor(n.options.slidesToShow / 2) - n.slideWidth : !0 === n.options.centerMode && (n.slideOffset = 0, n.slideOffset += n.slideWidth * Math.floor(n.options.slidesToShow / 2)), e = !1 === n.options.vertical ? t * n.slideWidth * -1 + n.slideOffset : t * i * -1 + a, !0 === n.options.variableWidth && (s = n.slideCount <= n.options.slidesToShow || !1 === n.options.infinite ? n.$slideTrack.children(".slick-slide").eq(t) : n.$slideTrack.children(".slick-slide").eq(t + n.options.slidesToShow), e = !0 === n.options.rtl ? s[0] ? -1 * (n.$slideTrack.width() - s[0].offsetLeft - s.width()) : 0 : s[0] ? -1 * s[0].offsetLeft : 0, !0 === n.options.centerMode && (s = n.slideCount <= n.options.slidesToShow || !1 === n.options.infinite ? n.$slideTrack.children(".slick-slide").eq(t) : n.$slideTrack.children(".slick-slide").eq(t + n.options.slidesToShow + 1), e = !0 === n.options.rtl ? s[0] ? -1 * (n.$slideTrack.width() - s[0].offsetLeft - s.width()) : 0 : s[0] ? -1 * s[0].offsetLeft : 0, e += (n.$list.width() - s.outerWidth()) / 2)), e }, i.prototype.getOption = i.prototype.slickGetOption = function (t) { return this.options[t] }, i.prototype.getNavigableIndexes = function () { var t, e = this, i = 0, s = 0, o = []; for (!1 === e.options.infinite ? t = e.slideCount : (i = -1 * e.options.slidesToScroll, s = -1 * e.options.slidesToScroll, t = 2 * e.slideCount); i < t;)o.push(i), i = s + e.options.slidesToScroll, s += e.options.slidesToScroll <= e.options.slidesToShow ? e.options.slidesToScroll : e.options.slidesToShow; return o }, i.prototype.getSlick = function () { return this }, i.prototype.getSlideCount = function () { var e, i, s = this; return i = !0 === s.options.centerMode ? s.slideWidth * Math.floor(s.options.slidesToShow / 2) : 0, !0 === s.options.swipeToSlide ? (s.$slideTrack.find(".slick-slide").each(function (o, n) { if (n.offsetLeft - i + t(n).outerWidth() / 2 > -1 * s.swipeLeft) return e = n, !1 }), Math.abs(t(e).attr("data-slick-index") - s.currentSlide) || 1) : s.options.slidesToScroll }, i.prototype.goTo = i.prototype.slickGoTo = function (t, e) { this.changeSlide({ data: { message: "index", index: parseInt(t) } }, e) }, i.prototype.init = function (e) { var i = this; t(i.$slider).hasClass("slick-initialized") || (t(i.$slider).addClass("slick-initialized"), i.buildRows(), i.buildOut(), i.setProps(), i.startLoad(), i.loadSlider(), i.initializeEvents(), i.updateArrows(), i.updateDots(), i.checkResponsive(!0), i.focusHandler()), e && i.$slider.trigger("init", [i]), !0 === i.options.accessibility && i.initADA(), i.options.autoplay && (i.paused = !1, i.autoPlay()) }, i.prototype.initADA = function () { var e = this, i = Math.ceil(e.slideCount / e.options.slidesToShow), s = e.getNavigableIndexes().filter(function (t) { return t >= 0 && t < e.slideCount }); e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({ "aria-hidden": "true", tabindex: "-1" }).find("a, input, button, select").attr({ tabindex: "-1" }), null !== e.$dots && (e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function (i) { var o = s.indexOf(i); t(this).attr({ role: "tabpanel", id: "slick-slide" + e.instanceUid + i, tabindex: -1 }), -1 !== o && t(this).attr({ "aria-describedby": "slick-slide-control" + e.instanceUid + o }) }), e.$dots.attr("role", "tablist").find("li").each(function (o) { var n = s[o]; t(this).attr({ role: "presentation" }), t(this).find("button").first().attr({ role: "tab", id: "slick-slide-control" + e.instanceUid + o, "aria-controls": "slick-slide" + e.instanceUid + n, "aria-label": o + 1 + " of " + i, "aria-selected": null, tabindex: "-1" }) }).eq(e.currentSlide).find("button").attr({ "aria-selected": "true", tabindex: "0" }).end()); for (var o = e.currentSlide, n = o + e.options.slidesToShow; o < n; o++)e.$slides.eq(o).attr("tabindex", 0); e.activateADA() }, i.prototype.initArrowEvents = function () { var t = this; !0 === t.options.arrows && t.slideCount > t.options.slidesToShow && (t.$prevArrow.off("click.slick").on("click.slick", { message: "previous" }, t.changeSlide), t.$nextArrow.off("click.slick").on("click.slick", { message: "next" }, t.changeSlide), !0 === t.options.accessibility && (t.$prevArrow.on("keydown.slick", t.keyHandler), t.$nextArrow.on("keydown.slick", t.keyHandler))) }, i.prototype.initDotEvents = function () { var e = this; !0 === e.options.dots && (t("li", e.$dots).on("click.slick", { message: "index" }, e.changeSlide), !0 === e.options.accessibility && e.$dots.on("keydown.slick", e.keyHandler)), !0 === e.options.dots && !0 === e.options.pauseOnDotsHover && t("li", e.$dots).on("mouseenter.slick", t.proxy(e.interrupt, e, !0)).on("mouseleave.slick", t.proxy(e.interrupt, e, !1)) }, i.prototype.initSlideEvents = function () { var e = this; e.options.pauseOnHover && (e.$list.on("mouseenter.slick", t.proxy(e.interrupt, e, !0)), e.$list.on("mouseleave.slick", t.proxy(e.interrupt, e, !1))) }, i.prototype.initializeEvents = function () { var e = this; e.initArrowEvents(), e.initDotEvents(), e.initSlideEvents(), e.$list.on("touchstart.slick mousedown.slick", { action: "start" }, e.swipeHandler), e.$list.on("touchmove.slick mousemove.slick", { action: "move" }, e.swipeHandler), e.$list.on("touchend.slick mouseup.slick", { action: "end" }, e.swipeHandler), e.$list.on("touchcancel.slick mouseleave.slick", { action: "end" }, e.swipeHandler), e.$list.on("click.slick", e.clickHandler), t(document).on(e.visibilityChange, t.proxy(e.visibility, e)), !0 === e.options.accessibility && e.$list.on("keydown.slick", e.keyHandler), !0 === e.options.focusOnSelect && t(e.$slideTrack).children().on("click.slick", e.selectHandler), t(window).on("orientationchange.slick.slick-" + e.instanceUid, t.proxy(e.orientationChange, e)), t(window).on("resize.slick.slick-" + e.instanceUid, t.proxy(e.resize, e)), t("[draggable!=true]", e.$slideTrack).on("dragstart", e.preventDefault), t(window).on("load.slick.slick-" + e.instanceUid, e.setPosition), t(e.setPosition) }, i.prototype.initUI = function () { var t = this; !0 === t.options.arrows && t.slideCount > t.options.slidesToShow && (t.$prevArrow.show(), t.$nextArrow.show()), !0 === t.options.dots && t.slideCount > t.options.slidesToShow && t.$dots.show() }, i.prototype.keyHandler = function (t) { var e = this; t.target.tagName.match("TEXTAREA|INPUT|SELECT") || (37 === t.keyCode && !0 === e.options.accessibility ? e.changeSlide({ data: { message: !0 === e.options.rtl ? "next" : "previous" } }) : 39 === t.keyCode && !0 === e.options.accessibility && e.changeSlide({ data: { message: !0 === e.options.rtl ? "previous" : "next" } })) }, i.prototype.lazyLoad = function () { function e(e) { t("img[data-lazy]", e).each(function () { var e = t(this), i = t(this).attr("data-lazy"), s = t(this).attr("data-srcset"), o = t(this).attr("data-sizes") || n.$slider.attr("data-sizes"), a = document.createElement("img"); a.onload = function () { e.animate({ opacity: 0 }, 100, function () { s && (e.attr("srcset", s), o && e.attr("sizes", o)), e.attr("src", i).animate({ opacity: 1 }, 200, function () { e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading") }), n.$slider.trigger("lazyLoaded", [n, e, i]) }) }, a.onerror = function () { e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"), n.$slider.trigger("lazyLoadError", [n, e, i]) }, a.src = i }) } var i, s, o, n = this; if (!0 === n.options.centerMode ? !0 === n.options.infinite ? o = (s = n.currentSlide + (n.options.slidesToShow / 2 + 1)) + n.options.slidesToShow + 2 : (s = Math.max(0, n.currentSlide - (n.options.slidesToShow / 2 + 1)), o = n.options.slidesToShow / 2 + 1 + 2 + n.currentSlide) : (s = n.options.infinite ? n.options.slidesToShow + n.currentSlide : n.currentSlide, o = Math.ceil(s + n.options.slidesToShow), !0 === n.options.fade && (s > 0 && s-- , o <= n.slideCount && o++)), i = n.$slider.find(".slick-slide").slice(s, o), "anticipated" === n.options.lazyLoad) for (var a = s - 1, l = o, r = n.$slider.find(".slick-slide"), d = 0; d < n.options.slidesToScroll; d++)a < 0 && (a = n.slideCount - 1), i = (i = i.add(r.eq(a))).add(r.eq(l)), a-- , l++; e(i), n.slideCount <= n.options.slidesToShow ? e(n.$slider.find(".slick-slide")) : n.currentSlide >= n.slideCount - n.options.slidesToShow ? e(n.$slider.find(".slick-cloned").slice(0, n.options.slidesToShow)) : 0 === n.currentSlide && e(n.$slider.find(".slick-cloned").slice(-1 * n.options.slidesToShow)) }, i.prototype.loadSlider = function () { var t = this; t.setPosition(), t.$slideTrack.css({ opacity: 1 }), t.$slider.removeClass("slick-loading"), t.initUI(), "progressive" === t.options.lazyLoad && t.progressiveLazyLoad() }, i.prototype.next = i.prototype.slickNext = function () { this.changeSlide({ data: { message: "next" } }) }, i.prototype.orientationChange = function () { this.checkResponsive(), this.setPosition() }, i.prototype.pause = i.prototype.slickPause = function () { this.autoPlayClear(), this.paused = !0 }, i.prototype.play = i.prototype.slickPlay = function () { var t = this; t.autoPlay(), t.options.autoplay = !0, t.paused = !1, t.focussed = !1, t.interrupted = !1 }, i.prototype.postSlide = function (e) { var i = this; i.unslicked || (i.$slider.trigger("afterChange", [i, e]), i.animating = !1, i.slideCount > i.options.slidesToShow && i.setPosition(), i.swipeLeft = null, i.options.autoplay && i.autoPlay(), !0 === i.options.accessibility && (i.initADA(), i.options.focusOnChange && t(i.$slides.get(i.currentSlide)).attr("tabindex", 0).focus())) }, i.prototype.prev = i.prototype.slickPrev = function () { this.changeSlide({ data: { message: "previous" } }) }, i.prototype.preventDefault = function (t) { t.preventDefault() }, i.prototype.progressiveLazyLoad = function (e) { e = e || 1; var i, s, o, n, a, l = this, r = t("img[data-lazy]", l.$slider); r.length ? (i = r.first(), s = i.attr("data-lazy"), o = i.attr("data-srcset"), n = i.attr("data-sizes") || l.$slider.attr("data-sizes"), (a = document.createElement("img")).onload = function () { o && (i.attr("srcset", o), n && i.attr("sizes", n)), i.attr("src", s).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"), !0 === l.options.adaptiveHeight && l.setPosition(), l.$slider.trigger("lazyLoaded", [l, i, s]), l.progressiveLazyLoad() }, a.onerror = function () { e < 3 ? setTimeout(function () { l.progressiveLazyLoad(e + 1) }, 500) : (i.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"), l.$slider.trigger("lazyLoadError", [l, i, s]), l.progressiveLazyLoad()) }, a.src = s) : l.$slider.trigger("allImagesLoaded", [l]) }, i.prototype.refresh = function (e) { var i, s, o = this; s = o.slideCount - o.options.slidesToShow, !o.options.infinite && o.currentSlide > s && (o.currentSlide = s), o.slideCount <= o.options.slidesToShow && (o.currentSlide = 0), i = o.currentSlide, o.destroy(!0), t.extend(o, o.initials, { currentSlide: i }), o.init(), e || o.changeSlide({ data: { message: "index", index: i } }, !1) }, i.prototype.registerBreakpoints = function () { var e, i, s, o = this, n = o.options.responsive || null; if ("array" === t.type(n) && n.length) { o.respondTo = o.options.respondTo || "window"; for (e in n) if (s = o.breakpoints.length - 1, n.hasOwnProperty(e)) { for (i = n[e].breakpoint; s >= 0;)o.breakpoints[s] && o.breakpoints[s] === i && o.breakpoints.splice(s, 1), s--; o.breakpoints.push(i), o.breakpointSettings[i] = n[e].settings } o.breakpoints.sort(function (t, e) { return o.options.mobileFirst ? t - e : e - t }) } }, i.prototype.reinit = function () { var e = this; e.$slides = e.$slideTrack.children(e.options.slide).addClass("slick-slide"), e.slideCount = e.$slides.length, e.currentSlide >= e.slideCount && 0 !== e.currentSlide && (e.currentSlide = e.currentSlide - e.options.slidesToScroll), e.slideCount <= e.options.slidesToShow && (e.currentSlide = 0), e.registerBreakpoints(), e.setProps(), e.setupInfinite(), e.buildArrows(), e.updateArrows(), e.initArrowEvents(), e.buildDots(), e.updateDots(), e.initDotEvents(), e.cleanUpSlideEvents(), e.initSlideEvents(), e.checkResponsive(!1, !0), !0 === e.options.focusOnSelect && t(e.$slideTrack).children().on("click.slick", e.selectHandler), e.setSlideClasses("number" == typeof e.currentSlide ? e.currentSlide : 0), e.setPosition(), e.focusHandler(), e.paused = !e.options.autoplay, e.autoPlay(), e.$slider.trigger("reInit", [e]) }, i.prototype.resize = function () { var e = this; t(window).width() !== e.windowWidth && (clearTimeout(e.windowDelay), e.windowDelay = window.setTimeout(function () { e.windowWidth = t(window).width(), e.checkResponsive(), e.unslicked || e.setPosition() }, 50)) }, i.prototype.removeSlide = i.prototype.slickRemove = function (t, e, i) { var s = this; if (t = "boolean" == typeof t ? !0 === (e = t) ? 0 : s.slideCount - 1 : !0 === e ? --t : t, s.slideCount < 1 || t < 0 || t > s.slideCount - 1) return !1; s.unload(), !0 === i ? s.$slideTrack.children().remove() : s.$slideTrack.children(this.options.slide).eq(t).remove(), s.$slides = s.$slideTrack.children(this.options.slide), s.$slideTrack.children(this.options.slide).detach(), s.$slideTrack.append(s.$slides), s.$slidesCache = s.$slides, s.reinit() }, i.prototype.setCSS = function (t) { var e, i, s = this, o = {}; !0 === s.options.rtl && (t = -t), e = "left" == s.positionProp ? Math.ceil(t) + "px" : "0px", i = "top" == s.positionProp ? Math.ceil(t) + "px" : "0px", o[s.positionProp] = t, !1 === s.transformsEnabled ? s.$slideTrack.css(o) : (o = {}, !1 === s.cssTransitions ? (o[s.animType] = "translate(" + e + ", " + i + ")", s.$slideTrack.css(o)) : (o[s.animType] = "translate3d(" + e + ", " + i + ", 0px)", s.$slideTrack.css(o))) }, i.prototype.setDimensions = function () { var t = this; !1 === t.options.vertical ? !0 === t.options.centerMode && t.$list.css({ padding: "0px " + t.options.centerPadding }) : (t.$list.height(t.$slides.first().outerHeight(!0) * t.options.slidesToShow), !0 === t.options.centerMode && t.$list.css({ padding: t.options.centerPadding + " 0px" })), t.listWidth = t.$list.width(), t.listHeight = t.$list.height(), !1 === t.options.vertical && !1 === t.options.variableWidth ? (t.slideWidth = Math.ceil(t.listWidth / t.options.slidesToShow), t.$slideTrack.width(Math.ceil(t.slideWidth * t.$slideTrack.children(".slick-slide").length))) : !0 === t.options.variableWidth ? t.$slideTrack.width(5e3 * t.slideCount) : (t.slideWidth = Math.ceil(t.listWidth), t.$slideTrack.height(Math.ceil(t.$slides.first().outerHeight(!0) * t.$slideTrack.children(".slick-slide").length))); var e = t.$slides.first().outerWidth(!0) - t.$slides.first().width(); !1 === t.options.variableWidth && t.$slideTrack.children(".slick-slide").width(t.slideWidth - e) }, i.prototype.setFade = function () { var e, i = this; i.$slides.each(function (s, o) { e = i.slideWidth * s * -1, !0 === i.options.rtl ? t(o).css({ position: "relative", right: e, top: 0, zIndex: i.options.zIndex - 2, opacity: 0 }) : t(o).css({ position: "relative", left: e, top: 0, zIndex: i.options.zIndex - 2, opacity: 0 }) }), i.$slides.eq(i.currentSlide).css({ zIndex: i.options.zIndex - 1, opacity: 1 }) }, i.prototype.setHeight = function () { var t = this; if (1 === t.options.slidesToShow && !0 === t.options.adaptiveHeight && !1 === t.options.vertical) { var e = t.$slides.eq(t.currentSlide).outerHeight(!0); t.$list.css("height", e) } }, i.prototype.setOption = i.prototype.slickSetOption = function () { var e, i, s, o, n, a = this, l = !1; if ("object" === t.type(arguments[0]) ? (s = arguments[0], l = arguments[1], n = "multiple") : "string" === t.type(arguments[0]) && (s = arguments[0], o = arguments[1], l = arguments[2], "responsive" === arguments[0] && "array" === t.type(arguments[1]) ? n = "responsive" : void 0 !== arguments[1] && (n = "single")), "single" === n) a.options[s] = o; else if ("multiple" === n) t.each(s, function (t, e) { a.options[t] = e }); else if ("responsive" === n) for (i in o) if ("array" !== t.type(a.options.responsive)) a.options.responsive = [o[i]]; else { for (e = a.options.responsive.length - 1; e >= 0;)a.options.responsive[e].breakpoint === o[i].breakpoint && a.options.responsive.splice(e, 1), e--; a.options.responsive.push(o[i]) } l && (a.unload(), a.reinit()) }, i.prototype.setPosition = function () { var t = this; t.setDimensions(), t.setHeight(), !1 === t.options.fade ? t.setCSS(t.getLeft(t.currentSlide)) : t.setFade(), t.$slider.trigger("setPosition", [t]) }, i.prototype.setProps = function () { var t = this, e = document.body.style; t.positionProp = !0 === t.options.vertical ? "top" : "left", "top" === t.positionProp ? t.$slider.addClass("slick-vertical") : t.$slider.removeClass("slick-vertical"), void 0 === e.WebkitTransition && void 0 === e.MozTransition && void 0 === e.msTransition || !0 === t.options.useCSS && (t.cssTransitions = !0), t.options.fade && ("number" == typeof t.options.zIndex ? t.options.zIndex < 3 && (t.options.zIndex = 3) : t.options.zIndex = t.defaults.zIndex), void 0 !== e.OTransform && (t.animType = "OTransform", t.transformType = "-o-transform", t.transitionType = "OTransition", void 0 === e.perspectiveProperty && void 0 === e.webkitPerspective && (t.animType = !1)), void 0 !== e.MozTransform && (t.animType = "MozTransform", t.transformType = "-moz-transform", t.transitionType = "MozTransition", void 0 === e.perspectiveProperty && void 0 === e.MozPerspective && (t.animType = !1)), void 0 !== e.webkitTransform && (t.animType = "webkitTransform", t.transformType = "-webkit-transform", t.transitionType = "webkitTransition", void 0 === e.perspectiveProperty && void 0 === e.webkitPerspective && (t.animType = !1)), void 0 !== e.msTransform && (t.animType = "msTransform", t.transformType = "-ms-transform", t.transitionType = "msTransition", void 0 === e.msTransform && (t.animType = !1)), void 0 !== e.transform && !1 !== t.animType && (t.animType = "transform", t.transformType = "transform", t.transitionType = "transition"), t.transformsEnabled = t.options.useTransform && null !== t.animType && !1 !== t.animType }, i.prototype.setSlideClasses = function (t) { var e, i, s, o, n = this; if (i = n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden", "true"), n.$slides.eq(t).addClass("slick-current"), !0 === n.options.centerMode) { var a = n.options.slidesToShow % 2 == 0 ? 1 : 0; e = Math.floor(n.options.slidesToShow / 2), !0 === n.options.infinite && (t >= e && t <= n.slideCount - 1 - e ? n.$slides.slice(t - e + a, t + e + 1).addClass("slick-active").attr("aria-hidden", "false") : (s = n.options.slidesToShow + t, i.slice(s - e + 1 + a, s + e + 2).addClass("slick-active").attr("aria-hidden", "false")), 0 === t ? i.eq(i.length - 1 - n.options.slidesToShow).addClass("slick-center") : t === n.slideCount - 1 && i.eq(n.options.slidesToShow).addClass("slick-center")), n.$slides.eq(t).addClass("slick-center") } else t >= 0 && t <= n.slideCount - n.options.slidesToShow ? n.$slides.slice(t, t + n.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false") : i.length <= n.options.slidesToShow ? i.addClass("slick-active").attr("aria-hidden", "false") : (o = n.slideCount % n.options.slidesToShow, s = !0 === n.options.infinite ? n.options.slidesToShow + t : t, n.options.slidesToShow == n.options.slidesToScroll && n.slideCount - t < n.options.slidesToShow ? i.slice(s - (n.options.slidesToShow - o), s + o).addClass("slick-active").attr("aria-hidden", "false") : i.slice(s, s + n.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false")); "ondemand" !== n.options.lazyLoad && "anticipated" !== n.options.lazyLoad || n.lazyLoad() }, i.prototype.setupInfinite = function () { var e, i, s, o = this; if (!0 === o.options.fade && (o.options.centerMode = !1), !0 === o.options.infinite && !1 === o.options.fade && (i = null, o.slideCount > o.options.slidesToShow)) { for (s = !0 === o.options.centerMode ? o.options.slidesToShow + 1 : o.options.slidesToShow, e = o.slideCount; e > o.slideCount - s; e -= 1)i = e - 1, t(o.$slides[i]).clone(!0).attr("id", "").attr("data-slick-index", i - o.slideCount).prependTo(o.$slideTrack).addClass("slick-cloned"); for (e = 0; e < s + o.slideCount; e += 1)i = e, t(o.$slides[i]).clone(!0).attr("id", "").attr("data-slick-index", i + o.slideCount).appendTo(o.$slideTrack).addClass("slick-cloned"); o.$slideTrack.find(".slick-cloned").find("[id]").each(function () { t(this).attr("id", "") }) } }, i.prototype.interrupt = function (t) { t || this.autoPlay(), this.interrupted = t }, i.prototype.selectHandler = function (e) { var i = t(e.target).is(".slick-slide") ? t(e.target) : t(e.target).parents(".slick-slide"), s = parseInt(i.attr("data-slick-index")); s || (s = 0), this.slideCount <= this.options.slidesToShow ? this.slideHandler(s, !1, !0) : this.slideHandler(s) }, i.prototype.slideHandler = function (t, e, i) { var s, o, n, a, l, r = null, d = this; if (e = e || !1, !(!0 === d.animating && !0 === d.options.waitForAnimate || !0 === d.options.fade && d.currentSlide === t)) if (!1 === e && d.asNavFor(t), s = t, r = d.getLeft(s), a = d.getLeft(d.currentSlide), d.currentLeft = null === d.swipeLeft ? a : d.swipeLeft, !1 === d.options.infinite && !1 === d.options.centerMode && (t < 0 || t > d.getDotCount() * d.options.slidesToScroll)) !1 === d.options.fade && (s = d.currentSlide, !0 !== i ? d.animateSlide(a, function () { d.postSlide(s) }) : d.postSlide(s)); else if (!1 === d.options.infinite && !0 === d.options.centerMode && (t < 0 || t > d.slideCount - d.options.slidesToScroll)) !1 === d.options.fade && (s = d.currentSlide, !0 !== i ? d.animateSlide(a, function () { d.postSlide(s) }) : d.postSlide(s)); else { if (d.options.autoplay && clearInterval(d.autoPlayTimer), o = s < 0 ? d.slideCount % d.options.slidesToScroll != 0 ? d.slideCount - d.slideCount % d.options.slidesToScroll : d.slideCount + s : s >= d.slideCount ? d.slideCount % d.options.slidesToScroll != 0 ? 0 : s - d.slideCount : s, d.animating = !0, d.$slider.trigger("beforeChange", [d, d.currentSlide, o]), n = d.currentSlide, d.currentSlide = o, d.setSlideClasses(d.currentSlide), d.options.asNavFor && (l = (l = d.getNavTarget()).slick("getSlick")).slideCount <= l.options.slidesToShow && l.setSlideClasses(d.currentSlide), d.updateDots(), d.updateArrows(), !0 === d.options.fade) return !0 !== i ? (d.fadeSlideOut(n), d.fadeSlide(o, function () { d.postSlide(o) })) : d.postSlide(o), void d.animateHeight(); !0 !== i ? d.animateSlide(r, function () { d.postSlide(o) }) : d.postSlide(o) } }, i.prototype.startLoad = function () { var t = this; !0 === t.options.arrows && t.slideCount > t.options.slidesToShow && (t.$prevArrow.hide(), t.$nextArrow.hide()), !0 === t.options.dots && t.slideCount > t.options.slidesToShow && t.$dots.hide(), t.$slider.addClass("slick-loading") }, i.prototype.swipeDirection = function () { var t, e, i, s, o = this; return t = o.touchObject.startX - o.touchObject.curX, e = o.touchObject.startY - o.touchObject.curY, i = Math.atan2(e, t), (s = Math.round(180 * i / Math.PI)) < 0 && (s = 360 - Math.abs(s)), s <= 45 && s >= 0 ? !1 === o.options.rtl ? "left" : "right" : s <= 360 && s >= 315 ? !1 === o.options.rtl ? "left" : "right" : s >= 135 && s <= 225 ? !1 === o.options.rtl ? "right" : "left" : !0 === o.options.verticalSwiping ? s >= 35 && s <= 135 ? "down" : "up" : "vertical" }, i.prototype.swipeEnd = function (t) { var e, i, s = this; if (s.dragging = !1, s.swiping = !1, s.scrolling) return s.scrolling = !1, !1; if (s.interrupted = !1, s.shouldClick = !(s.touchObject.swipeLength > 10), void 0 === s.touchObject.curX) return !1; if (!0 === s.touchObject.edgeHit && s.$slider.trigger("edge", [s, s.swipeDirection()]), s.touchObject.swipeLength >= s.touchObject.minSwipe) { switch (i = s.swipeDirection()) { case "left": case "down": e = s.options.swipeToSlide ? s.checkNavigable(s.currentSlide + s.getSlideCount()) : s.currentSlide + s.getSlideCount(), s.currentDirection = 0; break; case "right": case "up": e = s.options.swipeToSlide ? s.checkNavigable(s.currentSlide - s.getSlideCount()) : s.currentSlide - s.getSlideCount(), s.currentDirection = 1 }"vertical" != i && (s.slideHandler(e), s.touchObject = {}, s.$slider.trigger("swipe", [s, i])) } else s.touchObject.startX !== s.touchObject.curX && (s.slideHandler(s.currentSlide), s.touchObject = {}) }, i.prototype.swipeHandler = function (t) { var e = this; if (!(!1 === e.options.swipe || "ontouchend" in document && !1 === e.options.swipe || !1 === e.options.draggable && -1 !== t.type.indexOf("mouse"))) switch (e.touchObject.fingerCount = t.originalEvent && void 0 !== t.originalEvent.touches ? t.originalEvent.touches.length : 1, e.touchObject.minSwipe = e.listWidth / e.options.touchThreshold, !0 === e.options.verticalSwiping && (e.touchObject.minSwipe = e.listHeight / e.options.touchThreshold), t.data.action) { case "start": e.swipeStart(t); break; case "move": e.swipeMove(t); break; case "end": e.swipeEnd(t) } }, i.prototype.swipeMove = function (t) { var e, i, s, o, n, a, l = this; return n = void 0 !== t.originalEvent ? t.originalEvent.touches : null, !(!l.dragging || l.scrolling || n && 1 !== n.length) && (e = l.getLeft(l.currentSlide), l.touchObject.curX = void 0 !== n ? n[0].pageX : t.clientX, l.touchObject.curY = void 0 !== n ? n[0].pageY : t.clientY, l.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(l.touchObject.curX - l.touchObject.startX, 2))), a = Math.round(Math.sqrt(Math.pow(l.touchObject.curY - l.touchObject.startY, 2))), !l.options.verticalSwiping && !l.swiping && a > 4 ? (l.scrolling = !0, !1) : (!0 === l.options.verticalSwiping && (l.touchObject.swipeLength = a), i = l.swipeDirection(), void 0 !== t.originalEvent && l.touchObject.swipeLength > 4 && (l.swiping = !0, t.preventDefault()), o = (!1 === l.options.rtl ? 1 : -1) * (l.touchObject.curX > l.touchObject.startX ? 1 : -1), !0 === l.options.verticalSwiping && (o = l.touchObject.curY > l.touchObject.startY ? 1 : -1), s = l.touchObject.swipeLength, l.touchObject.edgeHit = !1, !1 === l.options.infinite && (0 === l.currentSlide && "right" === i || l.currentSlide >= l.getDotCount() && "left" === i) && (s = l.touchObject.swipeLength * l.options.edgeFriction, l.touchObject.edgeHit = !0), !1 === l.options.vertical ? l.swipeLeft = e + s * o : l.swipeLeft = e + s * (l.$list.height() / l.listWidth) * o, !0 === l.options.verticalSwiping && (l.swipeLeft = e + s * o), !0 !== l.options.fade && !1 !== l.options.touchMove && (!0 === l.animating ? (l.swipeLeft = null, !1) : void l.setCSS(l.swipeLeft)))) }, i.prototype.swipeStart = function (t) { var e, i = this; if (i.interrupted = !0, 1 !== i.touchObject.fingerCount || i.slideCount <= i.options.slidesToShow) return i.touchObject = {}, !1; void 0 !== t.originalEvent && void 0 !== t.originalEvent.touches && (e = t.originalEvent.touches[0]), i.touchObject.startX = i.touchObject.curX = void 0 !== e ? e.pageX : t.clientX, i.touchObject.startY = i.touchObject.curY = void 0 !== e ? e.pageY : t.clientY, i.dragging = !0 }, i.prototype.unfilterSlides = i.prototype.slickUnfilter = function () { var t = this; null !== t.$slidesCache && (t.unload(), t.$slideTrack.children(this.options.slide).detach(), t.$slidesCache.appendTo(t.$slideTrack), t.reinit()) }, i.prototype.unload = function () { var e = this; t(".slick-cloned", e.$slider).remove(), e.$dots && e.$dots.remove(), e.$prevArrow && e.htmlExpr.test(e.options.prevArrow) && e.$prevArrow.remove(), e.$nextArrow && e.htmlExpr.test(e.options.nextArrow) && e.$nextArrow.remove(), e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden", "true").css("width", "") }, i.prototype.unslick = function (t) { this.$slider.trigger("unslick", [this, t]), this.destroy() }, i.prototype.updateArrows = function () { var t = this; Math.floor(t.options.slidesToShow / 2), !0 === t.options.arrows && t.slideCount > t.options.slidesToShow && !t.options.infinite && (t.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), t.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), 0 === t.currentSlide ? (t.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true"), t.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : t.currentSlide >= t.slideCount - t.options.slidesToShow && !1 === t.options.centerMode ? (t.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), t.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : t.currentSlide >= t.slideCount - 1 && !0 === t.options.centerMode && (t.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), t.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"))) }, i.prototype.updateDots = function () { var t = this; null !== t.$dots && (t.$dots.find("li").removeClass("slick-active").end(), t.$dots.find("li").eq(Math.floor(t.currentSlide / t.options.slidesToScroll)).addClass("slick-active")) }, i.prototype.visibility = function () { this.options.autoplay && (document[this.hidden] ? this.interrupted = !0 : this.interrupted = !1) }, t.fn.slick = function () { var t, e, s = this, o = arguments[0], n = Array.prototype.slice.call(arguments, 1), a = s.length; for (t = 0; t < a; t++)if ("object" == typeof o || void 0 === o ? s[t].slick = new i(s[t], o) : e = s[t].slick[o].apply(s[t].slick, n), void 0 !== e) return e; return s } }), function (t) { t.fn.matchHeights = function (e) { var i = (e = jQuery.extend(this, { minHeight: null, maxHeight: null, extension: 0, overflow: null, includeMargin: !1 }, e)).extension, s = e.minHeight ? e.minHeight : 0; return this.each(function () { s = Math.max(s, t(this).outerHeight()) }), e.maxHeight && s > e.maxHeight && (s = e.maxHeight), this.each(function () { var o = t(this), n = o.innerHeight() - o.height() + (o.outerHeight(e.includeMargin) - o.innerHeight()); e.overflow ? o.css({ height: s - n + i, overflow: e.overflow }) : o.css({ "min-height": s - n + i }) }) } }(jQuery), function (t) { "use strict"; !function (t) { function e(e) { return !e.nodeName || -1 !== t.inArray(e.nodeName.toLowerCase(), ["iframe", "#document", "html", "body"]) } function i(e) { return t.isFunction(e) || t.isPlainObject(e) ? e : { top: e, left: e } } var s = t.scrollTo = function (e, i, s) { return t(window).scrollTo(e, i, s) }; s.defaults = { axis: "xy", duration: 0, limit: !0 }, t.fn.scrollTo = function (o, n, a) { "object" == typeof n && (a = n, n = 0), "function" == typeof a && (a = { onAfter: a }), "max" === o && (o = 9e9), a = t.extend({}, s.defaults, a), n = n || a.duration; var l = a.queue && 1 < a.axis.length; return l && (n /= 2), a.offset = i(a.offset), a.over = i(a.over), this.each(function () { function r(e) { var i = t.extend({}, a, { queue: !0, duration: n, complete: e && function () { e.call(h, u, a) } }); p.animate(f, i) } if (null !== o) { var d, c = e(this), h = c ? this.contentWindow || window : this, p = t(h), u = o, f = {}; switch (typeof u) { case "number": case "string": if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(u)) { u = i(u); break } u = c ? t(u) : t(u, h); case "object": if (0 === u.length) return; (u.is || u.style) && (d = (u = t(u)).offset()) }var g = t.isFunction(a.offset) && a.offset(h, u) || a.offset; t.each(a.axis.split(""), function (t, e) { var i = "x" === e ? "Left" : "Top", o = i.toLowerCase(), n = "scroll" + i, v = p[n](), m = s.max(h, e); d ? (f[n] = d[o] + (c ? 0 : v - p.offset()[o]), a.margin && (f[n] -= parseInt(u.css("margin" + i), 10) || 0, f[n] -= parseInt(u.css("border" + i + "Width"), 10) || 0), f[n] += g[o] || 0, a.over[o] && (f[n] += u["x" === e ? "width" : "height"]() * a.over[o])) : (i = u[o], f[n] = i.slice && "%" === i.slice(-1) ? parseFloat(i) / 100 * m : i), a.limit && /^\d+$/.test(f[n]) && (f[n] = 0 >= f[n] ? 0 : Math.min(f[n], m)), !t && 1 < a.axis.length && (v === f[n] ? f = {} : l && (r(a.onAfterFirst), f = {})) }), r(a.onAfter) } }) }, s.max = function (i, s) { var o = "scroll" + (n = "x" === s ? "Width" : "Height"); if (!e(i)) return i[o] - t(i)[n.toLowerCase()](); var n = "client" + n, a = (l = i.ownerDocument || i.document).documentElement, l = l.body; return Math.max(a[o], l[o]) - Math.min(a[n], l[n]) }, t.Tween.propHooks.scrollLeft = t.Tween.propHooks.scrollTop = { get: function (e) { return t(e.elem)[e.prop]() }, set: function (e) { var i = this.get(e); if (e.options.interrupt && e._last && e._last !== i) return t(e.elem).stop(); var s = Math.round(e.now); i !== s && (t(e.elem)[e.prop](s), e._last = this.get(e)) } } }(jQuery) }(), function (t) { var e = t(window), i = [], s = [], o = !1, n = 0, a = { top: 0, right: 0, bottom: 0, left: 0 }; function l() { ++n; var o, l, r, d, c, h = e.scrollTop(), p = e.scrollLeft(), u = p + e.width(), f = h + e.height(), g = (o = h + a.top, l = u + a.right, r = f + a.bottom, d = p + a.left, c = t(), t.each(i, function (t, e) { var i = e.offset().top, s = e.offset().left, n = s + e.width(), a = i + e.height(); !(s > l || n < d || i > r || a < o) && c.push(e) }), c); t.each(g, function (t, e) { "number" != typeof e.data("scrollSpy:ticks") && e.triggerHandler("scrollSpy:enter"), e.data("scrollSpy:ticks", n) }), t.each(s, function (t, e) { var i = e.data("scrollSpy:ticks"); "number" == typeof i && i !== n && (e.triggerHandler("scrollSpy:exit"), e.data("scrollSpy:ticks", null)) }), s = g } function r() { e.trigger("scrollSpy:winSize") } var d = Date.now || function () { return (new Date).getTime() }; function c(t, e, i) { var s, o, n, a = null, l = 0; i || (i = {}); var r = function () { l = !1 === i.leading ? 0 : d(), a = null, n = t.apply(s, o), s = o = null }; return function () { var c = d(); l || !1 !== i.leading || (l = c); var h = e - (c - l); return s = this, o = arguments, h <= 0 ? (clearTimeout(a), a = null, l = c, n = t.apply(s, o), s = o = null) : a || !1 === i.trailing || (a = setTimeout(r, h)), n } } t.scrollSpy = function (s, n) { (s = t(s)).each(function (e, s) { i.push(t(s)) }), n = n || { throttle: 100 }, a.top = n.offsetTop || 0, a.right = n.offsetRight || 0, a.bottom = n.offsetBottom || 0, a.left = n.offsetLeft || 0; var r = c(l, n.throttle || 100), d = function () { t(document).ready(r) }; return o || (e.on("scroll", d), e.on("resize", d), o = !0), setTimeout(d, 0), s }, t.winSizeSpy = function (i) { return t.winSizeSpy = function () { return e }, i = i || { throttle: 100 }, e.on("resize", c(r, i.throttle || 100)) }, t.fn.scrollSpy = function (e) { return t.scrollSpy(t(this), e) } }(jQuery), function (t, e) { function i() { return new Date(Date.UTC.apply(Date, arguments)) } function s() { var t = new Date; return i(t.getFullYear(), t.getMonth(), t.getDate()) } function o(t) { return function () { return this[t].apply(this, arguments) } } var n, a = (n = { get: function (t) { return this.slice(t)[0] }, contains: function (t) { for (var e = t && t.valueOf(), i = 0, s = this.length; s > i; i++)if (this[i].valueOf() === e) return i; return -1 }, remove: function (t) { this.splice(t, 1) }, replace: function (e) { e && (t.isArray(e) || (e = [e]), this.clear(), this.push.apply(this, e)) }, clear: function () { this.length = 0 }, copy: function () { var t = new a; return t.replace(this), t } }, function () { var e = []; return e.push.apply(e, arguments), t.extend(e, n), e }), l = function (e, i) { this._process_options(i), this.dates = new a, this.viewDate = this.o.defaultViewDate, this.focusDate = null, this.element = t(e), this.isInline = !1, this.isInput = this.element.is("input"), this.component = !!this.element.hasClass("date") && this.element.find(".add-on, .input-group-addon, .btn"), this.hasInput = this.component && this.element.find("input").length, this.component && 0 === this.component.length && (this.component = !1), this.picker = t(f.template), this._buildEvents(), this._attachEvents(), this.isInline ? this.picker.addClass("datepicker-inline").appendTo(this.element) : this.picker.addClass("datepicker-dropdown dropdown-menu"), this.o.rtl && this.picker.addClass("datepicker-rtl"), this.viewMode = this.o.startView, this.o.calendarWeeks && this.picker.find("tfoot .today, tfoot .clear").attr("colspan", function (t, e) { return parseInt(e) + 1 }), this._allow_update = !1, this.setStartDate(this._o.startDate), this.setEndDate(this._o.endDate), this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled), this.setDaysOfWeekHighlighted(this.o.daysOfWeekHighlighted), this.setDatesDisabled(this.o.datesDisabled), this.fillDow(), this.fillMonths(), this._allow_update = !0, this.update(), this.showMode(), this.isInline && this.show() }; l.prototype = { constructor: l, _process_options: function (o) { this._o = t.extend({}, this._o, o); var n = this.o = t.extend({}, this._o), a = n.language; switch (u[a] || (a = a.split("-")[0], u[a] || (a = h.language)), n.language = a, n.startView) { case 2: case "decade": n.startView = 2; break; case 1: case "year": n.startView = 1; break; default: n.startView = 0 }switch (n.minViewMode) { case 1: case "months": n.minViewMode = 1; break; case 2: case "years": n.minViewMode = 2; break; default: n.minViewMode = 0 }switch (n.maxViewMode) { case 0: case "days": n.maxViewMode = 0; break; case 1: case "months": n.maxViewMode = 1; break; default: n.maxViewMode = 2 }n.startView = Math.min(n.startView, n.maxViewMode), n.startView = Math.max(n.startView, n.minViewMode), !0 !== n.multidate && (n.multidate = Number(n.multidate) || !1, !1 !== n.multidate && (n.multidate = Math.max(0, n.multidate))), n.multidateSeparator = String(n.multidateSeparator), n.weekStart %= 7, n.weekEnd = (n.weekStart + 6) % 7; var l = f.parseFormat(n.format); if (n.startDate !== -1 / 0 && (n.startDate = n.startDate ? n.startDate instanceof Date ? this._local_to_utc(this._zero_time(n.startDate)) : f.parseDate(n.startDate, l, n.language) : -1 / 0), n.endDate !== 1 / 0 && (n.endDate = n.endDate ? n.endDate instanceof Date ? this._local_to_utc(this._zero_time(n.endDate)) : f.parseDate(n.endDate, l, n.language) : 1 / 0), n.daysOfWeekDisabled = n.daysOfWeekDisabled || [], t.isArray(n.daysOfWeekDisabled) || (n.daysOfWeekDisabled = n.daysOfWeekDisabled.split(/[,\s]*/)), n.daysOfWeekDisabled = t.map(n.daysOfWeekDisabled, function (t) { return parseInt(t, 10) }), n.daysOfWeekHighlighted = n.daysOfWeekHighlighted || [], t.isArray(n.daysOfWeekHighlighted) || (n.daysOfWeekHighlighted = n.daysOfWeekHighlighted.split(/[,\s]*/)), n.daysOfWeekHighlighted = t.map(n.daysOfWeekHighlighted, function (t) { return parseInt(t, 10) }), n.datesDisabled = n.datesDisabled || [], !t.isArray(n.datesDisabled)) { var r = []; r.push(f.parseDate(n.datesDisabled, l, n.language)), n.datesDisabled = r } n.datesDisabled = t.map(n.datesDisabled, function (t) { return f.parseDate(t, l, n.language) }); var d = String(n.orientation).toLowerCase().split(/\s+/g), c = n.orientation.toLowerCase(); if (d = t.grep(d, function (t) { return /^auto|left|right|top|bottom$/.test(t) }), n.orientation = { x: "auto", y: "auto" }, c && "auto" !== c) if (1 === d.length) switch (d[0]) { case "top": case "bottom": n.orientation.y = d[0]; break; case "left": case "right": n.orientation.x = d[0] } else c = t.grep(d, function (t) { return /^left|right$/.test(t) }), n.orientation.x = c[0] || "auto", c = t.grep(d, function (t) { return /^top|bottom$/.test(t) }), n.orientation.y = c[0] || "auto"; if (n.defaultViewDate) { var p = n.defaultViewDate.year || (new Date).getFullYear(), g = n.defaultViewDate.month || 0, v = n.defaultViewDate.day || 1; n.defaultViewDate = i(p, g, v) } else n.defaultViewDate = s(); n.showOnFocus = n.showOnFocus === e || n.showOnFocus, n.zIndexOffset = n.zIndexOffset !== e ? n.zIndexOffset : 10 }, _events: [], _secondaryEvents: [], _applyEvents: function (t) { for (var i, s, o, n = 0; n < t.length; n++)i = t[n][0], 2 === t[n].length ? (s = e, o = t[n][1]) : 3 === t[n].length && (s = t[n][1], o = t[n][2]), i.on(o, s) }, _unapplyEvents: function (t) { for (var i, s, o, n = 0; n < t.length; n++)i = t[n][0], 2 === t[n].length ? (o = e, s = t[n][1]) : 3 === t[n].length && (o = t[n][1], s = t[n][2]), i.off(s, o) }, _buildEvents: function () { var e = { keyup: t.proxy(function (e) { -1 === t.inArray(e.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) && this.update() }, this), keydown: t.proxy(this.keydown, this), paste: t.proxy(this.paste, this) }; !0 === this.o.showOnFocus && (e.focus = t.proxy(this.show, this)), this.isInput ? this._events = [[this.element, e]] : this.component && this.hasInput ? this._events = [[this.element.find("input"), e], [this.component, { click: t.proxy(this.show, this) }]] : this.element.is("div") ? this.isInline = !0 : this._events = [[this.element, { click: t.proxy(this.show, this) }]], this._events.push([this.element, "*", { blur: t.proxy(function (t) { this._focused_from = t.target }, this) }], [this.element, { blur: t.proxy(function (t) { this._focused_from = t.target }, this) }]), this.o.immediateUpdates && this._events.push([this.element, { "changeYear changeMonth": t.proxy(function (t) { this.update(t.date) }, this) }]), this._secondaryEvents = [[this.picker, { click: t.proxy(this.click, this) }], [t(window), { resize: t.proxy(this.place, this) }], [t(document), { mousedown: t.proxy(function (t) { this.element.is(t.target) || this.element.find(t.target).length || this.picker.is(t.target) || this.picker.find(t.target).length || this.picker.hasClass("datepicker-inline") || this.hide() }, this) }]] }, _attachEvents: function () { this._detachEvents(), this._applyEvents(this._events) }, _detachEvents: function () { this._unapplyEvents(this._events) }, _attachSecondaryEvents: function () { this._detachSecondaryEvents(), this._applyEvents(this._secondaryEvents) }, _detachSecondaryEvents: function () { this._unapplyEvents(this._secondaryEvents) }, _trigger: function (e, i) { var s = i || this.dates.get(-1), o = this._utc_to_local(s); this.element.trigger({ type: e, date: o, dates: t.map(this.dates, this._utc_to_local), format: t.proxy(function (t, e) { 0 === arguments.length ? (t = this.dates.length - 1, e = this.o.format) : "string" == typeof t && (e = t, t = this.dates.length - 1), e = e || this.o.format; var i = this.dates.get(t); return f.formatDate(i, e, this.o.language) }, this) }) }, show: function () { return this.element.attr("readonly") && !1 === this.o.enableOnReadonly ? void 0 : (this.isInline || this.picker.appendTo(this.o.container), this.place(), this.picker.show(), this._attachSecondaryEvents(), this._trigger("show"), (window.navigator.msMaxTouchPoints || "ontouchstart" in document) && this.o.disableTouchKeyboard && t(this.element).blur(), this) }, hide: function () { return this.isInline ? this : this.picker.is(":visible") ? (this.focusDate = null, this.picker.hide().detach(), this._detachSecondaryEvents(), this.viewMode = this.o.startView, this.showMode(), this.o.forceParse && (this.isInput && this.element.val() || this.hasInput && this.element.find("input").val()) && this.setValue(), this._trigger("hide"), this) : this }, remove: function () { return this.hide(), this._detachEvents(), this._detachSecondaryEvents(), this.picker.remove(), delete this.element.data().datepicker, this.isInput || delete this.element.data().date, this }, paste: function (e) { var i; if (e.originalEvent.clipboardData && e.originalEvent.clipboardData.types && -1 !== t.inArray("text/plain", e.originalEvent.clipboardData.types)) i = e.originalEvent.clipboardData.getData("text/plain"); else { if (!window.clipboardData) return; i = window.clipboardData.getData("Text") } this.setDate(i), this.update(), e.preventDefault() }, _utc_to_local: function (t) { return t && new Date(t.getTime() + 6e4 * t.getTimezoneOffset()) }, _local_to_utc: function (t) { return t && new Date(t.getTime() - 6e4 * t.getTimezoneOffset()) }, _zero_time: function (t) { return t && new Date(t.getFullYear(), t.getMonth(), t.getDate()) }, _zero_utc_time: function (t) { return t && new Date(Date.UTC(t.getUTCFullYear(), t.getUTCMonth(), t.getUTCDate())) }, getDates: function () { return t.map(this.dates, this._utc_to_local) }, getUTCDates: function () { return t.map(this.dates, function (t) { return new Date(t) }) }, getDate: function () { return this._utc_to_local(this.getUTCDate()) }, getUTCDate: function () { var t = this.dates.get(-1); return void 0 !== t ? new Date(t) : null }, clearDates: function () { var t; this.isInput ? t = this.element : this.component && (t = this.element.find("input")), t && t.val(""), this.update(), this._trigger("changeDate"), this.o.autoclose && this.hide() }, setDates: function () { var e = t.isArray(arguments[0]) ? arguments[0] : arguments; return this.update.apply(this, e), this._trigger("changeDate"), this.setValue(), this }, setUTCDates: function () { var e = t.isArray(arguments[0]) ? arguments[0] : arguments; return this.update.apply(this, t.map(e, this._utc_to_local)), this._trigger("changeDate"), this.setValue(), this }, setDate: o("setDates"), setUTCDate: o("setUTCDates"), setValue: function () { var t = this.getFormattedDate(); return this.isInput ? this.element.val(t) : this.component && this.element.find("input").val(t), this }, getFormattedDate: function (i) { i === e && (i = this.o.format); var s = this.o.language; return t.map(this.dates, function (t) { return f.formatDate(t, i, s) }).join(this.o.multidateSeparator) }, setStartDate: function (t) { return this._process_options({ startDate: t }), this.update(), this.updateNavArrows(), this }, setEndDate: function (t) { return this._process_options({ endDate: t }), this.update(), this.updateNavArrows(), this }, setDaysOfWeekDisabled: function (t) { return this._process_options({ daysOfWeekDisabled: t }), this.update(), this.updateNavArrows(), this }, setDaysOfWeekHighlighted: function (t) { return this._process_options({ daysOfWeekHighlighted: t }), this.update(), this }, setDatesDisabled: function (t) { this._process_options({ datesDisabled: t }), this.update(), this.updateNavArrows() }, place: function () { if (this.isInline) return this; var e = this.picker.outerWidth(), i = this.picker.outerHeight(), s = t(this.o.container), o = s.width(), n = s.scrollTop(), a = s.offset(), l = []; this.element.parents().each(function () { var e = t(this).css("z-index"); "auto" !== e && 0 !== e && l.push(parseInt(e)) }); var r = Math.max.apply(Math, l) + this.o.zIndexOffset, d = this.component ? this.component.parent().offset() : this.element.offset(), c = this.component ? this.component.outerHeight(!0) : this.element.outerHeight(!1), h = this.component ? this.component.outerWidth(!0) : this.element.outerWidth(!1), p = d.left - a.left, u = d.top - a.top; this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"), "auto" !== this.o.orientation.x ? (this.picker.addClass("datepicker-orient-" + this.o.orientation.x), "right" === this.o.orientation.x && (p -= e - h)) : d.left < 0 ? (this.picker.addClass("datepicker-orient-left"), p -= d.left - 10) : p + e > o ? (this.picker.addClass("datepicker-orient-right"), p = d.left + h - e) : this.picker.addClass("datepicker-orient-left"); var f = this.o.orientation.y; if ("auto" === f && (f = 0 > -n + u - i ? "bottom" : "top"), this.picker.addClass("datepicker-orient-" + f), "top" === f ? u -= i + parseInt(this.picker.css("padding-top")) : u += c, this.o.rtl) { var g = o - (p + h); this.picker.css({ top: u, right: g, zIndex: r }) } else this.picker.css({ top: u, left: p, zIndex: r }); return this }, _allow_update: !0, update: function () { if (!this._allow_update) return this; var e = this.dates.copy(), i = [], s = !1; return arguments.length ? (t.each(arguments, t.proxy(function (t, e) { e instanceof Date && (e = this._local_to_utc(e)), i.push(e) }, this)), s = !0) : (i = (i = this.isInput ? this.element.val() : this.element.data("date") || this.element.find("input").val()) && this.o.multidate ? i.split(this.o.multidateSeparator) : [i], delete this.element.data().date), i = t.map(i, t.proxy(function (t) { return f.parseDate(t, this.o.format, this.o.language) }, this)), i = t.grep(i, t.proxy(function (t) { return t < this.o.startDate || t > this.o.endDate || !t }, this), !0), this.dates.replace(i), this.viewDate = this.dates.length ? new Date(this.dates.get(-1)) : this.viewDate < this.o.startDate ? new Date(this.o.startDate) : this.viewDate > this.o.endDate ? new Date(this.o.endDate) : this.o.defaultViewDate, s ? this.setValue() : i.length && String(e) !== String(this.dates) && this._trigger("changeDate"), !this.dates.length && e.length && this._trigger("clearDate"), this.fill(), this.element.change(), this }, fillDow: function () { var t = this.o.weekStart, e = "<tr>"; for (this.o.calendarWeeks && (this.picker.find(".datepicker-days .datepicker-switch").attr("colspan", function (t, e) { return parseInt(e) + 1 }), e += '<th class="cw">&#160;</th>'); t < this.o.weekStart + 7;)e += '<th class="dow">' + u[this.o.language].daysMin[t++ % 7] + "</th>"; e += "</tr>", this.picker.find(".datepicker-days thead").append(e) }, fillMonths: function () { for (var t = "", e = 0; 12 > e;)t += '<span class="month">' + u[this.o.language].monthsShort[e++] + "</span>"; this.picker.find(".datepicker-months td").html(t) }, setRange: function (e) { e && e.length ? this.range = t.map(e, function (t) { return t.valueOf() }) : delete this.range, this.fill() }, getClassNames: function (e) { var i = [], s = this.viewDate.getUTCFullYear(), o = this.viewDate.getUTCMonth(), n = new Date; return e.getUTCFullYear() < s || e.getUTCFullYear() === s && e.getUTCMonth() < o ? i.push("old") : (e.getUTCFullYear() > s || e.getUTCFullYear() === s && e.getUTCMonth() > o) && i.push("new"), this.focusDate && e.valueOf() === this.focusDate.valueOf() && i.push("focused"), this.o.todayHighlight && e.getUTCFullYear() === n.getFullYear() && e.getUTCMonth() === n.getMonth() && e.getUTCDate() === n.getDate() && i.push("today"), -1 !== this.dates.contains(e) && i.push("active"), (e.valueOf() < this.o.startDate || e.valueOf() > this.o.endDate || -1 !== t.inArray(e.getUTCDay(), this.o.daysOfWeekDisabled)) && i.push("disabled"), -1 !== t.inArray(e.getUTCDay(), this.o.daysOfWeekHighlighted) && i.push("highlighted"), this.o.datesDisabled.length > 0 && t.grep(this.o.datesDisabled, function (t) { return s = t, (i = e).getUTCFullYear() === s.getUTCFullYear() && i.getUTCMonth() === s.getUTCMonth() && i.getUTCDate() === s.getUTCDate(); var i, s }).length > 0 && i.push("disabled", "disabled-date"), this.range && (e > this.range[0] && e < this.range[this.range.length - 1] && i.push("range"), -1 !== t.inArray(e.valueOf(), this.range) && i.push("selected"), e.valueOf() === this.range[0] && i.push("range-start"), e.valueOf() === this.range[this.range.length - 1] && i.push("range-end")), i }, fill: function () { var s, o = new Date(this.viewDate), n = o.getUTCFullYear(), a = o.getUTCMonth(), l = this.o.startDate !== -1 / 0 ? this.o.startDate.getUTCFullYear() : -1 / 0, r = this.o.startDate !== -1 / 0 ? this.o.startDate.getUTCMonth() : -1 / 0, d = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCFullYear() : 1 / 0, c = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCMonth() : 1 / 0, h = u[this.o.language].today || u.en.today || "", p = u[this.o.language].clear || u.en.clear || "", g = u[this.o.language].titleFormat || u.en.titleFormat; if (!isNaN(n) && !isNaN(a)) { this.picker.find(".datepicker-days thead .datepicker-switch").text(f.formatDate(new i(n, a), g, this.o.language)), this.picker.find("tfoot .today").text(h).toggle(!1 !== this.o.todayBtn), this.picker.find("tfoot .clear").text(p).toggle(!1 !== this.o.clearBtn), this.picker.find("thead .datepicker-title").text(this.o.title).toggle("" !== this.o.title), this.updateNavArrows(), this.fillMonths(); var v = i(n, a - 1, 28), m = f.getDaysInMonth(v.getUTCFullYear(), v.getUTCMonth()); v.setUTCDate(m), v.setUTCDate(m - (v.getUTCDay() - this.o.weekStart + 7) % 7); var y = new Date(v); v.getUTCFullYear() < 100 && y.setUTCFullYear(v.getUTCFullYear()), y.setUTCDate(y.getUTCDate() + 42), y = y.valueOf(); for (var w, k = []; v.valueOf() < y;) { if (v.getUTCDay() === this.o.weekStart && (k.push("<tr>"), this.o.calendarWeeks)) { var b = new Date(+v + (this.o.weekStart - v.getUTCDay() - 7) % 7 * 864e5), T = new Date(Number(b) + (11 - b.getUTCDay()) % 7 * 864e5), C = new Date(Number(C = i(T.getUTCFullYear(), 0, 1)) + (11 - C.getUTCDay()) % 7 * 864e5), S = (T - C) / 864e5 / 7 + 1; k.push('<td class="cw">' + S + "</td>") } if ((w = this.getClassNames(v)).push("day"), this.o.beforeShowDay !== t.noop) { var D = this.o.beforeShowDay(this._utc_to_local(v)); D === e ? D = {} : "boolean" == typeof D ? D = { enabled: D } : "string" == typeof D && (D = { classes: D }), !1 === D.enabled && w.push("disabled"), D.classes && (w = w.concat(D.classes.split(/\s+/))), D.tooltip && (s = D.tooltip) } w = t.unique(w), k.push('<td class="' + w.join(" ") + '"' + (s ? ' title="' + s + '"' : "") + ">" + v.getUTCDate() + "</td>"), s = null, v.getUTCDay() === this.o.weekEnd && k.push("</tr>"), v.setUTCDate(v.getUTCDate() + 1) } this.picker.find(".datepicker-days tbody").empty().append(k.join("")); var $ = this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode < 2 ? "Months" : n).end().find("span").removeClass("active"); if (t.each(this.dates, function (t, e) { e.getUTCFullYear() === n && $.eq(e.getUTCMonth()).addClass("active") }), (l > n || n > d) && $.addClass("disabled"), n === l && $.slice(0, r).addClass("disabled"), n === d && $.slice(c + 1).addClass("disabled"), this.o.beforeShowMonth !== t.noop) { var x = this; t.each($, function (e, i) { if (!t(i).hasClass("disabled")) { var s = new Date(n, e, 1), o = x.o.beforeShowMonth(s); !1 === o && t(i).addClass("disabled") } }) } k = "", n = 10 * parseInt(n / 10, 10); var M = this.picker.find(".datepicker-years").find(".datepicker-switch").text(n + "-" + (n + 9)).end().find("td"); n -= 1; for (var A, O = t.map(this.dates, function (t) { return t.getUTCFullYear() }), U = -1; 11 > U; U++) { if (A = ["year"], s = null, -1 === U ? A.push("old") : 10 === U && A.push("new"), -1 !== t.inArray(n, O) && A.push("active"), (l > n || n > d) && A.push("disabled"), this.o.beforeShowYear !== t.noop) { var _ = this.o.beforeShowYear(new Date(n, 0, 1)); _ === e ? _ = {} : "boolean" == typeof _ ? _ = { enabled: _ } : "string" == typeof _ && (_ = { classes: _ }), !1 === _.enabled && A.push("disabled"), _.classes && (A = A.concat(_.classes.split(/\s+/))), _.tooltip && (s = _.tooltip) } k += '<span class="' + A.join(" ") + '"' + (s ? ' title="' + s + '"' : "") + ">" + n + "</span>", n += 1 } M.html(k) } }, updateNavArrows: function () { if (this._allow_update) { var t = new Date(this.viewDate), e = t.getUTCFullYear(), i = t.getUTCMonth(); switch (this.viewMode) { case 0: this.picker.find(".prev").css(this.o.startDate !== -1 / 0 && e <= this.o.startDate.getUTCFullYear() && i <= this.o.startDate.getUTCMonth() ? { visibility: "hidden" } : { visibility: "visible" }), this.picker.find(".next").css(this.o.endDate !== 1 / 0 && e >= this.o.endDate.getUTCFullYear() && i >= this.o.endDate.getUTCMonth() ? { visibility: "hidden" } : { visibility: "visible" }); break; case 1: case 2: this.picker.find(".prev").css(this.o.startDate !== -1 / 0 && e <= this.o.startDate.getUTCFullYear() || this.o.maxViewMode < 2 ? { visibility: "hidden" } : { visibility: "visible" }), this.picker.find(".next").css(this.o.endDate !== 1 / 0 && e >= this.o.endDate.getUTCFullYear() || this.o.maxViewMode < 2 ? { visibility: "hidden" } : { visibility: "visible" }) } } }, click: function (e) { e.preventDefault(), e.stopPropagation(); var s, o, n, a = t(e.target).closest("span, td, th"); if (1 === a.length) switch (a[0].nodeName.toLowerCase()) { case "th": switch (a[0].className) { case "datepicker-switch": this.showMode(1); break; case "prev": case "next": var l = f.modes[this.viewMode].navStep * ("prev" === a[0].className ? -1 : 1); switch (this.viewMode) { case 0: this.viewDate = this.moveMonth(this.viewDate, l), this._trigger("changeMonth", this.viewDate); break; case 1: case 2: this.viewDate = this.moveYear(this.viewDate, l), 1 === this.viewMode && this._trigger("changeYear", this.viewDate) }this.fill(); break; case "today": var r = new Date; r = i(r.getFullYear(), r.getMonth(), r.getDate(), 0, 0, 0), this.showMode(-2); var d = "linked" === this.o.todayBtn ? null : "view"; this._setDate(r, d); break; case "clear": this.clearDates() }break; case "span": a.hasClass("disabled") || (this.viewDate.setUTCDate(1), a.hasClass("month") ? (n = 1, o = a.parent().find("span").index(a), s = this.viewDate.getUTCFullYear(), this.viewDate.setUTCMonth(o), this._trigger("changeMonth", this.viewDate), 1 === this.o.minViewMode ? (this._setDate(i(s, o, n)), this.showMode()) : this.showMode(-1)) : (n = 1, o = 0, s = parseInt(a.text(), 10) || 0, this.viewDate.setUTCFullYear(s), this._trigger("changeYear", this.viewDate), 2 === this.o.minViewMode && this._setDate(i(s, o, n)), this.showMode(-1)), this.fill()); break; case "td": a.hasClass("day") && !a.hasClass("disabled") && (n = parseInt(a.text(), 10) || 1, s = this.viewDate.getUTCFullYear(), o = this.viewDate.getUTCMonth(), a.hasClass("old") ? 0 === o ? (o = 11, s -= 1) : o -= 1 : a.hasClass("new") && (11 === o ? (o = 0, s += 1) : o += 1), this._setDate(i(s, o, n))) }this.picker.is(":visible") && this._focused_from && t(this._focused_from).focus(), delete this._focused_from }, _toggle_multidate: function (t) { var e = this.dates.contains(t); if (t || this.dates.clear(), -1 !== e ? (!0 === this.o.multidate || this.o.multidate > 1 || this.o.toggleActive) && this.dates.remove(e) : !1 === this.o.multidate ? (this.dates.clear(), this.dates.push(t)) : this.dates.push(t), "number" == typeof this.o.multidate) for (; this.dates.length > this.o.multidate;)this.dates.remove(0) }, _setDate: function (t, e) { var i; e && "date" !== e || this._toggle_multidate(t && new Date(t)), e && "view" !== e || (this.viewDate = t && new Date(t)), this.fill(), this.setValue(), e && "view" === e || this._trigger("changeDate"), this.isInput ? i = this.element : this.component && (i = this.element.find("input")), i && i.change(), !this.o.autoclose || e && "date" !== e || this.hide() }, moveMonth: function (t, e) { if (!(i = t) || isNaN(i.getTime())) return this.o.defaultViewDate; var i; if (!e) return t; var s, o, n = new Date(t.valueOf()), a = n.getUTCDate(), l = n.getUTCMonth(), r = Math.abs(e); if (e = e > 0 ? 1 : -1, 1 === r) o = -1 === e ? function () { return n.getUTCMonth() === l } : function () { return n.getUTCMonth() !== s }, s = l + e, n.setUTCMonth(s), (0 > s || s > 11) && (s = (s + 12) % 12); else { for (var d = 0; r > d; d++)n = this.moveMonth(n, e); s = n.getUTCMonth(), n.setUTCDate(a), o = function () { return s !== n.getUTCMonth() } } for (; o();)n.setUTCDate(--a), n.setUTCMonth(s); return n }, moveYear: function (t, e) { return this.moveMonth(t, 12 * e) }, dateWithinRange: function (t) { return t >= this.o.startDate && t <= this.o.endDate }, keydown: function (t) { if (this.picker.is(":visible")) { var e, i, o, n, a = !1, l = this.focusDate || this.viewDate; switch (t.keyCode) { case 27: this.focusDate ? (this.focusDate = null, this.viewDate = this.dates.get(-1) || this.viewDate, this.fill()) : this.hide(), t.preventDefault(), t.stopPropagation(); break; case 37: case 39: if (!this.o.keyboardNavigation) break; e = 37 === t.keyCode ? -1 : 1, t.ctrlKey ? (i = this.moveYear(this.dates.get(-1) || s(), e), o = this.moveYear(l, e), this._trigger("changeYear", this.viewDate)) : t.shiftKey ? (i = this.moveMonth(this.dates.get(-1) || s(), e), o = this.moveMonth(l, e), this._trigger("changeMonth", this.viewDate)) : ((i = new Date(this.dates.get(-1) || s())).setUTCDate(i.getUTCDate() + e), (o = new Date(l)).setUTCDate(l.getUTCDate() + e)), this.dateWithinRange(o) && (this.focusDate = this.viewDate = o, this.setValue(), this.fill(), t.preventDefault()); break; case 38: case 40: if (!this.o.keyboardNavigation) break; e = 38 === t.keyCode ? -1 : 1, t.ctrlKey ? (i = this.moveYear(this.dates.get(-1) || s(), e), o = this.moveYear(l, e), this._trigger("changeYear", this.viewDate)) : t.shiftKey ? (i = this.moveMonth(this.dates.get(-1) || s(), e), o = this.moveMonth(l, e), this._trigger("changeMonth", this.viewDate)) : ((i = new Date(this.dates.get(-1) || s())).setUTCDate(i.getUTCDate() + 7 * e), (o = new Date(l)).setUTCDate(l.getUTCDate() + 7 * e)), this.dateWithinRange(o) && (this.focusDate = this.viewDate = o, this.setValue(), this.fill(), t.preventDefault()); break; case 32: break; case 13: if (!this.o.forceParse) break; l = this.focusDate || this.dates.get(-1) || this.viewDate, this.o.keyboardNavigation && (this._toggle_multidate(l), a = !0), this.focusDate = null, this.viewDate = this.dates.get(-1) || this.viewDate, this.setValue(), this.fill(), this.picker.is(":visible") && (t.preventDefault(), "function" == typeof t.stopPropagation ? t.stopPropagation() : t.cancelBubble = !0, this.o.autoclose && this.hide()); break; case 9: this.focusDate = null, this.viewDate = this.dates.get(-1) || this.viewDate, this.fill(), this.hide() }a && (this._trigger(this.dates.length ? "changeDate" : "clearDate"), this.isInput ? n = this.element : this.component && (n = this.element.find("input")), n && n.change()) } else (40 === t.keyCode || 27 === t.keyCode) && (this.show(), t.stopPropagation()) }, showMode: function (t) { t && (this.viewMode = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, this.viewMode + t))), this.picker.children("div").hide().filter(".datepicker-" + f.modes[this.viewMode].clsName).show(), this.updateNavArrows() } }; var r = function (e, i) { this.element = t(e), this.inputs = t.map(i.inputs, function (t) { return t.jquery ? t[0] : t }), delete i.inputs, c.call(t(this.inputs), i).on("changeDate", t.proxy(this.dateUpdated, this)), this.pickers = t.map(this.inputs, function (e) { return t(e).data("datepicker") }), this.updateDates() }; r.prototype = { updateDates: function () { this.dates = t.map(this.pickers, function (t) { return t.getUTCDate() }), this.updateRanges() }, updateRanges: function () { var e = t.map(this.dates, function (t) { return t.valueOf() }); t.each(this.pickers, function (t, i) { i.setRange(e) }) }, dateUpdated: function (e) { if (!this.updating) { this.updating = !0; var i = t(e.target).data("datepicker"); if (void 0 !== i) { var s = i.getUTCDate(), o = t.inArray(e.target, this.inputs), n = o - 1, a = o + 1, l = this.inputs.length; if (-1 !== o) { if (t.each(this.pickers, function (t, e) { e.getUTCDate() || e.setUTCDate(s) }), s < this.dates[n]) for (; n >= 0 && s < this.dates[n];)this.pickers[n--].setUTCDate(s); else if (s > this.dates[a]) for (; l > a && s > this.dates[a];)this.pickers[a++].setUTCDate(s); this.updateDates(), delete this.updating } } } }, remove: function () { t.map(this.pickers, function (t) { t.remove() }), delete this.element.data().datepicker } }; var d = t.fn.datepicker, c = function (i) { var s, o = Array.apply(null, arguments); if (o.shift(), this.each(function () { var e = t(this), n = e.data("datepicker"), a = "object" == typeof i && i; if (!n) { var d = function (e, i) { function s(t, e) { return e.toLowerCase() } var o, n = t(e).data(), a = {}, l = new RegExp("^" + i.toLowerCase() + "([A-Z])"); i = new RegExp("^" + i.toLowerCase()); for (var r in n) i.test(r) && (o = r.replace(l, s), a[o] = n[r]); return a }(this, "date"), c = t.extend({}, h, d, a), f = function (e) { var i = {}; if (u[e] || (e = e.split("-")[0], u[e])) { var s = u[e]; return t.each(p, function (t, e) { e in s && (i[e] = s[e]) }), i } }(c.language), g = t.extend({}, h, f, d, a); if (e.hasClass("input-daterange") || g.inputs) { var v = { inputs: g.inputs || e.find("input").toArray() }; e.data("datepicker", n = new r(this, t.extend(g, v))) } else e.data("datepicker", n = new l(this, g)) } "string" == typeof i && "function" == typeof n[i] && (s = n[i].apply(n, o)) }), s === e || s instanceof l || s instanceof r) return this; if (this.length > 1) throw new Error("Using only allowed for the collection of a single element (" + i + " function)"); return s }; t.fn.datepicker = c; var h = t.fn.datepicker.defaults = { autoclose: !1, beforeShowDay: t.noop, beforeShowMonth: t.noop, beforeShowYear: t.noop, calendarWeeks: !1, clearBtn: !1, toggleActive: !1, daysOfWeekDisabled: [], daysOfWeekHighlighted: [], datesDisabled: [], endDate: 1 / 0, forceParse: !0, format: "mm/dd/yyyy", keyboardNavigation: !0, language: "en", minViewMode: 0, maxViewMode: 2, multidate: !1, multidateSeparator: ",", orientation: "auto", rtl: !1, startDate: -1 / 0, startView: 0, todayBtn: !1, todayHighlight: !1, weekStart: 0, disableTouchKeyboard: !1, enableOnReadonly: !0, container: "body", immediateUpdates: !1, title: "" }, p = t.fn.datepicker.locale_opts = ["format", "rtl", "weekStart"]; t.fn.datepicker.Constructor = l; var u = t.fn.datepicker.dates = { en: { days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], today: "Today", clear: "Clear", titleFormat: "MM yyyy" } }, f = { modes: [{ clsName: "days", navFnc: "Month", navStep: 1 }, { clsName: "months", navFnc: "FullYear", navStep: 1 }, { clsName: "years", navFnc: "FullYear", navStep: 10 }], isLeapYear: function (t) { return t % 4 == 0 && t % 100 != 0 || t % 400 == 0 }, getDaysInMonth: function (t, e) { return [31, f.isLeapYear(t) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][e] }, validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g, nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g, parseFormat: function (t) { if ("function" == typeof t.toValue && "function" == typeof t.toDisplay) return t; var e = t.replace(this.validParts, "\0").split("\0"), i = t.match(this.validParts); if (!e || !e.length || !i || 0 === i.length) throw new Error("Invalid date format."); return { separators: e, parts: i } }, parseDate: function (s, o, n) { function a() { var t = this.slice(0, p[c].length), e = p[c].slice(0, t.length); return t.toLowerCase() === e.toLowerCase() } if (!s) return e; if (s instanceof Date) return s; if ("string" == typeof o && (o = f.parseFormat(o)), o.toValue) return o.toValue(s, o, n); var r, d, c, h = /([\-+]\d+)([dmwy])/, p = s.match(/([\-+]\d+)([dmwy])/g); if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(s)) { for (s = new Date, c = 0; c < p.length; c++)switch (r = h.exec(p[c]), d = parseInt(r[1]), r[2]) { case "d": s.setUTCDate(s.getUTCDate() + d); break; case "m": s = l.prototype.moveMonth.call(l.prototype, s, d); break; case "w": s.setUTCDate(s.getUTCDate() + 7 * d); break; case "y": s = l.prototype.moveYear.call(l.prototype, s, d) }return i(s.getUTCFullYear(), s.getUTCMonth(), s.getUTCDate(), 0, 0, 0) } p = s && s.match(this.nonpunctuation) || [], s = new Date; var g, v, m = {}, y = ["yyyy", "yy", "M", "MM", "m", "mm", "d", "dd"], w = { yyyy: function (t, e) { return t.setUTCFullYear(e) }, yy: function (t, e) { return t.setUTCFullYear(2e3 + e) }, m: function (t, e) { if (isNaN(t)) return t; for (e -= 1; 0 > e;)e += 12; for (e %= 12, t.setUTCMonth(e); t.getUTCMonth() !== e;)t.setUTCDate(t.getUTCDate() - 1); return t }, d: function (t, e) { return t.setUTCDate(e) } }; w.M = w.MM = w.mm = w.m, w.dd = w.d, s = i(s.getFullYear(), s.getMonth(), s.getDate(), 0, 0, 0); var k = o.parts.slice(); if (p.length !== k.length && (k = t(k).filter(function (e, i) { return -1 !== t.inArray(i, y) }).toArray()), p.length === k.length) { var b, T, C; for (c = 0, b = k.length; b > c; c++) { if (g = parseInt(p[c], 10), r = k[c], isNaN(g)) switch (r) { case "MM": v = t(u[n].months).filter(a), g = t.inArray(v[0], u[n].months) + 1; break; case "M": v = t(u[n].monthsShort).filter(a), g = t.inArray(v[0], u[n].monthsShort) + 1 }m[r] = g } for (c = 0; c < y.length; c++)C = y[c], C in m && !isNaN(m[C]) && (T = new Date(s), w[C](T, m[C]), isNaN(T) || (s = T)) } return s }, formatDate: function (e, i, s) { if (!e) return ""; if ("string" == typeof i && (i = f.parseFormat(i)), i.toDisplay) return i.toDisplay(e, i, s); var o = { d: e.getUTCDate(), D: u[s].daysShort[e.getUTCDay()], DD: u[s].days[e.getUTCDay()], m: e.getUTCMonth() + 1, M: u[s].monthsShort[e.getUTCMonth()], MM: u[s].months[e.getUTCMonth()], yy: e.getUTCFullYear().toString().substring(2), yyyy: e.getUTCFullYear() }; o.dd = (o.d < 10 ? "0" : "") + o.d, o.mm = (o.m < 10 ? "0" : "") + o.m, e = []; for (var n = t.extend([], i.separators), a = 0, l = i.parts.length; l >= a; a++)n.length && e.push(n.shift()), e.push(o[i.parts[a]]); return e.join("") }, headTemplate: '<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">&#171;</th><th colspan="5" class="datepicker-switch"></th><th class="next">&#187;</th></tr></thead>', contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>', footTemplate: '<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>' }; f.template = '<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">' + f.headTemplate + "<tbody></tbody>" + f.footTemplate + '</table></div><div class="datepicker-months"><table class="table-condensed">' + f.headTemplate + f.contTemplate + f.footTemplate + '</table></div><div class="datepicker-years"><table class="table-condensed">' + f.headTemplate + f.contTemplate + f.footTemplate + "</table></div></div>", t.fn.datepicker.DPGlobal = f, t.fn.datepicker.noConflict = function () { return t.fn.datepicker = d, this }, t.fn.datepicker.version = "1.4.1-dev", t(document).on("focus.datepicker.data-api click.datepicker.data-api", '[data-provide="datepicker"]', function (e) { var i = t(this); i.data("datepicker") || (e.preventDefault(), c.call(i, "show")) }), t(function () { c.call(t('[data-provide="datepicker-inline"]')) }) }(jQuery), function (t) { "use strict"; function e(e, i) { this.$select = t(e), this.options = this.mergeOptions(t.extend({}, i, this.$select.data())), this.originalOptions = this.$select.clone()[0].options, this.query = "", this.searchTimeout = null, this.lastToggledInput = null, this.options.multiple = "multiple" === this.$select.attr("multiple"), this.options.onChange = t.proxy(this.options.onChange, this), this.options.onDropdownShow = t.proxy(this.options.onDropdownShow, this), this.options.onDropdownHide = t.proxy(this.options.onDropdownHide, this), this.options.onDropdownShown = t.proxy(this.options.onDropdownShown, this), this.options.onDropdownHidden = t.proxy(this.options.onDropdownHidden, this), this.buildContainer(), this.buildButton(), this.buildDropdown(), this.buildSelectAll(), this.buildDropdownOptions(), this.buildFilter(), this.updateButtonText(), this.updateSelectAll(), this.options.disableIfEmpty && t("option", this.$select).length <= 0 && this.disable(), this.$select.hide().after(this.$container) } "undefined" != typeof ko && ko.bindingHandlers && !ko.bindingHandlers.multiselect && (ko.bindingHandlers.multiselect = { after: ["options", "value", "selectedOptions"], init: function (e, i, s, o, n) { var a = t(e), l = ko.toJS(i()); if (a.multiselect(l), s.has("options")) { var r = s.get("options"); ko.isObservable(r) && ko.computed({ read: function () { r(), setTimeout(function () { var t = a.data("multiselect"); t && t.updateOriginalOptions(), a.multiselect("rebuild") }, 1) }, disposeWhenNodeIsRemoved: e }) } if (s.has("value")) { var d = s.get("value"); ko.isObservable(d) && ko.computed({ read: function () { d(), setTimeout(function () { a.multiselect("refresh") }, 1) }, disposeWhenNodeIsRemoved: e }).extend({ rateLimit: 100, notifyWhenChangesStop: !0 }) } if (s.has("selectedOptions")) { var c = s.get("selectedOptions"); ko.isObservable(c) && ko.computed({ read: function () { c(), setTimeout(function () { a.multiselect("refresh") }, 1) }, disposeWhenNodeIsRemoved: e }).extend({ rateLimit: 100, notifyWhenChangesStop: !0 }) } ko.utils.domNodeDisposal.addDisposeCallback(e, function () { a.multiselect("destroy") }) }, update: function (e, i, s, o, n) { var a = t(e), l = ko.toJS(i()); a.multiselect("setOptions", l), a.multiselect("rebuild") } }), e.prototype = { defaults: { buttonText: function (e, i) { if (0 === e.length) return this.nonSelectedText; if (this.allSelectedText && e.length == t("option", t(i)).length) return this.selectAllNumber ? this.allSelectedText + " (" + e.length + ")" : this.allSelectedText; if (e.length > this.numberDisplayed) return e.length + " " + this.nSelectedText; var s = ""; return e.each(function () { var e = void 0 !== t(this).attr("label") ? t(this).attr("label") : t(this).text(); s += e + ", " }), s.substr(0, s.length - 2) }, buttonTitle: function (e, i) { if (0 === e.length) return this.nonSelectedText; var s = ""; return e.each(function () { s += t(this).text() + ", " }), s.substr(0, s.length - 2) }, optionLabel: function (e) { return t(e).attr("label") || t(e).text() }, onChange: function (t, e) { }, onDropdownShow: function (t) { }, onDropdownHide: function (t) { }, onDropdownShown: function (t) { }, onDropdownHidden: function (t) { }, onSelectAll: function () { }, enableHTML: !1, buttonClass: "btn btn-default", inheritClass: !1, buttonWidth: "auto", buttonContainer: '<div class="btn-group" />', dropRight: !1, selectedClass: "active", maxHeight: !1, checkboxName: !1, includeSelectAllOption: !1, includeSelectAllIfMoreThan: 0, selectAllText: " Select all", selectAllValue: "multiselect-all", selectAllName: !1, selectAllNumber: !0, enableFiltering: !1, enableCaseInsensitiveFiltering: !1, enableClickableOptGroups: !1, filterPlaceholder: "Search", filterBehavior: "text", includeFilterClearBtn: !0, preventInputChangeEvent: !1, nonSelectedText: "None selected", nSelectedText: "selected", allSelectedText: "All selected", numberDisplayed: 3, disableIfEmpty: !1, templates: { button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"><span class="multiselect-selected-text"></span> <b class="caret"></b></button>', ul: '<ul class="multiselect-container dropdown-menu"></ul>', filter: '<li class="multiselect-item filter"><div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span><input class="form-control multiselect-search" type="text"></div></li>', filterClearBtn: '<span class="input-group-btn"><button class="btn btn-default multiselect-clear-filter" type="button"><i class="glyphicon glyphicon-remove-circle"></i></button></span>', li: '<li><a tabindex="0"><label></label></a></li>', divider: '<li class="multiselect-item divider"></li>', liGroup: '<li class="multiselect-item multiselect-group"><label></label></li>' } }, constructor: e, buildContainer: function () { this.$container = t(this.options.buttonContainer), this.$container.on("show.bs.dropdown", this.options.onDropdownShow), this.$container.on("hide.bs.dropdown", this.options.onDropdownHide), this.$container.on("shown.bs.dropdown", this.options.onDropdownShown), this.$container.on("hidden.bs.dropdown", this.options.onDropdownHidden) }, buildButton: function () { this.$button = t(this.options.templates.button).addClass(this.options.buttonClass), this.$select.attr("class") && this.options.inheritClass && this.$button.addClass(this.$select.attr("class")), this.$select.prop("disabled") ? this.disable() : this.enable(), this.options.buttonWidth && "auto" !== this.options.buttonWidth && (this.$button.css({ width: this.options.buttonWidth, overflow: "hidden", "text-overflow": "ellipsis" }), this.$container.css({ width: this.options.buttonWidth })); var e = this.$select.attr("tabindex"); e && this.$button.attr("tabindex", e), this.$container.prepend(this.$button) }, buildDropdown: function () { this.$ul = t(this.options.templates.ul), this.options.dropRight && this.$ul.addClass("pull-right"), this.options.maxHeight && this.$ul.css({ "max-height": this.options.maxHeight + "px", "overflow-y": "auto", "overflow-x": "hidden" }), this.$container.append(this.$ul) }, buildDropdownOptions: function () { this.$select.children().each(t.proxy(function (e, i) { var s = t(i), o = s.prop("tagName").toLowerCase(); s.prop("value") !== this.options.selectAllValue && ("optgroup" === o ? this.createOptgroup(i) : "option" === o && ("divider" === s.data("role") ? this.createDivider() : this.createOptionValue(i))) }, this)), t("li input", this.$ul).on("change", t.proxy(function (e) { var i = t(e.target), s = i.prop("checked") || !1, o = i.val() === this.options.selectAllValue; this.options.selectedClass && (s ? i.closest("li").addClass(this.options.selectedClass) : i.closest("li").removeClass(this.options.selectedClass)); var n = i.val(), a = this.getOptionByValue(n), l = t("option", this.$select).not(a), r = t("input", this.$container).not(i); if (o && (s ? this.selectAll() : this.deselectAll()), o || (s ? (a.prop("selected", !0), this.options.multiple ? a.prop("selected", !0) : (this.options.selectedClass && t(r).closest("li").removeClass(this.options.selectedClass), t(r).prop("checked", !1), l.prop("selected", !1), this.$button.click()), "active" === this.options.selectedClass && l.closest("a").css("outline", "")) : a.prop("selected", !1)), this.$select.change(), this.updateButtonText(), this.updateSelectAll(), this.options.onChange(a, s), this.options.preventInputChangeEvent) return !1 }, this)), t("li a", this.$ul).on("mousedown", function (t) { if (t.shiftKey) return !1 }), t("li a", this.$ul).on("touchstart click", t.proxy(function (e) { e.stopPropagation(); var i = t(e.target); if (e.shiftKey && this.options.multiple) { i.is("label") && (e.preventDefault(), (i = i.find("input")).prop("checked", !i.prop("checked"))); var s = i.prop("checked") || !1; if (null !== this.lastToggledInput && this.lastToggledInput !== i) { var o = i.closest("li").index(), n = this.lastToggledInput.closest("li").index(); if (o > n) { var a = n; n = o, o = a } ++n; var l = this.$ul.find("li").slice(o, n).find("input"); l.prop("checked", s), this.options.selectedClass && l.closest("li").toggleClass(this.options.selectedClass, s); for (var r = 0, d = l.length; r < d; r++) { var c = t(l[r]); this.getOptionByValue(c.val()).prop("selected", s) } } i.trigger("change") } i.is("input") && !i.closest("li").is(".multiselect-item") && (this.lastToggledInput = i), i.blur() }, this)), this.$container.off("keydown.multiselect").on("keydown.multiselect", t.proxy(function (e) { if (!t('input[type="text"]', this.$container).is(":focus")) if (9 === e.keyCode && this.$container.hasClass("open")) this.$button.click(); else { var i = t(this.$container).find("li:not(.divider):not(.disabled) a").filter(":visible"); if (!i.length) return; var s = i.index(i.filter(":focus")); 38 === e.keyCode && s > 0 ? s-- : 40 === e.keyCode && s < i.length - 1 ? s++ : ~s || (s = 0); var o = i.eq(s); if (o.focus(), 32 === e.keyCode || 13 === e.keyCode) { var n = o.find("input"); n.prop("checked", !n.prop("checked")), n.change() } e.stopPropagation(), e.preventDefault() } }, this)), this.options.enableClickableOptGroups && this.options.multiple && t("li.multiselect-group", this.$ul).on("click", t.proxy(function (e) { e.stopPropagation(); var i = !0, s = t(e.target).parent().nextUntil("li.multiselect-group").filter(":visible:not(.disabled)").find("input"); s.each(function () { i = i && t(this).prop("checked") }), s.prop("checked", !i).trigger("change") }, this)) }, createOptionValue: function (e) { var i = t(e); i.is(":selected") && i.prop("selected", !0); var s = this.options.optionLabel(e), o = i.val(), n = this.options.multiple ? "checkbox" : "radio", a = t(this.options.templates.li), l = t("label", a); l.addClass(n), this.options.enableHTML ? l.html(" " + s) : l.text(" " + s); var r = t("<input/>").attr("type", n); this.options.checkboxName && r.attr("name", this.options.checkboxName), l.prepend(r); var d = i.prop("selected") || !1; r.val(o), o === this.options.selectAllValue && (a.addClass("multiselect-item multiselect-all"), r.parent().parent().addClass("multiselect-all")), l.attr("title", i.attr("title")), this.$ul.append(a), i.is(":disabled") && r.attr("disabled", "disabled").prop("disabled", !0).closest("a").attr("tabindex", "-1").closest("li").addClass("disabled"), r.prop("checked", d), d && this.options.selectedClass && r.closest("li").addClass(this.options.selectedClass) }, createDivider: function (e) { var i = t(this.options.templates.divider); this.$ul.append(i) }, createOptgroup: function (e) { var i = t(e).prop("label"), s = t(this.options.templates.liGroup); this.options.enableHTML ? t("label", s).html(i) : t("label", s).text(i), this.options.enableClickableOptGroups && s.addClass("multiselect-group-clickable"), this.$ul.append(s), t(e).is(":disabled") && s.addClass("disabled"), t("option", e).each(t.proxy(function (t, e) { this.createOptionValue(e) }, this)) }, buildSelectAll: function () { if ("number" == typeof this.options.selectAllValue && (this.options.selectAllValue = this.options.selectAllValue.toString()), !this.hasSelectAll() && this.options.includeSelectAllOption && this.options.multiple && t("option", this.$select).length > this.options.includeSelectAllIfMoreThan) { this.options.includeSelectAllDivider && this.$ul.prepend(t(this.options.templates.divider)); var e = t(this.options.templates.li); t("label", e).addClass("checkbox"), this.options.enableHTML ? t("label", e).html(" " + this.options.selectAllText) : t("label", e).text(" " + this.options.selectAllText), this.options.selectAllName ? t("label", e).prepend('<input type="checkbox" name="' + this.options.selectAllName + '" />') : t("label", e).prepend('<input type="checkbox" />'); var i = t("input", e); i.val(this.options.selectAllValue), e.addClass("multiselect-item multiselect-all"), i.parent().parent().addClass("multiselect-all"), this.$ul.prepend(e), i.prop("checked", !1) } }, buildFilter: function () { if (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering) { var e = Math.max(this.options.enableFiltering, this.options.enableCaseInsensitiveFiltering); if (this.$select.find("option").length >= e) { if (this.$filter = t(this.options.templates.filter), t("input", this.$filter).attr("placeholder", this.options.filterPlaceholder), this.options.includeFilterClearBtn) { var i = t(this.options.templates.filterClearBtn); i.on("click", t.proxy(function (e) { clearTimeout(this.searchTimeout), this.$filter.find(".multiselect-search").val(""), t("li", this.$ul).show().removeClass("filter-hidden"), this.updateSelectAll() }, this)), this.$filter.find(".input-group").append(i) } this.$ul.prepend(this.$filter), this.$filter.val(this.query).on("click", function (t) { t.stopPropagation() }).on("input keydown", t.proxy(function (e) { 13 === e.which && e.preventDefault(), clearTimeout(this.searchTimeout), this.searchTimeout = this.asyncFunction(t.proxy(function () { var i, s; this.query !== e.target.value && (this.query = e.target.value, t.each(t("li", this.$ul), t.proxy(function (e, o) { var n = t("input", o).length > 0 ? t("input", o).val() : "", a = t("label", o).text(), l = ""; if ("text" === this.options.filterBehavior ? l = a : "value" === this.options.filterBehavior ? l = n : "both" === this.options.filterBehavior && (l = a + "\n" + n), n !== this.options.selectAllValue && a) { var r = !1; this.options.enableCaseInsensitiveFiltering && l.toLowerCase().indexOf(this.query.toLowerCase()) > -1 ? r = !0 : l.indexOf(this.query) > -1 && (r = !0), t(o).toggle(r).toggleClass("filter-hidden", !r), t(o).hasClass("multiselect-group") ? (i = o, s = r) : (r && t(i).show().removeClass("filter-hidden"), !r && s && t(o).show().removeClass("filter-hidden")) } }, this))); this.updateSelectAll() }, this), 300, this) }, this)) } } }, destroy: function () { this.$container.remove(), this.$select.show(), this.$select.data("multiselect", null) }, refresh: function () { t("option", this.$select).each(t.proxy(function (e, i) { var s = t("li input", this.$ul).filter(function () { return t(this).val() === t(i).val() }); t(i).is(":selected") ? (s.prop("checked", !0), this.options.selectedClass && s.closest("li").addClass(this.options.selectedClass)) : (s.prop("checked", !1), this.options.selectedClass && s.closest("li").removeClass(this.options.selectedClass)), t(i).is(":disabled") ? s.attr("disabled", "disabled").prop("disabled", !0).closest("li").addClass("disabled") : s.prop("disabled", !1).closest("li").removeClass("disabled") }, this)), this.updateButtonText(), this.updateSelectAll() }, select: function (e, i) { t.isArray(e) || (e = [e]); for (var s = 0; s < e.length; s++) { var o = e[s]; if (null !== o && void 0 !== o) { var n = this.getOptionByValue(o), a = this.getInputByValue(o); void 0 !== n && void 0 !== a && (this.options.multiple || this.deselectAll(!1), this.options.selectedClass && a.closest("li").addClass(this.options.selectedClass), a.prop("checked", !0), n.prop("selected", !0)) } } this.updateButtonText(), this.updateSelectAll(), i && 1 === e.length && this.options.onChange(n, !0) }, clearSelection: function () { this.deselectAll(!1), this.updateButtonText(), this.updateSelectAll() }, deselect: function (e, i) { t.isArray(e) || (e = [e]); for (var s = 0; s < e.length; s++) { var o = e[s]; if (null !== o && void 0 !== o) { var n = this.getOptionByValue(o), a = this.getInputByValue(o); void 0 !== n && void 0 !== a && (this.options.selectedClass && a.closest("li").removeClass(this.options.selectedClass), a.prop("checked", !1), n.prop("selected", !1)) } } this.updateButtonText(), this.updateSelectAll(), i && 1 === e.length && this.options.onChange(n, !1) }, selectAll: function (e, i) { e = void 0 === e || e; var s = t("li input[type='checkbox']:enabled", this.$ul), o = s.filter(":visible"), n = s.length, a = o.length; if (e ? (o.prop("checked", !0), t("li:not(.divider):not(.disabled)", this.$ul).filter(":visible").addClass(this.options.selectedClass)) : (s.prop("checked", !0), t("li:not(.divider):not(.disabled)", this.$ul).addClass(this.options.selectedClass)), n === a || !1 === e) t("option:enabled", this.$select).prop("selected", !0); else { var l = o.map(function () { return t(this).val() }).get(); t("option:enabled", this.$select).filter(function (e) { return -1 !== t.inArray(t(this).val(), l) }).prop("selected", !0) } i && this.options.onSelectAll() }, deselectAll: function (e) { if (e = void 0 === e || e) { var i = t("li input[type='checkbox']:not(:disabled)", this.$ul).filter(":visible"); i.prop("checked", !1); var s = i.map(function () { return t(this).val() }).get(); t("option:enabled", this.$select).filter(function (e) { return -1 !== t.inArray(t(this).val(), s) }).prop("selected", !1), this.options.selectedClass && t("li:not(.divider):not(.disabled)", this.$ul).filter(":visible").removeClass(this.options.selectedClass) } else t("li input[type='checkbox']:enabled", this.$ul).prop("checked", !1), t("option:enabled", this.$select).prop("selected", !1), this.options.selectedClass && t("li:not(.divider):not(.disabled)", this.$ul).removeClass(this.options.selectedClass) }, rebuild: function () { this.$ul.html(""), this.options.multiple = "multiple" === this.$select.attr("multiple"), this.buildSelectAll(), this.buildDropdownOptions(), this.buildFilter(), this.updateButtonText(), this.updateSelectAll(), this.options.disableIfEmpty && t("option", this.$select).length <= 0 ? this.disable() : this.enable(), this.options.dropRight && this.$ul.addClass("pull-right") }, dataprovider: function (e) { var i = 0, s = this.$select.empty(); t.each(e, function (e, o) { var n; t.isArray(o.children) ? (i++ , n = t("<optgroup/>").attr({ label: o.label || "Group " + i, disabled: !!o.disabled }), function (t, e) { for (var i = 0; i < t.length; ++i)e(t[i], i) }(o.children, function (e) { n.append(t("<option/>").attr({ value: e.value, label: e.label || e.value, title: e.title, selected: !!e.selected, disabled: !!e.disabled })) })) : n = t("<option/>").attr({ value: o.value, label: o.label || o.value, title: o.title, selected: !!o.selected, disabled: !!o.disabled }), s.append(n) }), this.rebuild() }, enable: function () { this.$select.prop("disabled", !1), this.$button.prop("disabled", !1).removeClass("disabled") }, disable: function () { this.$select.prop("disabled", !0), this.$button.prop("disabled", !0).addClass("disabled") }, setOptions: function (t) { this.options = this.mergeOptions(t) }, mergeOptions: function (e) { return t.extend(!0, {}, this.defaults, this.options, e) }, hasSelectAll: function () { return t("li.multiselect-all", this.$ul).length > 0 }, updateSelectAll: function () { if (this.hasSelectAll()) { var e = t("li:not(.multiselect-item):not(.filter-hidden) input:enabled", this.$ul), i = e.length, s = e.filter(":checked").length, o = t("li.multiselect-all", this.$ul), n = o.find("input"); s > 0 && s === i ? (n.prop("checked", !0), o.addClass(this.options.selectedClass), this.options.onSelectAll()) : (n.prop("checked", !1), o.removeClass(this.options.selectedClass)) } }, updateButtonText: function () { var e = this.getSelected(); this.options.enableHTML ? t(".multiselect .multiselect-selected-text", this.$container).html(this.options.buttonText(e, this.$select)) : t(".multiselect .multiselect-selected-text", this.$container).text(this.options.buttonText(e, this.$select)), t(".multiselect", this.$container).attr("title", this.options.buttonTitle(e, this.$select)) }, getSelected: function () { return t("option", this.$select).filter(":selected") }, getOptionByValue: function (e) { for (var i = t("option", this.$select), s = e.toString(), o = 0; o < i.length; o += 1) { var n = i[o]; if (n.value === s) return t(n) } }, getInputByValue: function (e) { for (var i = t("li input", this.$ul), s = e.toString(), o = 0; o < i.length; o += 1) { var n = i[o]; if (n.value === s) return t(n) } }, updateOriginalOptions: function () { this.originalOptions = this.$select.clone()[0].options }, asyncFunction: function (t, e, i) { var s = Array.prototype.slice.call(arguments, 3); return setTimeout(function () { t.apply(i || window, s) }, e) }, setAllSelectedText: function (t) { this.options.allSelectedText = t, this.updateButtonText() } }, t.fn.multiselect = function (i, s, o) { return this.each(function () { var n = t(this).data("multiselect"); n || (n = new e(this, "object" == typeof i && i), t(this).data("multiselect", n)), "string" == typeof i && (n[i](s, o), "destroy" === i && t(this).data("multiselect", !1)) }) }, t.fn.multiselect.Constructor = e, t(function () { t("select[data-role=multiselect]").multiselect() }) }(jQuery), function (t) { t.fn.rwdImageMaps = function () { var e = this; return t(window).resize(function () { e.each(function () { if (void 0 !== t(this).attr("usemap")) { var e = t(this); t("<img />").load(function () { var i = e.attr("width"), s = e.attr("height"); if (!i || !s) { var o = new Image; o.src = e.attr("src"), i || (i = o.width), s || (s = o.height) } var n = e.width() / 100, a = e.height() / 100, l = e.attr("usemap").replace("#", ""), r = "coords"; t('map[name="' + l + '"]').find("area").each(function () { var e = t(this); e.data(r) || e.data(r, e.attr(r)); for (var o = e.data(r).split(","), l = new Array(o.length), d = 0; d < l.length; ++d)l[d] = d % 2 == 0 ? parseInt(o[d] / i * 100 * n) : parseInt(o[d] / s * 100 * a); e.attr(r, l.toString()) }) }).attr("src", e.attr("src")) } }) }).trigger("resize"), this } }(jQuery), function (t) { var e = "portfilter", i = function (e) { this.$element = t(e), this.stuff = t("[data-tag]"), this.target = this.$element.data("target") || "" }; i.prototype.filter = function (e) { var i = [], s = this.target; this.stuff.fadeOut("fast").promise().done(function () { t(this).each(function () { t(this).data("tag") != s && "all" != s || i.push(this) }), t(i).show() }) }; var s = t.fn[e]; t.fn[e] = function (s) { return this.each(function () { var o = t(this), n = o.data(e); n || o.data(e, n = new i(this)), "filter" == s && n.filter() }) }, t.fn[e].defaults = {}, t.fn[e].Constructor = i, t.fn[e].noConflict = function () { return t.fn[e] = s, this }, t(document).on("click.portfilter.data-api", "[data-toggle^=portfilter]", function (e) { t(this).portfilter("filter") }) }(jQuery);;
/*! CLICK NAVIGATION FUNCTIONALITY
* Version: 0.9.2
* Author: Nick Goodrum
* Licensed under MIT:
* http://www.opensource.org/licenses/mit-license.php
* Followed WAI-ARIA spec except for typing a letter key keyboard functionality */

(function ($) {
    'use strict';

    /*----------- ADD DEBOUNCER -----------*/

    // Code from Underscore.js

    var debounce = function (func, wait, immediate) {
        var timeout;
        return function () {
            var context = this, args = arguments;
            var later = function () {
                timeout = null;
                if (!immediate) func.apply(context, args);
            };
            var callNow = immediate && !timeout;
            clearTimeout(timeout);
            timeout = setTimeout(later, wait);
            if (callNow) func.apply(context, args);
        };
    };



    // Some functions take a variable number of arguments, or a few expected
    // arguments at the beginning and then a variable number of values to operate
    // on. This helper accumulates all remaining arguments past the function�s
    // argument length (or an explicit `startIndex`), into an array that becomes
    // the last argument. Similar to ES6�s "rest parameter".
    var restArguments = function (func, startIndex) {
        startIndex = startIndex == null ? func.length - 1 : +startIndex;
        return function () {
            var length = Math.max(arguments.length - startIndex, 0),
                rest = Array(length),
                index = 0;
            for (; index < length; index++) {
                rest[index] = arguments[index + startIndex];
            }
            switch (startIndex) {
                case 0: return func.call(this, rest);
                case 1: return func.call(this, arguments[0], rest);
                case 2: return func.call(this, arguments[0], arguments[1], rest);
            }
            var args = Array(startIndex + 1);
            for (index = 0; index < startIndex; index++) {
                args[index] = arguments[index];
            }
            args[startIndex] = rest;
            return func.apply(this, args);
        };
    };

    /*-----------  ADD PROTOTYPE FOR OLDER BROWSERS -----------*/
    if (!Function.prototype.bind) {
        Function.prototype.bind = function () {
            var fn = this, args = Array.prototype.slice.call(arguments),
                object = args.shift();
            return function () {
                return fn.apply(object, args.concat(Array.prototype.slice.call(arguments)));
            };
        };
    }

    var ClickMenu = (function () {

        function ClickMenu(element, settings) {
            var _ = this,
                dataSettings;

            _.defaults = {
                menutype: "dropdown",
                animationSpeed: 200,
                toggle: "toggle-menu",
                menu: "cm-menu",
                htmlClass: "cm-js-menu-active",
                expanderText: "expand / collapse",
                landings: false,
                expanders: false,
                singleClick: true
            };

            dataSettings = $(element).data() || {};

            _.options = $.extend({}, _.defaults, dataSettings, settings);

            _.menu = element;
            _.$menu = $(element);
            _.$menuBar = _.$menu.find("." + _.options.menu);
            _.$menuToggle = _.$menu.find("." + _.options.toggle);
            _.isActive = false;
            _.lastEventType;
            _.isToggled = false;
            _.currentFocus = 0;
            _.initialLinks = [];
            _.currentLinks = [];

            _.keyHandler = $.proxy(_.keyHandler, _);
            _.showMenu = $.proxy(_.showMenu, _);
            _.hideMenu = $.proxy(_.hideMenu, _);
            _.menuToggle = $.proxy(_.menuToggle, _);
            _.subMenuToggle = $.proxy(_.subMenuToggle, _);
            _.menuHandler = $.proxy(_.menuHandler, _);
            _.menuToggleHandler = $.proxy(_.menuToggleHandler, _);

            if (_.$menuBar.length > 0) {
                _.init();
            }
        }

        return ClickMenu;
    }());

    ClickMenu.prototype.init = function () {
        var _ = this;

        //Bind Toggle Function to expand/collapse menu in small screens
        _.$menuToggle.on("touchstart click", _.menuToggle);

        // Add Aria Aspects and initial classes to menu wrap and menu
        _.$menu.addClass("cm-js-enabled").attr({ "role": "navigation" });
        _.$menuBar.attr("role", "menubar");

        //If there are prior dropdowns you want to get the highest one and add to the numbers
        var idNum = 1;

        if ($("[id^='cm-dropdown']").last().length > 0) {
            var highestNum = 0;

            $("[id^='cm-dropdown']").each(function () {
                var currentNum = $(this).attr("id").split("dropdown")[1];

                highestNum = currentNum && highestNum < parseInt(currentNum, 10) ? parseInt(currentNum, 10) : highestNum;
            });

            idNum = highestNum + 1;
        }

        _.$menu.on('keydown', _.keyHandler);

        _.$menu.find("." + _.options.menu + " a").each(function () {
            var $anchor = $(this);
            var $parentLi = $anchor.closest('li');

            $anchor.attr({ "role": "menuitem", "tabindex": "-1" });
            $parentLi.attr("role", "presentation");

            if (!$parentLi.data("type") && $parentLi.parent().hasClass(_.options.menu)) {
                $parentLi.attr('data-type', _.options.menutype);
            }

            // Have anchor do what it normally would do unless it has subs

            if ($anchor.siblings().not("a").length > 0) {
                //Style it up via class
                var $expandable = $anchor.siblings();

                var newID = "cm-dropdown" + idNum;

                if (_.options.expanders) {
                    var $sibling = $("<a id='" + newID + "' href='#' role='menuitem' aria-haspopup='true' class='has-sub' tabindex='-1'><span><span class='visually-hidden'>" + _.options.expanderText + "</span></span></a>");
                    $anchor.wrap("<div class='expander-wrap'></div>").after($sibling);

                    $sibling.on("click", _.subMenuToggle);
                } else {
                    //if there is an ID use it and make sure the expandable item gets it otherwise add the new id created
                    $anchor.attr("id") ? newID = $anchor.attr("id") : $anchor.attr("id", "cm-dropdown" + idNum);
                    // bind click functionality for anchors as well as aria / class
                    $anchor.attr({ "aria-haspopup": "true" }).addClass("has-sub").on("click", _.subMenuToggle);
                }

                var visibleAlready = $expandable.height() > 0 ? true : false;
                $expandable.attr({ "role": "menu", "aria-expanded": visibleAlready, "aria-hidden": !visibleAlready, "aria-labelledby": newID });

                if (_.options.landings && !_.options.expanders) {
                    var $duplicate = $expandable.is("ul") ? $("<li class='link-landing'>" + $anchor.get(0).outerHTML + "</li>") : $("<div class='link-landing'>" + $anchor.get(0).outerHTML + "</div>");
                    $duplicate.children().removeAttr("aria-haspopup class id");
                    $duplicate.find("a").removeClass("has-sub");
                    $expandable.prepend($duplicate);
                }

                if ($parentLi.data("type") && $parentLi.data("type") === "sliding") {
                    var $subMenu = $("<div class='sub-menu cm-js-inactive'></div>");

                    $expandable.wrap($subMenu);

                    var adjustMenu = function () {
                        var maxWidth = _.$menu.innerWidth(),
                            leftPosition = $parentLi.position().left,
                            $adjustable;

                        $adjustable = $parentLi.children(".sub-menu");
                        $adjustable.find("> ul > li > ul").innerWidth(maxWidth);

                        $adjustable.innerWidth(maxWidth).css("left", "-" + leftPosition + "px");
                    };


                    var debounceAdjustments = debounce(adjustMenu, 200);

                    $(window).load(function () {
                        adjustMenu();

                        $(window).resize(debounceAdjustments);
                    });

                }

                if (newID === "cm-dropdown" + idNum) {
                    idNum++;
                }
            }

            // ADD In Initial Links for main tier
            if ($anchor.closest("[role]:not(a)").data("type")) {
                _.initialLinks.push($anchor);

                if (_.options.expanders && $sibling) {
                    _.initialLinks.push($sibling);
                }
            }

        });

        _.currentLinks = _.initialLinks;
        _.currentLinks[_.currentFocus].attr("tabindex", "0");

    };

    ClickMenu.prototype.keyHandler = function (e) {
        var _ = this;

        if (!_.$menu.hasClass("cm-js-inFocus")) {
            _.$menu.addClass("cm-js-inFocus").attr("tabindex", "-1");
        }
        //LEFT UP RIGHT DOWN
        if (e.keyCode === 37 || e.keyCode === 38 || e.keyCode === 39 || e.keyCode === 40) {
            //Prevent Scrolling aspects from browser
            e.preventDefault();

            //Maintain currentLink since it will potentially be overwritten wtih the next focus
            var oldLink = _.currentLinks[_.currentFocus];

            //Don't do anything if in mid transition
            if (oldLink) {
                var inMainTier = oldLink.closest("[role]:not(a)").attr("data-type"),
                    inSecondTier = oldLink.closest("[role=menu]:not(a)").closest("[role=presentation]").attr("data-type"),
                    next, direction, close, open;

                //IF LEFT / UP  (Depending on TIER) change next item to rotate to

                if (inMainTier) {
                    // IF LEFT / RIGHT rotate to new item
                    if (e.keyCode === 37) {
                        direction = "prev";
                    } else if (e.keyCode === 39) {
                        direction = "next";
                    } else if (e.keyCode === 40 || e.keyCode === 38) {
                        open = true;
                    }
                } else {
                    // IF UP / DOWN rotate to new item - IF LEFT on sub subs close menu
                    if (e.keyCode === 38) {
                        direction = "prev";
                    } else if (e.keyCode === 40) {
                        direction = "next";
                    } else if (e.keyCode === 39) {
                        open = true;
                    } else if (!inSecondTier && e.keyCode === 37) {
                        close = true;
                    }
                }

                if (direction) {

                    if (direction === "prev") {
                        //If there aren't any prior items move to last item in the list
                        _.currentFocus = _.currentFocus - 1 >= 0 ? _.currentFocus - 1 : _.currentLinks.length - 1;
                    } else {
                        //If there aren't any more items move to first item in the list
                        _.currentFocus = _.currentFocus + 1 < _.currentLinks.length ? _.currentFocus + 1 : 0;
                    }
                    next = _.currentLinks[_.currentFocus];

                }

                //If there isn't anything next click the anchor
                if (next) {
                    oldLink.attr("tabindex", "-1");
                    _.currentLinks[_.currentFocus].attr("tabindex", "0").focus();
                } else if (close) {
                    //Same as ESCAPE
                    _.$menu.find(".opened").last().find("[aria-haspopup]").first().trigger("click");
                } else if (open) {
                    //Only open if it isn't opened - escape is how to close a menu
                    if (!oldLink.closest("li").hasClass("clicked")) {
                        _.currentLinks[_.currentFocus].trigger("click");
                    }
                }
            }
            //ESCAPE
        } else if (e.keyCode === 27) {
            e.preventDefault();
            _.$menu.find(".opened").last().find("[aria-haspopup]").first().trigger("click");
            //SPACE BAR
        } else if (e.keyCode === 32) {
            e.preventDefault();
            _.currentLinks[_.currentFocus].trigger("click");
        }
    };

    ClickMenu.prototype.cleanUpEvents = function () {
        var _ = this;
        _.$menu.find("li a").off("click", _.subMenuToggle);
        _.$menu.find("li a[tabindex]").removeAttr("tabindex");

        // Change into FOCUS with corresponding namespace function
        _.$menu.off('keydown', _.keyHandler);

        $("html").off("touchstart click focusin", _.menuHandler);
        $("html").off("touchstart click focusin", _.menuToggleHandler);
    };

    ClickMenu.prototype.destroy = function () {
        var _ = this;

        _.$menu.removeClass("cm-js-enabled cm-js-inFocus");
        _.$menu.find("li").removeClass("opened animating animated");
        _.cleanUpEvents();
    };

    ClickMenu.prototype.showMenu = function () {
        var _ = this;

        _.isActive = true;
        _.isToggled = true;
        _.$menu.addClass("cm-js-active");

        _.$menuToggle.addClass("active").removeClass("touched");
        $("html").addClass(_.options.htmlClass); // ADD FOR INITIAL STYLING

        _.currentLinks[_.currentFocus].attr("tabindex", "0").focus();

        $("html").off("touchstart click focusin", _.menuToggleHandler);

        // ADD TOGGLE HANDLER AFTER ANIMATION TO PREVENT CLOSING MENUS FROM REMOVING THE HANDLER
        setTimeout(function () {
            $("html").addClass(_.options.htmlClass).on("touchstart click focusin", _.menuToggleHandler);
        }, _.options.animationSpeed);
    };

    ClickMenu.prototype.hideMenu = function () {
        var _ = this;

        _.isActive = false;
        _.isToggled = false;
        _.$menu.removeClass("cm-js-active cm-js-inFocus");
        _.$menuToggle.removeClass("active touched");

        $("html").removeClass(_.options.htmlClass).addClass("cm-animate-out").off("touchstart click focusin", _.menuToggleHandler);

        setTimeout(function () {
            $("html").removeClass("cm-animate-out");
        }, _.options.animationSpeed);
    };

    ClickMenu.prototype.menuToggle = function (e) {
        var _ = this;
        e.preventDefault();

        if (e.type === "touchstart") {
            _.$menuToggle.addClass("touched");
        }

        if (!(_.$menuToggle.hasClass("touched") && e.type === "click")) {
            _.isActive ? _.hideMenu() : _.showMenu();
        }
    };

    ClickMenu.prototype.subMenuToggle = function (e) {
        var _ = this;

        var $currAnchor = $(e.currentTarget),
            $parentLi = $currAnchor.closest("li"),
            $menuCol = $currAnchor.closest("[data-type]"),
            menuType = $menuCol.data("type"),
            relatedMenu = $("[aria-labelledby=" + $currAnchor.attr("id") + "]");

        if ($parentLi.hasClass("opened")) {

            $("html").off("touchstart click focusin", _.menuHandler);

            if (_.options.singleClick) {
                e.preventDefault();

                if (menuType === "sliding" && $parentLi.parents(".sub-menu").hasClass("sub-menu")) {
                    $parentLi.parents(".sub-menu").addClass("cm-js-inactive");
                }

                $parentLi.removeClass("opened animating animated");

                if (_.$menu.find(".opened").length > 0) {
                    $("html").on("touchstart click focusin", _.menuHandler);
                }

                relatedMenu.attr({ "aria-expanded": "false", "aria-hidden": "true" });

                $.each(_.currentLinks, function () {
                    var $anchor = this;
                    $anchor.attr("tabindex", "-1");
                });

                _.currentLinks = [];

                setTimeout(function () {
                    if (!$parentLi.data("type")) {
                        var actualKey = 0;

                        $parentLi.closest("[role=menu]").find("a, input, select, textarea, button").each(function (key, val) {
                            //How do you find :hidden items that aren't actually hidden? Check the height of the parent - be careful of floating clearout issues
                            var $val = $(val);
                            //Looks like even with animation speed done correctly there can be a minor amount of pixels still transitioning in css
                            if ($val.closest("[role=menu]").height() > 10 && $val.closest("[role=menu]").width() > 10) {
                                _.currentLinks.push($val);

                                if ($currAnchor.attr("id") === $val.attr("id")) {
                                    _.currentFocus = actualKey;
                                }

                                actualKey++;
                            }
                        });
                    } else {
                        _.currentLinks = _.initialLinks;
                        _.currentFocus = $parentLi.index();
                    }

                    $currAnchor.attr("tabindex", "0").focus();
                }, _.options.animationSpeed);

            }
        } else {
            // Otherwise Open submenu and attach site click handler
            // Also - close any other open menus and their children
            e.preventDefault();

            $parentLi.addClass("opened animating").siblings().removeClass("opened animating animated")
                     .find(".opened").removeClass("opened animating animated");

            $parentLi.siblings().find(".sub-menu").addClass("cm-js-inactive");

            if (menuType === "sliding" && $parentLi.parents(".sub-menu").length > 0) {
                $parentLi.parents(".sub-menu").removeClass("cm-js-inactive");
            }

            relatedMenu.attr({ "aria-expanded": "true", "aria-hidden": "false" });

            $.each(_.currentLinks, function () {
                var $anchor = this;
                $anchor.attr("tabindex", "-1");
            });

            _.currentLinks = [];

            //Wait until timer is complete so the bindings and currentLink groupings don't overlap
            setTimeout(function () {
                if ($parentLi.hasClass("animating")) {
                    $parentLi.removeClass("animating").addClass("animated");
                }

                $parentLi.find("[role=menu]").first().find("a").each(function (key, val) {
                    //How do you find :hidden items that aren't actually hidden? Check the height of the parent - be careful of floating clearout issues
                    var $val = $(val);

                    if ($val.closest("[role=menu]").height() > 10 && $val.closest("[role=menu]").width() > 10) {
                        _.currentLinks.push($val);
                    }
                });

                _.currentFocus = 0;

                try {
                    _.currentLinks[_.currentFocus].attr("tabindex", "0").focus();
                }
                catch (err) {
                }

                // ADD TOGGLE HANDLER AFTER ANIMATION TO PREVENT CLOSING MENUS FROM REMOVING THE HANDLER
                $("html").on("touchstart click focusin", _.menuHandler);

            }, _.options.animationSpeed);
        }
    };

    ClickMenu.prototype.menuToggleHandler = function (e) {
        var _ = this;
        try {
            if (!$.contains(_.menu, e.target) && !_.$menu.is($(e.target)) && _.isToggled) {
                if (_.$menuToggle.length > 600 || (e.target.constructor.name === "HTMLAnchorElement" || e.target.constructor.name === "HTMLSpanElement")) {

                    _.isToggled = false;
                    _.touchStart = false;
                    if (_.$menuToggle.length > 0) {
                        _.$menuToggle.trigger("click");
                    } else {
                        _.hideMenu();
                    }
                    $("html").removeClass(_.options.htmlClass).off("touchstart click focusin", _.menuToggleHandler);
                }
            }

        } catch (err) { }

    };

    ClickMenu.prototype.menuHandler = function (e) {
        var _ = this;

        if (!$.contains(_.menu, e.target) && !_.$menu.is($(e.target))) {
            _.$menu.find(".opened").removeClass("opened animated animating");
            _.$menu.find("[role=menu]").attr({ "aria-expanded": "false", "aria-hidden": "false" });
            _.$menu.find(".sub-menu").addClass("cm-js-inactive");
            _.$menu.find("li a[tabindex=0]").attr("tabindex", "-1");

            _.currentLinks = _.initialLinks;
            _.currentFocus = 0;

            $(".cm-js-inFocus").removeClass("cm-js-inFocus");
            _.currentLinks[_.currentFocus].attr("tabindex", "0");

            $("html").off("touchstart click focusin", _.menuHandler);
        }
    };

    $.fn.clickMenu = function () {
        var _ = this,
            opt = arguments[0],
            args = Array.prototype.slice.call(arguments, 1),
            l = _.length,
            i = 0,
            ret;

        for (i; i < l; i++) {
            if (typeof opt == 'object' || typeof opt == 'undefined') {
                _[i].clickMenu = new ClickMenu(_[i], opt);
            } else {
                ret = _[i].clickMenu[opt].apply(_[i].clickMenu, args);
            }

            if (typeof ret != 'undefined') return ret;
        }

        return _;
    };

})(jQuery);
;
// Begin Inline Image Lazy Loader
const LAZY_IMAGES = document.querySelectorAll('.u-lazy-image[data-src]');

function preloadImage(img) {
  const LAZY_SRC = img.getAttribute('data-src');
  if(!LAZY_SRC){
    return;
  } 
  img.src = LAZY_SRC;
}

const LAZY_IMG_OPTIONS = {};

const LAZY_IMG_OBSERVER = new IntersectionObserver ( function (entries, LAZY_IMG_OBSERVER) {
  entries.forEach( function (entry) {
    if (!entry.isIntersecting) {
      return;
    } else {
      preloadImage(entry.target);
      LAZY_IMG_OBSERVER.unobserve(entry.target);
    }
  })
}, LAZY_IMG_OPTIONS);

for (var i = LAZY_IMAGES.length - 1; i >= 0; i--) {
  LAZY_IMG_OBSERVER.observe(LAZY_IMAGES[i]);
}

// requestAnimationFrame polyfill by Erik Möller.
// Fixes from Paul Irish, Tino Zijdel, Andrew Mao, Klemen Slavič, Darius Bacon
// MIT license
if (!Date.now) {
    Date.now = function () { return new Date().getTime(); }
}

(function () {
    'use strict';
    var vendors = ['webkit', 'moz'];
    for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
        var vp = vendors[i];
        window.requestAnimationFrame = window[vp + 'RequestAnimationFrame'];
        window.cancelAnimationFrame = (window[vp + 'CancelAnimationFrame']
                                   || window[vp + 'CancelRequestAnimationFrame']);
    }
    if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) // iOS6 is buggy
        || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
        var lastTime = 0;
        window.requestAnimationFrame = function (callback) {
            var now = Date.now();
            var nextTime = Math.max(lastTime + 16, now);
            return setTimeout(function () { callback(lastTime = nextTime); },
                              nextTime - now);
        };
        window.cancelAnimationFrame = clearTimeout;
    }
}());

//ACCESSIBILITY A11Y CLICK FUNCTION
function a11yClick(event) {
    if (event.type === 'click' || event.type === 'touchstart') {
        return true;
    }
    else if (event.type === 'keypress') {
        var code = event.charCode || event.keyCode;
        if (code === 32) {
            event.preventDefault();
        }
        if ((code === 32) || (code === 13)) {
            return true;
        }
    }
    else {
        return false;
    }
}

//FUNCTIONALITY CHECK FOR DATE INPUT STYLE SUPPORT
function checkDateInput() {
    var input = document.createElement('input');
    input.setAttribute('type', 'date');

    var notADateValue = 'not-a-date';
    input.setAttribute('value', notADateValue);

    return !(input.value === notADateValue);
}

//iOS FIX to incorrect focus bug with keyboard not showing up and then the last touchup element gets clicked.
if (/iPad|iPhone|iPod/g.test(navigator.userAgent)) {
    (function ($) {
        return $.fn.focus = function () {
            return arguments[0];
        };
    })(jQuery);
}

/*----------- GET PROPER VIEWPORT -----------*/
var getViewportW = window.getViewportW || function () {
    var win = typeof window != 'undefined' && window,
        doc = typeof document != 'undefined' && document,
        docElem = doc && doc.documentElement;

    var a = docElem['clientWidth'], b = win['innerWidth'];
    return a < b ? b : a;
};

// var jQuery = jQuery.noConflict();
jQuery(document).ready(function ($) {

    /* TO ORGANIZE */

    $("body").on("click", function () {
        var $html = $("html");
        if (!$html.hasClass("click-user")) {
            $html.removeClass("keyboard-user").addClass("click-user");
        }
    });

    $("body").on("keyup", function () {
        var $html = $("html");
        if (!$html.hasClass("keyboard-user")) {
            $html.removeClass("click-user").addClass("keyboard-user");
        }
    });

    //JS insertion of placeholders	

    $(".help-block + .help-block").each(function () {
        var $help = $(this).addClass("visually-hidden");
        var $siblingInput = $help.siblings("input");
        var $siblingLabel = $help.siblings("label");

        if ($siblingInput.length > 0) {
            $siblingInput.attr("placeholder", $help.text());
            $siblingLabel.append($help);
        }
    });

    // Check if ".actions-stacked" exist on the page and put a class to the body
    if ($(".actions-stacked").length) {
        $("body").addClass("has-box");
    }

    // adding Debounce to do Match Heights
    var debounce = function (func, wait, immediate) {
        var timeout;
        return function () {
            var context = this, args = arguments;
            var later = function () {
                timeout = null;
                if (!immediate) func.apply(context, args);
            };
            var callNow = immediate && !timeout;
            clearTimeout(timeout);
            timeout = setTimeout(later, wait);
            if (callNow) func.apply(context, args);
        };
    };

    var adjustHeights = function () {
        var windolWidth = getViewportW();

        $('.main-actions a .ql-title , .widget-header .title').css("min-height", 0);

        if (windolWidth < 768) {
            $(".main-actions").each(function () {
                $(this).find("a").matchHeights();
            });
        }

        if (windolWidth >= 400) {
            $(".news-widget .widget-content").each(function () {
                $(this).find(".content .title").matchHeights();
            });
        }
        if (windolWidth >= 768) {
            $(".sm-flexing").each(function () {
                $(this).find(".widget-header .title").matchHeights();
            });
            $(".main-actions").each(function () {
                $(this).find("ul li a .ql-title").matchHeights();
            });
        }

    }

    adjustHeights();
    var debounceHeights = debounce(adjustHeights, 200);

    $(window).load(function () {

        adjustHeights();
        $(window).resize(debounceHeights);

    });

    /* REMOVE POINTER EVENTS WHILE SCROLLING TO HELP WITH FPS */
    var body = document.body,
        cover = document.createElement('div'),
        timer;

    //cover.setAttribute('class', 'scroll-cover');

    window.addEventListener('scroll', function () {
        clearTimeout(timer);
        body.appendChild(cover);

        timer = setTimeout(function () {
            body.removeChild(cover);
        }, 300);
    }, false);
    /* END POINTER EVENTS WHILE SCROLLING CHANGES */

    $(".sticky-nav").each(function () {
        var $nav = $(this),
            navOffset = $nav.offset().top;

        $nav.affix({
            offset: {
                top: navOffset
            }
        });
    });

    $(".toggle-content").on("click", function (e) {
        e.preventDefault();
        var $toggle = $(this),
            target = $toggle.attr("href"),
            $shown = $(".shown");

        $shown.removeClass("shown").fadeOut(function () {
            $shown.addClass("hide");
        });
        $(target).hide().removeClass("hide").fadeIn(function () {
            $(window).scrollTo(target, 300, {
                onAfter: function (t, settings) {
                    $(target).addClass("shown").focus();
                }
            });
        });
    });

    // disable automatic dl creation if we're in page editor
    // otherwise the WYSIWYG editor will happily save these
    if ($(".scWebEditInput").length <= 0) {
        $(".table-split-dl").each(function () {
            var $table = $(this),
                $newTable = $table.clone();

            var $thead = $table.find("thead th");

            $newTable.find("> tbody tr").each(function () {
                var $row = $(this);

                $row.children().each(function (key, val) {
                    var $cell = $(this),
                        $dl = $("<dl></dl>"),
                        $dtContent = $thead.eq(key).html() ? $("<dt class='visually-hidden'>" + $thead.eq(key).html() + "</dt>") : "",
                        $ddContent = $("<dd>" + $cell.html() + "</dd>");

                    if ($cell.text() && $cell.find("[href=#top]").length <= 0) {
                        $cell.html($dl.append([$dtContent, $ddContent]));
                    }
                });
            });

            $table.html($newTable.html());

        });
    }

    /* ================================================================
         A11Y
       ================================================================ */

    var $lastFocused = $("body");

    // GET LAST FOCUS LOCATION BEFORE AJAX UPDATES
    function updateFocusLocation(e) {
        $lastFocused = $(e.target).closest("#hawkfacets, #hawktoppager, #hawkbottompager");
    }

    $("#hawkfacets, #hawktoppager, #hawkbottompager").on("focus", "a, button, input, select, textarea, [tabindex]", updateFocusLocation);

    // CALL A11Y FIXES ON LOAD AND ON AJAX UPDATES
    function updateHawkA11y() {

        $(".hawk-railNavHeading").attr({ tabindex: 0, role: "button"});

        var $headings = $(".hawk-groupHeading");
        var expandItemID = $headings.last().data("expandItemID") ? parseInt( $headings.last().data("expandItemID") ) : 0;

        $headings.not("[tabindex]").each(function(){
            var $heading = $(this),
                $content = $heading.siblings(".hawk-navGroupContent");

            var expanded = $content.is(":visible") ? "true" : "false";
            var headingID = $heading.attr("id") ? $heading.attr("id") : "hawk-expanderID" + expandItemID;
            var contentID = $content.attr("id") ? $content.attr("id") : "hawk-expandableID" + expandItemID;
            expandItemID++;

            $heading.attr( { id : headingID, tabindex: "0", role: "button", "aria-expanded": expanded, "aria-controls": contentID }).on("click", function(e){
                if ( $heading.attr("aria-expanded") === "true" ) {
                    $heading.add($content).attr("aria-expanded", "false");
                    $content.slideUp();
                } else {
                    $heading.add($content).attr("aria-expanded", "true");
                    $content.slideDown();
                }
            }).on("keypress", function(e){
                if (a11yClick(e)) {
                    e.preventDefault();
                    $heading.trigger("click");
                } 
            }).data( expandItemID );

            $content.attr( { "aria-expanded": expanded, "aria-labelledby": headingID } );

            if ( $content.closest(".hawk-selectedNav").length <= 0 ) {
                $content.wrapInner("<fieldset/>");
                $content.find("fieldset").prepend("<legend class='visually-hidden'>" + $heading.text() +"</legend>");
            }

        });

        function resetHeadings() {
            $headings.each(function(){
                var $heading = $(this),
                    $content = $heading.siblings(".hawk-navGroupContent"),
                    expanded = $content.is(":visible") ? "true" : "false";

                $heading.attr( { "aria-expanded": expanded } );
                $content.attr( { "aria-expanded": expanded } );
            })
        }

        var debouncedResetHeadings = debounce(resetHeadings, 200);

        $(window).on("resize", debouncedResetHeadings);

        $(".hawk-quickSearch").each(function(){
            var $wrap = $(this);
            if ( $wrap.find("label").length <= 0 ) {
                $wrap.find("input").wrap("<label />")
                $wrap.find("label").prepend("<span class='visually-hidden'>Quick Lookup</span>");
            }
        });

        var dateInputID = 0;
        $(".hawk-datePicker:not(.a11y-setup)").each(function(){
            var $wrap = $(this),
                $label = $wrap.find("label"),
                $input = $wrap.find("input[type=text]");
            
            $wrap.addClass("a11y-setup");


            $label.each(function(key, val){
                var $currLabel = $(this);
                if ( ! $currLabel.attr("for") && $input.get(key) ) {
                    var $relatedInput = $( $input.get(key) );
                    if ( $relatedInput.attr("id") ) {
                        $currLabel.attr("for", $relatedInput.attr("id"));
                    } else {
                        $currLabel.attr("for", "hawkDateInput" + dateInputID);
                        $relatedInput.attr("id", "hawkDateInput" + dateInputID);
                        dateInputID++;
                    }

                    $currLabel.append("<span class='visually-hidden'>* Note: use arrow keys to select datepicker days</span>");
                }
            });

            var helperAlert = "<div class='visually-hidden' role='alert'><span>datepicker selected </span><span class='date-content'></span></div>";
            var dayArray = ["Sunday", "Monday", "Tuesday", "Wednesady", "Thursday", "Friday", "saturday"];

            $input.each(function() {
                var $this = $(this),
                    $helperAlert = $(helperAlert),
                    $alertContent = $helperAlert.find(".date-content"),
                    currText = "";

            function keyupUpdateInfo(e){
                    var listedCase = false;

                    switch (e.which) {
                        case 37:
                        case 38:
                        case 39:
                        case 40:
                            listedCase = true;
                            break;
                        case 33:
                            e.preventDefault();
                            $(".datepicker-days .prev:visible").trigger("click");
                            listedCase = true;
                            break;
                        case 34:
                            e.preventDefault();
                            $(".datepicker-days .next:visible").trigger("click");
                            listedCase = true;
                            break;
                    }

                    if ( listedCase ) {
                        updateDateAlert();
                    }
                }

                function updateDateAlert(){
                    var $datepicker = $(".datepicker"),
                        $currSelect = $datepicker.find(".focused:visible").length > 0 ? $datepicker.find(".focused:visible") : $datepicker.find(".active:visible"),
                        dayText = dayArray[$currSelect.index()] ? dayArray[$currSelect.index()] : "month ",
                        updateText =  dayText + " " + $currSelect.text() + " " + $datepicker.find(".datepicker-switch:visible").text();

                    if ( updateText === currText ) {
                        updateText = "reached date range boundary";
                    } else {
                        currText = updateText;
                    }

                    $alertContent.css("visibility", "hidden").text( updateText );
                    setTimeout( function() { $alertContent.css("visibility", "visible"); }, 200);
                }

                $this.before($helperAlert);

                $this.on("show", function(e) {
                    $helperAlert.attr({ "role": "alert", "aria-live": "polite" });
                    $this.on("keydown", keyupUpdateInfo);
            }).on("hide", function(e){
                    $this.off("keydown", keyupUpdateInfo);
            });
            });
        });

        $lastFocused.focus();
    }

    updateHawkA11y();
    $(document).on("hawksearch.processed", updateHawkA11y);

    if ( $("#hawkfacets").length > 0 ) {
        var $skipContent = $("<div class='skip-links' />"),
            $info = $("<div class='hidden-info visually-hidden focusable' tabindex='0'><p>For keyboard shortcuts to move through the search tool, you can use ctrl + left '[' or right ']' brackets to move between the search facets, pagination, and results.</p></div>");
            focusArray = ["hawkfacets", "hawktoppager", "hawkitemlist"],
            $skipToTop = $('<a href="#'+ focusArray[1] +'" class="hidden-info visually-hidden focusable">Skip to Pagination</a>'),
            $skipToList = $('<a href="#'+ focusArray[2] +'" class="hidden-info visually-hidden focusable">Skip to Results</a>');

        $skipContent.append($info);
        $skipContent.append($skipToList);
        $skipContent.append($skipToTop);
        $("#hawkfacets").before($skipContent);

        var currFocus = 0;

        function jumpToLocation(e) {
            if (e.ctrlKey && e.keyCode === 219 || e.keyCode === 221) {
                if (e.keyCode === 219) {
                    if ( currFocus > 0 ) {
                        currFocus--;
                    } else {
                        currFocus = focusArray.length-1;
                    }
                } else {
                    if (currFocus < focusArray.length-1) {
                        currFocus++;
                    } else {
                        currFocus = 0;
                    }
                }
                $("#"+focusArray[currFocus]).attr("tabindex", -1).focus();
            }
        }

        $("body").on("keyup", jumpToLocation);
    }

    /* ================================================================
         LAZY LOADING
       ================================================================ */


    $(".page-section").on("scrollSpy:enter", function () {
        var $section = $(this),
            $next = $section.next(".page-section");

        requestAnimationFrame(function () {
            if ($section.hasClass("unloaded")) {
                $section.removeClass("unloaded").addClass("loaded");
            }
            if ($next && $next.hasClass("unloaded")) {
                $next.removeClass("unloaded").addClass("loaded");
            }

            $section.removeClass("static").addClass("animate");
        });
    });

    /*
    $(".page-section").on("scrollSpy:exit", function() {
        $(this).removeClass("animate").addClass("static");
    });
    */

    $(window).load(function () {
        $(".page-section").scrollSpy();
    });

    /* ================================================================
         CAROUSELS / SLIDESHOWS
       ================================================================ */

    $(".slideshow").each(function () {
        var $slideshow = $(this);

        if ($slideshow.find(".banner-section:first").hasClass("theme-color7")) {
            $slideshow.addClass("dark-theme");
        } else {
            $slideshow.addClass("light-theme");
        }

        // infinite causes div cloning which breaks page editor
        var isExperienceEditor = $("#scPageExtendersForm").length > 0;
        var useInfinite = !isExperienceEditor;

        var slideshowSlickOptions = {
            dots: true,
            infinite: useInfinite,
            speed: 300,
            autoplay: false
        };

        if (typeof slideshowAutoplaySpeed != 'undefined' && slideshowAutoplaySpeed > 0) {
            slideshowSlickOptions.autoplay = !isExperienceEditor;
            slideshowSlickOptions.autoplaySpeed = slideshowAutoplaySpeed;
        }

        $slideshow.slick(slideshowSlickOptions);


        $slideshow.on("beforeChange", function (e, slick, currSlide, nextSlide) {
            var $nextSlide = $(slick.$slides[nextSlide]);
            //Clear out background overwrite class to load image
            $nextSlide.removeClass("unloaded static").addClass("loaded animate");
            $(".slick-cloned.unloaded").removeClass("unloaded static").addClass("loaded animate");

                if ($nextSlide.hasClass("theme-color7")) {
                    $nextSlide.closest(".slideshow").removeClass("light-theme").addClass("dark-theme");
                } else {
                    $nextSlide.closest(".slideshow").removeClass("dark-theme").addClass("light-theme");
                }
        });

        //inital impression

        //registerImpression($(".slick-slide.slick-current.slick-active").attr("data-bannerguid"));
        //$(".slickSlideshow").on('afterChange', function (event, slick, currentSlide, nextSlide) {
        //    registerImpression(slick.$slides.eq($(".slickSlideshow").slick("slickCurrentSlide")).attr("data-bannerguid"));
        //});

    });

    $(".impression").each(function () {
        var $this = $(this);
    //    registerImpression($this.attr("data-bannerguid"));
    });

    $(".btn-click").click(function () {
        var $this = $(this);
        registerClick($this.attr("data-buttonguid"));
    });

    $(".videobtn-click").click(function () {
        var $this = $(this);
        if ($this.attr("data-goalguid") != "") {
            registerClickVideo($this.attr("data-goalguid"));
        }
    });

    if ($(".slideshow + .section-nav").length >= 0) {
        $(".section-nav").prev(".slideshow").addClass("has-section-nav");
    }

    $(".carousel").each(function() {
        var $this = $(this);
		maxItems = $this.data("items") || 4;
		
        $this.slick({
            lazyLoad: "ondemand",
            dots: true,
            speed: 300,
            slidesToShow: maxItems,
            slidesToScroll: 1,
            infinite: false,
            responsive: [
                {
                    breakpoint: 1024,
                    settings: {
                        slidesToShow: 3,
                        slidesToScroll: 1
                    }
                },
                {
                    breakpoint: 600,
                    settings: {
                        slidesToShow: 2,
                        slidesToScroll: 1
                    }
                },
                {
                    breakpoint: 400,
                    settings: {
                        slidesToShow: 1,
                        slidesToScroll: 1
                    }
                }
            ]
        });
		
        $this.find(".slick-slide").removeAttr("aria-describedby");
    });

    $(".carousel-providers").each(function() {
        var $this = $(this);

        $this.slick({
            lazyLoad: "ondemand",
            dots: false,
            arrows: true,
            speed: 300,
            slidesToShow: 4,
            slidesToScroll: 1,
            infinite: false,
            responsive: [
                {
                    breakpoint: 1300,
                    settings: {
                        slidesToShow: 3,
                        slidesToScroll: 1
                    }
                },
                {
                    breakpoint: 700,
                    settings: {
                        slidesToShow: 2,
                        slidesToScroll: 1
                    }
                },
                {
                    breakpoint: 500,
                    settings: {
                        slidesToShow: 1,
                        slidesToScroll: 1
                    }
                }
            ]
        });

        $this.find(".slick-slide").removeAttr("aria-describedby");
    });
	
    $(".carousel-with-rows").each(function(){
		var $this = $(this);
		
        $this.slick({
            infinite: true,
            speed: 300,
            rows: 2,
            slidesPerRow: 3,
			slidesToScroll: 1,
            dots: true,
            arrows: false,
            responsive: [
                {
                    breakpoint: 1024,
                    settings: {
						slidesPerRow: 2
                    }
                },
                {
                    breakpoint: 600,
                    settings: {					
						slidesPerRow: 1
                    }
                }
            ]
        });
    });	
	

    /* ================================================================
         NAVIGATION
       ================================================================ */

    var $additionalItems = $(".extra-links").first().find("a:not(.tool-link)");

    $additionalItems.each(function (key, link) {
        var $extraLinkWrap = $("<li class='extra-link'></li>");
        $extraLinkWrap.html($(link).clone());
        $(".main-nav .cm-menu").append($extraLinkWrap);
    });

    $(".main-nav").clickMenu({ menutype: "mega" });

    $(".main-nav .has-sub").on("click keypress", function (e) {
        var $link = $(this),
            $lazyItems = $link.siblings(".sub-menu").find("[data-src]");

        $lazyItems.each(function () {
            var $this = $(this);
            $this.attr("src", $this.data("src"));
            $this.removeAttr("data-src");
        });

        if (getViewportW() < 1240 && $link.siblings(".tier-3").length > 0) {
            $link.siblings(".tier-3").find(".section-link a").trigger("click");
        }
    });

    $(".header-top").on("touchstart click keypress", ".toggle-menu", function (e) {
        e.preventDefault();
        if (a11yClick(e) === true && $(".cm-js-menu-active").length <= 0 && $(".cm-animate-out").length <= 0) {
            $(".main-nav .toggle-menu:not(.active)").trigger("click");
        }
    });

    $(".section-nav").on("touchstart click", ".toggle", function (e) {
        e.preventDefault();
        var $toggle = $(this);

        $toggle.toggleClass("active").siblings().slideToggle();
    });

    $(".toggle-search").each(function () {
        var $toggle = $(this);

        $toggle.on("click keypress", function (e) {
            if (a11yClick(e) === true) {
                e.preventDefault();
                var $trigger = $(this);

                $("html").off("click touchstart focusin", searchToggleHandler);

                if ($trigger.hasClass("active")) {
                    $trigger.removeClass("active");
                    $(".site-search").slideUp(function () {
                        $trigger.find("span span").html("Open");
                    });
                } else {
                    $trigger.addClass("active").find("span span").html("Close");
                    $(".site-search").slideDown(function () {
                        var $search = $(this);
                        setTimeout(function () {
                            $search.find("input").first().focus();
                        }, 300);
                    });

                    $("html").on("click touchstart focusin", searchToggleHandler);
                }
            }
        });

        function searchToggleHandler(e) {
            var $target = $(e.target);
            if ($target.closest(".site-search").length <= 0 && $target.closest(".toggle-search").length <= 0 && !$target.hasClass("toggle-search")) {
                $toggle.trigger("click");
            }
        };
    });

    /* ================================================================
         FORMS / HINTING
       ================================================================ */


    $('.hinted-input').on("focus", 'input', function (e) {
        $(this).addClass("hint");
    });

    $('.hinted-input').on("blur", 'input', function (e) {
        var $this = $(this);
        if ($this.val().length <= 0) {
            $(this).removeClass("hint");
        }
    });

    $(".hinted-input input").each(function () {
        var $this = $(this);
        if ($this.val().length > 0) {
            $this.addClass("hint");
        }
    });

    $(".date-row .input-group.date").each(function () {
        var $controlGroup = $(this);

        if (checkDateInput() === false) {
            $controlGroup.addClass("has-picker");
            $controlGroup.datepicker();
        }
    });

    $("select[multiple]").multiselect({
        buttonText: function (options, select) {
            if (options.length === 0) {
                return 'Select a Topic...';
            }
            else {
                return options.length + ' selected';
            }
        }
    });

    /* ================================================================
	   FILTERS/TABS FUNCTIONALITY
       ================================================================ */
    if ( $(".scWebEditInput").length <= 0 ) {
        $(".filters--tabs").each(function () {
            var $this = $(this),
                $filtersWrap = $this.find(".tabs"),
                $filters = $filtersWrap.find("a"),
		        tabText = $filters.filter("[aria-expanded=true]").text(),
		        $tabTitle = $this.find(".active-tab > span"),
		        $toggle = $this.find(".menu-link"),
                $first = $filtersWrap.find('li:first-child');

            $filters.length < 2 ? $this.addClass("is-single") : $first.addClass('active');

            $tabTitle.html(tabText);

            $toggle.on("click", function (e) {
                e.preventDefault();
            
                $("body").off("click", tabMenuToggle);

                if ($toggle.hasClass("active")) {
                    $toggle.removeClass("active");
                    $filtersWrap.removeClass("opened");
                } else {
                    $("body").on("click", tabMenuToggle);
                    $toggle.addClass("active");
                    $filtersWrap.addClass("opened").focus();
                }
            });

            $filters.on("click", function (e) {
                var $current = $(this);
                $tabTitle.html($current.text());
                $filters.parent().removeClass("active");
                $current.parent().addClass("active");
                $filters.attr('aria-selected', 'false');
                $current.attr('aria-selected', 'true');
            });

            function tabMenuToggle(e) {
                var $target = $(e.target);

                if ($target.parents(".menu-link").length <= 0 && !$target.hasClass("menu-link")) {
                    $toggle.trigger("click");
                }
            }

            $filtersWrap.on("keydown", "a", function (e) {
                var key = e.which,
                    $this = $(this),
                    $selected = $this.attr("aria-selected"),
                    $parent = $this.parent(),
                    $prevUncle = $parent.prev(),
                    $nextUncle = $parent.next();

                if (key == 39) {
                    $nextUncle.find('a').trigger('click').focus();
                }

                if (key == 37) {
                    $prevUncle.find('a').trigger('click').focus();
                }


            });
        });
    }

    /* ================================================================
         LATER BINDINGS
       ================================================================ */


    $(".help-overlay").each(function () {
        var $overlay = $(this),
            $toggle = $overlay.find(".help-toggle"),
            $content = $toggle.siblings(".help-content");

        $overlay.on("click", ".close-btn", function (e) {
            $toggle.trigger("click");
        });

        $toggle.on("click keypress", function (e) {
            if (a11yClick(e) === true) {
                e.preventDefault();
                var $trigger = $(this);

                $("html").off("click touchstart focusin", helpToggleHandler);

                if ($overlay.hasClass("active")) {
                    $overlay.removeClass("active");
                } else {
                    $overlay.addClass("active");
                    setTimeout(function () {
                        $content.focus();
                    }, 300);

                    $("html").on("click touchstart focusin", helpToggleHandler);
                }
            }
        });

        function helpToggleHandler(e) {
            var $target = $(e.target);
            if ($target.closest(".help-overlay").length <= 0 && !$target.hasClass("help-overlay")) {
                $overlay.removeClass("active");
                $("html").off("click touchstart focusin", helpToggleHandler);
            }
        };
    });

    bindVideoModals = function () {
        $('a[href="#"][videoid].control').on("click keypress", function (e) {
            if (a11yClick(e) === true) {
                e.preventDefault();
                $(".modal .text").hide();
                $(".modal .video").show();
                var videoId = this.getAttribute('videoid')
                var title = this.getAttribute("title")
                var desc = this.getAttribute("desc")
                var link = this.getAttribute("link")
                if (title != null) {
                    $("#videoTitle").html(title)
                    $("#videoTitle").show()
                }
                if (desc != null) {
                    $("#videoDescription").html(desc)
                    $("#videoDescription").show()
                }
                if (link != null) {
                    $("#videoLink").attr('href', link)
                    $("#videoLink").show()
                }
                else {
                    var link = document.getElementById('videoLink');
                    link.style.visibility = 'hidden';
                }
                var src = 'https://www.youtube.com/embed/' + videoId;
                $('#myModal iframe').attr('src', src);
                $("#myModal").modal('show');
                var clickClose = "dataLayer.push({ 'event': 'Video', 'eventName': '" + title + "', 'eventType': 'Closed' });";
                $('#videoHeaderClose').attr('onclick', clickClose);
                $('#videoFooterClose').attr('onclick', clickClose);
            }
        });
    }
    bindVideoModals();
    $(document).on("hawksearch.processed", bindVideoModals); // bind on ajax update of hawk results

	// STOPS VIDEO ON MODAL CLOSE
	$("#myModal").on('hidden.bs.modal', function (e) {
		$("#myModal iframe").attr("src", $("#myModal iframe").attr("src"));
	});

    //Web form for marketers.
    $('a.modal-form-trigger').on("click keypress", function (e) {
        if (a11yClick(e) === true) {
            var modal = $(this).next('.modal');
            if (modal.length)
            {
                modal.appendTo(document.body);  
            }
        }
    });

    //NEEDS TO HAPPEN AFTER TABLE SPLIT DL BUT REALLY ANYTIME AFTER PAGE LOAD IS FINE
    $('[data-toggle="popover"]').popover({
        placement: "auto top",
        trigger: "focus hover"
    });

    $(window).load(function () {
        OpenPanel();
    });

    $(window).on('hashchange', function () {
        OpenPanel();
    });

    function OpenPanel() {
        var hash = window.location.hash;

        if (hash !== '') {
            hash = decodeURIComponent((hash + '').replace(/\+/g, '%20')).replace(/=/g, '').replace(/&/g, '')
            .replace(/'/g, ''); //fix ' error
            
            // HawkSearch uses # for ui faceting, so url decode and strip equal signs to prevent errors
            var $anchorElement = $(hash);

            if ($anchorElement && $anchorElement.attr('data-toggle') == 'collapse') {
                $anchorElement.trigger("click");
            }
        }
    }

    /* ================================================================
	 Health Plans Calculator Specific Use Case
	=============================================================== */
//	$(window).bind("pageshow", function() {
    //	   $('input:checkbox').prop('checked', false);
    //});




    $('img[usemap]').rwdImageMaps();

    $("#baker, #benton, #clackamas, #clatsop, #columbia, #coos, #crook, #curry, #deschutes, #douglas, #gilliam, #grant, #harney, #hood-river, #jackson, #jefferson, #josephine, #klamath, #linn, #lane, #lake, #lincoln, #malheur, #marion, #morrow, #multnomah, #polk, #sherman, #tillamook, #umatilla, #union, #wallowa, #wasco, #washington, #wheeler, #yamhill")
		.mouseenter(function () {
		    $('#countySelect').attr('src', this.attributes['data-url'].value);
		})
		.mouseleave(function () {
		    $('#countySelect').attr('src', this.attributes['data-orig-url'].value);
		});



    $('.plan-button').change(function (e) {
        var $button = $(this);

        $button.toggleClass("selected");
        var counter = $(".plan-button.selected").length;

        $button.find(".checkbox-label").attr('data-content', counter);

        var planText = $button.find(".plan-button-data label").text().trim(),
			planType = $button.closest("[data-plan]").data("plan");

        if (planType === "Standard") {
            planText = planText + " " + planType;
        } else {
            planText = planType + " " + planText;
        }
        $("#planOption" + counter).val(planText);
        //$(this).find(".select-text").html("Selected");

        if (counter >= 2 && counter <= 4) {
            $(".plans-list-footer button").removeAttr("disabled");
            if (counter == 4) {
                $(".plan-button").not(".selected").addClass("disabled");
            }
            else {
                $(".plan-button").removeClass("disabled");
            }
        } else {
            $(".plan-button").removeClass("disabled");
        }
    });

    $(".plans-list-footer .clear-all").click(function (e) {
        e.preventDefault();
        $('.plan-button').removeClass("selected");
        $('.plan-button').find(".checkbox-label").attr('data-content', 0);
        $('.plan-button').find('.plan-button-checkbox input[type="checkbox"]').prop('checked', false);
    });

    $(window).bind("pageshow", function () {
        if ($('.plan-button').length) {
            var form = $('form');
            form[0].reset();
            form.find(':input').not(':button,:submit,:reset,:hidden').trigger('change');
        }
    });

    $('#selectCounty').change(function() {
        var val = $(this).val();
        if (val != '') {
            window.location = val;
        }
    });
    /* ================================================================
	END of Health Plans Calculator Specific Use Case
	=============================================================== */



    /* ================================================================
         Image SVG to inline SVG (to support css)
       ================================================================ */

    // adapted from http://stackoverflow.com/a/11978996
    jQuery('img.svg').each(function () {
        var $img = jQuery(this);
        var imgID = $img.attr('id');
        var imgClass = $img.attr('class');
        var imgURL = $img.attr('src');
        var imgAlt = $img.attr('alt');

        jQuery.get(imgURL, function (data) {
            // Get the SVG tag, ignore the rest
            var $svg = jQuery(data).find('svg');

            // Add replaced image's ID to the new SVG
            if (typeof imgID !== 'undefined') {
                $svg = $svg.attr('id', imgID);
            }
            // Add replaced image's classes to the new SVG
            if (typeof imgClass !== 'undefined') {
                $svg = $svg.attr('class', imgClass + ' replaced-svg');
            }
            // Add replaced image's alt text to the new SVG
            if (typeof imgAlt !== 'undefined') {
                $svg.prepend('<title>' + imgAlt + '</title>');
                // for accessibility
                $svg = $svg.attr('aria-label', imgAlt);
            }

            // for accessibility
            $svg = $svg.attr('role', 'img');

            // Remove any invalid XML tags as per http://validator.w3.org
            $svg = $svg.removeAttr('xmlns:a');

            // Check if the viewport is set, if the viewport is not set the SVG wont't scale.
            if (!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) {
                $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width'))
            }

            // Replace image with new SVG
            $img.replaceWith($svg);

        }, 'xml');

    });
});

/* ================================================================
   CONFIRMATION MODAL WHEN CLICKING LINK TO AN EXTERNAL SITE
   ================================================================ */
var externalUrl = '';
var useNewWindow = false;

function launchLeaveSiteModal(a)
{
    externalUrl = $(a).attr('href');
    useNewWindow = $(a).attr('target') == '_blank';
    $('.leaving_site').modal();
    return false;
}

function leaveSite()
{
    if (useNewWindow)
    {
        window.open(externalUrl, '_blank');
    }
    else
    {
        window.location = externalUrl;
    }
}

jQuery(document).ready(function ($) {

    // Disable Link Leave Feature for page editor (interferes with link editor)
    var isExperienceEditor = $("#scPageExtendersForm").length > 0;
    if (isExperienceEditor)
        return;

    var medicareDomain = /medicare.samhealthplans/;
    var shpDomain = /samhealthplans/;
    var allowedDomains = [/google/, /linkedin/, /youtube/, /facebook/, /twitter/, /samhealthplans/, /samhealth/, /samfit/, /ihntogether/, /formularynavigator/];
    var medicareAllowedDomains = [/medicare.samhealthplans/, /formularynavigator/];

    var baseUri = document.location.origin;

    $('a').filter(function () {
        if ($(this).parents("#hawkfacets, .hawksearch").length) {
            // exclude hawksearch links
            return false;
        }

        var hrefAttrib = $(this).attr('href');

        if (hrefAttrib === undefined || hrefAttrib.indexOf('http') === -1) {
            // exclude any anchors without http(s) links
            return false;
        }

        hrefAttrib = hrefAttrib.toLowerCase();

        if (!shpDomain.test(baseUri)) {
            //Not on a shp site.  Allowed to go to any other site.
            return false;
        }


        if (medicareDomain.test(baseUri)) {
            for (i = 0; i < medicareAllowedDomains.length; i++) {
                var domain = medicareAllowedDomains[i];
                if (domain.test(hrefAttrib)) {
                    return false;
                    break;
                }
            }
        }


        //Site we are on is shp but not Medicare.  Only certain other domains are allowed 
        //from here.
        if (shpDomain.test(baseUri) && !medicareDomain.test(baseUri)) {
            for (i = 0; i < allowedDomains.length; i++) {
                var domain = allowedDomains[i];
                if (domain.test(hrefAttrib)) {
                    return false;
                    break;
                }
            }
        }

        return true;
    })
    .click(function (event)
    {
        event.preventDefault();

        launchLeaveSiteModal(this);
    });
});

function getParameterByName(name)
{
    var url = window.location.href;

    url = url.toLowerCase(); // This is just to avoid case sensitiveness  
    name = name.replace(/[\[\]]/g, "\\$&").toLowerCase();// This is just to avoid case sensitiveness for query parameter name

    var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
        results = regex.exec(url);

    if (!results) return null;
    if (!results[2]) return '';

    return decodeURIComponent(results[2].replace(/\+/g, " "));
}

// support to pre-populate the searchingzipcode field if the zipcode parameter is present in the url
jQuery(document).ready(function ($)
{
    var zipField = $("#searchingzipcode");
    var zipParam = getParameterByName("searchingzipcode");

    if (zipField.length && zipParam)
    {
        zipField.val(encodeURIComponent(zipParam));
        // add hint to remove hint label
        zipField.addClass("hint");
    }
});

function registerImpression(guid) {
    $.ajax({
        url: '/track/impression/' + guid,
        type: 'GET',
        dataType: 'json',
        success: function (data) {

        }
    });
}

function registerClickVideo(guid) {
    $.ajax({
        url: '/track/videoclick/' + guid,
        type: 'GET',
        dataType: 'json',
        success: function (data) {
        }
    });
}

function registerClick(guid) {
    $.ajax({
        url: '/track/click/' + guid,
        type: 'GET',
        dataType: 'json',
        success: function (data) {

        }
    });
}

jQuery(document).ready(function ($) {
    // hook up export PDF buttons to open a new window to the pdf server
    $(".btn-pdf").on("click", function () {
        var exportUrl = $(this).data("export-url");

        if (!exportUrl)
            return;
        // full export pdf does not need hawk params
        if (exportUrl.indexOf('?') > -1) {
            // on hawk pages, append hash parameters to the grabber url
            if ($(".hawksearch").length > 0 && typeof (HawkSearch) !== "undefined") {
                var hawkHash = HawkSearch.getHash();

                if (hawkHash) {
                    exportUrl += encodeURIComponent("&" + hawkHash);
                }
            }
        }

        window.open(exportUrl, "_blank");
    });
});


jQuery(document).ready(function ($) {
    // All media download links should open in new window
    $('a[href*="ashx"]').each(function () {
        $(this).attr("target", "_blank");
    });
});


jQuery(document).ready(function ($) {
    // WFFM - remove required text on click
    $("input[type='submit']").on("click", function (e) {
        $('.required').hide();
    });
});


// Used on the facet slice for find a doctor to clear all fields.
function ClearFacetFields() {

    var elements = document.getElementsByTagName("select")
    for (var i = 0; i < elements.length; i++) {
        var elem = '#' + elements[i].name;
        $(elem).val('').trigger('chosen:updated');
    }
};
const THIS_URL = window.location.href; // This gets the current URL
const CLEAN_URL = THIS_URL.replace(/^(?:https?:\/\/)?(?:www\.)?/i, ""); // This cleans the URL so it doesn't have extra parameters

const NEW_FACEBOOK_URL = "https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2F" + CLEAN_URL + "%2F";
const NEW_TWITTER_URL = "https://twitter.com/intent/tweet?text=SHS&url=https%3A%2F%2F" + CLEAN_URL + "%2F";
const NEW_PINTEREST_URL = "https://www.pinterest.com/pin/create/button/?url=https%3A%2F%2F" + CLEAN_URL + "%2F";
const NEW_LINKEDIN_URL = "https://www.linkedin.com/cws/share?url=https%3A%2F%2F" + CLEAN_URL + "%2F";

function setSocialShareURLs() {
	document.querySelector('#c-floating-social-share .is-facebook').href = NEW_FACEBOOK_URL;
	document.querySelector('#c-floating-social-share .is-twitter').href = NEW_TWITTER_URL;
	document.querySelector('#c-floating-social-share .is-pinterest').href = NEW_PINTEREST_URL;
	document.querySelector('#c-floating-social-share .is-linkedin').href = NEW_LINKEDIN_URL;
}
function setRecipeSocialURLS(){
	document.querySelector('.c_recipe_social_media .is-facebook').href = NEW_FACEBOOK_URL;
	document.querySelector('.c_recipe_social_media .is-twitter').href = NEW_TWITTER_URL;
	document.querySelector('.c_recipe_social_media .is-pinterest').href = NEW_PINTEREST_URL;
}

// execute the functions if the correct elements are on the page
if (document.querySelector('#c-floating-social-share .is-facebook')) {
	setSocialShareURLs();
}

if (document.querySelector('.c_recipe_social_media .is-facebook')) {
	setRecipeSocialURLS();
};
var LocationMap = (function ($) {
    // our maximum zoom level on the map, for cases where markers are closely grouped at a single location
    var MAX_ZOOM = 15;


    var g_SearchMap = null;
    var g_Markers = [];
    var g_RichMarkers = [];

    var g_Settings = null;


    function initMap(elemId, settings) {

        g_Settings = settings || {};
        var isDraggable = $(document).width() > 480 ? true : false; // If document (your website) is wider than 480px, isDraggable = true, else isDraggable = false

        g_SearchMap = new google.maps.Map(document.getElementById(elemId), {
            draggable: isDraggable,
            scrollwheel: false,
            disableDoubleClickZoom: true,
            mapTypeControl: false,
            // by default, center the map around oregon
            center: { lat: 44.1743278, lng: -120.6196422 },
            zoom: 6
        });
    }

    function requestLocations() {

        if (typeof HawkSearch === "undefined") {
            throw new Error("requestLocations: HawkSearch not available");
        }

        if (typeof HawkSearch.getCustomUrl === "undefined") {
            throw new Error("requestLocations: HawkSearch not finished loading");
        }

        var lpurl = HawkSearch.getCustomUrl();
        var hash = HawkSearch.getHash();

        if (!lpurl) {
            throw new Error("requestLocations: No landing page url. Is HawkResults component missing?");
        }

        var fullUrl = "/search/map/?" + (hash != '' ? hash : '')
            + (lpurl != '' ? "&lpurl=" + encodeURIComponent(lpurl) : '');

        $.ajax({
            dataType: "json",
            method: "POST",
            url: fullUrl,
            success: processLocations,
        });
    }

    function processLocations(results) {

        if (!results || !results.success) {
            throw new Error("processLocations: unable to request locations");
        }

        clearMarkers();
        buildMarkers(results.locations);
    }

    function loadLocations(locationList) {

        if (g_SearchMap == null) {
            throw new Error("loadLocations: map not initialized");
        }

        clearMarkers();
        buildMarkers(locationList);
    }

    function buildMarkers(locationList) {

        //var markerImage = {
        //    url: "/Includes/Common/images/globals/map-indicator.png",
        //    size: new google.maps.Size(34, 42),
        //    origin: new google.maps.Point(0, 0),
        //    anchor: new google.maps.Point(0, 32)
        //};

        var bounds = new google.maps.LatLngBounds();

        var baseIndex = 0;
        var pageSize = HawkSearch.getHashOrQueryVariable("mpp") || 24;

        if (locationList.length <= pageSize)
        {
            var currentPage = HawkSearch.getHashOrQueryVariable("pg") || 1;
            baseIndex = (currentPage - 1) * pageSize;
        }
        // Draw backwards so the first locations are on top
        for (var i = locationList.length; i > 0; --i) {

            var loc = locationList[i - 1];

            var latLng = new google.maps.LatLng(loc.lat, loc.lng);
            var richmarker = new RichMarker({
                position: latLng,
                map: g_SearchMap,
                title: loc.title,
                content: '<div class="map-pin"><span class="text">' + (baseIndex + i) + '</span></div>',
                // labelContent: loc.title,
                flat: true
            });
            var marker = new google.maps.Marker({
                position: latLng,
                map: g_SearchMap,
                title: loc.title
            });

            // save our markers so we can later clear them to rebuild locations
            g_Markers.push(marker);
            g_RichMarkers.push(richmarker);

            bounds.extend(marker.position);

            if (!loc.infoHtml) {
                // if this location has no infowindow html, process the template to create it
                processTemplate(loc);
            }

            var infoWindow = buildInfoWindow(loc, marker, richmarker);
        }

        if (locationList.length > 0) {
            // if we have some locations, fit to their bounds and adjust zoom
            g_SearchMap.fitBounds(bounds);

            if (g_SearchMap.getZoom() > MAX_ZOOM) {
                // if the map zoomed in past our maximum zoom due to fitBounds, zoom back out to our maximum zoom level
                g_SearchMap.setZoom(MAX_ZOOM);
            }
        }
    }

    function processTemplate(location) {
        var hasDetails = location.details && location.details !== "";

        // create a dom element for our infowindow template
        var template = $($("#mapInfoTemplate").html());

        var findTemplateElement = function (template, selector) {
            return template
                .find(selector)
                .removeAttr("id");
        };

        var titleElem = findTemplateElement(template, "#mapInfoTemplate-title");

        titleElem.text(location.title);

        if (hasDetails) {
            // if we have details url, hook up the href
            titleElem.attr("href", location.details)
        } else {
            // otherwise, unwrap the anchor tag so the title isn't a link anymore
            titleElem.replaceWith(titleElem.html());
        }

        // update address and phone
        findTemplateElement(template, "#mapInfoTemplate-address").html(location.address);
        findTemplateElement(template, "#mapInfoTemplate-phone").text(location.phone);

        // update directions and details buttons
        findTemplateElement(template, "#mapInfoTemplate-directions").attr("href", location.directions);

        var detailsBtn = findTemplateElement(template, "#mapInfoTemplate-details");

        if (hasDetails) {
            detailsBtn.attr("href", location.details);
        } else {
            detailsBtn.remove();
        }

        // write out html to our location data
        location.infoHtml = template[0].outerHTML;
    }


    function buildInfoWindow(location, marker, richmarker) {

        var infoWindow = new google.maps.InfoWindow({
            content: location.infoHtml
        });

        richmarker.addListener('click', function () {

            // close other info windows, if configured to do so
            if (shouldCloseInfoWindows()) {

                for (var i = 0; i < g_Markers.length; ++i) {
                    var otherWindow = g_Markers[i].infoWindow;

                    if (otherWindow) {
                        otherWindow.close();
                    }
                }
            }

            infoWindow.open(g_SearchMap, marker);

            if (shouldCenterPin()) {
                g_SearchMap.panTo(marker.getPosition());
            }
        });

        google.maps.event.addListener(infoWindow, 'domready', function() {
            var iwOuter = $(".gm-style-iw");
            var iwBackground = iwOuter.prev();
            var iwCloseBtn = iwOuter.next();

            // remove background shadow div
            iwBackground.children(':nth-child(2)').css({ 'display': 'none' });
            // remove white background div
            iwBackground.children(':nth-child(4)').css({ 'display': 'none' });
            // style color of bubble tail
            iwBackground.children(':nth-child(3)')
                .find('div')
                .children()
                .css({
                    'box-shadow': '0 0 0 3px #00529b',
                    'z-index': '1'
                });

            iwCloseBtn.css({
                'right': '47px', 'top': '17px',
                'width': '25px', 'height': '25px',
                'border': '3px solid #00529b',
                'opacity': '1'
            });

            iwCloseBtn.children('img').css({
                'left': '1px', 'top': '-333px'
            });

            iwCloseBtn.mouseout(function () {
                $(this).css({ 'opacity': '1' });
            });
        });

        // store a reference to the info window on the marker so we can clean them up later
        marker.infoWindow = infoWindow;
    }

    function clearMarkers() {

        for (var i = 0; i < g_Markers.length; ++i) {
            g_Markers[i].setMap(null);
            g_RichMarkers[i].setMap(null);
        }

        g_Markers = [];
        g_RichMarkers = [];
    }

    function shouldCenterPin() { return g_Settings.CenterPinsOnClick || false; }
    function shouldCloseInfoWindows() { return g_Settings.CloseInfoWindows || false; }


    return {
        init: initMap,
        load: loadLocations,
        request: requestLocations,

        isReady: function () { return g_SearchMap != null; }
    };
}(jQuery));

(function ($) {

    var mapPromise = $.Deferred();
    var hawkPromise = $.Deferred();

    var settings = {};


    function initHawk() {
        hawkPromise.resolve();
    }

    // must be exposed globally so google maps can call on load
    window.initMap = function() {
        mapPromise.resolve();
    }


    $.when(mapPromise, hawkPromise).done(function () {

        if (typeof (LocationMapSettings) !== "undefined") {
            settings = LocationMapSettings
        }

        LocationMap.init('map', settings);

        // on initial load, request all location pins
        reloadMap(); //LocationMap.request();
    });


    function reloadMap() {
        // hawksearch finished processing search results

        if (!LocationMap.isReady()) {
            // if we have no map, don't perform any reloading logic
            return;
        }

        if (isAllPinMode()) {
            // if we're in all-pin mode, request all pins for our current facets
            LocationMap.request();
            return;
        }

        // otherwise, update location pins based on our current result html

        var locations = [];

        $(".results-list .location-results-item:visible").each(function () {
            var loc = {};

            loc.lat = $(this).data('lat');
            loc.lng = $(this).data('lng');

            if (loc.lat != '' && loc.lng != '') {
                loc.title = $(this).data('name');

                loc.infoHtml = $(this).html();

                locations.push(loc);
            }
        });

        LocationMap.load(locations);
    }

    $(document).on("hawksearch.processed", reloadMap);
    $(document).on("hawksearch.ready", initHawk);

    function isAllPinMode() { return settings.AllLocationPinMode || false; }

})(jQuery);;
/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com

Version 1.8.7
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011-2018 Harvest http://getharvest.com

MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
This file is generated by `grunt build`, do not edit it by hand.
*/

(function() {
  var $, AbstractChosen, Chosen, SelectParser,
    bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
    extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    hasProp = {}.hasOwnProperty;

  SelectParser = (function() {
    function SelectParser() {
      this.options_index = 0;
      this.parsed = [];
    }

    SelectParser.prototype.add_node = function(child) {
      if (child.nodeName.toUpperCase() === "OPTGROUP") {
        return this.add_group(child);
      } else {
        return this.add_option(child);
      }
    };

    SelectParser.prototype.add_group = function(group) {
      var group_position, i, len, option, ref, results1;
      group_position = this.parsed.length;
      this.parsed.push({
        array_index: group_position,
        group: true,
        label: group.label,
        title: group.title ? group.title : void 0,
        children: 0,
        disabled: group.disabled,
        classes: group.className
      });
      ref = group.childNodes;
      results1 = [];
      for (i = 0, len = ref.length; i < len; i++) {
        option = ref[i];
        results1.push(this.add_option(option, group_position, group.disabled));
      }
      return results1;
    };

    SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
      if (option.nodeName.toUpperCase() === "OPTION") {
        if (option.text !== "") {
          if (group_position != null) {
            this.parsed[group_position].children += 1;
          }
          this.parsed.push({
            array_index: this.parsed.length,
            options_index: this.options_index,
            value: option.value,
            text: option.text,
            html: option.innerHTML,
            title: option.title ? option.title : void 0,
            selected: option.selected,
            disabled: group_disabled === true ? group_disabled : option.disabled,
            group_array_index: group_position,
            group_label: group_position != null ? this.parsed[group_position].label : null,
            classes: option.className,
            style: option.style.cssText
          });
        } else {
          this.parsed.push({
            array_index: this.parsed.length,
            options_index: this.options_index,
            empty: true
          });
        }
        return this.options_index += 1;
      }
    };

    return SelectParser;

  })();

  SelectParser.select_to_array = function(select) {
    var child, i, len, parser, ref;
    parser = new SelectParser();
    ref = select.childNodes;
    for (i = 0, len = ref.length; i < len; i++) {
      child = ref[i];
      parser.add_node(child);
    }
    return parser.parsed;
  };

  AbstractChosen = (function() {
    function AbstractChosen(form_field, options1) {
      this.form_field = form_field;
      this.options = options1 != null ? options1 : {};
      this.label_click_handler = bind(this.label_click_handler, this);
      if (!AbstractChosen.browser_is_supported()) {
        return;
      }
      this.is_multiple = this.form_field.multiple;
      this.set_default_text();
      this.set_default_values();
      this.setup();
      this.set_up_html();
      this.register_observers();
      this.on_ready();
    }

    AbstractChosen.prototype.set_default_values = function() {
      this.click_test_action = (function(_this) {
        return function(evt) {
          return _this.test_active_click(evt);
        };
      })(this);
      this.activate_action = (function(_this) {
        return function(evt) {
          return _this.activate_field(evt);
        };
      })(this);
      this.active_field = false;
      this.mouse_on_container = false;
      this.results_showing = false;
      this.result_highlighted = null;
      this.is_rtl = this.options.rtl || /\bchosen-rtl\b/.test(this.form_field.className);
      this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
      this.disable_search_threshold = this.options.disable_search_threshold || 0;
      this.disable_search = this.options.disable_search || false;
      this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
      this.group_search = this.options.group_search != null ? this.options.group_search : true;
      this.search_contains = this.options.search_contains || false;
      this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
      this.max_selected_options = this.options.max_selected_options || Infinity;
      this.inherit_select_classes = this.options.inherit_select_classes || false;
      this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
      this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
      this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
      this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
      this.case_sensitive_search = this.options.case_sensitive_search || false;
      return this.hide_results_on_select = this.options.hide_results_on_select != null ? this.options.hide_results_on_select : true;
    };

    AbstractChosen.prototype.set_default_text = function() {
      if (this.form_field.getAttribute("data-placeholder")) {
        this.default_text = this.form_field.getAttribute("data-placeholder");
      } else if (this.is_multiple) {
        this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
      } else {
        this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
      }
      this.default_text = this.escape_html(this.default_text);
      return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
    };

    AbstractChosen.prototype.choice_label = function(item) {
      if (this.include_group_label_in_selected && (item.group_label != null)) {
        return "<b class='group-name'>" + (this.escape_html(item.group_label)) + "</b>" + item.html;
      } else {
        return item.html;
      }
    };

    AbstractChosen.prototype.mouse_enter = function() {
      return this.mouse_on_container = true;
    };

    AbstractChosen.prototype.mouse_leave = function() {
      return this.mouse_on_container = false;
    };

    AbstractChosen.prototype.input_focus = function(evt) {
      if (this.is_multiple) {
        if (!this.active_field) {
          return setTimeout(((function(_this) {
            return function() {
              return _this.container_mousedown();
            };
          })(this)), 50);
        }
      } else {
        if (!this.active_field) {
          return this.activate_field();
        }
      }
    };

    AbstractChosen.prototype.input_blur = function(evt) {
      if (!this.mouse_on_container) {
        this.active_field = false;
        return setTimeout(((function(_this) {
          return function() {
            return _this.blur_test();
          };
        })(this)), 100);
      }
    };

    AbstractChosen.prototype.label_click_handler = function(evt) {
      if (this.is_multiple) {
        return this.container_mousedown(evt);
      } else {
        return this.activate_field();
      }
    };

    AbstractChosen.prototype.results_option_build = function(options) {
      var content, data, data_content, i, len, ref, shown_results;
      content = '';
      shown_results = 0;
      ref = this.results_data;
      for (i = 0, len = ref.length; i < len; i++) {
        data = ref[i];
        data_content = '';
        if (data.group) {
          data_content = this.result_add_group(data);
        } else {
          data_content = this.result_add_option(data);
        }
        if (data_content !== '') {
          shown_results++;
          content += data_content;
        }
        if (options != null ? options.first : void 0) {
          if (data.selected && this.is_multiple) {
            this.choice_build(data);
          } else if (data.selected && !this.is_multiple) {
            this.single_set_selected_text(this.choice_label(data));
          }
        }
        if (shown_results >= this.max_shown_results) {
          break;
        }
      }
      return content;
    };

    AbstractChosen.prototype.result_add_option = function(option) {
      var classes, option_el;
      if (!option.search_match) {
        return '';
      }
      if (!this.include_option_in_results(option)) {
        return '';
      }
      classes = [];
      if (!option.disabled && !(option.selected && this.is_multiple)) {
        classes.push("active-result");
      }
      if (option.disabled && !(option.selected && this.is_multiple)) {
        classes.push("disabled-result");
      }
      if (option.selected) {
        classes.push("result-selected");
      }
      if (option.group_array_index != null) {
        classes.push("group-option");
      }
      if (option.classes !== "") {
        classes.push(option.classes);
      }
      option_el = document.createElement("li");
      option_el.className = classes.join(" ");
      if (option.style) {
        option_el.style.cssText = option.style;
      }
      option_el.setAttribute("data-option-array-index", option.array_index);
      option_el.innerHTML = option.highlighted_html || option.html;
      if (option.title) {
        option_el.title = option.title;
      }
      return this.outerHTML(option_el);
    };

    AbstractChosen.prototype.result_add_group = function(group) {
      var classes, group_el;
      if (!(group.search_match || group.group_match)) {
        return '';
      }
      if (!(group.active_options > 0)) {
        return '';
      }
      classes = [];
      classes.push("group-result");
      if (group.classes) {
        classes.push(group.classes);
      }
      group_el = document.createElement("li");
      group_el.className = classes.join(" ");
      group_el.innerHTML = group.highlighted_html || this.escape_html(group.label);
      if (group.title) {
        group_el.title = group.title;
      }
      return this.outerHTML(group_el);
    };

    AbstractChosen.prototype.results_update_field = function() {
      this.set_default_text();
      if (!this.is_multiple) {
        this.results_reset_cleanup();
      }
      this.result_clear_highlight();
      this.results_build();
      if (this.results_showing) {
        return this.winnow_results();
      }
    };

    AbstractChosen.prototype.reset_single_select_options = function() {
      var i, len, ref, result, results1;
      ref = this.results_data;
      results1 = [];
      for (i = 0, len = ref.length; i < len; i++) {
        result = ref[i];
        if (result.selected) {
          results1.push(result.selected = false);
        } else {
          results1.push(void 0);
        }
      }
      return results1;
    };

    AbstractChosen.prototype.results_toggle = function() {
      if (this.results_showing) {
        return this.results_hide();
      } else {
        return this.results_show();
      }
    };

    AbstractChosen.prototype.results_search = function(evt) {
      if (this.results_showing) {
        return this.winnow_results();
      } else {
        return this.results_show();
      }
    };

    AbstractChosen.prototype.winnow_results = function(options) {
      var escapedQuery, fix, i, len, option, prefix, query, ref, regex, results, results_group, search_match, startpos, suffix, text;
      this.no_results_clear();
      results = 0;
      query = this.get_search_text();
      escapedQuery = query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
      regex = this.get_search_regex(escapedQuery);
      ref = this.results_data;
      for (i = 0, len = ref.length; i < len; i++) {
        option = ref[i];
        option.search_match = false;
        results_group = null;
        search_match = null;
        option.highlighted_html = '';
        if (this.include_option_in_results(option)) {
          if (option.group) {
            option.group_match = false;
            option.active_options = 0;
          }
          if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
            results_group = this.results_data[option.group_array_index];
            if (results_group.active_options === 0 && results_group.search_match) {
              results += 1;
            }
            results_group.active_options += 1;
          }
          text = option.group ? option.label : option.text;
          if (!(option.group && !this.group_search)) {
            search_match = this.search_string_match(text, regex);
            option.search_match = search_match != null;
            if (option.search_match && !option.group) {
              results += 1;
            }
            if (option.search_match) {
              if (query.length) {
                startpos = search_match.index;
                prefix = text.slice(0, startpos);
                fix = text.slice(startpos, startpos + query.length);
                suffix = text.slice(startpos + query.length);
                option.highlighted_html = (this.escape_html(prefix)) + "<em>" + (this.escape_html(fix)) + "</em>" + (this.escape_html(suffix));
              }
              if (results_group != null) {
                results_group.group_match = true;
              }
            } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
              option.search_match = true;
            }
          }
        }
      }
      this.result_clear_highlight();
      if (results < 1 && query.length) {
        this.update_results_content("");
        return this.no_results(query);
      } else {
        this.update_results_content(this.results_option_build());
        if (!(options != null ? options.skip_highlight : void 0)) {
          return this.winnow_results_set_highlight();
        }
      }
    };

    AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
      var regex_flag, regex_string;
      regex_string = this.search_contains ? escaped_search_string : "(^|\\s|\\b)" + escaped_search_string + "[^\\s]*";
      if (!(this.enable_split_word_search || this.search_contains)) {
        regex_string = "^" + regex_string;
      }
      regex_flag = this.case_sensitive_search ? "" : "i";
      return new RegExp(regex_string, regex_flag);
    };

    AbstractChosen.prototype.search_string_match = function(search_string, regex) {
      var match;
      match = regex.exec(search_string);
      if (!this.search_contains && (match != null ? match[1] : void 0)) {
        match.index += 1;
      }
      return match;
    };

    AbstractChosen.prototype.choices_count = function() {
      var i, len, option, ref;
      if (this.selected_option_count != null) {
        return this.selected_option_count;
      }
      this.selected_option_count = 0;
      ref = this.form_field.options;
      for (i = 0, len = ref.length; i < len; i++) {
        option = ref[i];
        if (option.selected) {
          this.selected_option_count += 1;
        }
      }
      return this.selected_option_count;
    };

    AbstractChosen.prototype.choices_click = function(evt) {
      evt.preventDefault();
      this.activate_field();
      if (!(this.results_showing || this.is_disabled)) {
        return this.results_show();
      }
    };

    AbstractChosen.prototype.keydown_checker = function(evt) {
      var ref, stroke;
      stroke = (ref = evt.which) != null ? ref : evt.keyCode;
      this.search_field_scale();
      if (stroke !== 8 && this.pending_backstroke) {
        this.clear_backstroke();
      }
      switch (stroke) {
        case 8:
          this.backstroke_length = this.get_search_field_value().length;
          break;
        case 9:
          if (this.results_showing && !this.is_multiple) {
            this.result_select(evt);
          }
          this.mouse_on_container = false;
          break;
        case 13:
          if (this.results_showing) {
            evt.preventDefault();
          }
          break;
        case 27:
          if (this.results_showing) {
            evt.preventDefault();
          }
          break;
        case 32:
          if (this.disable_search) {
            evt.preventDefault();
          }
          break;
        case 38:
          evt.preventDefault();
          this.keyup_arrow();
          break;
        case 40:
          evt.preventDefault();
          this.keydown_arrow();
          break;
      }
    };

    AbstractChosen.prototype.keyup_checker = function(evt) {
      var ref, stroke;
      stroke = (ref = evt.which) != null ? ref : evt.keyCode;
      this.search_field_scale();
      switch (stroke) {
        case 8:
          if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
            this.keydown_backstroke();
          } else if (!this.pending_backstroke) {
            this.result_clear_highlight();
            this.results_search();
          }
          break;
        case 13:
          evt.preventDefault();
          if (this.results_showing) {
            this.result_select(evt);
          }
          break;
        case 27:
          if (this.results_showing) {
            this.results_hide();
          }
          break;
        case 9:
        case 16:
        case 17:
        case 18:
        case 38:
        case 40:
        case 91:
          break;
        default:
          this.results_search();
          break;
      }
    };

    AbstractChosen.prototype.clipboard_event_checker = function(evt) {
      if (this.is_disabled) {
        return;
      }
      return setTimeout(((function(_this) {
        return function() {
          return _this.results_search();
        };
      })(this)), 50);
    };

    AbstractChosen.prototype.container_width = function() {
      if (this.options.width != null) {
        return this.options.width;
      } else {
        return this.form_field.offsetWidth + "px";
      }
    };

    AbstractChosen.prototype.include_option_in_results = function(option) {
      if (this.is_multiple && (!this.display_selected_options && option.selected)) {
        return false;
      }
      if (!this.display_disabled_options && option.disabled) {
        return false;
      }
      if (option.empty) {
        return false;
      }
      return true;
    };

    AbstractChosen.prototype.search_results_touchstart = function(evt) {
      this.touch_started = true;
      return this.search_results_mouseover(evt);
    };

    AbstractChosen.prototype.search_results_touchmove = function(evt) {
      this.touch_started = false;
      return this.search_results_mouseout(evt);
    };

    AbstractChosen.prototype.search_results_touchend = function(evt) {
      if (this.touch_started) {
        return this.search_results_mouseup(evt);
      }
    };

    AbstractChosen.prototype.outerHTML = function(element) {
      var tmp;
      if (element.outerHTML) {
        return element.outerHTML;
      }
      tmp = document.createElement("div");
      tmp.appendChild(element);
      return tmp.innerHTML;
    };

    AbstractChosen.prototype.get_single_html = function() {
      return "<a class=\"chosen-single chosen-default\">\n  <span>" + this.default_text + "</span>\n  <div><b></b></div>\n</a>\n<div class=\"chosen-drop\">\n  <div class=\"chosen-search\">\n    <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" />\n  </div>\n  <ul class=\"chosen-results\"></ul>\n</div>";
    };

    AbstractChosen.prototype.get_multi_html = function() {
      return "<ul class=\"chosen-choices\">\n  <li class=\"search-field\">\n    <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" value=\"" + this.default_text + "\" />\n  </li>\n</ul>\n<div class=\"chosen-drop\">\n  <ul class=\"chosen-results\"></ul>\n</div>";
    };

    AbstractChosen.prototype.get_no_results_html = function(terms) {
      return "<li class=\"no-results\">\n  " + this.results_none_found + " <span>" + (this.escape_html(terms)) + "</span>\n</li>";
    };

    AbstractChosen.browser_is_supported = function() {
      if ("Microsoft Internet Explorer" === window.navigator.appName) {
        return document.documentMode >= 8;
      }
      //if (/iP(od|hone)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) {
      //  return false;
      //}
      return true;
    };

    AbstractChosen.default_multiple_text = "Select Some Options";

    AbstractChosen.default_single_text = "Select an Option";

    AbstractChosen.default_no_result_text = "No results match";

    return AbstractChosen;

  })();

  $ = jQuery;

  $.fn.extend({
    chosen: function(options) {
      if (!AbstractChosen.browser_is_supported()) {
        return this;
      }
      return this.each(function(input_field) {
        var $this, chosen;
        $this = $(this);
        chosen = $this.data('chosen');
        if (options === 'destroy') {
          if (chosen instanceof Chosen) {
            chosen.destroy();
          }
          return;
        }
        if (!(chosen instanceof Chosen)) {
          $this.data('chosen', new Chosen(this, options));
        }
      });
    }
  });

  Chosen = (function(superClass) {
    extend(Chosen, superClass);

    function Chosen() {
      return Chosen.__super__.constructor.apply(this, arguments);
    }

    Chosen.prototype.setup = function() {
      this.form_field_jq = $(this.form_field);
      return this.current_selectedIndex = this.form_field.selectedIndex;
    };

    Chosen.prototype.set_up_html = function() {
      var container_classes, container_props;
      container_classes = ["chosen-container"];
      container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
      if (this.inherit_select_classes && this.form_field.className) {
        container_classes.push(this.form_field.className);
      }
      if (this.is_rtl) {
        container_classes.push("chosen-rtl");
      }
      container_props = {
        'class': container_classes.join(' '),
        'title': this.form_field.title
      };
      if (this.form_field.id.length) {
        container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
      }
      this.container = $("<div />", container_props);
      this.container.width(this.container_width());
      if (this.is_multiple) {
        this.container.html(this.get_multi_html());
      } else {
        this.container.html(this.get_single_html());
      }
      this.form_field_jq.hide().after(this.container);
      this.dropdown = this.container.find('div.chosen-drop').first();
      this.search_field = this.container.find('input').first();
      this.search_results = this.container.find('ul.chosen-results').first();
      this.search_field_scale();
      this.search_no_results = this.container.find('li.no-results').first();
      if (this.is_multiple) {
        this.search_choices = this.container.find('ul.chosen-choices').first();
        this.search_container = this.container.find('li.search-field').first();
      } else {
        this.search_container = this.container.find('div.chosen-search').first();
        this.selected_item = this.container.find('.chosen-single').first();
      }
      this.results_build();
      this.set_tab_index();
      return this.set_label_behavior();
    };

    Chosen.prototype.on_ready = function() {
      return this.form_field_jq.trigger("chosen:ready", {
        chosen: this
      });
    };

    Chosen.prototype.register_observers = function() {
      this.container.on('touchstart.chosen', (function(_this) {
        return function(evt) {
          _this.container_mousedown(evt);
        };
      })(this));
      this.container.on('touchend.chosen', (function(_this) {
        return function(evt) {
          _this.container_mouseup(evt);
        };
      })(this));
      this.container.on('mousedown.chosen', (function(_this) {
        return function(evt) {
          _this.container_mousedown(evt);
        };
      })(this));
      this.container.on('mouseup.chosen', (function(_this) {
        return function(evt) {
          _this.container_mouseup(evt);
        };
      })(this));
      this.container.on('mouseenter.chosen', (function(_this) {
        return function(evt) {
          _this.mouse_enter(evt);
        };
      })(this));
      this.container.on('mouseleave.chosen', (function(_this) {
        return function(evt) {
          _this.mouse_leave(evt);
        };
      })(this));
      this.search_results.on('mouseup.chosen', (function(_this) {
        return function(evt) {
          _this.search_results_mouseup(evt);
        };
      })(this));
      this.search_results.on('mouseover.chosen', (function(_this) {
        return function(evt) {
          _this.search_results_mouseover(evt);
        };
      })(this));
      this.search_results.on('mouseout.chosen', (function(_this) {
        return function(evt) {
          _this.search_results_mouseout(evt);
        };
      })(this));
      this.search_results.on('mousewheel.chosen DOMMouseScroll.chosen', (function(_this) {
        return function(evt) {
          _this.search_results_mousewheel(evt);
        };
      })(this));
      this.search_results.on('touchstart.chosen', (function(_this) {
        return function(evt) {
          _this.search_results_touchstart(evt);
        };
      })(this));
      this.search_results.on('touchmove.chosen', (function(_this) {
        return function(evt) {
          _this.search_results_touchmove(evt);
        };
      })(this));
      this.search_results.on('touchend.chosen', (function(_this) {
        return function(evt) {
          _this.search_results_touchend(evt);
        };
      })(this));
      this.form_field_jq.on("chosen:updated.chosen", (function(_this) {
        return function(evt) {
          _this.results_update_field(evt);
        };
      })(this));
      this.form_field_jq.on("chosen:activate.chosen", (function(_this) {
        return function(evt) {
          _this.activate_field(evt);
        };
      })(this));
      this.form_field_jq.on("chosen:open.chosen", (function(_this) {
        return function(evt) {
          _this.container_mousedown(evt);
        };
      })(this));
      this.form_field_jq.on("chosen:close.chosen", (function(_this) {
        return function(evt) {
          _this.close_field(evt);
        };
      })(this));
      this.search_field.on('blur.chosen', (function(_this) {
        return function(evt) {
          _this.input_blur(evt);
        };
      })(this));
      this.search_field.on('keyup.chosen', (function(_this) {
        return function(evt) {
          _this.keyup_checker(evt);
        };
      })(this));
      this.search_field.on('keydown.chosen', (function(_this) {
        return function(evt) {
          _this.keydown_checker(evt);
        };
      })(this));
      this.search_field.on('focus.chosen', (function(_this) {
        return function(evt) {
          _this.input_focus(evt);
        };
      })(this));
      this.search_field.on('cut.chosen', (function(_this) {
        return function(evt) {
          _this.clipboard_event_checker(evt);
        };
      })(this));
      this.search_field.on('paste.chosen', (function(_this) {
        return function(evt) {
          _this.clipboard_event_checker(evt);
        };
      })(this));
      if (this.is_multiple) {
        return this.search_choices.on('click.chosen', (function(_this) {
          return function(evt) {
            _this.choices_click(evt);
          };
        })(this));
      } else {
        return this.container.on('click.chosen', function(evt) {
          evt.preventDefault();
        });
      }
    };

    Chosen.prototype.destroy = function() {
      $(this.container[0].ownerDocument).off('click.chosen', this.click_test_action);
      if (this.form_field_label.length > 0) {
        this.form_field_label.off('click.chosen');
      }
      if (this.search_field[0].tabIndex) {
        this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
      }
      this.container.remove();
      this.form_field_jq.removeData('chosen');
      return this.form_field_jq.show();
    };

    Chosen.prototype.search_field_disabled = function() {
      this.is_disabled = this.form_field.disabled || this.form_field_jq.parents('fieldset').is(':disabled');
      this.container.toggleClass('chosen-disabled', this.is_disabled);
      this.search_field[0].disabled = this.is_disabled;
      if (!this.is_multiple) {
        this.selected_item.off('focus.chosen', this.activate_field);
      }
      if (this.is_disabled) {
        return this.close_field();
      } else if (!this.is_multiple) {
        return this.selected_item.on('focus.chosen', this.activate_field);
      }
    };

    Chosen.prototype.container_mousedown = function(evt) {
      var ref;
      if (this.is_disabled) {
        return;
      }
      if (evt && ((ref = evt.type) === 'mousedown' || ref === 'touchstart') && !this.results_showing) {
        evt.preventDefault();
      }
      if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
        if (!this.active_field) {
          if (this.is_multiple) {
            this.search_field.val("");
          }
          $(this.container[0].ownerDocument).on('click.chosen', this.click_test_action);
          this.results_show();
        } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
          evt.preventDefault();
          this.results_toggle();
        }
        return this.activate_field();
      }
    };

    Chosen.prototype.container_mouseup = function(evt) {
      if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
        return this.results_reset(evt);
      }
    };

    Chosen.prototype.search_results_mousewheel = function(evt) {
      var delta;
      if (evt.originalEvent) {
        delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
      }
      if (delta != null) {
        evt.preventDefault();
        if (evt.type === 'DOMMouseScroll') {
          delta = delta * 40;
        }
        return this.search_results.scrollTop(delta + this.search_results.scrollTop());
      }
    };

    Chosen.prototype.blur_test = function(evt) {
      if (!this.active_field && this.container.hasClass("chosen-container-active")) {
        return this.close_field();
      }
    };

    Chosen.prototype.close_field = function() {
      $(this.container[0].ownerDocument).off("click.chosen", this.click_test_action);
      this.active_field = false;
      this.results_hide();
      this.container.removeClass("chosen-container-active");
      this.clear_backstroke();
      this.show_search_field_default();
      this.search_field_scale();
      return this.search_field.blur();
    };

    Chosen.prototype.activate_field = function() {
      if (this.is_disabled) {
        return;
      }
      this.container.addClass("chosen-container-active");
      this.active_field = true;
      this.search_field.val(this.search_field.val());
      return this.search_field.focus();
    };

    Chosen.prototype.test_active_click = function(evt) {
      var active_container;
      active_container = $(evt.target).closest('.chosen-container');
      if (active_container.length && this.container[0] === active_container[0]) {
        return this.active_field = true;
      } else {
        return this.close_field();
      }
    };

    Chosen.prototype.results_build = function() {
      this.parsing = true;
      this.selected_option_count = null;
      this.results_data = SelectParser.select_to_array(this.form_field);
      if (this.is_multiple) {
        this.search_choices.find("li.search-choice").remove();
      } else {
        this.single_set_selected_text();
        if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
          this.search_field[0].readOnly = true;
          this.container.addClass("chosen-container-single-nosearch");
        } else {
          this.search_field[0].readOnly = false;
          this.container.removeClass("chosen-container-single-nosearch");
        }
      }
      this.update_results_content(this.results_option_build({
        first: true
      }));
      this.search_field_disabled();
      this.show_search_field_default();
      this.search_field_scale();
      return this.parsing = false;
    };

    Chosen.prototype.result_do_highlight = function(el) {
      var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
      if (el.length) {
        this.result_clear_highlight();
        this.result_highlight = el;
        this.result_highlight.addClass("highlighted");
        maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
        visible_top = this.search_results.scrollTop();
        visible_bottom = maxHeight + visible_top;
        high_top = this.result_highlight.position().top + this.search_results.scrollTop();
        high_bottom = high_top + this.result_highlight.outerHeight();
        if (high_bottom >= visible_bottom) {
          return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
        } else if (high_top < visible_top) {
          return this.search_results.scrollTop(high_top);
        }
      }
    };

    Chosen.prototype.result_clear_highlight = function() {
      if (this.result_highlight) {
        this.result_highlight.removeClass("highlighted");
      }
      return this.result_highlight = null;
    };

    Chosen.prototype.results_show = function() {
      if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
        this.form_field_jq.trigger("chosen:maxselected", {
          chosen: this
        });
        return false;
      }
      this.container.addClass("chosen-with-drop");
      this.results_showing = true;
      this.search_field.focus();
      this.search_field.val(this.get_search_field_value());
      this.winnow_results();
      return this.form_field_jq.trigger("chosen:showing_dropdown", {
        chosen: this
      });
    };

    Chosen.prototype.update_results_content = function(content) {
      return this.search_results.html(content);
    };

    Chosen.prototype.results_hide = function() {
      if (this.results_showing) {
        this.result_clear_highlight();
        this.container.removeClass("chosen-with-drop");
        this.form_field_jq.trigger("chosen:hiding_dropdown", {
          chosen: this
        });
      }
      return this.results_showing = false;
    };

    Chosen.prototype.set_tab_index = function(el) {
      var ti;
      if (this.form_field.tabIndex) {
        ti = this.form_field.tabIndex;
        this.form_field.tabIndex = -1;
        return this.search_field[0].tabIndex = ti;
      }
    };

    Chosen.prototype.set_label_behavior = function() {
      this.form_field_label = this.form_field_jq.parents("label");
      if (!this.form_field_label.length && this.form_field.id.length) {
        this.form_field_label = $("label[for='" + this.form_field.id + "']");
      }
      if (this.form_field_label.length > 0) {
        return this.form_field_label.on('click.chosen', this.label_click_handler);
      }
    };

    Chosen.prototype.show_search_field_default = function() {
      if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
        this.search_field.val(this.default_text);
        return this.search_field.addClass("default");
      } else {
        this.search_field.val("");
        return this.search_field.removeClass("default");
      }
    };

    Chosen.prototype.search_results_mouseup = function(evt) {
      var target;
      target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
      if (target.length) {
        this.result_highlight = target;
        this.result_select(evt);
        return this.search_field.focus();
      }
    };

    Chosen.prototype.search_results_mouseover = function(evt) {
      var target;
      target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
      if (target) {
        return this.result_do_highlight(target);
      }
    };

    Chosen.prototype.search_results_mouseout = function(evt) {
      if ($(evt.target).hasClass("active-result") || $(evt.target).parents('.active-result').first()) {
        return this.result_clear_highlight();
      }
    };

    Chosen.prototype.choice_build = function(item) {
      var choice, close_link;
      choice = $('<li />', {
        "class": "search-choice"
      }).html("<span>" + (this.choice_label(item)) + "</span>");
      if (item.disabled) {
        choice.addClass('search-choice-disabled');
      } else {
        close_link = $('<a />', {
          "class": 'search-choice-close',
          'data-option-array-index': item.array_index
        });
        close_link.on('click.chosen', (function(_this) {
          return function(evt) {
            return _this.choice_destroy_link_click(evt);
          };
        })(this));
        choice.append(close_link);
      }
      return this.search_container.before(choice);
    };

    Chosen.prototype.choice_destroy_link_click = function(evt) {
      evt.preventDefault();
      evt.stopPropagation();
      if (!this.is_disabled) {
        return this.choice_destroy($(evt.target));
      }
    };

    Chosen.prototype.choice_destroy = function(link) {
      if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
        if (this.active_field) {
          this.search_field.focus();
        } else {
          this.show_search_field_default();
        }
        if (this.is_multiple && this.choices_count() > 0 && this.get_search_field_value().length < 1) {
          this.results_hide();
        }
        link.parents('li').first().remove();
        return this.search_field_scale();
      }
    };

    Chosen.prototype.results_reset = function() {
      this.reset_single_select_options();
      this.form_field.options[0].selected = true;
      this.single_set_selected_text();
      this.show_search_field_default();
      this.results_reset_cleanup();
      this.trigger_form_field_change();
      if (this.active_field) {
        return this.results_hide();
      }
    };

    Chosen.prototype.results_reset_cleanup = function() {
      this.current_selectedIndex = this.form_field.selectedIndex;
      return this.selected_item.find("abbr").remove();
    };

    Chosen.prototype.result_select = function(evt) {
      var high, item;
      if (this.result_highlight) {
        high = this.result_highlight;
        this.result_clear_highlight();
        if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
          this.form_field_jq.trigger("chosen:maxselected", {
            chosen: this
          });
          return false;
        }
        if (this.is_multiple) {
          high.removeClass("active-result");
        } else {
          this.reset_single_select_options();
        }
        high.addClass("result-selected");
        item = this.results_data[high[0].getAttribute("data-option-array-index")];
        item.selected = true;
        this.form_field.options[item.options_index].selected = true;
        this.selected_option_count = null;
        if (this.is_multiple) {
          this.choice_build(item);
        } else {
          this.single_set_selected_text(this.choice_label(item));
        }
        if (this.is_multiple && (!this.hide_results_on_select || (evt.metaKey || evt.ctrlKey))) {
          if (evt.metaKey || evt.ctrlKey) {
            this.winnow_results({
              skip_highlight: true
            });
          } else {
            this.search_field.val("");
            this.winnow_results();
          }
        } else {
          this.results_hide();
          this.show_search_field_default();
        }
        if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
          this.trigger_form_field_change({
            selected: this.form_field.options[item.options_index].value
          });
        }
        this.current_selectedIndex = this.form_field.selectedIndex;
        evt.preventDefault();
        return this.search_field_scale();
      }
    };

    Chosen.prototype.single_set_selected_text = function(text) {
      if (text == null) {
        text = this.default_text;
      }
      if (text === this.default_text) {
        this.selected_item.addClass("chosen-default");
      } else {
        this.single_deselect_control_build();
        this.selected_item.removeClass("chosen-default");
      }
      return this.selected_item.find("span").html(text);
    };

    Chosen.prototype.result_deselect = function(pos) {
      var result_data;
      result_data = this.results_data[pos];
      if (!this.form_field.options[result_data.options_index].disabled) {
        result_data.selected = false;
        this.form_field.options[result_data.options_index].selected = false;
        this.selected_option_count = null;
        this.result_clear_highlight();
        if (this.results_showing) {
          this.winnow_results();
        }
        this.trigger_form_field_change({
          deselected: this.form_field.options[result_data.options_index].value
        });
        this.search_field_scale();
        return true;
      } else {
        return false;
      }
    };

    Chosen.prototype.single_deselect_control_build = function() {
      if (!this.allow_single_deselect) {
        return;
      }
      if (!this.selected_item.find("abbr").length) {
        this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
      }
      return this.selected_item.addClass("chosen-single-with-deselect");
    };

    Chosen.prototype.get_search_field_value = function() {
      return this.search_field.val();
    };

    Chosen.prototype.get_search_text = function() {
      return $.trim(this.get_search_field_value());
    };

    Chosen.prototype.escape_html = function(text) {
      return $('<div/>').text(text).html();
    };

    Chosen.prototype.winnow_results_set_highlight = function() {
      var do_high, selected_results;
      selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
      do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
      if (do_high != null) {
        return this.result_do_highlight(do_high);
      }
    };

    Chosen.prototype.no_results = function(terms) {
      var no_results_html;
      no_results_html = this.get_no_results_html(terms);
      this.search_results.append(no_results_html);
      return this.form_field_jq.trigger("chosen:no_results", {
        chosen: this
      });
    };

    Chosen.prototype.no_results_clear = function() {
      return this.search_results.find(".no-results").remove();
    };

    Chosen.prototype.keydown_arrow = function() {
      var next_sib;
      if (this.results_showing && this.result_highlight) {
        next_sib = this.result_highlight.nextAll("li.active-result").first();
        if (next_sib) {
          return this.result_do_highlight(next_sib);
        }
      } else {
        return this.results_show();
      }
    };

    Chosen.prototype.keyup_arrow = function() {
      var prev_sibs;
      if (!this.results_showing && !this.is_multiple) {
        return this.results_show();
      } else if (this.result_highlight) {
        prev_sibs = this.result_highlight.prevAll("li.active-result");
        if (prev_sibs.length) {
          return this.result_do_highlight(prev_sibs.first());
        } else {
          if (this.choices_count() > 0) {
            this.results_hide();
          }
          return this.result_clear_highlight();
        }
      }
    };

    Chosen.prototype.keydown_backstroke = function() {
      var next_available_destroy;
      if (this.pending_backstroke) {
        this.choice_destroy(this.pending_backstroke.find("a").first());
        return this.clear_backstroke();
      } else {
        next_available_destroy = this.search_container.siblings("li.search-choice").last();
        if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
          this.pending_backstroke = next_available_destroy;
          if (this.single_backstroke_delete) {
            return this.keydown_backstroke();
          } else {
            return this.pending_backstroke.addClass("search-choice-focus");
          }
        }
      }
    };

    Chosen.prototype.clear_backstroke = function() {
      if (this.pending_backstroke) {
        this.pending_backstroke.removeClass("search-choice-focus");
      }
      return this.pending_backstroke = null;
    };

    Chosen.prototype.search_field_scale = function() {
      var div, i, len, style, style_block, styles, width;
      if (!this.is_multiple) {
        return;
      }
      style_block = {
        position: 'absolute',
        left: '-1000px',
        top: '-1000px',
        display: 'none',
        whiteSpace: 'pre'
      };
      styles = ['fontSize', 'fontStyle', 'fontWeight', 'fontFamily', 'lineHeight', 'textTransform', 'letterSpacing'];
      for (i = 0, len = styles.length; i < len; i++) {
        style = styles[i];
        style_block[style] = this.search_field.css(style);
      }
      div = $('<div />').css(style_block);
      div.text(this.get_search_field_value());
      $('body').append(div);
      width = div.width() + 25;
      div.remove();
      if (this.container.is(':visible')) {
        width = Math.min(this.container.outerWidth() - 10, width);
      }
      return this.search_field.width(width);
    };

    Chosen.prototype.trigger_form_field_change = function(extra) {
      this.form_field_jq.trigger("input", extra);
      return this.form_field_jq.trigger("change", extra);
    };

    return Chosen;

  })(AbstractChosen);

}).call(this);
;
var config = {
  '.chosen-select'           : {},
  '.chosen-select-deselect'  : { allow_single_deselect: true },
  '.chosen-select-no-single' : { disable_search_threshold: 10 },
  '.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' },
  '.chosen-select-rtl'       : { rtl: true },
  '.chosen-select-width'     : { width: '95%' }
}
for (var selector in config) {
  $(selector).chosen(config[selector]);
}
;
/// <reference path="http://localhost:53453/login.aspx" />
// check to see if bootstrap3 already exists
var bootstrap3_enabled = (typeof $ == 'function' && typeof $().emulateTransitionEnd == 'function');
// check to see if boostrap collapse plugin exists
var bootstrapCollapse_enabled = (typeof $ == 'function' && typeof $.fn.collapse == 'function');

(function (HawkSearchLoader, undefined) {
    var jQuery;
    HawkSearch = window.HawkSearch = (window.HawkSearch || {});

    // Allow HostUrl override for on-premise solutions
    HawkSearchLoader.HostUrl = HawkSearchLoader.HostUrl || '//manage.hawksearch.com';

    //if true, HawkSearch's jQuery will be loaded dynamically in noConflict mode.
    HawkSearchLoader.loadjQuery = "loadjQuery" in HawkSearchLoader ? HawkSearchLoader.loadjQuery : true;

    //if true, some messages will be sent to the console.
    HawkSearchLoader.debugMode = "debugMode" in HawkSearchLoader ? HawkSearchLoader.debugMode : false;

    HawkSearchLoader.IncludesFolder = HawkSearchLoader.IncludesFolder || '/sites/shared/'
    HawkSearchLoader.AssetsFolder = HawkSearchLoader.AssetsFolder || '/sites/shared/assets/'
    HawkSearchLoader.LoadingImage = HawkSearchLoader.LoadingImage || HawkSearchLoader.HostUrl + HawkSearchLoader.IncludesFolder + 'images/global/load.gif';

    // Allow CMS to set landing page url
    HawkSearch.LandingPageUrl = HawkSearchLoader.LandingPageUrl || '';

    // Pass through request state for hyprid proxy - advanced connector usage
    HawkSearch.Types = HawkSearchLoader.Types || {};
    HawkSearch.CustomBasePageSize = HawkSearchLoader.CustomBasePageSize || 0;
    HawkSearch.CustomSortOptions = HawkSearchLoader.CustomSortOptions || '';

    HawkSearch.SuggesterGlobal = {
        qf: '',
        lookupURL: '',
        divName: '',
        lastVal: '',
        searching: false,
        globalDiv: null,
        divFormatted: false,
        focus: false,
        defaultKeyword: []
    };


    HawkSearch.GetQueryStringValue = (function (a) {
        if (a == "") return {};
        var b = {};
        for (var i = 0; i < a.length; ++i) {
            var p = a[i].split('=');
            if (p.length != 2) continue;
            b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
        }
        return b;
    })(window.location.search.substr(1).split('&'));

    HawkSearch.getTrackingUrl = function () {
        if (HawkSearch.TrackingUrl === undefined || HawkSearch.TrackingUrl === "") {
            return HawkSearch.BaseUrl;
        } else {
            return HawkSearch.TrackingUrl;
        }
    };

    HawkSearch.getHawkUrl = function () {
        if (HawkSearch.HawkUrl === undefined || HawkSearch.HawkUrl === "") {
            return HawkSearch.BaseUrl;
        } else {
            return HawkSearch.HawkUrl;
        }
    };

    HawkSearch.getClientGuid = function () {
        if (HawkSearch.ClientGuid !== undefined) {
            return HawkSearch.ClientGuid;
        } else {
            return '';
        }
    }

    HawkSearch.RecommendationContext = {
        visitId: "",
        visitorId: "",
        baseUrl: HawkSearch.getHawkUrl(),
        clientGuid: HawkSearch.getClientGuid(),
        enablePreview: false,
        widgetUids: [],
        contextProperties: [],
        customProperties: []
    };

    // and we can set up a data structure that contains information
    // that the server retrieved from long term storage to send
    // along with our clicks
    HawkSearch.EventBase = {
        version: '0.1a',
        event_type: 'PageLoad'
    };

    HawkSearch.Tracking = {}
    HawkSearch.Tracking.eventQueue = [];
    HawkSearch.Tracking.isReady = false;
    HawkSearch.Tracking.ready = function (callback) {
        if (HawkSearch.Tracking.isReady) {
            callback(HawkSearch.jQuery);
        } else {
            HawkSearch.Tracking.eventQueue.push(callback);
        }
    }

    HawkSearch.Tracking.setReady = function ($) {
        var callback;
        while (callback = HawkSearch.Tracking.eventQueue.shift()) {
            callback($);
        }
        HawkSearch.Tracking.isReady = true;
    }

    HawkSearch.Tracking.CurrentVersion = function () {
        return HawkSearch.jQuery("#hdnhawktrackingversion").val();
    }

    HawkSearch.Tracking.Version = {
        none: "none",
        v1: "v1",
        v2: "v2",
        v2AndSQL: "v2AndSQL"
    }

    HawkSearch.Tracking.writePageLoad = function (pageType) {
        var callback = function () {
            if (pageType === undefined) {
                pageType = "";
            }

            var pageTypeVal = HawkSearch.LilBro.Schema.PageLoad.PageType.itemDetails;
            switch (pageType.toLowerCase()) {
                case "page":
                    pageTypeVal = HawkSearch.LilBro.Schema.PageLoad.PageType.landingPage;
                    break;
                case "item":
                    pageTypeVal = HawkSearch.LilBro.Schema.PageLoad.PageType.itemDetails;
                    break;
                case "cart":
                    pageTypeVal = HawkSearch.LilBro.Schema.PageLoad.PageType.shoppingCart;
                    break;
                case "order":
                    pageTypeVal = HawkSearch.LilBro.Schema.PageLoad.PageType.orderConfirmation;
                    break;
                case "custom":
                    pageTypeVal = HawkSearch.LilBro.Schema.PageLoad.PageType.custom;
                    break;
                default:
                    pageTypeVal = HawkSearch.LilBro.Schema.PageLoad.PageType.itemDetails;
            }
            var trackingValues = null;
            if (trackingValues != null) {
                return;
            }
            log("Tracking: write page load");
            var trackingContextValues = null;
            if (HawkSearch.Context) {
                trackingContextValues = HawkSearch.Context.keyValuePairs()
            }
            //This is where we need to check if its v2 tracking refer JIRA hs-2376
            if ((HawkSearch.Tracking.CurrentVersion() == HawkSearch.Tracking.Version.v2) || (HawkSearch.Tracking.CurrentVersion() == HawkSearch.Tracking.Version.v2AndSql)) {
                HawkSearch.lilBro.write({
                    event_type: 'PageLoad',
                    tracking_properties: JSON.stringify(trackingContextValues),
                    page_type_id: pageTypeVal
                });
            }
        }
        HawkSearch.Tracking.ready(callback);
    }


    HawkSearch.Tracking.writeSearchTracking = function (trackingId) {
        var callback = function (jQuery) {
            var $ = jQuery;

            if (trackingId == null || trackingId === "") {
                return;
            }

            var typeId = HawkSearch.LilBro.Schema.Search.SearchType["Refinement"];
            if ($("#hdnhawkquery").size() === 0) {
                $('<input>').attr({
                    type: 'hidden',
                    id: 'hdnhawkquery',
                    name: 'hdnhawkquery'
                }).appendTo('body');
                $("#hdnhawkquery").val(HawkSearch.lilBro.event.createUUID());
                typeId = HawkSearch.LilBro.Schema.Search.SearchType["Search"];
            }


            var mpp = HawkSearch.getHashOrQueryVariable("mpp");
            var pg = HawkSearch.getHashOrQueryVariable("pg");
            var sort = HawkSearch.getHashOrQueryVariable("sort");

            var spellingSuggestion = HawkSearch.getHashOrQueryVariable("hawks") === "1";
            var lpurl = HawkSearch.getCustomUrl();
            if (lpurl == "/") {
                lpurl = "";
            }

            log("Tracking: write search type" + typeId);
            HawkSearch.lilBro.write({
                event_type: 'Search',
                tracking_id: trackingId,
                query_id: $('#hdnhawkquery').val(),
                type_id: typeId,
                lpurl: lpurl
            });
        }
        HawkSearch.Tracking.ready(callback);
    }

    HawkSearch.Tracking.writeSearch = function () {
        var callback = function (jQuery) {
            var $ = jQuery;
            var trackingId = HawkSearch.lilBro.getTrackingId();
            if (trackingId == null) {
                return;
            }
            HawkSearch.Tracking.writeSearchTracking(trackingId);
        }
        HawkSearch.Tracking.ready(callback);
    }

    HawkSearch.Tracking.writeClick = function (event, elementNo, mlt, uniqueId, trackingId) {
        log("Tracking: write click");

        if (trackingId == null) {
            return;
        }

        var $ = $ || jQuery;
        var maxPerPage = $("#hdnhawkmpp").val();
        var pageNo = $("#hdnhawkpg").val();

        if (pageNo > 1) {
            elementNo = elementNo + maxPerPage * (pageNo - 1);
        }


        var url = event.currentTarget.href;
        var location = escape(event.currentTarget.href.href).replace(/\+/g, "%2B");
        HawkSearch.lilBro.write({
            url: url,
            event_type: 'Click',
            tracking_id: trackingId,
            element_no: elementNo,
            mlt: mlt === true,
            unique_id: uniqueId,
            location: location,
            ev: event
        });
    };

    HawkSearch.Tracking.writeBannerClick = function (el, id) {
        log("Tracking: banner click id:" + id);
        HawkSearch.lilBro.write({
            event_type: 'BannerClick',
            banner_id: id,
            tracking_id: HawkSearch.lilBro.getTrackingId()
        });
    }

    HawkSearch.Tracking.writeBannerImpression = function (id) {
        var callback = function () {
            log("Tracking: banner impression id:" + id);
            HawkSearch.lilBro.write({
                event_type: 'BannerImpression',
                banner_id: id,
                tracking_id: HawkSearch.lilBro.getTrackingId()
            });
        }

        HawkSearch.Tracking.ready(callback);
    };

    HawkSearch.Tracking.writeSale = function (orderNo, itemList, total, subTotal, tax, currency) {
        var callback = function () {
            log("Tracking: write sale");
            HawkSearch.lilBro.write({
                event_type: 'Sale',
                order_no: orderNo,
                item_list: JSON.stringify(itemList),
                total: total,
                tax: tax,
                currency: currency,
                sub_total: subTotal
            }, function () {
                HawkSearch.lilBro.event.clearVisitId();
                log("Tracking visit id clared after order.");
            });
        }
        HawkSearch.Tracking.ready(callback);
    };

    HawkSearch.Tracking.writeAdd2Cart = function (uniqueId, price, quantity, currency) {
        var callback = function () {
            log("Tracking: write Add2Cart");
            HawkSearch.lilBro.write({
                event_type: 'Add2Cart',
                unique_id: uniqueId,
                price: price,
                quantity: quantity,
                currency: currency
            });
        }

        HawkSearch.Tracking.ready(callback);
    }

    HawkSearch.Tracking.writeRate = function (uniqueId, value) {
        if (value < 1 || value > 5) {
            return;
        }
        var callback = function () {
            log("Tracking: write Rate");
            HawkSearch.lilBro.write({
                event_type: 'Rate',
                unique_id: uniqueId,
                value: value
            });
        }

        HawkSearch.Tracking.ready(callback);
    }


    HawkSearch.Tracking.writeRecommendationClick = function (widgetGuid, uniqueId, itemIndex, requestId) {
        var callback = function () {
            log("Tracking: write RecommendationClick");
            HawkSearch.lilBro.write({
                event_type: 'RecommendationClick',
                widget_guid: widgetGuid,
                unique_id: uniqueId,
                item_index: itemIndex,
                request_id: requestId
            });
        }
        HawkSearch.Tracking.ready(callback);
    }

    HawkSearch.Tracking.writeAutoCompleteClick = function (keyword, event, type, name, itemUrl) {
        log("AutoComplete: item click id:" + name);
        var $ = $ || jQuery;

        HawkSearch.lilBro.write({
            event_type: 'AutoCompleteClick',
            url: itemUrl,
            suggest_type: type,
            name: name,
            keyword: keyword
        });
    }

    HawkSearch.Tracking.track = function (eventName, args) {
        var ns = HawkSearch.Tracking;
        switch (eventName.toLowerCase()) {
            case 'pageload':
                return ns.writePageLoad(args.pageType);
            case 'search':
                return ns.writeSearch();
            case 'searchtracking':
                return ns.writeSearchTracking(args.trackingId);
            case 'click':
                return ns.writeClick(args.event, args.elementNo, args.mlt, args.uniqueId, args.trackingId);
            case 'bannerclick':
                return ns.writeBannerClick(args.el, args.id);
            case 'bannerimpression':
                return ns.writeBannerImpression(args.id);
            case 'sale':
                return ns.writeSale(args.orderNo, args.itemList, args.total, args.subTotal, args.tax, args.currency);
            case 'add2cart':
                return ns.writeAdd2Cart(args.uniqueId, args.price, args.quantity, args.currency);
            case 'rate':
                return ns.writeRate(args.uniqueId, args.value);
            case 'recommendationclick':
                return ns.writeRecommendationClick(args.widgetGuid, args.uniqueId, args.itemIndex, args.requestId);
            case 'autocompleteclick':
                return ns.writeAutoCompleteClick(args.keyword, args.event, args.suggest_type, args.name, args.itemUrl);
        }

        throw 'No such tracking event: ' + eventName;
    };

    HawkSearch.Tracking.V1 = {};

    HawkSearch.Tracking.V1.bannerLink = function (el, id) {
        el.href = HawkSearch.getTrackingUrl() + '/banners.aspx?BannerId=' + id; el.mousedown = '';
        return true;
    };

    HawkSearch.Tracking.V1.autosuggestClick = function (keyword, name, url, type) {
        var args = '&keyword=' + encodeURIComponent(keyword) + '&name=' + encodeURIComponent(name) + '&type=' + type + '&url=' + encodeURIComponent(url);
        var getUrl = HawkSearch.getTrackingUrl() + "?fn=ajax&f=GetAutoCompleteClick" + args;
        var $ = $ || jQuery;

        $.ajax({
            "type": "GET",
            "data": "",
            "async": "false",
            "contentType": "application/json; charset=utf-8",
            "url": getUrl,
            "dataType": "jsonp",
            success: function (data) {
                var json = $.parseJSON(data);
                if (json.success === 'True') {
                    log("success added tracking autocomplete click");
                }
                else {
                    log("failed added tracking autocomplete click");
                }
            },
            error: function (error) {
                log(error);
            }
        });
    };
    
    HawkSearch.Tracking.V1.link = function (el, id, i, pk, mlt) {
        //var full = HawkSearch.getTrackingUrl() + "/link.aspx?id=" + escape(id) + "&q=" + escape(el.currentTarget.href).replace(/\+/g, "%2B") + "&i=" + i + "&pk=" + pk + "&mlt=" + mlt;
        //el.currentTarget.href = full;
        if (el.href != null) {
            var full = HawkSearch.getTrackingUrl() + "/link.aspx?stop=1&id=" + escape(id) + "&q=" + escape(el.href).replace(/\+/g, "%2B") + "&i=" + i + "&pk=" + pk + "&mlt=" + mlt;
            $.ajax({
                "type": "GET", "data": "", "dataType": "jsonp", "async": "true", "contentType": "application/json; charset=utf-8", "url": full, "success": function () {
                    window.location.href = el.href;
                }
            });
        }
        return true;
    };

    // LilBro code
    HawkSearch.LilBro = function (args) {

        var self = this;
        var $ = null;

        this.initialize = function (args) {
            this.ensureBase64Encoding();
            if (args) {

                $ = args.jQuery;

                if (!args.server) {
                    return;
                }

                this.watch_container(args.element, args.watch_focus);

                this.freshEvent = function () {
                    var base = {};
                    if (args.event_base) {
                        for (var p in args.event_base) {
                            if (args.event_base.hasOwnProperty(p)) {
                                base[p] = args.event_base[p];
                            }
                        }
                    }

                    var eventType = args.event_type || args.event_base.event_type || "PageLoad";
                    return new HawkSearch.LilBro.Event({
                        base: base,
                        key_map: args.key_map || HawkSearch.LilBro.Schema[eventType].key_map || HawkSearch.LilBro.Schema.key_map,
                        type_map: args.type_map || HawkSearch.LilBro.Schema.type_map,
                        server: args.server,
                        ssl_server: args.ssl_server,
                        visit_id_cookie: args.visit_id_cookie || 'visit_id',
                        visitor_id_cookie: args.visitor_id_cookie || 'visitor_id'
                    });
                };
            } else {
                return;
            }

            try {
                if (sessionStorage && sessionStorage.getItem('lilbrobug' + window.location.protocol)) {
                    var src = decodeURIComponent(sessionStorage.getItem('lilbrobug' + window.location.protocol));
                    var bug = new Image();
                    bug.onload = function () {
                        sessionStorage.removeItem('lilbrobug' + window.location.protocol);
                    };
                    bug.src = src;
                }
            } catch (e) {
                log('ERROR: ' + e);
            }

            this.event = this.freshEvent();
            HawkSearch.RecommendationContext.visitorId = this.event.getVisitorId();
            HawkSearch.RecommendationContext.visitId = this.event.getVisitId();
        };

        this.watch_container = function (el, focus) {
            if (!el) {
                return;
            }
            if (el.addEventListener) {
                el.addEventListener('click', _doer_maker('click'), false);
                if (focus) {
                    el.addEventListener('focusin', _doer_maker('focusin'), false);
                    el.addEventListener('focusout', _doer_maker('focusout'), false);
                }
            } else {
                el.attachEvent('onclick', _doer_maker('click'), false);
                if (focus) {
                    el.attachEvent('onfocusin', _doer_maker('focusin'), false);
                    el.attachEvent('onfocusout', _doer_maker('focusout'), false);
                }
            }
        };

        this.watch = function (args) {
            if (!args) {
                return;
            }
            if (!args.element) {
                return;
            }
            if (args.element.addEventListener) {
                args.element.addEventListener(
                    'click',
                    _doer_maker('click', args.callback, args.bubble),
                    false
                );
            } else {
                args.element.attachEvent(
                    'onclick',
                    _doer_maker('click', args.callback, args.bubble),
                    false
                );
            }
        };

        function _doer_maker(type, callback, bubble) {
            return function (ev) {
                if (!ev) {
                    ev = window.event;
                }
                var targ = self._findTarget(ev);
                self.event.fill({
                    type: type,
                    event: ev,
                    target: targ
                });
                if (callback) {
                    try {
                        callback(self.event);
                    } catch (e) {
                    }
                }
                if (bubble != null && !bubble) {
                    ev.cancelBubble = true;
                    if (ev.stopPropagation) {
                        ev.stopPropagation();
                    }
                }
                self.event.write();
                self.event = self.freshEvent();
            };
        };

        this.createObjectProps = function (obj) {
            var key_map = obj._key_map;
            for (var key in key_map) {
                if (!obj._event.hasOwnProperty(key)) {
                    obj._event[key] = "";
                }
            }
        };

        this.write = function (obj, callback) {
            var schema = HawkSearch.LilBro.Schema[obj.event_type];
            var key_map = args.key_map || schema.key_map;
            var version = schema.version || HawkSearch.LilBro.Schema.version;
            self.event._key_map = key_map;
            this.createObjectProps(self.event);
            var ev = obj.ev;
            if (!obj.ev && window.event) {
                ev = window.event;
            }
            var targ = self._findTarget(ev);
            self.event.fill({
                type: obj.event_type,
                event: ev,
                target: targ,
                version: version
            });

            for (var key in obj) {
                self.event.set(key, obj[key]);
            }

            self.event.write(callback);
            self.event = self.freshEvent();
        };

        // event target lifted from quirksmode
        this._findTarget = function (ev) {
            var targ = null;
            if (ev && ev.target) {
                targ = ev.target;
            } else if (ev && ev.srcElement) {
                targ = ev.srcElement;
            }
            // defeat Safari bug
            if (targ && targ.nodeType == 3) {
                targ = targ.parentNode;
            }
            return targ;
        };

        this.getTrackingId = function () {
            if (!$) return null;
            if ($("#hdnhawktrackingid").size() == 0 || $("#hdnhawktrackingid").val() === "") {
                return null;
            }
            return $("#hdnhawktrackingid").val();
        };

        this.ensureBase64Encoding = function () {
            /*base 64*/
            !function () {
                function t(t) { this.message = t } var r = "undefined" != typeof exports ? exports : this, e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; t.prototype = new Error, t.prototype.name = "InvalidCharacterError", r.btoa || (r.btoa = function (r) {
                    for (var o, n, a = String(r), i = 0, c = e, d = ""; a.charAt(0 | i) || (c = "=", i % 1) ; d += c.charAt(63 & o >> 8 - i % 1 * 8)) {
                        if (n = a.charCodeAt(i += .75), n > 255) throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); o = o << 8 | n
                    } return d
                }), r.atob || (r.atob = function (r) {
                    var o = String(r).replace(/=+$/, ""); if (o.length % 4 == 1) throw new t("'atob' failed: The string to be decoded is not correctly encoded."); for (var n, a, i = 0, c = 0, d = ""; a = o.charAt(c++) ; ~a && (n = i % 4 ? 64 * n + a : a, i++ % 4) ? d += String.fromCharCode(255 & n >> (-2 * i & 6)) : 0) a = e.indexOf(a); return d
                })
            }();
        }

        this.initialize(args);
    };

    HawkSearch.LilBro.Event = function (args) {

        this.initialize = function (args) {
            this._event = args.base;
            this._key_map = args.key_map;
            this._type_map = args.type_map;
            this.server = args.server;
            this.ssl_server = args.ssl_server;
            this.visit_id_cookie = args.visit_id_cookie;
            this.visitor_id_cookie = args.visitor_id_cookie;
        };

        this.set = function (prop, val) {
            if (!this._event.hasOwnProperty(prop)) {
                return;
            }
            return this._event[prop] = val;
        };

        this.get = function (prop) {
            return this._event[prop];
        };

        this.write = function (callback) {
            var isExpand = HawkSearch.GetQueryStringValue["expand"] !== undefined;
            if (isExpand) {
                return;
            }
            var event = [];
            var et = "";
            for (var key in this._key_map) {
                if (key === "event_type") {
                    event[this._key_map[key]] = this._type_map[this.get(key)] || 0;
                    et = event[this._key_map[key]];
                } else {
                    event[this._key_map[key]] = this.get(key);
                }
            }
            var protocol = window.location.protocol;
            var customDictionaryString = JSON.stringify(HawkSearch.Context.Custom.keyValuePairs());

            var clientIdentifyToken;
            if (HawkSearch.getClientGuid() !== "") {
                clientIdentifyToken = '&cg=' + HawkSearch.getClientGuid();
            } else {
                clientIdentifyToken = '&bu=' + HawkSearch.getHawkUrl();
            }

            if ((HawkSearch.Tracking.CurrentVersion() == HawkSearch.Tracking.Version.v2) || (HawkSearch.Tracking.CurrentVersion() == HawkSearch.Tracking.Version.v2AndSql)) {

                var src = HawkSearch.getTrackingUrl() + '/hawk.png?t=' + encodeURIComponent(btoa(event.join('\x01'))) + '&et=' + et + clientIdentifyToken + '&cd=' + encodeURIComponent(customDictionaryString) + '&' + this.randomHexBlocks(1);

                log(src);
                try {
                    if (sessionStorage) {
                        sessionStorage.setItem(
                            'lilbrobug' + protocol,
                            encodeURIComponent(src)
                        );
                    }
                } catch (e) {
                    log('Tracking: ERROR ' + e);
                }

                var bug = new Image();
                bug.onload = function () {
                    log("Tracking sent. " + src);
                    try {
                        sessionStorage.removeItem('lilbrobug' + protocol);
                    } catch (e) {
                        log('Tracking: ERROR ' + e);
                    }
                    if (callback) {
                        callback();
                    }
                };
                bug.src = src;
            }
        };

        this.fill
            = function (args) {
                //version
                if (args && args.version) {
                    this.set('version', args.version);
                } else {
                    this.set('version', HawkSearch.LilBro.Schema.version);
                }

                if (args && args.type) {
                    // event type
                    this.set('event_type', args.type);
                };
                if (args && args.event) {

                    // mouse coordinates
                    var mouse_x = '';
                    var mouse_y = '';
                    if (args.event.pageX || args.event.pageY) {
                        mouse_x = args.event.pageX;
                        mouse_y = args.event.pageY;
                    } else if (args.event.clientX || args.event.clientY) {
                        mouse_x = args.event.clientX + document.body.scrollLeft
                            + document.documentElement.scrollLeft;
                        mouse_y = args.event.clientY + document.body.scrollTop
                            + document.documentElement.scrollTop;
                    }
                    this.set('mouse_x', mouse_x);
                    this.set('mouse_y', mouse_y);
                }

                // viewport
                this.set('viewport_width', document.documentElement.clientWidth);
                this.set('viewport_height', document.documentElement.clientHeight);

                // scroll, snaked from http://webcodingeasy.com/Javascript/Get-scroll-position-of-webpage--crossbrowser
                var scroll_x = 0, scroll_y = 0;
                if (typeof (window.pageYOffset) == 'number') {
                    scroll_x = window.pageXOffset;
                    scroll_y = window.pageYOffset;
                } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
                    scroll_x = document.body.scrollLeft;
                    scroll_y = document.body.scrollTop;
                } else if (document.documentElement && (document.documentElement.scrollLeft
                    || document.documentElement.scrollTop)) {
                    scroll_x = document.documentElement.scrollLeft;
                    scroll_y = document.documentElement.scrollTop;
                }
                this.set('scroll_x', scroll_x || 0);
                this.set('scroll_y', scroll_y || 0);

                // element goodies
                if (args && args.target) {
                    // element id and class, or their closest ancestors
                    var el_id = args.target.id;
                    var el_class = args.target.className;
                    var id_from_ancestor = !el_id;
                    var class_from_ancestor = !el_class;
                    var id_path, class_path;
                    if (!el_id || !el_class) {
                        var targ_orig = args.target;
                        id_path = args.target.tagName;
                        class_path = args.target.tagName;
                        do {
                            args.target = args.target.parentNode;
                            if (args.target === null || args.target == undefined) {
                                break;
                            }
                            if (!el_id && args.target.tagName) {
                                id_path = args.target.tagName + '/' + id_path;
                                el_id = args.target.id;
                            }
                            if (!el_class && args.target.tagName) {
                                class_path = args.target.tagName + '/' + class_path;
                                el_class = args.target.className;
                            }
                        } while ((!el_id || !el_class) && args.target.parentNode);
                        args.target = targ_orig;
                    }
                    this.set('element_id', el_id);
                    this.set('element_class', el_class);
                    if (el_id && id_from_ancestor) {
                        this.set('element_id_from', id_path);
                    }
                    if (el_class && class_from_ancestor) {
                        this.set('element_class_from', class_path);
                    }

                    // element sundry
                    this.set('element_name', args.target.name || '');
                    this.set('element_tag', args.target.tagName || '');
                    this.set('element_type', args.target.type || '');
                    this.set('element_checked', args.target.checked ? 1 : '');
                    // by default, ignore typed input
                    if (args.target.type && args.target.type.toLowerCase() !== 'text'
                        && args.target.type.toLowerCase() !== 'password') {
                        this.set('element_value', args.target.value || '');
                    }

                    // including the position best effort (http://stackoverflow.com/a/442474)
                    var element_x = 0;
                    var element_y = 0;
                    var targ_orig = args.target;
                    while (args.target && !isNaN(args.target.offsetLeft) && !isNaN(args.target.offsetTop)) {
                        element_x += args.target.offsetLeft - args.target.scrollLeft;
                        element_y += args.target.offsetTop - args.target.scrollTop;
                        args.target = args.target.offsetParent;
                    }
                    args.target = targ_orig;
                    this.set('element_x', element_x);
                    this.set('element_y', element_y);
                }

                // browser
                if (HawkSearch.LilBro.BrowserDetect) {
                    this.set('browser', HawkSearch.LilBro.BrowserDetect.browser);
                    this.set('browser_version', HawkSearch.LilBro.BrowserDetect.version);
                    this.set('operating_system', HawkSearch.LilBro.BrowserDetect.OS);
                }

                // path part of url
                this.set('request_path', window.location.pathname);

                // other client bits
                var d = new Date();
                this.set('timestamp', d.getTime());
                var visitorId = this.getVisitorId();
                var visitId = this.getVisitId();
                this.set('visitor_id', visitorId);
                this.set('visit_id', visitId);
                this.set('qs', encodeURIComponent(HawkSearch.getHash()));
            };

        this.getVisitorId = function () {
            var visitor_id = this.getCookie(this.visitor_id_cookie);
            if (!visitor_id) {
                visitor_id = this.createUUID();
            }
            this.setCookie(this.visitor_id_cookie, visitor_id, this.getVisitorExpiry());
            return visitor_id;
        };

        this.getVisitId = function () {
            var visit_id = this.getCookie(this.visit_id_cookie);
            if (!visit_id) {
                visit_id = this.createUUID();
            }
            this.setCookie(this.visit_id_cookie, visit_id, this.getVisitExpiry());
            return visit_id;
        };

        this.clearVisitId = function () {
            this.setCookie(this.visit_id_cookie, "", 'Thu, 01 Jan 1970 00:00:01 GMT');
        };

        this.getVisitorExpiry = function () {
            var d = new Date();
            // 1 year
            d.setTime(d.getTime() + (360 * 24 * 60 * 60 * 1000));
            return d.toGMTString();
        };

        this.getVisitExpiry = function () {
            var d = new Date();
            // 4 hours
            d.setTime(d.getTime() + (4 * 60 * 60 * 1000));
            return d.toGMTString();
        };

        this.randomHexBlocks = function (blocks) {
            if (!blocks) {
                blocks = 4;
            }
            var hex = '';
            for (var i = 0; i < blocks; i++) {
                hex += parseInt(Math.random() * (Math.pow(2, 32))).toString(16);
            }
            return hex;
        };

        this.createUUID = function () {
            var s = [];
            var hexDigits = "0123456789abcdef";
            for (var i = 0; i < 36; i++) {
                s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
            }
            s[14] = "4";  // bits 12-15 of the time_hi_and_version field to 0010
            s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);  // bits 6-7 of the clock_seq_hi_and_reserved to 01
            s[8] = s[13] = s[18] = s[23] = "-";

            var uuid = s.join("");
            return uuid;
        }


        // cookies borrowed from quirksmode
        this.setCookie = function (name, value, expiry) {
            var expires;
            if (expiry) {
                expires = "; expires=" + expiry;
            } else {
                expires = "";
            }
            document.cookie = name + "=" + value + expires + "; path=/";
        };

        this.getCookie = function (name) {
            var nameEQ = name + "=";
            var ca = document.cookie.split(';');
            for (var i = 0; i < ca.length; i++) {
                var c = ca[i];
                while (c.charAt(0) == ' ') c = c.substring(1, c.length);
                if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
            }
            return null;
        };

        this.initialize(args);
    };

    // browser detection lifted from quirksmode
    HawkSearch.LilBro.BrowserDetect = {
        init: function () {
            this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
            this.version = this.searchVersion(navigator.userAgent)
                || this.searchVersion(navigator.appVersion)
                || "an unknown version";
            this.OS = this.searchString(this.dataOS) || "an unknown OS";
        },
        searchString: function (data) {
            for (var i = 0; i < data.length; i++) {
                var dataString = data[i].string;
                var dataProp = data[i].prop;
                this.versionSearchString = data[i].versionSearch || data[i].identity;
                if (dataString) {
                    if (dataString.indexOf(data[i].subString) != -1)
                        return data[i].identity;
                }
                else if (dataProp)
                    return data[i].identity;
            }
        },
        searchVersion: function (dataString) {
            var index = dataString.indexOf(this.versionSearchString);
            if (index == -1) return;
            return parseFloat(dataString.substring(index + this.versionSearchString.length + 1));
        },
        dataBrowser: [
            {
                string: navigator.userAgent,
                subString: "BlackBerry",
                identity: "BlackBerry"
            },
            {
                string: navigator.userAgent,
                subString: "BB10",
                identity: "BlackBerry"
            },
            {
                string: navigator.userAgent,
                subString: "PlayBook",
                identity: "BlackBerry"
            },
            {
                string: navigator.userAgent,
                subString: "Chrome",
                identity: "Chrome"
            },
            {
                string: navigator.userAgent,
                subString: "OmniWeb",
                versionSearch: "OmniWeb/",
                identity: "OmniWeb"
            },
            {
                string: navigator.vendor,
                subString: "Apple",
                identity: "Safari",
                versionSearch: "Version"
            },
            {
                prop: window.opera,
                identity: "Opera",
                versionSearch: "Version"
            },
            {
                string: navigator.vendor,
                subString: "iCab",
                identity: "iCab"
            },
            {
                string: navigator.vendor,
                subString: "KDE",
                identity: "Konqueror"
            },
            {
                string: navigator.userAgent,
                subString: "Firefox",
                identity: "Firefox"
            },
            {
                string: navigator.vendor,
                subString: "Camino",
                identity: "Camino"
            },
            {// for newer Netscapes (6+)
                string: navigator.userAgent,
                subString: "Netscape",
                identity: "Netscape"
            },
            {
                string: navigator.userAgent,
                subString: "MSIE",
                identity: "Explorer",
                versionSearch: "MSIE"
            },
            {
                string: navigator.userAgent,
                subString: "Gecko",
                identity: "Mozilla",
                versionSearch: "rv"
            },
            { // for older Netscapes (4-)
                string: navigator.userAgent,
                subString: "Mozilla",
                identity: "Netscape",
                versionSearch: "Mozilla"
            }
        ],
        dataOS: [
            {
                string: navigator.userAgent,
                subString: "iPhone",
                identity: "iPhone/iPod"
            },
            {
                string: navigator.userAgent,
                subString: "iPod",
                identity: "iPhone/iPod"
            },
            {
                string: navigator.userAgent,
                subString: "iPad",
                identity: "iPad"
            },
            {
                string: navigator.userAgent,
                subString: "BlackBerry",
                identity: "BlackBerry"
            },
            {
                string: navigator.userAgent,
                subString: "BB10",
                identity: "BlackBerry"
            },
            {
                string: navigator.userAgent,
                subString: "PlayBook",
                identity: "BlackBerry"
            },
            {
                string: navigator.userAgent,
                subString: "Android",
                identity: "Android"
            },
            {
                string: navigator.platform,
                subString: "Win",
                identity: "Windows"
            },
            {
                string: navigator.platform,
                subString: "Mac",
                identity: "Mac"
            },
            {
                string: navigator.platform,
                subString: "Linux",
                identity: "Linux"
            }
        ]
    };

    try {
        HawkSearch.LilBro.BrowserDetect.init();
    } catch (e) { }

    HawkSearch.Recommender = function (jQuery) {

        var self = this;
        this._uniqueId = null;
        var $ = jQuery;

        this.Init = function () {
            if (!HawkSearch.getRecommenderUrl()) {
                return;
            }

            log("Recommender init");

            if (HawkSearch.Context.containsKey("uniqueid")) {
                self._uniqueId = HawkSearch.Context["uniqueid"];
            }

            self._context = HawkSearch.RecommendationContext;
            self._context.enablePreview = HawkSearch.Recommender.IsPreviewEnabled();

            self._context.contextProperties = HawkSearch.Context.keyValuePairs();
            self._context.customProperties = HawkSearch.Context.Custom.keyValuePairs();
            $(".hawk-recommendation").each(function () {
                var uid = HawkSearch.Recommender.GetWidgetUid($(this).data("widgetguid"), $(this).data("uniqueid"));
                if ($(this).data("uniqueid") === undefined || uid.uniqueId === "") {
                    uid.uniqueId = self._uniqueId;
                }
                var widgetExists = false;
                $(self._context.widgetUids).each(function () {
                    var currentWidgetGuid = this.widgetGuid;
                    if (currentWidgetGuid == uid.widgetGuid) {
                        widgetExists = true;
                        return;
                    }
                })
                if (!widgetExists) {
                    self._context.widgetUids.push(uid);
                }
            });

            if (self._context.widgetUids.length == 0) {
                return;
            }
            var recommenderUrl = HawkSearch.getRecommenderUrl() + "/api/recommendation/";

            var previewVisitorTargets = HawkSearch.Recommender.PreviewVisitorTarget();

            if (HawkSearch.Recommender.IsPreviewEnabled() && previewVisitorTargets != null && previewVisitorTargets !== "") {
                recommenderUrl = recommenderUrl + "?hawkb=" + previewVisitorTargets;
            }

            $.ajax({
                type: 'POST',
                url: recommenderUrl,
                data: JSON.stringify(self._context),
                contentType: "application/json",
                dataType: 'json'
            })
            .done(self.RegWidgets);
        }

        bindRecommendationPopover = function (container, ruleExplainDictionary, triggerRuleExplainDictionary) {
            container.find(".hawk-recommendation-item").each(function () {
                var modelType = $(this).data("hawk-modeltype");
                var modelName = $(this).data("hawk-modelname");
                var modelGuid = $(this).data("hawk-modelguid");
                var recInfoContainer = $(this).find(".hawk-recommendation-info");
                if (recInfoContainer.size() === 0) {
                    recInfoContainer = $("<div class='hawk-recommendation-info' data-trigger='hover'></div>");
                    recInfoContainer.append($("<div class='hawk-recommendation-model-icon hawk-" + modelType.toLowerCase() + "'></div>"));
                    $(this).prepend(recInfoContainer);
                }

                var ruleString = ruleExplainDictionary[modelGuid];
                var triggerRuleString = triggerRuleExplainDictionary[modelGuid];

                $(recInfoContainer).popover({
                    html: true,
                    placement: HawkSearch.getTipPlacementFunction('top', 230, 200),

                    content: function () {
                        var content = "<b>Strategy Name:</b> " + modelName;
                        if (ruleString !== undefined && ruleString !== "") {
                            content += "<div class=''>"
                            content += "<div class=''><b>Rule:</b></div>";
                            content += ruleString;
                            content += "</div>";
                        }

                        if (triggerRuleString !== undefined && triggerRuleString !== "") {
                            content += "<div class=''>"
                            content += "<div class=''><b>Trigger Rule:</b></div>";
                            content += triggerRuleString;
                            content += "</div>";
                        }

                        return content;
                    },
                    trigger: 'hover',
                    container: 'body'
                });

            });
        }

        this.RegWidgets = function (data) {
            if (!data.isSuccess) {
                return;
            }

            $(data.items).each(function () {
                var item = this;
                var contaierSelector = '.hawk-recommendation[data-widgetguid="' + item.widgetGuid + '"]';
                var widgetContainer = $(contaierSelector);
                if (widgetContainer.length > 0) {
                    widgetContainer.attr("data-hawk-requestid", data.requestId);
                    var layoutClass = "hawk-recommendation-" + (item.isVertical ? "vertical" : "horizontal");
                    widgetContainer.addClass(layoutClass);
                    widgetContainer.addClass(item.widgetCssClass);
                    widgetContainer.append("<div class='hawk-recommendation-inner'></div>");
                    var widgetContainerInner = widgetContainer.find(".hawk-recommendation-inner");
                    widgetContainerInner.css('visibility', 'hidden');
                    widgetContainerInner.html(item.html);
                    var hawkRecommendationItems = widgetContainerInner.find(".hawk-recommendation-item");
                    widgetContainerInner.waitForImages(function () {
                        var itemContainer = widgetContainerInner.find(".hawk-recommendation-list")

                        hawkRecommendationItems.matchHeights({ includeMargin: true });

                        if (!itemContainer.children().length) {
                            widgetContainer.hide();
                        }

                        var container = $("#hawkitemlist");

                        HawkSearch.ExposeEvents("RecommenderAfterWidgetImagesLoaded", { widgetContainer: widgetContainer });


                        if (item.isCarousel) {
                            if (item.carouselData.showNextPrevButtons) {
                                widgetContainerInner.addClass("has-arrows");
                            }
                            if (item.carouselData.showDots) {
                                widgetContainerInner.addClass("has-dots vertical-dots");
                            }

                            var autoRotateSpeed = item.carouselData.autoRotate ? item.carouselData.autoRotateSpeed : 0;
                            var showDots = item.carouselData.showDots;
                            var slickOptions = {
                                speed: item.carouselData.animationSpeed,
                                autoplay: item.carouselData.autoRotate,
                                autoplaySpeed: item.carouselData.autoRotateSpeed,
                                vertical: item.isVertical,
                                slidesToShow: item.carouselData.nofVisible,
                                arrows: item.carouselData.showNextPrevButtons,
                                nextArrow: '<button type="button" class="hawk-carousel-next"><span>Next</span></button>',
                                prevArrow: '<button type="button" class="hawk-carousel-prev"><span>Prev</span></button>',
                                slidesToScroll: item.carouselData.scrollNumber,
                                infinite: item.carouselData.isCircular,
                                dots: item.carouselData.showDots,
                                //variableWidth: (!item.isVertical),
                                slide: ".hawk-recommendation-item",
                                pauseOnHover: true,
                                pauseOnDotsHover: true,
                                mobileFirst: true
                            };
                            if (item.carouselData.enableResponsive) {
                                var responsiveConfig = null;
                                try {
                                    responsiveConfig = JSON.parse(item.carouselData.responseiveConfig);

                                } catch (e) {
                                    log("Responsive data is corupted. WidgetGuid: " + item.widgetGuid + " Error:" + e);
                                }
                                if (responsiveConfig != null) {
                                    slickOptions.responsive = responsiveConfig;
                                }
                            }

                            itemContainer.slick(slickOptions);

                            if (!item.isVertical) {
                                var itemWidth = itemContainer.find(".hawk-recommendation-item:visible").first().outerWidth(true);
                                var itemCount = item.carouselData.nofVisible;
                                //itemContainer.width(itemWidth * itemCount);
                                //widgetContainer.css( "maxWidth", widgetContainerInner.width() + 52 + "px");
                                //widgetContainer.height(widgetContainerInner.height() + "px");
                            }
                            else {
                                var itemWidth = itemContainer.find(".hawk-recommendation-item:visible").first().outerWidth(true);
                                //itemContainer.width(itemWidth + "px");
                            }

                            $(window).on("debouncedresize", function () {
                                itemContainer.slick('slickGoTo', itemContainer.slick('slickCurrentSlide'), true);
                            });
                        } else {
                            if (!item.isVertical) {
                                var itemWidth = itemContainer.find(".hawk-recommendation-item:visible").first().outerWidth(true);
                                var itemCount = itemContainer.find(".hawk-recommendation-item").size();
                                itemContainer.width(itemWidth * itemCount);
                                widgetContainer.height(widgetContainerInner.height() + "px");
                            }
                            else {
                                widgetContainer.width(widgetContainerInner.width() + "px");
                            }
                        }
                        widgetContainer.append("<div class='clearfix'></div>");
                        widgetContainerInner.css('visibility', 'visible');

                        var enablePreview = HawkSearch.Recommender.IsPreviewEnabled();

                        if (enablePreview) {
                            var ruleExplainDictionary = new HawkSearch.Dictionary();
                            var triggerRuleExplainDictionary = new HawkSearch.Dictionary();
                            var bindPreview = function (data) {

                                for (i = 0; i < data.length; i++) {
                                    var item = data[i];
                                    ruleExplainDictionary[item.ModelGuid] = item.RuleString;
                                    triggerRuleExplainDictionary[item.ModelGuid] = item.TriggerRuleString;
                                }
                                bindRecommendationPopover(widgetContainerInner, ruleExplainDictionary, triggerRuleExplainDictionary);
                            };

                            $(window).on("debouncedresize", function () {
                                $(".hawk-recommendation-info").each(function (index, item) {
                                    $(item).popover('destroy');
                                });

                                setTimeout(function () {
                                    bindRecommendationPopover(widgetContainerInner, ruleExplainDictionary, triggerRuleExplainDictionary);
                                }, 10);

                            });
                            var uriParser = document.createElement("a");
                            var url = uriParser.href = HawkSearch.getHawkUrl();
                            var apiUrl = uriParser.protocol + "//" + uriParser.hostname + "/api/v3/RecommendationModel/getruleexplain?widgetGuid=" + item.widgetGuid + "&bu=" + encodeURIComponent(HawkSearch.getHawkUrl()) + "&cg=" + HawkSearch.getClientGuid();
                            $.ajax({
                                url: apiUrl,
                                dataType: "jsonp",
                                success: bindPreview
                            });
                        }
                    });
                }
            });
            HawkSearch.ExposeEvents('RecommenderAfterInit');
        }
        this.Init();
    }
    HawkSearch.Recommender.PreviewInfoCookieName = "EnableRecommendationPreviewInfo";
    HawkSearch.Recommender.HawkPreviewBucket = "hawkPreviewBucket";

    HawkSearch.Recommender.GetWidgetUid = function (widgetGuid, uniqueId) {
        var uid = new Object();
        uid.widgetGuid = widgetGuid;
        uid.uniqueId = uniqueId;

        if (uniqueId !== undefined && uniqueId.match(/{{.+}}/)) {
            uid.uniqueId = "";
        }

        return uid;
    }

    HawkSearch.Recommender.SetWidget = function (widgetGuid, uniqueId) {
        HawkSearch.RecommendationContext.widgetUids.push(HawkSearch.Recommender.GetWidgetUid(widgetGuid, uniqueId));
    }

    HawkSearch.Recommender.IsPreviewEnabled = function () {
        var enablePreview = HawkSearch.lilBro.event.getCookie(HawkSearch.Recommender.PreviewInfoCookieName)

        return (enablePreview !== null && enablePreview.toLowerCase() === 'true');
    }

    HawkSearch.Recommender.ToggleRecPreview = function () {
        HawkSearch.Tracking.ready(function () {
            var toggleVal = HawkSearch.getHashOrQueryVariable("hawkToggleRecPreview");
            if (toggleVal !== "") {
                HawkSearch.lilBro.event.setCookie(HawkSearch.Recommender.PreviewInfoCookieName, toggleVal, HawkSearch.lilBro.event.getVisitorExpiry());
                var hawkb = HawkSearch.getHashOrQueryVariable("hawksetb");
                HawkSearch.lilBro.event.setCookie(HawkSearch.Recommender.HawkPreviewBucket, hawkb, HawkSearch.lilBro.event.getVisitorExpiry());
            }
        });
    }

    HawkSearch.Recommender.PreviewVisitorTarget = function () {
        return HawkSearch.lilBro.event.getCookie(HawkSearch.Recommender.HawkPreviewBucket);
    }

    HawkSearch.Recommender.Track = function (el, uniqueId, itemIndex) {
        var widgetGuid = HawkSearch.jQuery(el).parents(".hawk-recommendation").data("widgetguid");
        var recommendation = HawkSearch.jQuery(el).parents(".hawk-recommendation");
        var requestId = recommendation.data("hawk-requestid");
        HawkSearch.Tracking.writeRecommendationClick(widgetGuid, uniqueId, itemIndex, requestId);
    }

    function log(msg) {
        if (HawkSearchLoader.debugMode && window.console && console.log) {
            console.log('HawkSearch: ' + msg);
        };
    }

    if (HawkSearchLoader.loadjQuery) {
        log('Loading jQuery/jQuery UI.');
        // set document head to varible
        var head = (document.getElementsByTagName("head")[0] || document.documentElement),
            	script = HawkSearchLoader.HostUrl + HawkSearchLoader.IncludesFolder + "includes/jquery-1.11.0_jquery-ui-slider-1.10.4.min.js";

        var jqScriptTag = document.createElement('script');
        jqScriptTag.type = 'text/javascript';
        jqScriptTag.src = script;

        // Handle Script loading
        // IE9+ supports both script.onload AND script.onreadystatechange (bit.ly/18gsqtw)
        // so both events will be triggered (that's 2 calls), which is why "jqLoadDone" is needed
        var jqLoadDone = false;

        // Attach handlers for all browsers
        jqScriptTag.onload = jqScriptTag.onreadystatechange = function () {
            if (!jqLoadDone && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
                jqLoadDone = true;

                log("jQuery applied and ready");
                jQueryLoaded();

                // Handle memory leak in IE
                jqScriptTag.onload = jqScriptTag.onreadystatechange = null;
                if (head && jqScriptTag.parentNode) {
                    head.removeChild(jqScriptTag);
                }
            }
        };


        // add script to page's head tag.
        // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
        // This arises when a base node is used (#2709 and #4378).
        head.insertBefore(jqScriptTag, head.firstChild);

    } else {
        jQuery = window.jQuery;
        jQuery(function () {
            containedHawkSearchInitializer(jQuery);
        });
    }

    function jQueryLoaded() {
        log('Finalizing JS Component Binding');
        jQuery = window.jQuery.noConflict(true);

        log('Local jQuery version: ' + jQuery.fn.jquery);

        if (window.jQuery)
            log('Global jQuery version: ' + window.jQuery.fn.jquery);
        else {
            log('No Global jQuery present. Adding current jQuery');
            window.jQuery = jQuery;
        }
        containedHawkSearchInitializer(jQuery);
    };

    //Since we're loading jQuery dynamically and are using callbacks, we need to store all of our
    //plugins inside a single function that passes $ aliased from our version of jQuery.
    function containedHawkSearchInitializer($) {
        // BEGIN Namespaced HawkSearch block.

        (function (HawkSearch, $) {
            HawkSearch.loadingtpl = '<img src="' + HawkSearchLoader.LoadingImage + '" style="margin:0 5px;vertical-align:middle;" />';
            HawkSearch.loadtimer = null;
            HawkSearch.scroll = false;
            HawkSearch.processing = false;
            
            HawkSearch.disableAjax = function () {
                return false;
            };

            HawkSearch.getHash = function () {
                var hashSplit = window.location.toString().split("#");
                if (hashSplit.length > 1) return hashSplit[1];
                return window.location.search.substring(1);
            };

            HawkSearch.lilBro = new HawkSearch.LilBro({
                server: HawkSearch.getHawkUrl(),
                server_ssl: HawkSearch.getHawkUrl() + ':443',
                watch_focus: false,
                watch_click: false,
                event_base: HawkSearch.EventBase,
                qs: encodeURIComponent(HawkSearch.getHash()),
                jQuery: $
            });

            HawkSearch.jQuery = $;

            HawkSearch.normalizeHeights = function () {
                var container = $("#hawkitemlist");
                var topcontainer = $("#hawkbannertop");
                var targetElement = container.find(".itemWrapper");

                // use imagesLoaded() plugin to detect if images are fully loaded
                // http://imagesloaded.desandro.com/
                var imgLoad = imagesLoaded(container);

                // Triggered after all images have been either loaded or confirmed broken.
                imgLoad.on("always", function (instance) {
                    log("Heights Normalize; No broken images");
                    // match heights of specified elements
                    container.find(".itemWrapper .itemImage").matchHeights();
                    container.find(".itemWrapper .itemTitle").matchHeights();
                    topcontainer.find(".itemWrapper .itemImage").matchHeights();
                    topcontainer.find(".itemWrapper .itemTitle").matchHeights();
                    targetElement.matchHeights({
                        extension: 3
                    });
                });

                // Triggered after all images have been loaded with at least one broken image.
                imgLoad.on('fail', function (instance) {
                    log("Heights Normalize; Broken image(s)");
                });

                // Triggered after each image has been loaded.
                /* DISABLED for SamHealth due to browser compatibility issues */
                //imgLoad.on("progress", function (instance, image) {
                //    var result = image.isLoaded ? 'loaded' : 'broken';
                //    // check if image is broken
                //    if (result === "broken") {
                //        // in debug mode log broken image src
                //        log('Image Broken: ' + image.img.src);
                //        // change broken image src with spacer.gif and apply broken image class
                //        image.img.src = HawkSearchLoader.IncludesFolder + "images/spacer.gif";
                //        image.img.className = "itemImage hawk-brokenImage";
                //    };
                //});
            };

            HawkSearch.regTracking = function () {
                log("Register Tracking");

                $(".hawk-bannerLink").each(function () {
                    var bannerId = $(this).data("bannerid");
                    HawkSearch.Tracking.writeBannerImpression(bannerId);
                });
            };

            HawkSearch.regSmartBug = function () {
                $('#aBug').click(function () {
                    if ($('#divSmartBug > ul').children().length > 0) {
                        $('#divSmartBugEye').hide();
                        $('#divSmartBug').toggle('fast');
                        return false;
                    }
                    return true;
                });

                $('#aEye').click(function () {
                    if ($('#divSmartBugEye > ul').children().length > 0) {
                        $('#divSmartBug').hide();
                        $('#divSmartBugEye').toggle('fast');
                        return false;
                    }
                    return true;
                });

                $('#aRefresh').click(function () {
                    HawkSearch.resetSearch();
                });

                $("#divSmartBugEye .hawk-mutilbucket input[type=checkbox]").click(function (e) {
                    e.stopPropagation();
                });

                $("#divSmartBugEye a.hawk-mutilbucket").click(function (e) {
                    e.preventDefault();
                    var checkBox = $(this).find("input[type=checkbox]");
                    checkBox.prop("checked", !checkBox.prop("checked"));
                });


                $("#hawkBtnApplayVisitorTarget").click(function () {
                    var url = $("#hawkHdnBucketUrl").val();
                    var selectedBuckets = [];
                    $("#divSmartBugEye .hawk-mutilbucket input[type=checkbox]:checked").each(function () {
                        selectedBuckets.push($(this).data("hawkbucketid"));
                    });

                    if ($("#divSmartBugEye .hawk-mutilbucket input[type=checkbox]:checked").length === 0) {
                        selectedBuckets.push(0);
                    }

                    url = url.replace(/__bucket_ids__/i, selectedBuckets.join());
                    window.location.href = url;
                });

                if (typeof HawkPreviewDateTime !== 'undefined') {
                    HawkPreviewDateTime.registerPreviewDatetime();
                }
            }

            HawkSearch.regFacets = function () {
                log("Register Facets");

                // normalize heights across items in results list
                HawkSearch.normalizeHeights();

                // initializes slider configuration for use with price range
                $("div.hawk-slideRange").each(function () {
                    var container = $(this),
                        options = container.data(),
                        minRange = options.minRange,
                        maxRange = options.maxRange,
                        stepSlide = options.stepRange,
                        minValueDisplay = container.siblings(".slider-min-value"),
                        maxValueDisplay = container.siblings(".slider-max-value");

                    var values = $(this).parent().find("input.hawk-sliderRangeInput").val().split(','),
                        minValue = parseInt(values[0]),
                        maxValue = parseInt(values[1]);

                    var numericFrom = $($(this).parent().find(".numeric-from"));
                    var numericTo = $($(this).parent().find(".numeric-to"));

                    // set up slider range functionality
                    container.slider({
                        range: true,
                        min: minRange,
                        max: maxRange,
                        step: stepSlide,
                        values: [minValue, maxValue],
                        slide: function (event, ui) {
                            var start = ui.values[0];
                            var end = ui.values[1];
                            var type = $(this).parent().find("input:last").val().toLowerCase();
                            if (type == 'currency') {
                                start = HawkSearch.formatCurrency(start);
                                end = HawkSearch.formatCurrency(end);
                            }

                            if (numericTo.size() > 0) {
                                numericFrom.val(start);
                                numericTo.val(end);
                            }

                            minValueDisplay.text(start);
                            maxValueDisplay.text(end);

                            $(this).parent().find("input.hawk-sliderRangeInput").val(ui.values[0] + ',' + ui.values[1]);
                        },
                        stop: function (event, ui) {
                            // clear the current page
                            $("#hdnhawkpg").val("");

                            HawkSearch.refreshUrl();
                        }
                    });

                    var hawkSlideHandles = container.children().filter("a");
                    hawkSlideHandles.eq(0).addClass("first-handle");
                    hawkSlideHandles.eq(1).addClass("second-handle");
                });

                $("div.hawk-sliderNumeric").each(function () {
                    $(this).find(".hawk-numericInput").each(function (e) {
                        $(this).numeric();
                        $(this).blur(function () {
                            var val = parseFloat($(this).val().replace(/[^0-9\.]+/g, ""));

                            var type = $(this).data("type");
                            if (type == 'currency') {
                                $(this).val(HawkSearch.formatCurrency(val));
                            }
                        })

                        $(this).on("focus", function () {
                            $(this).attr("data-orgval", $(this).val().replace(/[^0-9\.]+/g, ""));
                        });

                        $(this).on("change", function () {
                            var val = parseFloat($(this).val().replace(/[^0-9\.]+/g, ""));
                            var minValue = parseFloat($(this).data("min"));
                            var maxValue = parseFloat($(this).data("max"));
                            var isInvalid = false;

                            var numericFrom = $($(this).parent().find(".numeric-from"));
                            var numericTo = $($(this).parent().find(".numeric-to"));

                            var fromVal = parseFloat(numericFrom.val().replace(/[^0-9\.]+/g, ""));
                            var toVal = parseFloat(numericTo.val().replace(/[^0-9\.]+/g, ""));

                            var orgval = parseFloat($(this).data("orgval"));
                            if (val < minValue || val > maxValue || fromVal > toVal) {
                                val = orgval;
                                isInvalid = true;
                            }

                            var type = $(this).data("type");
                            if (type == 'currency') {
                                $(this).val(HawkSearch.formatCurrency(val));
                            } else {
                                $(this).val(val);
                            }
                            if (isInvalid) {
                                return;
                            }

                            $(this).parents(".hawk-slideFacet").find("div.hawk-slideRange").slider('values', 0, parseFloat(fromVal));
                            $(this).parents(".hawk-slideFacet").find("div.hawk-slideRange").slider('values', 1, parseFloat(toVal));
                            $(this).parents(".hawk-slideFacet").find("input.hawk-sliderRangeInput").val(fromVal + ',' + toVal);

                            HawkSearch.refreshUrl();
                        });
                    })


                })

                // configures truncated list functionality
                $(".hawk-navTruncateList").each(function () {
                    var cont = $(this);
                    var listItems = cont.children("li");
                    var options = cont.data().options;

                    var moreItems = listItems.filter(function (index) {
                        return index >= options.cutoff;
                    });

                    if (moreItems.size() == 0) {
                        return;
                    }
                    // only hide if not already expanded
                    if (!window["hawkexpfacet_" + cont.attr("id")])
                        moreItems.hide();

                    var moreLess = $("<li class='hawk-navMore'><span>" + options.moreText + "</span></li>");
                    cont.append(moreLess);
                    moreLess.children("span").click(function (event) {
                        var moreTrigger = $(this);
                        if ($(this).hasClass("hawk-navMoreActive")) {
                            moreItems.hide();
                            moreTrigger.removeClass("hawk-navMoreActive").closest("span").text(options.moreText);
                            window["hawkexpfacet_" + cont.attr("id")] = null;
                        } else {
                            moreItems.show();
                            moreTrigger.addClass("hawk-navMoreActive").closest("span").text(options.lessText);
                            window["hawkexpfacet_" + cont.attr("id")] = true;
                        };
                    });

                    if (window["hawkexpfacet_" + cont.attr("id")]) cont.find(".hawk-navMore span").click();

                });




                // this handles the mouse hovers and click states for the hawk nav
                $(".hawkRailNav").delegate(".hawk-navGroup li > a", "mouseover mouseout click", function (event) {

                    var facetCont = $(this).parent();

                    if (event.type == "mouseover") {
                        facetCont.addClass("hawkFacet-hover");
                    } else if (event.type == "mouseout") {
                        facetCont.removeClass("hawkFacet-hover");
                    } else if (event.type == "click") {
                        event.preventDefault();
                        if (facetCont.hasClass("hawkFacet-indetermined")) {
                            facetCont.removeClass("hawkFacet-indetermined")
                            facetCont.addClass("hawkFacet-active");
                            facetCont.find("> ul > li ").removeClass("hawkFacet-active");
                        } else {
                            facetCont.toggleClass("hawkFacet-active");
                        }

                        $(facetCont).find(".hawkFacet-active").removeClass("hawkFacet-active");
                        $(facetCont).parentsUntil(".hawk-navGroupContent", "ul").each(function () {
                            var parentUl = $(this);
                            var activeCount = parentUl.find("li.hawkFacet-active").size();
                            var allCount = parentUl.find("li").size();
                            if (allCount > 0) {
                                var closestLi = $(this).closest("li");
                                closestLi.removeClass("hawkFacet-active");
                                closestLi.addClass("hawkFacet-indetermined");
                            }
                        });
                    };
                });

                // initializes filter quicksearch
                $('.hawk-quickSearch input').each(function () {
                    var searchInput = $(this);
                    searchInput.filterThatList({
                        list: searchInput.closest(".hawk-quickSearch").next()
                    });
                });

                // handles collapsible display on larger screens
                $(".hawk-guidedNavWrapper .hawk-collapsible .hawk-groupHeading").on("click", function () {
                    var facetGroup = $(this).closest(".hawk-navGroup");
                    var fgHeightBefore = facetGroup.outerHeight();
                    facetGroup.toggleClass("hawk-collapsed");
                    var fgHeightAfter = facetGroup.outerHeight();
                    if ($(".hawk-facetScollingContainer").length && $(".hawk-facetScollingContainer").position().top > 0) {
                        var menuHeight = $(".hawk-facetScollingContainer").outerHeight();
                        var maxOffset = $(".footer").offset().top;
                        var menuOffset = $(".hawk-facetScollingContainer").offset().top;
                        if (menuHeight + menuOffset > maxOffset) {
                            var offset = $(".hawk-facetScollingContainer").position().top;
                            offset = offset - (menuHeight + menuOffset - maxOffset) - 10;
                            $(".hawk-facetScollingContainer").css("top", offset + "px");
                        }

                        HawkSearch.SetFacetScrollPosition();
                    }

                    var fieldName = facetGroup.attr("data-field");
                    var collapsed = false;
                    if (facetGroup.hasClass("hawk-collapsed")) {
                        collapsed = true;
                    }
                    $.cookie(fieldName, collapsed, { expires: 365 });
                });

                $(".hawk-guidedNavWrapper .hawk-collapsible").each(function () {
                    var fieldName = $(this).attr("data-field");
                    var visible = $.cookie(fieldName);
                    if (visible == 'true') {
                        $(this).addClass("hawk-collapsed");
                    } else if (visible == 'false') {
                        $(this).removeClass("hawk-collapsed");
                    }

                    // edw - initial load only
                    //if (fieldName == 'facet-lastname') {
                        //$(this).hide();
                        //console.log(fieldName);
                    //}
                });
                // edw - resizing function, 
                // maybe check bootstrap's .container width instead
                // need another function to run toggle on load for mobile devices
                // update CSS:
                // .hawk-railNavHeading {display: none;} on @media only screen and (max-width:991px)
                // .hawkRailNav remove display setting on  @media only screen and (max-width:991px)
                $(window).resize(function () {
                    checkSize();
                });
                $(document).ready(function () {
                    checkSize();
                });
                function checkSize() {
                    var clientWidth = document.documentElement.clientWidth;
					if (clientWidth <= 600) {						
                      //  console.log(clientWidth);
                        $('[data-field="facet-gender"]').hide();
                        //$('[data-field="facet-specialties"]').hide();
                        $('[data-field="facet-services"]').hide();
                        $('[data-field="facet-languages"]').hide();
                        $('[data-field="facet-primarycarephysician"]').hide();
						
                        //$('[data-field="facet-cities"]').hide();
						$('[data-field="facet-acceptingpatients"]').hide();
						$('[data-field="facet-shsaffiliate"]').hide();
						$('[data-field="facet-eventtype"]').hide();
						$('[data-field="facet-eventlocation"]').hide();
                        //var hawkRail = $(".hawkRailNav").attr("display");
                        //console.log(hawkRail);

                    } else if (clientWidth > 601) {
						
                       // console.log(clientWidth);
                        $('[data-field="facet-gender"]').show();
                        $('[data-field="facet-specialties"]').show();
                        $('[data-field="facet-services"]').show();
                        $('[data-field="facet-languages"]').show();
                        $('[data-field="facet-primarycarephysician"]').show();
                        $('[data-field="facet-cities"]').show();
						$('[data-field="facet-acceptingpatients"]').show();
						$('[data-field="facet-shsaffiliate"]').show();
						$('[data-field="facet-eventtype"]').show();
						$('[data-field="facet-eventlocation"]').show();

                    }
                };

                // bind click event to filter heading to hide/show for small devices
                $(".hawk-railNavHeading").on("click", function () {
                    var railNavHeading = $(this);
                    var hawkNavFilters = railNavHeading.next(".hawkRailNav");
                    railNavHeading.toggleClass("hawk-railNavHeadingActive");
                    hawkNavFilters.toggleClass("hawk-notCollapsed");

                    // edw - this works - hide fields on expanding Narrow Results header
                    //var facetLastName = $('[data-field="facet-lastname"]');
                    //facetLastName.toggle();
                    //var facetGender = $('[data-field="facet-gender"]');
                    //facetGender.toggle();

                });

                // bind click event to filter group heading to hide/show for small devices
                $(".hawk-guidedNavWrapper .hawk-navGroup .hawk-groupHeading").on("click", function () {
                    var facetGroup = $(this).closest(".hawk-navGroup");
                    facetGroup.toggleClass("hawk-notCollapsed");
                });

                HawkSearch.regSmartBug();

                $("table.compTbl div.itemWrapper .itemPrice").matchHeights();

                $(".hawk-nestedfacet .hawkFacet-active").each(function () {
                    $(this).children("ul").removeClass("collapse").addClass("in");
                    $(this).children(".hawk-collapseState").removeClass("collapsed");

                    $(this).parentsUntil(".hawk-navGroup", ".hawk-facetgroup").addClass("in");
                    $(this).parentsUntil(".hawk-navGroup", "li").each(function () {
                        $(this).children(".hawk-collapseState").removeClass("collapsed");
                    });
                });

                $(".hawk-nestedfacet ul >.hawkFacet-active").each(function () {
                    var parents = $(this).parentsUntil(".hawk-navGroupContent", "ul").each(function () {
                        var parentUl = $(this);
                        var activeCount = parentUl.find("li.hawkFacet-active").size();
                        var allCount = parentUl.find("li").size();
                        if (allCount > 0) {
                            var closestLi = $(this).closest("li");
                            closestLi.removeClass("hawkFacet-active");
                            closestLi.addClass("hawkFacet-indetermined");
                        }
                    });

                });


                // initialize bootstrap datepicker
                HawkSearch.jQuery('.bootstrap-datepicker').each(function () {
                    $(this).datepicker({
                        orientation: "top",
                        autoclose: true,
                        format: "mm/dd/yyyy",
                        startDate: new Date($(this).attr("data-date-min")),
                        endDate: new Date($(this).attr("data-date-max"))
                    });
                    $(this).datepicker().on('changeDate', function (ev) {
                        var date = ev.date;
                        var yyyy = date.getFullYear().toString();
                        var mm = (date.getMonth() + 1).toString();
                        var dd = date.getDate().toString();
                        var mmChars = mm.split('');
                        var ddChars = dd.split('');
                        var datestring = yyyy + (mmChars[1] ? mm : "0" + mmChars[0]) + (ddChars[1] ? dd : "0" + ddChars[0]);
                        if ($(this).hasClass("numeric-from")) {
                            //$(this).attr('data-min', datestring);
                            $(this).parent().find(".hawk-dateSliderInput").val(datestring + "," + $(this).parent().find(".hawk-dateMaxRange").val())
                        }
                        else if ($(this).hasClass("numeric-to")) {
                            $(this).attr('data-max', datestring);
                            $(this).parent().find(".hawk-dateSliderInput").val($(this).parent().find(".hawk-dateMinRange").val() + "," + datestring)
                        }

                        HawkSearch.refreshUrl();
                    });
                });

                // Alex D. - changed { scrollTop: 0 } to { scrollTop: 400 }
                if ($(window).scrollTop() > 0) {
                    $('html,body').animate({ scrollTop: 400 }, 500, function () { HawkSearch.scroll = false; HawkSearch.hideBlockUI(); });

                    // $('html,body').animate({ scrollTop: 0 }, 500, function () { HawkSearch.scroll = false; HawkSearch.hideBlockUI(); });
                } else {
                    HawkSearch.scroll = false; HawkSearch.hideBlockUI();
                }
            };

            HawkSearch.refreshUrl = function (event, forceReload) {
                $("#hdnhawkcompare").val(window['hawktocompare'].join(","));

                var qs = "";
                var prevName = "";
                var vals = "";
                var keyword = $("#hdnhawkkeyword").val();
                var prv = $("#hdnhawkprv").val();
                var lp = $("#hdnhawklp").val();
                var adv = $("#hdnhawkadv").val();
                var searchWithin = $("#searchWithin").val();
                var pg = $("#hdnhawkpg").val();
                var mpp = $("#hdnhawkmpp").val();
                var distance = $("#hdnhawkdistance").val();
                var searchingzipcode = $("#hdnhawksearchingzipcode").val();
                var searchingzipcodeparam = $("#hdnhawksearchingzipcodeparam").val();
                if (!(searchingzipcodeparam && searchingzipcodeparam !== "")) {
                    searchingzipcodeparam = "zipcode";
                }
                var sort = $("#hdnhawksortby").val();
                var it = $("#hdnhawkit").val();
                var items = $("#hdnhawkcompare").val();
                var operator = $("#hdnhawkoperator").val();
                var expand = $("#hdnhawkexpand").val();
                var hawkb = $("#hdnhawkb").val();
                var defaultmpp = $("#hdnhawkdefaultmpp").val();
                var keywordfield = $("#hdnhawkkeywordfield").val() || "keyword";
                var previewDate = typeof smartbugDatetimepicker != 'undefined' ? smartbugDatetimepicker.hawkDate : null;
                var hawkflags = $('#hdnhawkflags').val();
                var tabsField = $("#hdnhawktabfield").val();
                var tabValue = $("#hdnhawktabvalue").val();
                var aid = $("#hdnhawkaid").val();

                if (keyword && keyword !== "") qs += (qs === "" ? "" : "&") + keywordfield + "=" + encodeURIComponent(keyword);
                if (prv && prv !== "") qs += (qs === "" ? "" : "&") + "prv=" + encodeURIComponent(prv);
                if (lp && lp !== "") qs += (qs === "" ? "" : "&") + "lp=" + encodeURIComponent(lp);
                if (adv && adv !== "") qs += (qs === "" ? "" : "&") + "adv=" + encodeURIComponent(adv);
                if (searchWithin && searchWithin !== "") qs += (qs === "" ? "" : "&") + "searchWithin=" + encodeURIComponent(searchWithin);
                if (sort && sort !== "") qs += (qs === "" ? "" : "&") + "sort=" + encodeURIComponent(sort);
                if (it && it !== "") qs += (qs === "" ? "" : "&") + "it=" + encodeURIComponent(it);
                if (tabsField && tabsField !== "") qs += (qs === "" ? "" : "&") + "hawktabfield=" + encodeURIComponent(tabsField);
                if (items && items !== "") qs += (qs === "" ? "" : "&") + "items=" + encodeURIComponent(items);
                if (operator && operator !== "") qs += (qs === "" ? "" : "&") + "operator=" + encodeURIComponent(operator);
                if (expand && expand !== "") qs += (qs === "" ? "" : "&") + "expand=" + encodeURIComponent(expand);
                if (hawkb && hawkb !== "") qs += (qs === "" ? "" : "&") + "hawkb=" + encodeURIComponent(hawkb);
                if (previewDate) qs += (qs === "" ? "" : "&") + "HawkDate=" + previewDate;
                if (hawkflags && hawkflags !== "") qs += (qs === "" ? "" : "&") + "hawkflags=" + encodeURIComponent(hawkflags);
                if (tabValue && tabValue !== "" && tabsField && tabsField !== "") qs += (qs === "" ? "" : "&") + tabsField + "=" + encodeURIComponent(tabValue);
                if (searchingzipcode && searchingzipcode !== "") qs += (qs === "" ? "" : "&") + searchingzipcodeparam + "=" + encodeURIComponent(searchingzipcode);
                if (aid && aid !== "") qs += (qs === "" ? "" : "&") + "hawkaid=" + encodeURIComponent(aid);

                $(".hawk-facetFilters li.hawkFacet-active > a").each(function () {
                    var options = $(this).data().options;
                    if (options.name !== prevName) {
                        if (vals !== "") qs += (qs === "" ? "" : "&") + encodeURIComponent(prevName) + '=' + vals;
                        vals = "";
                    }
                    vals += (vals === "" ? "" : ",") + encodeURIComponent(options.value.replace(/,/g, "%c%"));
                    prevName = options.name;
                });

                if (prevName !== "" && vals !== "") qs += (qs === "" ? "" : "&") + encodeURIComponent(prevName) + '=' + vals;

                $(".hawk-sliderRangeInput").each(function () {
                    if ($(this).val() !== "") {
                        var values = $(this).val().split(",");
                        if (values.length === 2) {
                            var sliderRange = $(this).parent().find(".hawk-slideRange");
                            var min = sliderRange.data().minRange;
                            var max = sliderRange.data().maxRange;

                            if (parseFloat(values[0]) !== parseFloat(min) || parseFloat(values[1]) !== parseFloat(max)) {
                                qs += (qs === "" ? "" : "&") + encodeURIComponent($(this).attr("name")) + '=' + encodeURIComponent(values[0]) + ',' + encodeURIComponent(values[1]);
                            }
                        }
                    }
                });

                $(".hawk-dateSliderInput").each(function () {
                    if ($(this).val() !== "") {
                        var values = $(this).val().split(",");
                        if (values.length === 2) {
                            var min = $(this).parent().find(".numeric-from").attr("data-min");
                            var max = $(this).parent().find(".numeric-from").attr("data-max");
                            if (parseFloat(values[0]) !== parseFloat(min) || parseFloat(values[1]) !== parseFloat(max)) {
                                qs += (qs === "" ? "" : "&") + encodeURIComponent($(this).attr("name")) + '=' + encodeURIComponent(values[0]) + ',' + encodeURIComponent(values[1]);
                            }
                        }
                    }
                });


                if (mpp && mpp !== "" && mpp !== defaultmpp) qs += (qs === "" ? "" : "&") + "mpp=" + encodeURIComponent(mpp);
                if (pg && pg !== "" && pg !== "1") qs += (qs === "" ? "" : "&") + "pg=" + encodeURIComponent(pg);
                if (distance && distance !== "" && distance !== "25") qs += (qs === "" ? "" : "&") + "distance=" + encodeURIComponent(distance);

                // cancel refresh if hash is not changed
                if (window.location.hash === "#" + qs) {
                    return;
                }

                if (HawkSearch.disableAjax() || forceReload) {
                    var url = window.location.toString();
                    if (url.indexOf("?") > -1) url = url.substring(0, url.indexOf("?"));
                    if (url.indexOf("#") > -1) url = url.substring(0, url.indexOf("#"));
                    window.location = url + '?' + qs;
                } else {
                    if (window.location.hash !== "" || qs !== "") {
                        var scroll = $(document).scrollTop();

                        window.location.hash = qs;

                        if (qs === "") {
                            $(document).scrollTop(scroll);
                        }
                    }
                    else if (qs === "") {
                        window.location.hash = " ";
                    }

                }

            };

            HawkSearch.resetSearch = function () {
                $("#hdnhawkpg").val(1);
                if (window.location.hash !== "") {
                    window.location.hash += "&";
                }
                HawkSearch.clearAllFacets();
            }

            HawkSearch.getCustomUrl = function () {
                // Check if landing page has been declared (for cases when landing page url is not the pathname)
                if (HawkSearch.LandingPageUrl || typeof HawkSearch.LandingPageUrl == "string")
                    return HawkSearch.LandingPageUrl;

                var lpurl = window.location.pathname;
                if (lpurl.indexOf('/preview.aspx') >= 0) {
                    lpurl = '';
                }
                if (lpurl.indexOf('/search/') >= 0) {
                    lpurl = '';
                }
                return lpurl;
            };
            HawkSearch.IsExplainPopupOpen = false;

            HawkSearch.getPinFunctionUrl = function (f, itemId) {
                var keywordField = $('#hdnhawkkeywordfield').val() || "keyword";
                var keyword = HawkSearch.getHashOrQueryVariable(keywordField);
                var lpurl = HawkSearch.getCustomUrl();
                var lpId = $("#hdnhawklp").val();
                return HawkSearch.BaseUrl + "/?fn=ajax&f=" + f + "&itemId=" + encodeURIComponent(itemId) + "&" + keywordField + "=" + keyword + "&lp=" + encodeURIComponent(lpId) + "&lpurl=" + encodeURIComponent(lpurl) + "&hawkb=" + HawkSearch.getHashOrQueryVariable("hawkb") + "&hawkaid=" + HawkSearch.getHashOrQueryVariable("hawkaid");
            }

            HawkSearch.addToTop = function (el, itemId) {

                var url = HawkSearch.getPinFunctionUrl("AddItemToTop", itemId);
                var currentEl = el;
                $.ajax({
                    type: "GET",
                    async: true,
                    context: el,
                    contentType: "application/json; charset=utf-8",
                    url: url,
                    dataType: "jsonp",
                    success: function () {
                        log("Added item to top");
                        var parentContainer = $(this).parents(".grid_3");
                        parentContainer.addClass("hawk-itemPinned");
                        parentContainer.find(".preview-info").append("<span class='hawkIcon-itemPinned'></span>");
                        $(".itemWrapper.hawk-itemWrapper").removeClass("hawk-itemPinned preview-info");

                        $(this).parents(".popover").popover('hide');
                    },
                    error: function (e) {
                        log("ERROR: Add item to top " + e);
                    }
                });
            }

            HawkSearch.unpinItem = function (el, itemId) {
                var keywordField = $('#hdnhawkkeywordfield').val() || "keyword";
                var keyword = HawkSearch.getHashOrQueryVariable(keywordField);
                var lpurl = HawkSearch.getCustomUrl();
                var lpId = $("#hdnhawklp").val();
                var url = HawkSearch.getPinFunctionUrl("UnpinItem", itemId);

                $.ajax({
                    type: "GET",
                    async: true,
                    contentType: "application/json; charset=utf-8",
                    url: url,
                    context: el,
                    dataType: "jsonp",
                    success: function () {
                        log("Unpin item");
                        var parentContainer = $(this).parents(".grid_3");
                        parentContainer.removeClass("hawk-itemPinned");
                        parentContainer.find(".hawkIcon-itemPinned").remove();
                        $(this).parents(".popover").popover('hide');
                    },
                    error: function (e) {
                        log("ERROR: Unpin item " + e);
                    }
                });
            };

            HawkSearch.updatePinOrder = function (itemOrder) {
                var url = HawkSearch.getPinFunctionUrl("UpdateItemPinOrder", 0);
                url += "&itemList=" + encodeURIComponent(itemOrder);

                $.ajax({
                    type: "GET",
                    async: true,
                    contentType: "application/json; charset=utf-8",
                    url: url,
                    dataType: "jsonp",
                    success: function () {
                        log("UpdateItemPinOrder");
                    },
                    error: function (e) {
                        log("ERROR: UpdateItemPinOrder " + e);
                    }
                });
            }
            HawkSearch.getProxyView = function () {
                return HawkSearch.ProxyView || '';
            }

            HawkSearch.getResultsType = function () {
                return HawkSearch.Types.ResultsAsHtml || '';
            }
            HawkSearch.getFacetsType = function () {
                return HawkSearch.Types.FacetsAsHtml || '';
            }
            HawkSearch.getTopPagerType = function () {
                return HawkSearch.Types.TopPagerAsHtml || '';
            }
            HawkSearch.getTabsType = function () {
                return HawkSearch.Types.TabsAsHtml || '';
            }

            HawkSearch.explain = function (docid) {
                if (HawkSearch.IsExplainPopupOpen) {
                    return;
                }

                HawkSearch.IsExplainPopupOpen = true;

                var keyword = $("#hdnhawkkeyword").val();
                var keywordField = $("#hdnhawkkeywordfield").val() || "keyword";
                var keywordfromQuery = HawkSearch.getHashOrQueryVariable(keywordField);
                var hash = window.location.search.substring(1);
                if (keyword.toLowerCase() != decodeURIComponent(keywordfromQuery.toLowerCase().replace(/\+/g, " "))) {
                    hash = hash.replace(keywordField + '=' + keywordfromQuery, keywordField + '=' + encodeURIComponent(keyword));
                }
                if (hash === "" || (window.location.search.substring(1) !== "" && window.location.href.indexOf("#") > -1)) hash = HawkSearch.getHash();

                var lpurl = HawkSearch.getCustomUrl();
                var hawktabfield = $("#hdnhawktabfield").val();
                var hawkcustom = $("#hdnhawkcustom").val();
                var full = HawkSearch.BaseUrl + "/?" + hash + "&ajax=1&json=1&docid="
                    + encodeURIComponent(docid)
                    + (lpurl != '' ? "&lpurl=" + encodeURIComponent(lpurl) : "")
                    + (hawktabfield != '' ? "&hawktabfield=" + encodeURIComponent(hawktabfield) : "")
                    + (hawkcustom != '' ? "&hawkcustom=" + encodeURIComponent(hawkcustom) : "");
                full += "&hawkvisitorid=" + HawkSearch.lilBro.event.getVisitorId();

                $.ajax({ "type": "GET", "data": "", "async": "false", "contentType": "application/json; charset=utf-8", "url": full, "dataType": "jsonp", "success": HawkSearch.showAjaxPopup });
            };

            HawkSearch.loadMoreLikeThis = function (event, arg) {
                var argsArr = arg.split('|');
                var pk = argsArr[0];
                var trackingId = HawkSearch.lilBro.getTrackingId();
                if (argsArr.length >= 3) {
                    trackingId = argsArr[2];
                }
                HawkSearch.Tracking.writeClick(event, 0, true, pk, trackingId);

                var url = HawkSearch.BaseUrl + "/default.aspx?fn=ajax&f=MoreLikeThis&args=" + arg;

                $.ajax({
                    "type": "GET",
                    "data": "",
                    "async": "false",
                    "contentType": "application/json; charset=utf-8",
                    "url": url,
                    "dataType": "jsonp",
                    "success": function (data) {
                        HawkSearch.bootbox.dialog({
                            title: "More Like This",
                            message: data.Html,
                            buttons: {
                                main: {
                                    label: "Close"
                                }
                            }
                        });
                    }
                });
            };

            HawkSearch.HawkSubmit = (function (e) {
                var field = $(e).find('input[name=' + ($('#hdnhawkkeywordfield').val() || "keyword") + ']');
                var keywords = $(field).val();
                var id = $(field).attr('id')
                if (!(field.length == 0 && $('#hdnhawkkeyword').length == 0)) {
                    if ((keywords == HawkSearch.SuggesterGlobal.defaultKeyword[id]) || (keywords == $('#hdnhawkkeyword').val())) {
                        return false;
                    }
                }
                return true;
            });

            HawkSearch.showAjaxPopup = function (json) {
                var html = json.html;
                var objs = $(html);

                var obj = objs.find("#hawkexplain");
                if (obj != null && obj.length > 0) $("#divAjaxPopupContent").html(obj.html());
                HawkSearch.bootbox.dialog({
                    title: "Item details",
                    message: obj.html(),
                    buttons: {
                        main: {
                            label: "Close"
                        }
                    }
                });

                HawkSearch.IsExplainPopupOpen = false;
            };

            HawkSearch.hideBlockUI = function () {
                if (HawkSearch.processing || HawkSearch.scroll) {
                    return;
                }
                $.unblockUI({ "fadeOut": 0 });
            };

            HawkSearch.showBlockUI = function () {
                // $.blockUI({ "message": HawkSearch.loadingtpl, "fadeIn": 0, overlayCSS: { backgroundColor: '#fff', opacity: 0.6, cursor: 'wait' }, "css": { "opacity": "0.8", "filter": "progid:DXImageTransform.Microsoft.Alpha(opacity=80)","backgroundColor": "#fff", "fontSize": "9px", "borderWidth": "0px", "padding": "40px", top: ($(window).height() - 100) / 2 + 'px', left: ($(window).width() - 190) / 2 + 'px', width: '190px' } });
                $.blockUI({ "message": HawkSearch.loadingtpl, "fadeIn": 0, overlayCSS: { backgroundColor: '#fff', opacity: 0.5, cursor: 'wait' }, "css": { "borderWidth": "0px", top: ($(window).height() - 100) / 2 + 'px', left: ($(window).width()) / 2 + 'px', width: '0px' } });
            };

            HawkSearch.refreshResults = function () {

                log('RefreshResults');

                if ($("#hawkitemlist").length > 0) {
                    HawkSearch.processing = true;
                    if ($(window).scrollTop() > 0) {
                        HawkSearch.scroll = true;
                        HawkSearch.showBlockUI();
                        // $('html,body').animate({ scrollTop: 0 }, 500, 'linear', function () { HawkSearch.scroll = false; HawkSearch.hideBlockUI(); });
                    } else {
                        HawkSearch.loadtimer = setTimeout(function () { HawkSearch.showBlockUI(); }, 500);
                    }

                    var lpurl = HawkSearch.getCustomUrl();
                    var hash = HawkSearch.getHash();
                    var hawkcustom = $("#hdnhawkcustom").val();
                    var queryGuid = $("#hdnhawkquery").val();

                    var proxyView = HawkSearch.getProxyView();
                    var hawktabfield = hash.indexOf('hawktabfield') >= 0 ? '' : $("#hdnhawktabfield").val();

                    var resultType = HawkSearch.getResultsType();
                    var facetType = HawkSearch.getFacetsType();
                    var topPagerType = HawkSearch.getTopPagerType();
                    var tabsType = HawkSearch.getTabsType();
                    var customSortOptions = HawkSearch.CustomSortOptions;

                    var searchingzipcode = $("#hdnhawksearchingzipcode").val();
                    var searchingzipcodeparam = $("#hdnhawksearchingzipcodeparam").val();
                    if (!(searchingzipcodeparam && searchingzipcodeparam !== "")) {
                        searchingzipcodeparam = "zipcode";
                    }
                    if (searchingzipcode && searchingzipcode !== "" && hash.indexOf(searchingzipcodeparam + '=') >= 0)
                    {
                        hash = hash.replace(searchingzipcodeparam + '=', 'ignore' + searchingzipcodeparam + '=');
                    }

                    var sort = HawkSearch.getQueryVariable(window.location.search.substring(1), "sort");
                    if (sort && hash.indexOf('sort=') == -1) {
                        hash = (hash != '' ? hash + '&' : '') + 'sort=' + sort;
                    }
                    


                    var full = HawkSearch.BaseUrl + "/?" + (hash != '' ? hash + '&' : '') + "ajax=1&json=1"
                        + (lpurl != '' ? "&lpurl=" + encodeURIComponent(lpurl) : "")
                        + (hawktabfield != '' ? "&hawktabfield=" + encodeURIComponent(hawktabfield) : "")
                        + (hawkcustom != '' ? "&hawkcustom=" + encodeURIComponent(hawkcustom) : "")
                        + (proxyView != '' ? "&proxyView=" + encodeURIComponent(proxyView) : "")
                        + (resultType != '' ? "&res_ash=" + encodeURIComponent(resultType) : "")
                        + (facetType != '' ? "&fac_ash=" + encodeURIComponent(facetType) : "")
                        + (topPagerType != '' ? "&tpp_ash=" + encodeURIComponent(topPagerType) : "")
                        + (tabsType != '' ? "&tbs_ash=" + encodeURIComponent(tabsType) : "")
                        + (searchingzipcode && searchingzipcode !== "" ? "&" + searchingzipcodeparam + "=" + encodeURIComponent(searchingzipcode) : "")
                        + (customSortOptions != '' ? "&hawk_csb=" + encodeURIComponent(customSortOptions) : "");
                    full += '&hawkvisitorid=' + HawkSearch.lilBro.event.getVisitorId();
                    if (HawkSearch.CustomBasePageSize != 0)
                        full += "&hawk_cbps=" + HawkSearch.CustomBasePageSize;

                    // notice we use global jQuery to be able to track global events for ajax calls
                    // used by miniprofiler and possibly other libraries
                    window.jQuery.ajax({
                        type: "GET",
                        data: "",
                        async: "true",
                        contentType: "application/json; charset=utf-8",
                        url: full,
                        dataType: "jsonp",
                        success: function (json) {
                            HawkSearch.processFacets(hash, json, queryGuid);
                        }
                    });
                };
            };

            HawkSearch.getUrl = function () {
                var url = window.location.toString();
                if (url.indexOf("?") > -1) url = url.substring(0, url.indexOf("?"));
                if (url.indexOf("#") > -1) url = url.substring(0, url.indexOf("#"));

                return url;
            };


            HawkSearch.copyValue = function (objs, name) {
                var obj = objs.find(name);
                if (obj != null && obj.length > 0) $(name).html(obj.html());
            };

            HawkSearch.processFacets = function (hash, json, queryGuid) {
                var html = json.html;
                var location = json.location;
                if (!location == '') {
                    window.location.replace(location);
                }

                // update the page contents
                var objs = $(html);
                var obj;
                HawkSearch.copyValue(objs, "#hawktoppager");
                HawkSearch.copyValue(objs, "#hawktabs");
                HawkSearch.copyValue(objs, "#hawktitle");
                HawkSearch.copyValue(objs, "#hawkitemlist");
                HawkSearch.copyValue(objs, "#hawktoptext");
                HawkSearch.copyValue(objs, "#hawkfacets");
                HawkSearch.copyValue(objs, "#hawkbreadcrumb");
                HawkSearch.copyValue(objs, "#hawkbottompager");
                HawkSearch.copyValue(objs, "#hawkbannertop");
                HawkSearch.copyValue(objs, "#hawkbannerbottom");
                HawkSearch.copyValue(objs, "#hawkfirstitem");
                HawkSearch.copyValue(objs, "#hawklastitem");
                HawkSearch.copyValue(objs, "#hawkbannerlefttop");
                HawkSearch.copyValue(objs, "#hawkbannerleftbottom");
                HawkSearch.copyValue(objs, "#hawksmartbug");
                HawkSearch.copyValue(objs, "#hdnhawktrackingid");
                HawkSearch.copyValue(objs, '#hawkflags');
                HawkSearch.copyValue(objs, '#hawkaid');


                if (queryGuid !== undefined) {
                    $("#hdnhawkquery").val(queryGuid);
                }

                // related terms are loaded only first time
                if ($("#hawkrelated").html() == '') {
                    HawkSearch.copyValue(objs, "#hawkrelated");
                }

                obj = objs.find("#errormsg");
                if (obj != null && obj.length > 0) alert(obj.html());

                // register trackingre
                HawkSearch.regTracking();
                HawkSearch.Tracking.writeSearch();

                // register facets (sliders, etc)
                HawkSearch.regFacets();

                if ($.isFunction(HawkCompare.reload)) HawkCompare.reload();

                // clear the pager click and the loading timer & unblock the page
                HawkSearch.processing = false;
                clearTimeout(HawkSearch.loadtimer);
                HawkSearch.hideBlockUI();
                if (HawkSearch.GetRecentSearches !== undefined) {
                    HawkSearch.GetRecentSearches();
                }
                HawkSearch.BindPreviewInformation();
                HawkSearch.BindFacetTooltip();
                HawkSearch.BindBackToTop();

                $(document).trigger("hawksearch.processed");

            };

            HawkSearch.clearAllFacets = function () {
                var keyword = $("#hdnhawkkeyword").val();
                var prv = $("#hdnhawkprv").val();
                var lp = $("#hdnhawklp").val();
                var adv = $("#hdnhawkadv").val();
                var mpp = $("#hdnhawkmpp").val();
                var sort = $("#hdnhawksortby").val();
                var it = $("#hdnhawkit").val();
                var items = $("#hdnhawkcompare").val();
                var operator = $("#hdnhawkoperator").val();
                var expand = $("#hdnhawkexpand").val();
                var hawkb = $("#hdnhawkb").val();
                var defaultmpp = $("#hdnhawkdefaultmpp").val();
                var keywordfield = $("#hdnhawkkeywordfield").val() || "keyword";
                var hawkflags = $('#hdnhawkflags').val();
                var aid = $("#hdnhawkaid").val();

                var tabfield = $("#hdnhawktabfield").val();
                var tabValue = $("#hdnhawktabvalue").val();
                var zipcode = $("#hdnhawksearchingzipcode").val();
                var searchingzipcodeparam = $("#hdnhawksearchingzipcodeparam").val();
                if (!(searchingzipcodeparam && searchingzipcodeparam !== "")) {
                    searchingzipcodeparam = "zipcode";
                }
                var dist = $("#hdnhawkdistance").val();

                var qs = '';

                if (keyword && keyword !== "") qs += (qs === "" ? "" : "&") + keywordfield + "=" + encodeURIComponent(keyword);
                if (prv && prv !== "") qs += (qs === "" ? "" : "&") + "prv=" + encodeURIComponent(prv);
                if (lp && lp !== "") qs += (qs === "" ? "" : "&") + "lp=" + encodeURIComponent(lp);
                if (adv && adv !== "") qs += (qs === "" ? "" : "&") + "adv=" + encodeURIComponent(adv);
                if (mpp && mpp !== "" && mpp !== defaultmpp) qs += (qs === "" ? "" : "&") + "mpp=" + encodeURIComponent(mpp);
                if (sort && sort !== "") qs += (qs === "" ? "" : "&") + "sort=" + encodeURIComponent(sort);
                if (it && it !== "") qs += (qs === "" ? "" : "&") + "it=" + encodeURIComponent(it);
                if (items && items !== "") qs += (qs === "" ? "" : "&") + "items=" + encodeURIComponent(items);
                if (operator && operator !== "") qs += (qs === "" ? "" : "&") + "operator=" + encodeURIComponent(operator);
                if (expand && expand !== "") qs += (qs === "" ? "" : "&") + "expand=" + encodeURIComponent(expand);
                if (hawkb && hawkb !== "") qs += (qs === "" ? "" : "&") + "hawkb=" + encodeURIComponent(hawkb);
                if (hawkflags && hawkflags !== "") qs += (qs === "" ? "" : "&") + "hawkflags=" + encodeURIComponent(hawkflags);
                if (aid && aid !== "") qs += (qs === "" ? "" : "&") + "hawkaid=" + encodeURIComponent(aid);

                if (tabfield && tabfield !== "") qs += (qs === "" ? "" : "&") + "hawktabfield=" + encodeURIComponent(tabfield);
                if (tabValue && tabValue !== "" && tabfield && tabfield !== "") qs += (qs === "" ? "" : "&") + tabfield + "=" + encodeURIComponent(tabValue);
                if (zipcode && zipcode !== "") qs += (qs === "" ? "" : "&") + searchingzipcodeparam + "=" + encodeURIComponent(zipcode);
                if (dist && dist !== "") qs += (qs === "" ? "" : "&") + "distance=" + encodeURIComponent(dist);

                if (HawkSearch.disableAjax()) {
                    var url = window.location.toString();
                    if (url.indexOf("?") > -1) url = url.substring(0, url.indexOf("?"));
                    if (url.indexOf("#") > -1) url = url.substring(0, url.indexOf("#"));
                    window.location = url + '?' + qs;
                } else {
                    if (qs) {
                        window.location.hash = qs;
                    } else {
                        window.location.hash = " ";
                    }

                }
            };

            HawkSearch.getHashOrQueryVariable = function (variable) {
                var query = HawkSearch.getHash();
                var vars = query.split("&");
                for (var i = 0; i < vars.length; i++) {
                    var pair = vars[i].split("=");
                    if (pair[0].toLowerCase() == variable.toLowerCase()) {
                        return pair[1];
                    }
                }
                return HawkSearch.getQueryVariable(window.location.search.substring(1), variable);
            };

            HawkSearch.getQueryVariable = function (url, variable) {
                if (variable === undefined || variable === null) {
                    return "";
                }

                var query = url;
                var vars = query.split("&");
                for (var i = 0; i < vars.length; i++) {
                    var pair = vars[i].split("=");
                    if (pair[0].toLowerCase() == variable.toLowerCase()) {
                        return pair[1];
                    }
                }
                return "";
            };

            HawkSearch.getRecommenderUrl = function () {
                if (HawkSearch.RecommenderUrl === undefined || HawkSearch.RecommenderUrl === "") {
                    return null;
                }
                else {
                    return HawkSearch.RecommenderUrl;
                }
            }

            HawkSearch.link = function (event, id, i, pk, mlt) {
                // Avoid Right clicks
                //if (event.which && event.which === 3) return;
                //if (event.buttons === 2) return;

                if (event.currentTarget === undefined || event.currentTarget.href === undefined) {
                    return true;
                }

                if (HawkSearch.Tracking.CurrentVersion() == HawkSearch.Tracking.Version.v2) {
                    HawkSearch.Tracking.writeClick(event, i, mlt, pk, id);
                }
                else if (HawkSearch.Tracking.CurrentVersion() == HawkSearch.Tracking.Version.v2AndSql) {
                    HawkSearch.Tracking.writeClick(event, i, mlt, pk, id);
                    HawkSearch.Tracking.V1.link(event, id, i, pk, mlt);
                }
                else {
                    HawkSearch.Tracking.V1.link(event, id, i, pk, mlt);
                }

                return true;
            };

            HawkSearch.bannerLink = function (el, id) {
                if (HawkSearch.Tracking.CurrentVersion() == HawkSearch.Tracking.Version.v2) {
                    HawkSearch.Tracking.writeBannerClick(el, id);
                }
                else if (HawkSearch.Tracking.CurrentVersion() == HawkSearch.Tracking.Version.v2AndSql) {
                    HawkSearch.Tracking.writeBannerClick(el, id);
                    HawkSearch.Tracking.V1.bannerLink(el, id);
                }
                else {
                    HawkSearch.Tracking.V1.bannerLink(el, id);
                }

                return true;
            };

            HawkSearch.formatCurrency = function (num) {
                num = num.toString().replace(/\$|\,/g, '');
                if (isNaN(num))
                    num = "0";
                var sign = (num == (num = Math.abs(num)));
                num = Math.floor(num * 100 + 0.50000000001);
                var cents = num % 100;
                num = Math.floor(num / 100).toString();
                if (cents < 10)
                    cents = "0" + cents;
                for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3) ; i++)
                    num = num.substring(0, num.length - (4 * i + 3)) + ',' +
                        num.substring(num.length - (4 * i + 3));
                return (((sign) ? '' : '-') + '$' + num + '.' + cents);
            };

            // HawkSearch Suggest initialize
            HawkSearch.suggestInit = function (queryField, settings) {
                $.fn.hawksearchSuggest = function (settings) {
                    settings = $.extend({
                        isAutoWidth: false,
                        isInstatSearch: false,
                        value: $('#hdnhawkkeyword').val(),
                        showTerms: showTerms,
                        showProducts: showProducts,
                        showContent: showContent,
                        showSection: showSection,
                        showFooter: showFooter
                    }, settings);

                    return this.each(function () {
                        var suggestQueryField = $(this);
                        var opts = optionsHandler(suggestQueryField, settings);
                    });

                    function isEven(num) {
                        if (num !== false && num !== true && !isNaN(num)) {
                            return num % 2 == 0;
                        } else return false;
                    }

                    function showTerms(suggestDiv, terms, title, type, settings) {
                        //suggestDiv.empty();
                        suggestDivNode = suggestDiv[0];

                        // create and append suggest header to suggest container
                        var suggestHeader = document.createElement("div");
                        suggestHeader.className = "hawk-sqHeader";
                        suggestHeader.innerHTML = title;
                        suggestDivNode.appendChild(suggestHeader);

                        // set up and append suggest content to suggest container
                        var suggestContent = document.createElement("ul");
                        suggestContent.className = "hawk-sqContent";
                        suggestDivNode.appendChild(suggestContent);

                        // loop through suggest options
                        for (var i = 0; i < terms.length; i++) {
                            var term = terms[i];
                            if (term.Value == null) continue;

                            var resultItem = document.createElement("li");

                            resultItem.setAttribute('data-url', term.Url);
                            resultItem.setAttribute("data-autoCompleteType", type);
                            // check for odd/even alternative styling
                            if (isEven(i)) {
                                resultItem.className = "hawk-sqItem term";
                            } else {
                                resultItem.className = "hawk-sqItem hawk-sqItemAlt term";
                            };

                            var resultItemContent = document.createElement("h1");
                            resultItemContent.className = "hawk-sqItemName";
                            resultItemContent.innerHTML = term.Value

                            resultItem.appendChild(resultItemContent);

                            // append results of suggest options to the suggest content container
                            suggestContent.appendChild(resultItem);
                        }
                    }

                    function showContent(suggestDiv, content, title, settings) {
                        //suggestDiv.empty();
                        suggestDivNode = suggestDiv[0];

                        settings.showSection(suggestDivNode, content, title, true, settings);
                    }

                    function showProducts(suggestDiv, products, title, settings) {
                        //suggestDiv.empty();
                        suggestDivNode = suggestDiv[0];

                        settings.showSection(suggestDivNode, products, title, false, settings);
                    }

                    function showSection(suggestDivNode, products, title, isContent, settings) {
                        // create and append suggest header to suggest container
                        var suggestHeader = document.createElement("div");
                        suggestHeader.className = "hawk-sqHeader";
                        suggestHeader.innerHTML = title;
                        suggestDivNode.appendChild(suggestHeader);

                        // set up and append suggest content to suggest container
                        var suggestContent = document.createElement("ul");
                        suggestContent.className = "hawk-sqContent";
                        suggestDivNode.appendChild(suggestContent);

                        // loop through suggest options
                        for (var i = 0; i < products.length; i++) {
                            var product = products[i];

                            var resultItem = document.createElement("li");

                            // check for odd/even alternative styling
                            if (isEven(i)) {
                                resultItem.className = "hawk-sqItem" + (isContent ? ' term' : '');
                            } else {
                                resultItem.className = "hawk-sqItem hawk-sqItemAlt" + (isContent ? ' term' : '');
                            };

                            resultItem.setAttribute('data-url', product.Url);
                            resultItem.setAttribute("data-autoCompleteType", (isContent ? HawkSearch.LilBro.Schema.AutoCompleteClick.AutoCompleteType.content : HawkSearch.LilBro.Schema.AutoCompleteClick.AutoCompleteType.product));
                            resultItem.innerHTML = product.Html;

                            // append results of suggest options to the suggest content container
                            suggestContent.appendChild(resultItem);
                        }
                    }

                    function showFooter(suggestDiv, count, contentCount, url, settings) {
                        // creating the footer container
                        var footerContainer = document.createElement("div");
                        footerContainer.className = "hawk-sqFooter";

                        //creating the footer link
                        var footerLink = document.createElement("a");
                        footerLink.href = "javascript:void(0);";
                        footerLink.setAttribute("onclick", "window.location='" + url + "'");
                        footerLink.innerHTML = "View All Matches";

                        //creating the footer count
                        var footerCount = document.createElement("div");
                        footerCount.style.marginTop = "3px";
                        footerCount.style.fontSize = ".85em";
                        //footerCount.innerHTML = count + " product(s), " + contentCount + " content item(s)";
                        footerCount.innerHTML = count + " content item(s)";

                        //appending link and count to container
                        footerContainer.appendChild(footerLink);
                        footerContainer.appendChild(footerCount);

                        //appending container to suggestDiv
                        suggestDiv.append(footerContainer);
                    }

                    // configures options and settings for hawk search suggest
                    function optionsHandler(suggestQueryField, settings) {
                        var suggestQueryFieldNode = suggestQueryField[0];

                        // for some reason, Firefox 1.0 doesn't allow us to set autocomplete to off
                        // this way, so you should manually set autocomplete="off" in the input tag
                        // if you can -- we'll try to set it here in case you forget
                        suggestQueryFieldNode.autocomplete = "off";

                        $(suggestQueryField).val(settings.value);
                        HawkSearch.SuggesterGlobal.defaultKeyword[$(suggestQueryField).attr('id')] = settings.value;
                        suggestQueryField.on("keyup", keypressHandler);

                        suggestQueryField.on("focus", function (e) {
                            HawkSearch.SuggesterGlobal.focus = true;
                            this.value = '';
                        });

                        if (settings.hiddenDivName) {
                            HawkSearch.SuggesterGlobal.divName = settings.hiddenDivName;
                        } else {
                            HawkSearch.SuggesterGlobal.divName = "querydiv";
                        }

                        // This is the function that monitors the queryField, and calls the lookup functions when the queryField value changes.
                        function suggestLookup(suggestQueryField, settings) {
                            var val = suggestQueryField.val();
                            if ((HawkSearch.SuggesterGlobal.lastVal != val || HawkSearch.SuggesterGlobal.lastVal != "") && HawkSearch.SuggesterGlobal.focus && HawkSearch.SuggesterGlobal.searching == false) {

                                HawkSearch.SuggesterGlobal.lastVal = val;
                                suggestDoRemoteQuery(escape(val));
                            }
                            return true;
                        }

                        function suggestDoRemoteQuery(val) {
                            HawkSearch.SuggesterGlobal.searching = true;

                            var req = settings.lookupUrlPrefix;
                            var visitorId = HawkSearch.lilBro.event.getVisitorId();
                            var keywordField = $("#hdnhawkkeywordfield").val() || "keyword";
                            var kw = $("#" + keywordField).val();

                            var hawkb = HawkSearch.GetQueryStringValue["hawkb"];
                            if (hawkb !== undefined) {
                                req = req + '&hawkb=' + hawkb;
                            }

                            jQuery.ajax({
                                type: "GET",
                                contentType: "application/json; charset=utf-8",
                                url: req + '&q=' + escape(val) + '&hawkvisitorid=' + visitorId + '&' + keywordField + '=' + encodeURIComponent(kw),
                                data: "",
                                dataType: "jsonp",
                                success: function (autoSuggestResult) {
                                    showQueryDiv(autoSuggestResult);
                                    HawkSearch.SuggesterGlobal.searching = false;
                                },
                                error: function () {
                                    try { hideSuggest(); } catch (error) { };
                                    HawkSearch.SuggesterGlobal.searching = false;
                                }
                            });
                        }

                        // Get the <DIV> we're using to display the lookup results, and create the <DIV> if it doesn't already exist.
                        function getSuggestDiv(divId, suggesterParentSelector) {
							var appendToBody = !suggesterParentSelector;
                            if (!HawkSearch.SuggesterGlobal.globalDiv) {
                                // if the div doesn't exist on the page already, create it
                                if (!document.getElementById(divId)) {
                                    var newNode = document.createElement("div");
                                    newNode.setAttribute("id", divId);
                                    newNode.setAttribute("class", "hawk-searchQuery");
									if(appendToBody)
									{
										document.body.appendChild(newNode);
									} else {
										$(suggesterParentSelector).first().append(newNode);
									}
                                }

                                // set the globalDiv reference
                                HawkSearch.SuggesterGlobal.globalDiv = document.getElementById(divId);
                                HawkSearch.SuggesterGlobal.queryDiv = $("#" + divId);
                            }

							if(appendToBody)
							{
								if (suggestQueryField && (suggestQueryField.offset().left != HawkSearch.SuggesterGlobal.storedOffset)) {
									// figure out where the top corner of the div should be, based on the
									// bottom left corner of the input field
									var x = suggestQueryField.offset().left,
										y = suggestQueryField.offset().top + suggestQueryField.outerHeight(),
										fieldID = suggestQueryField.attr("id");
								
									HawkSearch.SuggesterGlobal.storedOffset = x;
								
									// add some formatting to the div, if we haven't already
									if (!HawkSearch.SuggesterGlobal.divFormatted) {
										// set positioning and apply identifier class using ID of corresponding search field
										HawkSearch.SuggesterGlobal.queryDiv.removeAttr("style").css({
											"left": x,
											"top": y
										}).attr("class", "hawk-searchQuery hawk-searchQuery-" + fieldID);
								
										// check to see if 'isAutoWidth' is enabled
										// if enabled apply width based on search field width
										if (settings && settings.isAutoWidth) {
											var queryWidth = suggestQueryField.outerWidth();
											var minValue = 250;
											if (queryWidth < minValue) {
												queryWidth = minValue;
											}
											HawkSearch.SuggesterGlobal.queryDiv.css("width", queryWidth);
										}
								
										//HawkSearch.SuggesterGlobal.divFormatted = true;
									}
								}
							}

                            return HawkSearch.SuggesterGlobal.queryDiv;
                        }

                        function suggestIsAbove() {

                            if (settings.isAbove) {
                                var queryHeight = HawkSearch.SuggesterGlobal.queryDiv.outerHeight(true);
                                var y = suggestQueryField.offset().top - queryHeight;

                                HawkSearch.SuggesterGlobal.queryDiv.css({
                                    "top": y
                                });

                                if (!HawkSearch.SuggesterGlobal.queryDiv.hasClass("hawk-queryAbove")) {
                                    HawkSearch.SuggesterGlobal.queryDiv.addClass("hawk-queryAbove");
                                }
                            }

                        }

                        // This is the key handler function, for when a user presses the up arrow, down arrow, tab key, or enter key from the input field.
                        function keypressHandler(e) {
                            var suggestDiv = getSuggestDiv(HawkSearch.SuggesterGlobal.divName, settings.suggesterParentSelector),
                                divNode = suggestDiv[0];

                            // don't do anything if the div is hidden
                            if (suggestDiv.is(":hidden")) {
                                //return true;
                            }

                            // make sure we have a valid event variable
                            if (!e && window.event) {
                                e = window.event;
                            }

                            var key;
                            if (window.event) {
                                key = e.keyCode; // IE
                            } else {
                                key = e.which;
                            }

                            // if this key isn't one of the ones we care about, just return
                            var KEYUP = 38;
                            var KEYDOWN = 40;
                            var KEYENTER = 13;
                            var KEYTAB = 9;

                            if ((key != KEYUP) && (key != KEYDOWN) && (key != KEYENTER) && (key != KEYTAB)) {
                                suggestLookup(suggestQueryField, settings, e);
                                return true;
                            };

                            // get the span that's currently selected, and perform an appropriate action
                            var selectedIndex = getSelectedItem(suggestDiv);
                            //var selSpan = HawkSearch.suggest.setSelectedSpan(div, selNum);
                            var selectedItem;

                            if (key == KEYENTER) {
                                if (selectedIndex >= 0) {
                                    var selectedItem = setSelectedItem(suggestDiv, selectedIndex);
                                    _selectResult(selectedItem);
                                    e.cancelBubble = true;
                                    if (window.event) {
                                        return false;
                                    } else {
                                        e.preventDefault();
                                    };
                                } else {
                                    hideSuggest();
                                    return true;
                                };
                            } else if (key == KEYTAB) {
                                if ((selectedIndex + 1) < suggestDiv.find(".hawk-sqItem").length) {
                                    e.cancelBubble = true;
                                    e.preventDefault();
                                    selectedItem = setSelectedItem(suggestDiv, selectedIndex + 1);
                                } else {
                                    hideSuggest()
                                };
                            } else {
                                if (key == KEYUP) {
                                    selectedItem = setSelectedItem(suggestDiv, selectedIndex - 1);
                                } else if (key == KEYDOWN) {
                                    selectedItem = setSelectedItem(suggestDiv, selectedIndex + 1);
                                };
                            };


                            //showSuggest();
                            return true;
                        };

                        // displays query div and query results
                        function showQueryDiv(autoSuggestResult) {
                            var suggestDiv = getSuggestDiv(HawkSearch.SuggesterGlobal.divName, settings.suggesterParentSelector),
                                divNode = suggestDiv[0];

                            if (autoSuggestResult === null || autoSuggestResult.Count === 0) {
                                showSuggest(false);
                                return;
                            }

                            // if ie11 11.0.47 patch issue (sc-2766), direct straight to home page
                            // update: with 11.0.51 issue resolved, so removing workaround (sh 2/26/18)
                            //if (navigator.userAgent.match(/Trident\/7.0/))
                            //    return;

                            // remove any results that are already there
                            while (divNode.childNodes.length > 0)
                                divNode.removeChild(divNode.childNodes[0]);

                            var categories = autoSuggestResult.Categories;
                            var popular = autoSuggestResult.Popular;
                            var products = autoSuggestResult.Products;
                            var content = autoSuggestResult.Content;

                            if (popular.length >= 1) {
                                settings.showTerms(suggestDiv, popular, "Popular Searches", HawkSearch.LilBro.Schema.AutoCompleteClick.AutoCompleteType.popular, settings);
                                // find all newly added suggest options
                                var suggestItems = suggestDiv.find(".hawk-sqContent .hawk-sqItem");
                                // pass suggestItems to 'suggestItemHandler' to handle events
                                suggestItemHandler(suggestItems);
                                // check to see if query div should show above field
                                suggestIsAbove();
                            }
                            if (categories.length >= 1) {
                                settings.showTerms(suggestDiv, categories, "Top Product Categories", HawkSearch.LilBro.Schema.AutoCompleteClick.AutoCompleteType.category, settings)
                                // find all newly added suggest options
                                var suggestItems = suggestDiv.find(".hawk-sqContent .hawk-sqItem");
                                // pass suggestItems to 'suggestItemHandler' to handle events
                                suggestItemHandler(suggestItems);
                                // check to see if query div should show above field
                                suggestIsAbove();
                            }

                            if (products.length >= 1) {
                                var productsTitle = (products.length == 1 ? "Top Product Match" : "Top " + products.length + " Product Matches");
                                settings.showProducts(suggestDiv, products, productsTitle, settings);
                                // find all newly added suggest options
                                var suggestItems = suggestDiv.find(".hawk-sqContent .hawk-sqItem");
                                // pass suggestItems to 'suggestItemHandler' to handle events
                                suggestItemHandler(suggestItems);
                            }

                            if (content.length >= 1) {
                                var contentTitle = (content.length == 1 ? "Top Content Match" : "Top " + content.length + " Content Matches");
                                settings.showContent(suggestDiv, content, contentTitle, settings);
                                // find all newly added suggest options
                                var suggestItems = suggestDiv.find(".hawk-sqContent .hawk-sqItem");
                                // pass suggestItems to 'suggestItemHandler' to handle events
                                suggestItemHandler(suggestItems);
                            }

                            if (categories.length > 0 || popular.length > 0 || products.length > 0 || content.length > 0) {
                                var keywordField = $("#hdnhawkkeywordfield").val() || "keyword";
                                var url = autoSuggestResult.SearchWebsiteUrl + "?" + keywordField + "=" + escape($(queryField).val()) + HawkSearch.preserveUrlParams();
                                settings.showFooter(suggestDiv, autoSuggestResult.Count, autoSuggestResult.ContentCount, url, settings);
                                // check to see if query div should show above field
                                suggestIsAbove();

                                showSuggest(true);
                            }
                        }

                        // controls the visibility of the result lookup based on the "show" parameter
                        function showSuggest(show) {
                            var suggestDisplay = getSuggestDiv(HawkSearch.SuggesterGlobal.divName, settings.suggesterParentSelector);
                            if (show === false) {
                                suggestDisplay.hide();
                                $("body").off("click", hideSuggest);
                            } else {
                                suggestDisplay.show();
                                $("body").on("click", hideSuggest);
                            }
                        }

                        // We originally used showSuggest as the function that was called by the onBlur
                        // event of the field, but it turns out that Firefox will pass an event as the first
                        // parameter of the function, which would cause the div to always be visible.
                        function hideSuggest(e) {
                            var updatedDisplay = false;
                            if (!updatedDisplay && $(e.target).closest(".hawk-searchQuery").length <= 0) {
                                showSuggest(false);
                                updatedDisplay = true;
                            }
                        }

                        // sets up events for suggest items
                        function suggestItemHandler(suggestItems) {
                            // bind mouseenter/mouseleave to suggest options
                            // toggles active state on mouseenter

                            suggestItems.on("mouseenter mouseleave", function (e) {
                                var sqItem = $(e.currentTarget);
                                if (e.type === "mouseenter") {
                                    highlightResult(sqItem);
                                } else {
                                    unhighlightResult(sqItem);
                                }
                            });

                            // bind 'mousedown' event to suggest options to go to url
                            // using 'mousedown' instead of 'click' due to 'blur' event blocking the 'click' event from firing
                            suggestItems.off('click').on("click", SuggestedItemClick);
                        }

                        function SuggestedItemClick(e) {
                            e.preventDefault();
                            var suggest_type = $(e.target).closest("li").attr("data-autoCompleteType");
                            var name = $(e.target).text().replace(/\u00bb/g, "&raquo;");
                            if (name === "") {
                                name = $(e.target).parents(".hawk-sqActive").find("div.hawk-sqItemContent h1").text();
                            }
                            var itemUrl = $(e.currentTarget).data("url");
                            var keyword = $("#" + ($("#hdnhawkkeywordfield").val() || "keyword")).val();

                            if (HawkSearch.Tracking.CurrentVersion() == HawkSearch.Tracking.Version.v2) {
                                HawkSearch.Tracking.writeAutoCompleteClick(keyword, e, suggest_type, name, itemUrl);
                            }
                            else if (HawkSearch.Tracking.CurrentVersion() == HawkSearch.Tracking.Version.v2AndSQL) {
                                HawkSearch.Tracking.writeAutoCompleteClick(keyword, e, suggest_type, name, itemUrl);
                                HawkSearch.Tracking.V1.autosuggestClick(keyword, name, itemUrl, suggest_type);
                            }
                            else {
                                HawkSearch.Tracking.V1.autosuggestClick(keyword, name, itemUrl, suggest_type);
                            }

                            window.location = itemUrl;
                        }

                        // This is called whenever the user clicks one of the lookup results.
                        // It puts the value of the result in the queryField and hides the lookup div.
                        function selectResult(item) {
                            _selectResult(item);
                        }
                        // This actually fills the field with the selected result and hides the div
                        function _selectResult(item) {
                            itemUrl = item.data("url");
                            window.location = itemUrl;
                        }


                        // This is called when a user mouses over a lookup result
                        function highlightResult(item) {
                            $(HawkSearch.SuggesterGlobal.globalDiv).find(".hawk-sqItem").removeClass("hawk-sqActive");
                            _highlightResult(item);
                        }
                        // This actually highlights the selected result
                        function _highlightResult(item) {
                            if (item == null) return;
                            item.addClass("hawk-sqActive");
                        }


                        // This is called when a user mouses away from a lookup result
                        function unhighlightResult(item) {
                            _unhighlightResult(item);
                        }
                        // This actually unhighlights the selected result
                        function _unhighlightResult(item) {
                            item.removeClass("hawk-sqActive");
                        }


                        // Get the number of the result that's currently selected/highlighted
                        // (the first result is 0, the second is 1, etc.)
                        function getSelectedItem(suggestDiv) {
                            var count = -1;
                            var sqItems = suggestDiv.find(".hawk-sqItem");

                            if (sqItems) {
                                if (sqItems.filter(".hawk-sqActive").length == 1) {
                                    count = sqItems.index(sqItems.filter(".hawk-sqActive"));
                                };
                            }
                            return count
                        }


                        // Select and highlight the result at the given position
                        function setSelectedItem(suggestDiv, selectedIndex) {
                            var count = -1;
                            var selectedItem = null;
                            var first = null;
                            var sqItems = suggestDiv.find(".hawk-sqItem");

                            if (sqItems) {
                                for (var i = 0; i < sqItems.length; i++) {
                                    if (first == null) {
                                        first = sqItems.eq(i);
                                    };

                                    if (++count == selectedIndex) {
                                        _highlightResult(sqItems.eq(i));
                                        selectedItem = sqItems.eq(i);
                                    } else {
                                        _unhighlightResult(sqItems.eq(i));
                                    }
                                }
                            }

                            // handle if nothing is select yet to select first
                            // or loop through results if at the end/beginning.
                            if (selectedItem == null && (selectedIndex < 0)) {
                                selectedItem = sqItems.eq(-1);
                                _highlightResult(selectedItem);
                            } else if (selectedItem == null) {
                                selectedItem = first;
                                _highlightResult(selectedItem);
                            }

                            return selectedItem;
                        }
                    }
                };

                $(queryField).hawksearchSuggest(settings);
            };


            HawkSearch.preserveUrlParams = function () {
                var prv = HawkSearch.GetQueryStringValue["prv"] + '';
                var adv = HawkSearch.GetQueryStringValue["adv"] + '';
                var hawkflags = HawkSearch.GetQueryStringValue["hawkflags"] + '';
                var aid = HawkSearch.GetQueryStringValue["hawkaid"] + '';
                var ret = '';

                if (prv != "undefined" && prv != '') ret += '&prv=' + escape(prv);
                if (adv != "undefined" && adv != '') ret += '&adv=' + escape(adv);
                if (hawkflags != "undefined" && hawkflags != '') ret += '&hawkflags=' + escape(hawkflags);
                if (aid != "undefined" && aid != '') ret += '&hawkaid=' + escape(aid);

                return ret;
            };


            //Recent Searches

            HawkSearch.clearRelatedSearches = function () {
                $.cookie("recent-searches", "", { expires: -1 });
                $(".hawk-recentSearches .hawk-navGroupContent > ul").empty();
                $(".hawk-recentSearches").hide();
            };

            HawkSearch.GetRecentSearches = function () {
                var recentSearchesStr = $.cookie("recent-searches");
                var recentSearches = [];
                if (recentSearchesStr != null) {
                    var rsObjeArr = recentSearchesStr.split(",");
                    $(rsObjeArr).each(function () {
                        var obj = this.split("|");
                        if (obj.length > 1) {
                            var srch = {};
                            srch.keyword = obj[0];
                            srch.count = obj[1];
                            recentSearches.push(srch);
                        }
                    });
                }

                var keyword = HawkSearch.RecentSearchesKeyword;
                var count = HawkSearch.RecentSearchesCount;
                if (keyword !== "" && count > 0) {
                    var exists = false;
                    for (var i = 0; i < recentSearches.length; i++) {
                        if (recentSearches[i].keyword == encodeURIComponent(keyword)) {
                            exists = true;
                            break;
                        }
                    }
                    if (!exists) {
                        var search = new Object();
                        search.keyword = encodeURIComponent(keyword);
                        search.count = count;
                        recentSearches.unshift(search);
                    }
                }
                if (recentSearches.length == 0) {
                    $(".hawk-recentSearches").hide();
                }
                var maxRecentSearchesCount = HawkSearch.RecentSearchesRecentSearchesCount;
                var numberOrSearches = Math.min(recentSearches.length, maxRecentSearchesCount);
                for (var j = 0; j < numberOrSearches; j++) {
                    var k = recentSearches[j].keyword;
                    var c = recentSearches[j].count;
                    $(".hawk-recentSearches .hawk-navGroupContent > ul").append("<li><a href='" + HawkSearch.RecentSearchesUrl + "?" + ($("#hdnhawkkeywordfield").val() || "keyword") + "=" + k + "' rel='nofolow'>" + decodeURIComponent(k) + "<span class='count'> (" + c + ")</span></a></li>");
                }

                $(".hawk-recentSearches .hawk-navGroupContent > ul li a").click(function () {
                    window.location = $(this).attr("href");
                });
                var tempArray = [];
                $(recentSearches).each(function () {
                    tempArray.push(this.keyword + "|" + this.count);
                });
                recentSearchesStr = tempArray.join(",");
                $.cookie("recent-searches", recentSearchesStr, { expires: 365 });
            };

            HawkSearch.getTipPlacementFunction = function (defaultPosition, width, height) {
                return function (tip, element) {
                    var position, top, bottom, left, right;

                    var $element = $(element);
                    var boundTop = $(document).scrollTop();
                    var boundLeft = $(document).scrollLeft();
                    var boundRight = boundLeft + $(window).width();
                    var boundBottom = boundTop + $(window).height();

                    var pos = $.extend({}, $element.offset(), {
                        width: element.offsetWidth,
                        height: element.offsetHeight
                    });

                    var isWithinBounds = function (elPos) {
                        return boundTop < elPos.top && boundLeft < elPos.left && boundRight > (elPos.left + width) && boundBottom > (elPos.top + height);
                    };

                    var testTop = function () {
                        if (top === false) return false;
                        top = isWithinBounds({
                            top: pos.top - height,
                            left: pos.left + pos.width / 2 - width / 2
                        });
                        return top ? "top" : false;
                    };

                    var testBottom = function () {
                        if (bottom === false) return false;
                        bottom = isWithinBounds({
                            top: pos.top + pos.height,
                            left: pos.left + pos.width / 2 - width / 2
                        });
                        return bottom ? "bottom" : false;
                    };

                    var testLeft = function () {
                        if (left === false) return false;
                        left = isWithinBounds({
                            top: pos.top + pos.height / 2 - height / 2,
                            left: pos.left - width
                        });
                        return left ? "left" : false;
                    };

                    var testRight = function () {
                        if (right === false) return false;
                        right = isWithinBounds({
                            top: pos.top + pos.height / 2 - height / 2,
                            left: pos.left + pos.width
                        });
                        return right ? "right" : false;
                    };

                    switch (defaultPosition) {
                        case "top":
                            if (position = testTop()) return position;
                        case "bottom":
                            if (position = testBottom()) return position;
                        case "left":
                            if (position = testLeft()) return position;
                        case "right":
                            if (position = testRight()) return position;
                        default:
                            if (position = testTop()) return position;
                            if (position = testBottom()) return position;
                            if (position = testLeft()) return position;
                            if (position = testRight()) return position;
                            return defaultPosition;
                    }
                }
            };

            HawkSearch.PopoverShow = function ($this) {
                $this.addClass("bounded");
                var tip = $this.popover();
                var popover = $(tip).data("bs.popover");
                if ($this.data("tipclass") !== undefined) {
                    popover.tip().addClass($this.data("tipclass"));
                }
                tip.on("shown.bs.popover", function (e) {
                    $this.mouseleave(function () {
                        setTimeout(function () {
                            HawkSearch.TipMouseLeave($this);
                        }, 250);
                    });

                    popover.tip().hover(function () {
                        $(this).addClass("hover");
                    },
                    function () {
                        $(this).removeClass("hover");
                    });

                    popover.tip().mouseleave(function () {
                        setTimeout(function () {
                            HawkSearch.TipMouseLeave($this);
                        }, 250);
                    });
                });

                $this.data("popover");
                $this.popover('show');
            }

            HawkSearch.TipMouseLeave = function (that) {
                var tip = that.data("bs.popover").tip();
                if (tip.hasClass("hover")) {
                    return;
                } else {
                    tip.hide();
                    that.removeClass("hover");
                }
            }

            HawkSearch.BindPreviewInformation = function () {
                $(".on-off-cb").onoff();
                var hdnItemPinned = $(this).parents(".hawk-itemWrapper").find(".hdn-itemPinned");

                $("body").off("change", "input.toggle-item-pin").on("change", "input.toggle-item-pin", function () {
                    var isPinned = $(this).prop("checked");
                    var primaryKey = $(this).data("primary-key");
                    if (isPinned) {
                        HawkSearch.addToTop(this, primaryKey);
                        var hdnItemPinned = $(this).parents(".hawk-itemWrapper").find(".hdn-itemPinned");
                        hdnItemPinned.val(isPinned);
                    } else {
                        HawkSearch.unpinItem(this, primaryKey);
                        var hdnItemPinned = $(this).parents(".hawk-itemWrapper").find(".hdn-itemPinned");
                        hdnItemPinned.val(isPinned);
                    }

                    $(this).parents(".hawk-itemWrapper").find(".hdn-itemPinned").val(isPinned);

                    $("#hawkitemlist").sortable("option", "disabled", true);
                    $(".preview-info").addClass("no-sortable");
                });
                $(".preview-info.explain-info").on("hidden.bs.tooltip", function () {
                    $(this).css("display", "");
                });


                $(".preview-info").each(function () {
                    var content = $(this).parent().find(".preview-info-content").html();

                    $(this).popover({
                        html: true,
                        placement: HawkSearch.getTipPlacementFunction('right', 360, 200),
                        content: content
                    });

                    $(this).mouseover(function () {
                        if ($(this).parents(".grid_3").hasClass('ui-sortable-helper')) {
                            return;
                        }
                        $(this).addClass("hover");
                        var $this = $(this);
                        if ($this.hasClass("bounded")) {
                            var popup = $(this).parent().find(".popover");
                            if (!popup.is(":visible")) {
                                $this.popover("show");
                            }
                            return;
                        }
                        HawkSearch.PopoverShow($(this));
                    });
                    $(this).on("shown.bs.popover", function () {
                        var itemWrapper = $(this).parents(".hawk-itemWrapper")
                        var hdnItemPinned = itemWrapper.find(".hdn-itemPinned");
                        var cbToggleItemPin = itemWrapper.find(".popover").find("input.toggle-item-pin");
                        var checked = hdnItemPinned.val() === "true";
                        cbToggleItemPin.prop("checked", checked);
                    });
                });


                $("#hawkitemlist").sortable({
                    items: '.grid_3.hawk-itemPinned',
                    placeholder: "grid_3 hawk-itemWrapper-placeholder",
                    appendTo: "#hawkitemlist",
                    handle: ".preview-info",
                    cursor: "move",
                    start: function (e, ui) {
                        $(this).find(".popover").popover("hide");
                        ui.placeholder.hide();
                        var wrapper = ui.item.find(".hawk-itemWrapper");
                        var height = wrapper.outerHeight() - 4;
                        var width = wrapper.width() - 2;
                        ui.placeholder.height(height).width(width);
                        ui.placeholder.show();


                    },
                    update: function (e, ui) {
                        var docIdList = $(this).sortable('toArray', { attribute: 'data-hawk-id' }).toString();
                        HawkSearch.updatePinOrder(docIdList);
                    }
                });

            };

            HawkSearch.BindFacetTooltip = function () {
                $(".hawk-facet-tooltip").each(function () {
                    $(this).click(function (e) {
                        e.preventDefault();
                        e.stopPropagation();
                    });
                    var content = $(this).parent().find(".hawk-facet-tooltip-content").html();
                    $(this).popover({
                        html: true,
                        placement: 'right',
                        content: content,
                        container: 'body'
                    });
                    $(this).mouseover(function () {
                        $(this).addClass("hover");
                        var $this = $(this);
                        if ($this.hasClass("bounded")) {
                            var popup = $(this).parent().find(".popover");
                            if (!popup.is(":visible")) {
                                $this.popover("show");
                            }
                            return;
                        }
                        HawkSearch.PopoverShow($(this));
                    });
                });
            }

            HawkSearch.BindBackToTop = function () {
                $(window).scroll(function () {
                    var divBackToTop = $("#hawk-backToTop");
                    if ($(window).scrollTop() > 0) {
                        if (!divBackToTop.is(":visible")) {
                            divBackToTop.fadeIn({ duration: 200, queue: false });
                        }
                    }
                    else {
                        if (divBackToTop.is(":visible")) {
                            divBackToTop.fadeOut({ duration: 200, queue: false });
                        }
                    }
                });
                $("#hawk-backToTop").hover(function () {
                    $(this).toggleClass("hover");
                });
                $("#hawk-backToTop").on("click", function () {
                    $('html,body').animate({ scrollTop: 0 }, 500);
                });
            }

            HawkSearch.SetFacetScrollPosition = function () {
                var menuYloc = $(".hawk-facetScollingContainer").offset().top - $(".hawk-facetScollingContainer").position().top;
                var footerHeight = $(".footer").outerHeight();
                var footerOffsetTop = $(".footer").offset().top;


                var menuHeight = $(".hawk-facetScollingContainer").outerHeight();
                var winHeight = $(window).height();
                var offset = 0;
                var docScroll = $(document).scrollTop();
                var diff = menuHeight - winHeight;
                if (winHeight < menuHeight) {
                    offset = docScroll - diff - menuYloc;
                    if (docScroll < diff) {
                        offset = 0;
                    }

                } else {
                    offset = docScroll - menuYloc + 10;
                }

                if (offset < 0) {
                    offset = 0;
                }

                if (offset + menuHeight + menuYloc >= footerOffsetTop) {
                    offset = footerOffsetTop - menuHeight - menuYloc - 20;
                }

                $(".hawk-facetScollingContainer").animate({ top: offset }, { duration: 500, queue: false });
            }

            HawkSearch.FacetContainerScrollable = function () {
                $(window).scroll(function () {
                    HawkSearch.SetFacetScrollPosition();

                });

            }

            // exposes custom jQuery events to the body
            HawkSearch.ExposeEvents = function (type, args) {
                var callback = $.Event('hawk' + type, args);
                $('body').trigger(callback);

                // if prevent default block execution
                return !callback.isDefaultPrevented();
            }

            HawkSearch.Tracking.setReady($);

            if (HawkSearch.getHashOrQueryVariable("hawkRegVisitor") !== "") {
                parent.postMessage(HawkSearch.lilBro.event.getVisitorId(), "*");
            }

            $(document).trigger("hawksearch.ready");

            HawkSearch.Recommender.ToggleRecPreview();
        }(window.HawkSearch = window.HawkSearch || {}, $));

        (function (HawkCompare, $) {
            HawkCompare.process = function () {
                var itemIds = $("#hdnhawkcompare").val();
                if (itemIds === "") return;
                //alert('Compare feature is not available on samhealth site');
                var itemIds = $("#hdnhawkcompare").val();
                if (itemIds === "") return;

                var url = HawkSearch.BaseUrl + "?fn=compare&Items=" + itemIds;
                $.get(url, function (data) {
                    var html = data;
                    HawkSearch.bootbox.dialog({
                        title: 'Compare Items',
                        message: html,
                        className: 'hawk-compare hawk-preview',
                        buttons: {
                            main: {
                                label: "Close"
                            }
                        }
                    });
                    $(".item.span3 .product-shop .product-name").matchHeights();
                });
            };

            HawkCompare.addItem = function (itemVal) {
                var index = HawkCompare.countItems();
                window['hawktocompare'][index] = itemVal;
                if (HawkCompare.countItems() != 0) {
                    $(".hawk-subControls.clearfix").css("display", "block");
                }
            };

            HawkCompare.getImage = function (itemVal) {
                // sets up query and cache
                var compareQuery = HawkSearch.BaseUrl + "/default.aspx?fn=ajax&F=GetItemImageToCompare&ItemId=" + itemVal;
                var cacheResp = window[compareQuery];
                // check for cache; process and output ajax query
                if (cacheResp) {
                    HawkCompare.addImage(cacheResp.Image);
                } else {
                    $.ajax({
                        type: "GET",
                        contentType: "application/json; charset=utf-8",
                        url: compareQuery,
                        dataType: 'jsonp',
                        data: "",
                        async: false,
                        success: function (json) {
                            window[compareQuery] = json;
                            HawkCompare.addImage(json.Image);
                        }
                    });
                };
            };

            HawkCompare.addImage = function (htmlLi) {
                $(".hawk-compareList>ul").each(function () {
                    $(this).find("li").each(function () {
                        if ($(this).html() == "" || $(this).html() == "&nbsp;") {
                            $(this).html(htmlLi);
                            return false;
                        }
                        return true;
                    });
                });
            };

            HawkCompare.countItems = function () {
                return window['hawktocompare'].length;
            };

            HawkCompare.reload = function () {
                $.each(window['hawktocompare'], function (i, value) {
                    HawkCompare.getImage(value);
                    $("#chkItemCompare" + value).attr("checked", true);
                });
            };

            HawkCompare.removeItem = function (itemVal) {
                $(".hawk-compareList>ul").each(function () {
                    var cItem = $(this).find("a#" + itemVal).parent();
                    cItem.parent().append("<li>&nbsp;</li>");
                    cItem.remove();
                });
                $("#chkItemCompare" + itemVal).attr("checked", false);

                var index = window['hawktocompare'].indexOf(itemVal);
                window['hawktocompare'].splice(index, 1);

                if (HawkCompare.countItems() == 0) {
                    $(".hawk-subControls.clearfix").css("display", "none");
                }

            };

        }(window.HawkCompare = window.HawkCompare || {}, $));

        // END Namespaced HawkSearch block.

        window.onhashchange = function () {
            log("onhashchagne event handler");
            HawkSearch.refreshResults();
        }

        HawkSearch.loadRecommender = function () {
            var recommender = new HawkSearch.Recommender($);
        }
        
        $.expr[':'].containsNoCase = function (a, i, m) {
            var regex = /(.*?)\s\(\d+?\)/;
            var textNode = a.textContent || a.innerText || "";
            var matches = textNode.match(regex);
            if (matches == null) {
                return null;
            }

            return (matches[1]).toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
        };

        $.fn.filterThatList = function (options) {
            // if there are no passed options create an empty options object
            if (options === undefined || options === null) {
                options = {};
            }
            ;

            // set up default options
            var defaults = {
                searchTarget: $(this) // the search input
            };

            return this.each(function () {
                // merge passed options with default options to create settings
                var settings = $.extend(defaults, options);

                settings.searchTarget.change(function () {
                    // get the value of the input which is used to filter against
                    var filter = $(this).val();
                    var searchList = settings.list;
                    var isNestedFacet = settings.list.hasClass("hawk-nestedfacet");
                    //when nested facet prepare flat facet
                    if (isNestedFacet) {
                        var flatUlId = settings.list.attr("id") + "_flat";
                        if ($("#" + flatUlId).size() == 0) {
                            var searchList = $(settings.list[0].cloneNode(false));
                            searchList.removeClass("hawk-navTruncateList");
                            searchList.addClass("hawk-scrollList");
                            searchList.attr("id", flatUlId);
                            searchList.appendTo(settings.list.parent());

                            $(settings.list).find("li").each(function () {
                                var pathArr = [];
                                $(this).parentsUntil("#" + settings.list.attr("id"), "li").each(function () {
                                    var text = $($($(this).children("a")).children("span").contents()[0]).text();
                                    text = text.trim();
                                    pathArr.unshift(text);
                                });

                                var li = $("<li>");
                                if ($(this).hasClass("hawkFacet-active")) {
                                    li.addClass("hawkFacet-active");
                                }

                                li.appendTo(searchList);
                                var anchor = $(this).children("a").clone();
                                if (pathArr.length > 0) {
                                    var textSpan = anchor.children("span")
                                    var spanCount = textSpan.children(".hawk-facetCount").remove()
                                    pathArr.push(textSpan.text());
                                    textSpan.html(pathArr.join(" &raquo; "));
                                    textSpan.append(spanCount);
                                }

                                anchor.appendTo(li);
                            });
                            var liHeight = searchList.children("li").first().outerHeight();
                            //set search list for max 20 elements
                            searchList.css("max-height", (liHeight * 20) + "px");
                            settings.list.hide();
                        }
                        else {
                            searchList = $("#" + flatUlId);
                            searchList.show();
                            settings.list.hide();
                        }
                    }
                    var noResults = ("<li><span>No Results Found</span></li>");

                    if (filter) {
                        searchList
                            // hide items that do not match input filter
                            .find("li:not(:containsNoCase(" + filter + "))").hide()
                            // show items that match input filter
                            .end().find("li:containsNoCase(" + filter + ")").show();

                        var items = searchList.find("li:containsNoCase(" + filter + ")");

                        // nothing matches filter
                        // add no results found
                        if (items.length == 0) {
                            var item = $(noResults);
                            searchList.prepend(item);
                            return;
                        }

                        //check if more results
                        var options = settings.list.data().options;
                        var moreItems = items.filter(function (index) {
                            return index >= options.cutoff;
                        });
                        moreItems.hide();

                        //if no more results
                        if (moreItems.size() == 0) {
                            return;
                        }

                        //otherwise 
                        //remove no results
                        items.find(":contains('No Results Found')").remove();

                        if (moreItems) {
                            //add more button and handle it's click event
                            var more = settings.list.find("li.hawk-navMore");
                            more.off("click").find("span").text("(+) Show " + moreItems.size() + " More");
                            more.show();

                            more.on("click", function (event) {
                                var moreTrigger = $(this);
                                if ($(this).hasClass("hawk-navMoreActive")) {
                                    searchList
                                    // hide items that do not match input filter
                                    .find("li:not(:containsNoCase(" + filter + "))").hide()
                                    // show items that match input filter
                                    .end().find("li:containsNoCase(" + filter + ")").show();

                                    items = searchList.find("li:containsNoCase(" + filter + ")");

                                    moreItems = items.filter(function (index) {
                                        return index >= options.cutoff;
                                    });
                                    moreItems.hide();

                                    moreTrigger.find("span").text("(+) Show " + moreItems.size() + " More");
                                    moreTrigger.removeClass("hawk-navMoreActive");
                                    window["hawkexpfacet_" + searchList.attr("id")] = null;
                                    moreTrigger.show();
                                } else {
                                    searchList
                                   // hide items that do not match input filter
                                   .find("li:not(:containsNoCase(" + filter + "))").hide()
                                   // show items that match input filter
                                   .end().find("li:containsNoCase(" + filter + ")").show();

                                    items = searchList.find("li:containsNoCase(" + filter + ")");

                                    // nothing matches filter
                                    if (items.length == 0) {
                                        var item = $(noResults);
                                        searchList.prepend(item);
                                        return;
                                    }
                                    moreTrigger.addClass("hawk-navMoreActive").find("span").text(options.lessText);
                                    moreTrigger.show();
                                    window["hawkexpfacet_" + searchList.attr("id")] = true;
                                };
                            });

                        }
                        //no filter
                    } else {
                        //remove no results option
                        settings.list.find(":contains('No Results Found')").remove();

                        // if nothing is entered display all items in list
                        if (isNestedFacet) {
                            searchList.hide();
                            settings.list.show();
                        }
                        else {
                            if (settings.list.hasClass("hawk-navTruncateList")) {
                                var wasExpanded = settings.list.find("li.hawk-navMore > span").hasClass("hawk-navMoreActive");

                                if (wasExpanded) {
                                    settings.list.find("li").show();
                                }
                                else {
                                    var options = settings.list.data().options;
                                    var items = settings.list.find("li:not(.hawk-navMore)");

                                    items.each(function (i, el) {
                                        if (i < options.cutoff) {
                                            $(this).show();
                                        } else {
                                            $(this).hide();
                                        }
                                    });


                                    //check if more results
                                    var options = settings.list.data().options;
                                    var moreItems = items.filter(function (index) {
                                        return index >= options.cutoff;
                                    });
                                    moreItems.hide();

                                    //if no more results
                                    if (moreItems.size() == 0) {
                                        return;
                                    }

                                    if (moreItems) {
                                        var more = settings.list.find("li.hawk-navMore");
                                        more.off("click").find("span").text(options.moreText);
                                        more.show();

                                        more.on("click", function (event) {
                                            var moreTrigger = $(this);
                                            if ($(this).hasClass("hawk-navMoreActive")) {
                                                moreTrigger.hide();
                                                moreTrigger.removeClass("hawk-navMoreActive").find("span").text(options.moreText);
                                                window["hawkexpfacet_" + searchList.attr("id")] = null;
                                                moreTrigger.show();
                                            } else {
                                                moreTrigger.addClass("hawk-navMoreActive").find("span").text(options.lessText);
                                                window["hawkexpfacet_" + searchList.attr("id")] = true;
                                                moreTrigger.show();
                                            };
                                        });
                                    }

                                }
                            } else {
                                settings.list.find("li").show();
                            }
                        }
                    }
                }).keyup(function () {
                    //trigger above actions at every keyup
                    $(this).change();
                });

            });
        };

        /************************/
        /* Custom Plugins Below */
        /************************/

        //requireJS, these are not the plugins you are looking for
        //TRUST ME. THIS IS GOOD. PLEASE DON'T REMOVE THIS.
        var define = undefined;

        /*!
		 * jQuery blockUI plugin
		 * Version 2.66.0-2013.10.09
		 * Requires jQuery v1.7 or later
		 *
		 * Examples at: http://malsup.com/jquery/block/
		 * Copyright (c) 2007-2013 M. Alsup
		 * Dual licensed under the MIT and GPL licenses:
		 * http://www.opensource.org/licenses/mit-license.php
		 * http://www.gnu.org/licenses/gpl.html
		 *
		 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
		 */
        (function () {
            function p(b) {
                function p(c, a) {
                    var f, h, e = c == window, g = a && void 0 !== a.message ? a.message : void 0; a = b.extend({}, b.blockUI.defaults, a || {}); if (!a.ignoreIfBlocked || !b(c).data("blockUI.isBlocked")) {
                        a.overlayCSS = b.extend({}, b.blockUI.defaults.overlayCSS, a.overlayCSS || {}); f = b.extend({}, b.blockUI.defaults.css, a.css || {}); a.onOverlayClick && (a.overlayCSS.cursor = "pointer"); h = b.extend({}, b.blockUI.defaults.themedCSS, a.themedCSS || {}); g = void 0 === g ? a.message : g; e && l && s(window, { fadeOut: 0 }); if (g && "string" != typeof g &&
                        (g.parentNode || g.jquery)) {
                            var k = g.jquery ? g[0] : g, d = {}; b(c).data("blockUI.history", d); d.el = k; d.parent = k.parentNode; d.display = k.style.display; d.position = k.style.position; d.parent && d.parent.removeChild(k)
                        } b(c).data("blockUI.onUnblock", a.onUnblock); var d = a.baseZ, m; m = t || a.forceIframe ? b('<iframe class="blockUI" style="z-index:' + d++ + ';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="' + a.iframeSrc + '"></iframe>') : b('<div class="blockUI" style="display:none"></div>');
                        k = a.theme ? b('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:' + d++ + ';display:none"></div>') : b('<div class="blockUI blockOverlay" style="z-index:' + d++ + ';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'); a.theme && e ? (d = '<div class="blockUI ' + a.blockMsgClass + ' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:' + (d + 10) + ';display:none;position:fixed">', a.title && (d += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">' +
                        (a.title || "&nbsp;") + "</div>"), d += '<div class="ui-widget-content ui-dialog-content"></div></div>') : a.theme ? (d = '<div class="blockUI ' + a.blockMsgClass + ' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:' + (d + 10) + ';display:none;position:absolute">', a.title && (d += '<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">' + (a.title || "&nbsp;") + "</div>"), d += '<div class="ui-widget-content ui-dialog-content"></div>', d += "</div>") : d = e ? '<div class="blockUI ' + a.blockMsgClass + ' blockPage" style="z-index:' +
                        (d + 10) + ';display:none;position:fixed"></div>' : '<div class="blockUI ' + a.blockMsgClass + ' blockElement" style="z-index:' + (d + 10) + ';display:none;position:absolute"></div>'; d = b(d); g && (a.theme ? (d.css(h), d.addClass("ui-widget-content")) : d.css(f)); a.theme || k.css(a.overlayCSS); k.css("position", e ? "fixed" : "absolute"); (t || a.forceIframe) && m.css("opacity", 0); f = [m, k, d]; var r = e ? b("body") : b(c); b.each(f, function () { this.appendTo(r) }); a.theme && a.draggable && b.fn.draggable && d.draggable({ handle: ".ui-dialog-titlebar", cancel: "li" });
                        h = A && (!b.support.boxModel || 0 < b("object,embed", e ? null : c).length); if (v || h) {
                            e && a.allowBodyStretch && b.support.boxModel && b("html,body").css("height", "100%"); if ((v || !b.support.boxModel) && !e) {
                                h = parseInt(b.css(c, "borderTopWidth"), 10) || 0; var q = parseInt(b.css(c, "borderLeftWidth"), 10) || 0, w = h ? "(0 - " + h + ")" : 0, x = q ? "(0 - " + q + ")" : 0
                            } b.each(f, function (b, c) {
                                var d = c[0].style; d.position = "absolute"; if (2 > b) e ? d.setExpression("height", "Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:" +
                                a.quirksmodeOffsetHack + ') + "px"') : d.setExpression("height", 'this.parentNode.offsetHeight + "px"'), e ? d.setExpression("width", 'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') : d.setExpression("width", 'this.parentNode.offsetWidth + "px"'), x && d.setExpression("left", x), w && d.setExpression("top", w); else if (a.centerY) e && d.setExpression("top", '(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),
                                d.marginTop = 0; else if (!a.centerY && e) {
                                    var f = "((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + " + (a.css && a.css.top ? parseInt(a.css.top, 10) : 0) + ') + "px"'; d.setExpression("top", f)
                                }
                            })
                        } g && (a.theme ? d.find(".ui-widget-content").append(g) : d.append(g), (g.jquery || g.nodeType) && b(g).show()); (t || a.forceIframe) && a.showOverlay && m.show(); if (a.fadeIn) f = a.onBlock ? a.onBlock : u, m = a.showOverlay && !g ? f : u, f = g ? f : u, a.showOverlay && k._fadeIn(a.fadeIn, m), g && d._fadeIn(a.fadeIn,
                        f); else if (a.showOverlay && k.show(), g && d.show(), a.onBlock) a.onBlock(); y(1, c, a); e ? (l = d[0], n = b(a.focusableElements, l), a.focusInput && setTimeout(z, 20)) : B(d[0], a.centerX, a.centerY); a.timeout && (g = setTimeout(function () { e ? b.unblockUI(a) : b(c).unblock(a) }, a.timeout), b(c).data("blockUI.timeout", g))
                    }
                } function s(c, a) {
                    var f, h = c == window, e = b(c), g = e.data("blockUI.history"), k = e.data("blockUI.timeout"); k && (clearTimeout(k), e.removeData("blockUI.timeout")); a = b.extend({}, b.blockUI.defaults, a || {}); y(0, c, a); null === a.onUnblock &&
                    (a.onUnblock = e.data("blockUI.onUnblock"), e.removeData("blockUI.onUnblock")); var d; d = h ? b("body").children().filter(".blockUI").add("body > .blockUI") : e.find(">.blockUI"); a.cursorReset && (1 < d.length && (d[1].style.cursor = a.cursorReset), 2 < d.length && (d[2].style.cursor = a.cursorReset)); h && (l = n = null); a.fadeOut ? (f = d.length, d.stop().fadeOut(a.fadeOut, function () { 0 === --f && r(d, g, a, c) })) : r(d, g, a, c)
                } function r(c, a, f, h) {
                    var e = b(h); if (!e.data("blockUI.isBlocked")) {
                        c.each(function (a, b) { this.parentNode && this.parentNode.removeChild(this) });
                        a && a.el && (a.el.style.display = a.display, a.el.style.position = a.position, a.parent && a.parent.appendChild(a.el), e.removeData("blockUI.history")); e.data("blockUI.static") && e.css("position", "static"); if ("function" == typeof f.onUnblock) f.onUnblock(h, f); c = b(document.body); a = c.width(); f = c[0].style.width; c.width(a - 1).width(a); c[0].style.width = f
                    }
                } function y(c, a, f) {
                    var h = a == window; a = b(a); if (c || (!h || l) && (h || a.data("blockUI.isBlocked"))) a.data("blockUI.isBlocked", c), h && f.bindEvents && (!c || f.showOverlay) && (c ? b(document).bind("mousedown mouseup keydown keypress keyup touchstart touchend touchmove",
                    f, q) : b(document).unbind("mousedown mouseup keydown keypress keyup touchstart touchend touchmove", q))
                } function q(c) {
                    if ("keydown" === c.type && c.keyCode && 9 == c.keyCode && l && c.data.constrainTabKey) { var a = n, f = c.shiftKey && c.target === a[0]; if (!c.shiftKey && c.target === a[a.length - 1] || f) return setTimeout(function () { z(f) }, 10), !1 } var a = c.data, h = b(c.target); if (h.hasClass("blockOverlay") && a.onOverlayClick) a.onOverlayClick(c); return 0 < h.parents("div." + a.blockMsgClass).length ? !0 : 0 === h.parents().children().filter("div.blockUI").length
                }
                function z(b) {
                    n && (b = n[!0 === b ? n.length - 1 : 0]) && b.focus()
                } function B(c, a, f) {
                    var h = c.parentNode, e = c.style, g = (h.offsetWidth - c.offsetWidth) / 2 - (parseInt(b.css(h, "borderLeftWidth"), 10) || 0); c = (h.offsetHeight - c.offsetHeight) / 2 - (parseInt(b.css(h, "borderTopWidth"), 10) || 0); a && (e.left = 0 < g ? g + "px" : "0"); f && (e.top = 0 < c ? c + "px" : "0")
                } b.fn._fadeIn = b.fn.fadeIn; var u = b.noop || function () { }, t = /MSIE/.test(navigator.userAgent), v = /MSIE 6.0/.test(navigator.userAgent) && !/MSIE 8.0/.test(navigator.userAgent), A = b.isFunction(document.createElement("div").style.setExpression);
                b.blockUI = function (b) {
                    p(window, b)
                }; b.unblockUI = function (b) {
                    s(window, b)
                }; b.growlUI = function (c, a, f, h) {
                    var e = b('<div class="growlUI"></div>'); c && e.append("<h1>" + c + "</h1>"); a && e.append("<h2>" + a + "</h2>"); void 0 === f && (f = 3E3); var g = function (a) {
                        a = a || {}; b.blockUI({ message: e, fadeIn: "undefined" !== typeof a.fadeIn ? a.fadeIn : 700, fadeOut: "undefined" !== typeof a.fadeOut ? a.fadeOut : 1E3, timeout: "undefined" !== typeof a.timeout ? a.timeout : f, centerY: !1, showOverlay: !1, onUnblock: h, css: b.blockUI.defaults.growlCSS })
                    }; g(); e.css("opacity");
                    e.mouseover(function () { g({ fadeIn: 0, timeout: 3E4 }); var a = b(".blockMsg"); a.stop(); a.fadeTo(300, 1) }).mouseout(function () { b(".blockMsg").fadeOut(1E3) })
                }; b.fn.block = function (c) {
                    if (this[0] === window) return b.blockUI(c), this; var a = b.extend({}, b.blockUI.defaults, c || {}); this.each(function () { var c = b(this); a.ignoreIfBlocked && c.data("blockUI.isBlocked") || c.unblock({ fadeOut: 0 }) }); return this.each(function () {
                        "static" == b.css(this, "position") && (this.style.position = "relative", b(this).data("blockUI.static", !0)); this.style.zoom =
                        1; p(this, c)
                    })
                }; b.fn.unblock = function (c) {
                    return this[0] === window ? (b.unblockUI(c), this) : this.each(function () { s(this, c) })
                }; b.blockUI.version = 2.66; b.blockUI.defaults = {
                    message: "<h1>Please wait...</h1>", title: null, draggable: !0, theme: !1, css: {
                        padding: 0, margin: 0, width: "30%", top: "40%", left: "35%", textAlign: "center", color: "#000", border: "3px solid #aaa", backgroundColor: "#fff", cursor: "wait"
                    }, themedCSS: {
                        width: "30%", top: "40%", left: "35%"
                    }, overlayCSS: {
                        backgroundColor: "#000", opacity: 0.6, cursor: "wait"
                    }, cursorReset: "default",
                    growlCSS: {
                        width: "350px", top: "10px", left: "", right: "10px", border: "none", padding: "5px", opacity: 0.6, cursor: "default", color: "#fff", backgroundColor: "#000", "-webkit-border-radius": "10px", "-moz-border-radius": "10px", "border-radius": "10px"
                    }, iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank", forceIframe: !1, baseZ: 1E3, centerX: !0, centerY: !0, allowBodyStretch: !0, bindEvents: !0, constrainTabKey: !0, fadeIn: 200, fadeOut: 400, timeout: 0, showOverlay: !0, focusInput: !0, focusableElements: ":input:enabled:visible",
                    onBlock: null, onUnblock: null, onOverlayClick: null, quirksmodeOffsetHack: 4, blockMsgClass: "blockMsg", ignoreIfBlocked: !1
                }; var l = null, n = []
            } "function" === typeof define && define.amd && define.amd.jQuery ? define(["jquery"], p) : p(jQuery)
        })();


        /*
		 * Match Heights jQuery Plugin
		 * 
		 * Version 1.7.2 (Updated 7/31/2013)
		 * Copyright (c) 2010-2013 Mike Avello
		 * Dual licensed under the MIT and GPL licenses:
		 * http://www.opensource.org/licenses/mit-license.php
		 * http://www.gnu.org/licenses/gpl.html
		 *
		 */
        (function (d) { d.fn.matchHeights = function (a) { a = jQuery.extend(this, { minHeight: null, maxHeight: null, extension: 0, overflow: null, includeMargin: !1 }, a); var e = a.extension, b = a.minHeight ? a.minHeight : 0; this.each(function () { b = Math.max(b, d(this).outerHeight()) }); a.maxHeight && b > a.maxHeight && (b = a.maxHeight); return this.each(function () { var c = d(this), f = c.innerHeight() - c.height() + (c.outerHeight(a.includeMargin) - c.innerHeight()); a.overflow ? c.css({ height: b - f + e, overflow: a.overflow }) : c.css({ "min-height": b - f + e }) }) } })(jQuery);


        /*!
         * imagesLoaded PACKAGED v3.1.8
         * JavaScript is all like "You images are done yet or what?"
         * MIT License
         *
         * Hawk Note: Had to romove this line from the plguin to keep our encapsulation. var $ = window.jQuery;
         *
         */
        (function () { function e() { } function i(e, t) { var n = e.length; while (n--) { if (e[n].listener === t) { return n } } return -1 } function s(e) { return function () { return this[e].apply(this, arguments) } } var t = e.prototype; var n = this; var r = n.EventEmitter; t.getListeners = function (t) { var n = this._getEvents(); var r; var i; if (typeof t === "object") { r = {}; for (i in n) { if (n.hasOwnProperty(i) && t.test(i)) { r[i] = n[i] } } } else { r = n[t] || (n[t] = []) } return r }; t.flattenListeners = function (t) { var n = []; var r; for (r = 0; r < t.length; r += 1) { n.push(t[r].listener) } return n }; t.getListenersAsObject = function (t) { var n = this.getListeners(t); var r; if (n instanceof Array) { r = {}; r[t] = n } return r || n }; t.addListener = function (t, n) { var r = this.getListenersAsObject(t); var s = typeof n === "object"; var o; for (o in r) { if (r.hasOwnProperty(o) && i(r[o], n) === -1) { r[o].push(s ? n : { listener: n, once: false }) } } return this }; t.on = s("addListener"); t.addOnceListener = function (t, n) { return this.addListener(t, { listener: n, once: true }) }; t.once = s("addOnceListener"); t.defineEvent = function (t) { this.getListeners(t); return this }; t.defineEvents = function (t) { for (var n = 0; n < t.length; n += 1) { this.defineEvent(t[n]) } return this }; t.removeListener = function (t, n) { var r = this.getListenersAsObject(t); var s; var o; for (o in r) { if (r.hasOwnProperty(o)) { s = i(r[o], n); if (s !== -1) { r[o].splice(s, 1) } } } return this }; t.off = s("removeListener"); t.addListeners = function (t, n) { return this.manipulateListeners(false, t, n) }; t.removeListeners = function (t, n) { return this.manipulateListeners(true, t, n) }; t.manipulateListeners = function (t, n, r) { var i; var s; var o = t ? this.removeListener : this.addListener; var u = t ? this.removeListeners : this.addListeners; if (typeof n === "object" && !(n instanceof RegExp)) { for (i in n) { if (n.hasOwnProperty(i) && (s = n[i])) { if (typeof s === "function") { o.call(this, i, s) } else { u.call(this, i, s) } } } } else { i = r.length; while (i--) { o.call(this, n, r[i]) } } return this }; t.removeEvent = function (t) { var n = typeof t; var r = this._getEvents(); var i; if (n === "string") { delete r[t] } else if (n === "object") { for (i in r) { if (r.hasOwnProperty(i) && t.test(i)) { delete r[i] } } } else { delete this._events } return this }; t.removeAllListeners = s("removeEvent"); t.emitEvent = function (t, n) { var r = this.getListenersAsObject(t); var i; var s; var o; var u; for (o in r) { if (r.hasOwnProperty(o)) { s = r[o].length; while (s--) { i = r[o][s]; if (i.once === true) { this.removeListener(t, i.listener) } u = i.listener.apply(this, n || []); if (u === this._getOnceReturnValue()) { this.removeListener(t, i.listener) } } } } return this }; t.trigger = s("emitEvent"); t.emit = function (t) { var n = Array.prototype.slice.call(arguments, 1); return this.emitEvent(t, n) }; t.setOnceReturnValue = function (t) { this._onceReturnValue = t; return this }; t._getOnceReturnValue = function () { if (this.hasOwnProperty("_onceReturnValue")) { return this._onceReturnValue } else { return true } }; t._getEvents = function () { return this._events || (this._events = {}) }; e.noConflict = function () { n.EventEmitter = r; return e }; if (typeof define === "function" && define.amd) { define("eventEmitter/EventEmitter", [], function () { return e }) } else if (typeof module === "object" && module.exports) { module.exports = e } else { this.EventEmitter = e } }).call(this); (function (e) { function r(t) { var n = e.event; n.target = n.target || n.srcElement || t; return n } var t = document.documentElement; var n = function () { }; if (t.addEventListener) { n = function (e, t, n) { e.addEventListener(t, n, false) } } else if (t.attachEvent) { n = function (e, t, n) { e[t + n] = n.handleEvent ? function () { var t = r(e); n.handleEvent.call(n, t) } : function () { var t = r(e); n.call(e, t) }; e.attachEvent("on" + t, e[t + n]) } } var i = function () { }; if (t.removeEventListener) { i = function (e, t, n) { e.removeEventListener(t, n, false) } } else if (t.detachEvent) { i = function (e, t, n) { e.detachEvent("on" + t, e[t + n]); try { delete e[t + n] } catch (r) { e[t + n] = undefined } } } var s = { bind: n, unbind: i }; if (typeof define === "function" && define.amd) { define("eventie/eventie", s) } else { e.eventie = s } })(this); (function (e, t) { if (typeof define === "function" && define.amd) { define(["eventEmitter/EventEmitter", "eventie/eventie"], function (n, r) { return t(e, n, r) }) } else if (typeof exports === "object") { module.exports = t(e, require("wolfy87-eventemitter"), require("eventie")) } else { e.imagesLoaded = t(e, e.EventEmitter, e.eventie) } })(window, function (t, n, r) { function o(e, t) { for (var n in t) { e[n] = t[n] } return e } function a(e) { return u.call(e) === "[object Array]" } function f(e) { var t = []; if (a(e)) { t = e } else if (typeof e.length === "number") { for (var n = 0, r = e.length; n < r; n++) { t.push(e[n]) } } else { t.push(e) } return t } function l(e, t, n) { if (!(this instanceof l)) { return new l(e, t) } if (typeof e === "string") { e = document.querySelectorAll(e) } this.elements = f(e); this.options = o({}, this.options); if (typeof t === "function") { n = t } else { o(this.options, t) } if (n) { this.on("always", n) } this.getImages(); if ($) { this.jqDeferred = new $.Deferred } var r = this; setTimeout(function () { r.check() }) } function c(e) { this.img = e } function p(e) { this.src = e; h[e] = this } var i = t.console; var s = typeof i !== "undefined"; var u = Object.prototype.toString; l.prototype = new n; l.prototype.options = {}; l.prototype.getImages = function () { this.images = []; for (var e = 0, t = this.elements.length; e < t; e++) { var n = this.elements[e]; if (n.nodeName === "IMG") { this.addImage(n) } var r = n.nodeType; if (!r || !(r === 1 || r === 9 || r === 11)) { continue } var i = n.querySelectorAll("img"); for (var s = 0, o = i.length; s < o; s++) { var u = i[s]; this.addImage(u) } } }; l.prototype.addImage = function (e) { var t = new c(e); this.images.push(t) }; l.prototype.check = function () { function r(r, o) { if (e.options.debug && s) { i.log("confirm", r, o) } e.progress(r); t++; if (t === n) { e.complete() } return true } var e = this; var t = 0; var n = this.images.length; this.hasAnyBroken = false; if (!n) { this.complete(); return } for (var o = 0; o < n; o++) { var u = this.images[o]; u.on("confirm", r); u.check() } }; l.prototype.progress = function (e) { this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded; var t = this; setTimeout(function () { t.emit("progress", t, e); if (t.jqDeferred && t.jqDeferred.notify) { t.jqDeferred.notify(t, e) } }) }; l.prototype.complete = function () { var e = this.hasAnyBroken ? "fail" : "done"; this.isComplete = true; var t = this; setTimeout(function () { t.emit(e, t); t.emit("always", t); if (t.jqDeferred) { var n = t.hasAnyBroken ? "reject" : "resolve"; t.jqDeferred[n](t) } }) }; if ($) { $.fn.imagesLoaded = function (e, t) { var n = new l(this, e, t); return n.jqDeferred.promise($(this)) } } c.prototype = new n; c.prototype.check = function () { var e = h[this.img.src] || new p(this.img.src); if (e.isConfirmed) { this.confirm(e.isLoaded, "cached was confirmed"); return } if (this.img.complete && this.img.naturalWidth !== undefined) { this.confirm(this.img.naturalWidth !== 0, "naturalWidth"); return } var t = this; e.on("confirm", function (e, n) { t.confirm(e.isLoaded, n); return true }); e.check() }; c.prototype.confirm = function (e, t) { this.isLoaded = e; this.emit("confirm", this, t) }; var h = {}; p.prototype = new n; p.prototype.check = function () { if (this.isChecked) { return } var e = new Image; r.bind(e, "load", this); r.bind(e, "error", this); e.src = this.src; this.isChecked = true }; p.prototype.handleEvent = function (e) { var t = "on" + e.type; if (this[t]) { this[t](e) } }; p.prototype.onload = function (e) { this.confirm(true, "onload"); this.unbindProxyEvents(e) }; p.prototype.onerror = function (e) { this.confirm(false, "onerror"); this.unbindProxyEvents(e) }; p.prototype.confirm = function (e, t) { this.isConfirmed = true; this.isLoaded = e; this.emit("confirm", this, t) }; p.prototype.unbindProxyEvents = function (e) { r.unbind(e.target, "load", this); r.unbind(e.target, "error", this) }; return l })


        /*
        * jQuery cookie
        */
        HawkSearch.jQuery.cookie = function (name, value, options) {
            if (typeof value != 'undefined') { // name and value given, set cookie
                options = options || {
                };
                if (value === null) {
                    value = '';
                    options.expires = -1;
                }
                var expires = '';
                if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
                    var date;
                    if (typeof options.expires == 'number') {
                        date = new Date();
                        date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
                    } else {
                        date = options.expires;
                    }
                    expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
                }
                // CAUTION: Needed to parenthesize options.path and options.domain
                // in the following expressions, otherwise they evaluate to undefined
                // in the packed version for some reason...
                var path = options.path ? '; path=' + (options.path) : '';
                var domain = options.domain ? '; domain=' + (options.domain) : '';
                var secure = options.secure ? '; secure' : '';
                document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
            } else { // only name given, get cookie
                var cookieValue = null;
                if (document.cookie && document.cookie != '') {
                    var cookies = document.cookie.split(';');
                    for (var i = 0; i < cookies.length; i++) {
                        var cookie = $.trim(cookies[i]);
                        // Does this cookie string begin with the name we want?
                        if (cookie.substring(0, name.length + 1) == (name + '=')) {
                            cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                            break;
                        }
                    }
                }
                return cookieValue;
            }
        };


        // register indexOf() method if browser does not natively support it
        // this algorithm is exactly as specified in ECMA-262 standard, 5th edition, assuming Object, TypeError, Number, Math.floor, Math.abs, and Math.max have their original value.  
        // see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf for more details
        if (!Array.prototype.indexOf) {
            Array.prototype.indexOf = function (searchElement /*, fromIndex */) {
                "use strict";
                if (this == null) {
                    throw new TypeError();
                }
                var t = Object(this);
                var len = t.length >>> 0;
                if (len === 0) {
                    return -1;
                }
                var n = 0;
                if (arguments.length > 0) {
                    n = Number(arguments[1]);
                    if (n != n) { // shortcut for verifying if it's NaN
                        n = 0;
                    } else if (n != 0 && n != Infinity && n != -Infinity) {
                        n = (n > 0 || -1) * Math.floor(Math.abs(n));
                    }
                }
                if (n >= len) {
                    return -1;
                }
                var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
                for (; k < len; k++) {
                    if (k in t && t[k] === searchElement) {
                        return k;
                    }
                }
                return -1;
            }
        };

        // if bootstrap3 is already on the site, do not load this bootstrap.
        if (!bootstrap3_enabled) {
            log("Loading: local bootstrap");

            /**
            * Bootstrap.js by @fat & @mdo
            * plugins: bootstrap-modal.js, bootstrap-tooltip.js, bootstrap-popover.js
            * Copyright 2013 Twitter, Inc.
            * http://www.apache.org/licenses/LICENSE-2.0.txt
            */
            !function (a) { var b = function (b, c) { this.options = c, this.$element = a(b).delegate('[data-dismiss="modal"]', "click.dismiss.modal", a.proxy(this.hide, this)), this.options.remote && this.$element.find(".modal-body").load(this.options.remote) }; b.prototype = { constructor: b, toggle: function () { return this[this.isShown ? "hide" : "show"]() }, show: function () { var b = this, c = a.Event("show"); this.$element.trigger(c); if (this.isShown || c.isDefaultPrevented()) return; this.isShown = !0, this.escape(), this.backdrop(function () { var c = a.support.transition && b.$element.hasClass("fade"); b.$element.parent().length || b.$element.appendTo(document.body), b.$element.show(), c && b.$element[0].offsetWidth, b.$element.addClass("in").attr("aria-hidden", !1), b.enforceFocus(), c ? b.$element.one(a.support.transition.end, function () { b.$element.focus().trigger("shown") }) : b.$element.focus().trigger("shown") }) }, hide: function (b) { b && b.preventDefault(); var c = this; b = a.Event("hide"), this.$element.trigger(b); if (!this.isShown || b.isDefaultPrevented()) return; this.isShown = !1, this.escape(), a(document).off("focusin.modal"), this.$element.removeClass("in").attr("aria-hidden", !0), a.support.transition && this.$element.hasClass("fade") ? this.hideWithTransition() : this.hisamhealthdal() }, enforceFocus: function () { var b = this; a(document).on("focusin.modal", function (a) { b.$element[0] !== a.target && !b.$element.has(a.target).length && b.$element.focus() }) }, escape: function () { var a = this; this.isShown && this.options.keyboard ? this.$element.on("keyup.dismiss.modal", function (b) { b.which == 27 && a.hide() }) : this.isShown || this.$element.off("keyup.dismiss.modal") }, hideWithTransition: function () { var b = this, c = setTimeout(function () { b.$element.off(a.support.transition.end), b.hisamhealthdal() }, 500); this.$element.one(a.support.transition.end, function () { clearTimeout(c), b.hisamhealthdal() }) }, hisamhealthdal: function () { var a = this; this.$element.hide(), this.backdrop(function () { a.removeBackdrop(), a.$element.trigger("hidden") }) }, removeBackdrop: function () { this.$backdrop && this.$backdrop.remove(), this.$backdrop = null }, backdrop: function (b) { var c = this, d = this.$element.hasClass("fade") ? "fade" : ""; if (this.isShown && this.options.backdrop) { var e = a.support.transition && d; this.$backdrop = a('<div class="modal-backdrop ' + d + '" />').appendTo(document.body), this.$backdrop.click(this.options.backdrop == "static" ? a.proxy(this.$element[0].focus, this.$element[0]) : a.proxy(this.hide, this)), e && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"); if (!b) return; e ? this.$backdrop.one(a.support.transition.end, b) : b() } else !this.isShown && this.$backdrop ? (this.$backdrop.removeClass("in"), a.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one(a.support.transition.end, b) : b()) : b && b() } }; var c = a.fn.modal; a.fn.modal = function (c) { return this.each(function () { var d = a(this), e = d.data("modal"), f = a.extend({}, a.fn.modal.defaults, d.data(), typeof c == "object" && c); e || d.data("modal", e = new b(this, f)), typeof c == "string" ? e[c]() : f.show && e.show() }) }, a.fn.modal.defaults = { backdrop: !0, keyboard: !0, show: !0 }, a.fn.modal.Constructor = b, a.fn.modal.noConflict = function () { return a.fn.modal = c, this }, a(document).on("click.modal.data-api", '[data-toggle="modal"]', function (b) { var c = a(this), d = c.attr("href"), e = a(c.attr("data-target") || d && d.replace(/.*(?=#[^\s]+$)/, "")), f = e.data("modal") ? "toggle" : a.extend({ remote: !/#/.test(d) && d }, e.data(), c.data()); b.preventDefault(), e.modal(f).one("hide", function () { c.focus() }) }) }(jQuery), !function (a) { var b = function (a, b) { this.init("tooltip", a, b) }; b.prototype = { constructor: b, init: function (b, c, d) { var e, f, g, h, i; this.type = b, this.$element = a(c), this.options = this.getOptions(d), this.enabled = !0, g = this.options.trigger.split(" "); for (i = g.length; i--;) h = g[i], h == "click" ? this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this)) : h != "manual" && (e = h == "hover" ? "mouseenter" : "focus", f = h == "hover" ? "mouseleave" : "blur", this.$element.on(e + "." + this.type, this.options.selector, a.proxy(this.enter, this)), this.$element.on(f + "." + this.type, this.options.selector, a.proxy(this.leave, this))); this.options.selector ? this._options = a.extend({}, this.options, { trigger: "manual", selector: "" }) : this.fixTitle() }, getOptions: function (b) { return b = a.extend({}, a.fn[this.type].defaults, this.$element.data(), b), b.delay && typeof b.delay == "number" && (b.delay = { show: b.delay, hide: b.delay }), b }, enter: function (b) { var c = a.fn[this.type].defaults, d = {}, e; this._options && a.each(this._options, function (a, b) { c[a] != b && (d[a] = b) }, this), e = a(b.currentTarget)[this.type](d).data(this.type); if (!e.options.delay || !e.options.delay.show) return e.show(); clearTimeout(this.timeout), e.hoverState = "in", this.timeout = setTimeout(function () { e.hoverState == "in" && e.show() }, e.options.delay.show) }, leave: function (b) { var c = a(b.currentTarget)[this.type](this._options).data(this.type); this.timeout && clearTimeout(this.timeout); if (!c.options.delay || !c.options.delay.hide) return c.hide(); c.hoverState = "out", this.timeout = setTimeout(function () { c.hoverState == "out" && c.hide() }, c.options.delay.hide) }, show: function () { var b, c, d, e, f, g, h = a.Event("show"); if (this.hasContent() && this.enabled) { this.$element.trigger(h); if (h.isDefaultPrevented()) return; b = this.tip(), this.setContent(), this.options.animation && b.addClass("fade"), f = typeof this.options.placement == "function" ? this.options.placement.call(this, b[0], this.$element[0]) : this.options.placement, b.detach().css({ top: 0, left: 0, display: "block" }), this.options.container ? b.appendTo(this.options.container) : b.insertAfter(this.$element), c = this.getPosition(), d = b[0].offsetWidth, e = b[0].offsetHeight; switch (f) { case "bottom": g = { top: c.top + c.height, left: c.left + c.width / 2 - d / 2 }; break; case "top": g = { top: c.top - e, left: c.left + c.width / 2 - d / 2 }; break; case "left": g = { top: c.top + c.height / 2 - e / 2, left: c.left - d }; break; case "right": g = { top: c.top + c.height / 2 - e / 2, left: c.left + c.width } } this.applyPlacement(g, f), this.$element.trigger("shown") } }, applyPlacement: function (a, b) { var c = this.tip(), d = c[0].offsetWidth, e = c[0].offsetHeight, f, g, h, i; c.offset(a).addClass(b).addClass("in"), f = c[0].offsetWidth, g = c[0].offsetHeight, b == "top" && g != e && (a.top = a.top + e - g, i = !0), b == "bottom" || b == "top" ? (h = 0, a.left < 0 && (h = a.left * -2, a.left = 0, c.offset(a), f = c[0].offsetWidth, g = c[0].offsetHeight), this.replaceArrow(h - d + f, f, "left")) : this.replaceArrow(g - e, g, "top"), i && c.offset(a) }, replaceArrow: function (a, b, c) { this.arrow().css(c, a ? 50 * (1 - a / b) + "%" : "") }, setContent: function () { var a = this.tip(), b = this.getTitle(); a.find(".tooltip-inner")[this.options.html ? "html" : "text"](b), a.removeClass("fade in top bottom left right") }, hide: function () { function e() { var b = setTimeout(function () { c.off(a.support.transition.end).detach() }, 500); c.one(a.support.transition.end, function () { clearTimeout(b), c.detach() }) } var b = this, c = this.tip(), d = a.Event("hide"); this.$element.trigger(d); if (d.isDefaultPrevented()) return; return c.removeClass("in"), a.support.transition && this.$tip.hasClass("fade") ? e() : c.detach(), this.$element.trigger("hidden"), this }, fixTitle: function () { var a = this.$element; (a.attr("title") || typeof a.attr("data-original-title") != "string") && a.attr("data-original-title", a.attr("title") || "").attr("title", "") }, hasContent: function () { return this.getTitle() }, getPosition: function () { var b = this.$element[0]; return a.extend({}, typeof b.getBoundingClientRect == "function" ? b.getBoundingClientRect() : { width: b.offsetWidth, height: b.offsetHeight }, this.$element.offset()) }, getTitle: function () { var a, b = this.$element, c = this.options; return a = b.attr("data-original-title") || (typeof c.title == "function" ? c.title.call(b[0]) : c.title), a }, tip: function () { return this.$tip = this.$tip || a(this.options.template) }, arrow: function () { return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") }, validate: function () { this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null) }, enable: function () { this.enabled = !0 }, disable: function () { this.enabled = !1 }, toggleEnabled: function () { this.enabled = !this.enabled }, toggle: function (b) { var c = b ? a(b.currentTarget)[this.type](this._options).data(this.type) : this; c.tip().hasClass("in") ? c.hide() : c.show() }, destroy: function () { this.hide().$element.off("." + this.type).removeData(this.type) } }; var c = a.fn.tooltip; a.fn.tooltip = function (c) { return this.each(function () { var d = a(this), e = d.data("tooltip"), f = typeof c == "object" && c; e || d.data("tooltip", e = new b(this, f)), typeof c == "string" && e[c]() }) }, a.fn.tooltip.Constructor = b, a.fn.tooltip.defaults = { animation: !0, placement: "top", selector: !1, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger: "hover focus", title: "", delay: 0, html: !1, container: !1 }, a.fn.tooltip.noConflict = function () { return a.fn.tooltip = c, this } }(jQuery), !function (e) { "use strict"; var t = function (t, n) { this.$element = e(t), this.options = e.extend({}, e.fn.collapse.defaults, n), this.options.parent && (this.$parent = e(this.options.parent)), this.options.toggle && this.toggle() }; t.prototype = { constructor: t, dimension: function () { var e = this.$element.hasClass("width"); return e ? "width" : "height" }, show: function () { var t, n, r, i; if (this.transitioning || this.$element.hasClass("in")) return; t = this.dimension(), n = e.camelCase(["scroll", t].join("-")), r = this.$parent && this.$parent.find("> .accordion-group > .in"); if (r && r.length) { i = r.data("collapse"); if (i && i.transitioning) return; r.collapse("hide"), i || r.data("collapse", null) } this.$element[t](0), this.transition("addClass", e.Event("show"), "shown"), e.support.transition && this.$element[t](this.$element[0][n]) }, hide: function () { var t; if (this.transitioning || !this.$element.hasClass("in")) return; t = this.dimension(), this.reset(this.$element[t]()), this.transition("removeClass", e.Event("hide"), "hidden"), this.$element[t](0) }, reset: function (e) { var t = this.dimension(); return this.$element.removeClass("collapse")[t](e || "auto")[0].offsetWidth, this.$element[e !== null ? "addClass" : "removeClass"]("collapse"), this }, transition: function (t, n, r) { var i = this, s = function () { n.type == "show" && i.reset(), i.transitioning = 0, i.$element.trigger(r) }; this.$element.trigger(n); if (n.isDefaultPrevented()) return; this.transitioning = 1, this.$element[t]("in"), e.support.transition && this.$element.hasClass("collapse") ? this.$element.one(e.support.transition.end, s) : s() }, toggle: function () { this[this.$element.hasClass("in") ? "hide" : "show"]() } }; var n = e.fn.collapse; e.fn.collapse = function (n) { return this.each(function () { var r = e(this), i = r.data("collapse"), s = e.extend({}, e.fn.collapse.defaults, r.data(), typeof n == "object" && n); i || r.data("collapse", i = new t(this, s)), typeof n == "string" && i[n]() }) }, e.fn.collapse.defaults = { toggle: !0 }, e.fn.collapse.Constructor = t, e.fn.collapse.noConflict = function () { return e.fn.collapse = n, this }, e(document).on("click.collapse.data-api", "[data-toggle=collapse]", function (t) { var n = e(this), r, i = n.attr("data-target") || t.preventDefault() || (r = n.attr("href")) && r.replace(/.*(?=#[^\s]+$)/, ""), s = e(i).data("collapse") ? "toggle" : n.data(); n[e(i).hasClass("in") ? "addClass" : "removeClass"]("collapsed"), e(i).collapse(s) }) }(jQuery), !function (a) { var b = function (a, b) { this.init("popover", a, b) }; b.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype, { constructor: b, setContent: function () { var a = this.tip(), b = this.getTitle(), c = this.getContent(); a.find(".popover-title")[this.options.html ? "html" : "text"](b), a.find(".popover-content")[this.options.html ? "html" : "text"](c), a.removeClass("fade top bottom left right in") }, hasContent: function () { return this.getTitle() || this.getContent() }, getContent: function () { var a, b = this.$element, c = this.options; return a = (typeof c.content == "function" ? c.content.call(b[0]) : c.content) || b.attr("data-content"), a }, tip: function () { return this.$tip || (this.$tip = a(this.options.template)), this.$tip }, destroy: function () { this.hide().$element.off("." + this.type).removeData(this.type) } }); var c = a.fn.popover; a.fn.popover = function (c) { return this.each(function () { var d = a(this), e = d.data("popover"), f = typeof c == "object" && c; e || d.data("popover", e = new b(this, f)), typeof c == "string" && e[c]() }) }, a.fn.popover.Constructor = b, a.fn.popover.defaults = a.extend({}, a.fn.tooltip.defaults, { placement: "right", trigger: "click", content: "", template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' }), a.fn.popover.noConflict = function () { return a.fn.popover = c, this } }(HawkSearch.jQuery)
        }

        /* ========================================================================
		 * Bootstrap: tooltip.js v3.3.4
		 * http://getbootstrap.com/javascript/#tooltip
		 * Inspired by the original jQuery.tipsy by Jason Frame
		 * ========================================================================
		 * Copyright 2011-2015 Twitter, Inc.
		 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
		 * ======================================================================== */
        +function (e) {
            var d = function (b, a) {
                this.$element = this.hoverState = this.timeout = this.enabled = this.options = this.type = null; this.init("tooltip", b, a)
            }; d.VERSION = "3.3.4"; d.TRANSITION_DURATION = 150; d.DEFAULTS = {
                animation: !0, placement: "top", selector: !1, template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger: "hover focus", title: "", delay: 0, html: !1, container: !1, viewport: { selector: "body", padding: 0 }
            }; d.prototype.init = function (b, a, c) {
                this.enabled =
                !0; this.type = b; this.$element = e(a); this.options = this.getOptions(c); this.$viewport = this.options.viewport && e(this.options.viewport.selector || this.options.viewport); if (this.$element[0] instanceof document.constructor && !this.options.selector) throw Error("`selector` option must be specified when initializing " + this.type + " on the window.document object!"); b = this.options.trigger.split(" "); for (a = b.length; a--;) if (c = b[a], "click" == c) this.$element.on("click." + this.type, this.options.selector, e.proxy(this.toggle,
                this)); else if ("manual" != c) {
                    var f = "hover" == c ? "mouseleave" : "focusout"; this.$element.on(("hover" == c ? "mouseenter" : "focusin") + "." + this.type, this.options.selector, e.proxy(this.enter, this)); this.$element.on(f + "." + this.type, this.options.selector, e.proxy(this.leave, this))
                } this.options.selector ? this._options = e.extend({}, this.options, { trigger: "manual", selector: "" }) : this.fixTitle()
            }; d.prototype.getDefaults = function () {
                return d.DEFAULTS
            }; d.prototype.getOptions = function (b) {
                b = e.extend({
                }, this.getDefaults(), this.$element.data(),
                b); b.delay && "number" == typeof b.delay && (b.delay = { show: b.delay, hide: b.delay }); return b
            }; d.prototype.getDelegateOptions = function () {
                var b = {}, a = this.getDefaults(); this._options && e.each(this._options, function (c, f) { a[c] != f && (b[c] = f) }); return b
            }; d.prototype.enter = function (b) {
                var a = b instanceof this.constructor ? b : e(b.currentTarget).data("bs." + this.type); if (a && a.$tip && a.$tip.is(":visible")) a.hoverState = "in"; else {
                    a || (a = new this.constructor(b.currentTarget, this.getDelegateOptions()), e(b.currentTarget).data("bs." +
                    this.type, a)); clearTimeout(a.timeout); a.hoverState = "in"; if (!a.options.delay || !a.options.delay.show) return a.show(); a.timeout = setTimeout(function () { "in" == a.hoverState && a.show() }, a.options.delay.show)
                }
            }; d.prototype.leave = function (b) {
                var a = b instanceof this.constructor ? b : e(b.currentTarget).data("bs." + this.type); a || (a = new this.constructor(b.currentTarget, this.getDelegateOptions()), e(b.currentTarget).data("bs." + this.type, a)); clearTimeout(a.timeout); a.hoverState = "out"; if (!a.options.delay || !a.options.delay.hide) return a.hide();
                a.timeout = setTimeout(function () { "out" == a.hoverState && a.hide() }, a.options.delay.hide)
            }; d.prototype.show = function () {
                var b = e.Event("show.bs." + this.type); if (this.hasContent() && this.enabled) {
                    this.$element.trigger(b); var a = e.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]); if (!b.isDefaultPrevented() && a) {
                        var c = this, b = this.tip(), a = this.getUID(this.type); this.setContent(); b.attr("id", a); this.$element.attr("aria-describedby", a); this.options.animation && b.addClass("fade"); var a = "function" ==
                        typeof this.options.placement ? this.options.placement.call(this, b[0], this.$element[0]) : this.options.placement, f = /\s?auto?\s?/i, l = f.test(a); l && (a = a.replace(f, "") || "top"); b.detach().css({ top: 0, left: 0, display: "block" }).addClass(a).data("bs." + this.type, this); this.options.container ? b.appendTo(this.options.container) : b.insertAfter(this.$element); var f = this.getPosition(), h = b[0].offsetWidth, g = b[0].offsetHeight; if (l) {
                            var l = a, k = this.options.container ? e(this.options.container) : this.$element.parent(), k = this.getPosition(k),
                            a = "bottom" == a && f.bottom + g > k.bottom ? "top" : "top" == a && f.top - g < k.top ? "bottom" : "right" == a && f.right + h > k.width ? "left" : "left" == a && f.left - h < k.left ? "right" : a; b.removeClass(l).addClass(a)
                        } f = this.getCalculatedOffset(a, f, h, g); this.applyPlacement(f, a); a = function () {
                            var a = c.hoverState; c.$element.trigger("shown.bs." + c.type); c.hoverState = null; "out" == a && c.leave(c)
                        }; e.support.transition && this.$tip.hasClass("fade") ? b.one("bsTransitionEnd", a).emulateTransitionEnd(d.TRANSITION_DURATION) : a()
                    }
                }
            }; d.prototype.applyPlacement =
            function (b, a) {
                var c = this.tip(), f = c[0].offsetWidth, d = c[0].offsetHeight, h = parseInt(c.css("margin-top"), 10), g = parseInt(c.css("margin-left"), 10); isNaN(h) && (h = 0); isNaN(g) && (g = 0); b.top += h; b.left += g; e.offset.setOffset(c[0], e.extend({ using: function (a) { c.css({ top: Math.round(a.top), left: Math.round(a.left) }) } }, b), 0); c.addClass("in"); var g = c[0].offsetWidth, k = c[0].offsetHeight; "top" == a && k != d && (b.top = b.top + d - k); var m = this.getViewportAdjustedDelta(a, b, g, k); m.left ? b.left += m.left : b.top += m.top; f = (h = /top|bottom/.test(a)) ?
                2 * m.left - f + g : 2 * m.top - d + k; d = h ? "offsetWidth" : "offsetHeight"; c.offset(b); this.replaceArrow(f, c[0][d], h)
            }; d.prototype.replaceArrow = function (b, a, c) {
                this.arrow().css(c ? "left" : "top", 50 * (1 - b / a) + "%").css(c ? "top" : "left", "")
            }; d.prototype.setContent = function () {
                var b = this.tip(), a = this.getTitle(); b.find(".tooltip-inner")[this.options.html ? "html" : "text"](a); b.removeClass("fade in top bottom left right")
            }; d.prototype.hide = function (b) {
                function a() {
                    "in" != c.hoverState && f.detach(); c.$element.removeAttr("aria-describedby").trigger("hidden.bs." +
                    c.type); b && b()
                } var c = this, f = e(this.$tip), l = e.Event("hide.bs." + this.type); this.$element.trigger(l); if (!l.isDefaultPrevented()) return f.removeClass("in"), e.support.transition && f.hasClass("fade") ? f.one("bsTransitionEnd", a).emulateTransitionEnd(d.TRANSITION_DURATION) : a(), this.hoverState = null, this
            }; d.prototype.fixTitle = function () {
                var b = this.$element; (b.attr("title") || "string" != typeof b.attr("data-original-title")) && b.attr("data-original-title", b.attr("title") || "").attr("title", "")
            }; d.prototype.hasContent =
            function () {
                return this.getTitle()
            }; d.prototype.getPosition = function (b) {
                b = b || this.$element; var a = b[0], c = "BODY" == a.tagName, a = a.getBoundingClientRect(); null == a.width && (a = e.extend({}, a, { width: a.right - a.left, height: a.bottom - a.top })); var d = c ? { top: 0, left: 0 } : b.offset(); b = { scroll: c ? document.documentElement.scrollTop || document.body.scrollTop : b.scrollTop() }; c = c ? { width: e(window).width(), height: e(window).height() } : null; return e.extend({}, a, b, c, d)
            }; d.prototype.getCalculatedOffset = function (b, a, c, d) {
                return "bottom" ==
                b ? { top: a.top + a.height, left: a.left + a.width / 2 - c / 2 } : "top" == b ? { top: a.top - d, left: a.left + a.width / 2 - c / 2 } : "left" == b ? { top: a.top + a.height / 2 - d / 2, left: a.left - c } : {
                    top: a.top + a.height / 2 - d / 2, left: a.left + a.width
                }
            }; d.prototype.getViewportAdjustedDelta = function (b, a, c, d) {
                var e = {
                    top: 0, left: 0
                }; if (!this.$viewport) return e; var h = this.options.viewport && this.options.viewport.padding || 0, g = this.getPosition(this.$viewport); /right|left/.test(b) ? (c = a.top - h - g.scroll, a = a.top + h - g.scroll + d, c < g.top ? e.top = g.top - c : a > g.top + g.height && (e.top =
                g.top + g.height - a)) : (d = a.left - h, a = a.left + h + c, d < g.left ? e.left = g.left - d : a > g.width && (e.left = g.left + g.width - a)); return e
            }; d.prototype.getTitle = function () {
                var b = this.$element, a = this.options; return b.attr("data-original-title") || ("function" == typeof a.title ? a.title.call(b[0]) : a.title)
            }; d.prototype.getUID = function (b) {
                do b += ~~(1E6 * Math.random()); while (document.getElementById(b)); return b
            }; d.prototype.tip = function () {
                return this.$tip = this.$tip || e(this.options.template)
            }; d.prototype.arrow = function () {
                return this.$arrow =
                this.$arrow || this.tip().find(".tooltip-arrow")
            }; d.prototype.enable = function () {
                this.enabled = !0
            }; d.prototype.disable = function () {
                this.enabled = !1
            }; d.prototype.toggleEnabled = function () {
                this.enabled = !this.enabled
            }; d.prototype.toggle = function (b) {
                var a = this; b && (a = e(b.currentTarget).data("bs." + this.type), a || (a = new this.constructor(b.currentTarget, this.getDelegateOptions()), e(b.currentTarget).data("bs." + this.type, a))); a.tip().hasClass("in") ? a.leave(a) : a.enter(a)
            }; d.prototype.destroy = function () {
                var b = this; clearTimeout(this.timeout);
                this.hide(function () { b.$element.off("." + b.type).removeData("bs." + b.type) })
            }; var n = e.fn.tooltip; e.fn.tooltip = function (b) {
                return this.each(function () { var a = e(this), c = a.data("bs.tooltip"), f = "object" == typeof b && b; if (c || !/destroy|hide/.test(b)) if (c || a.data("bs.tooltip", c = new d(this, f)), "string" == typeof b) c[b]() })
            }; e.fn.tooltip.Constructor = d; e.fn.tooltip.noConflict = function () {
                e.fn.tooltip = n; return this
            }
        }(jQuery);


        /* ========================================================================
		 * Bootstrap: popover.js v3.3.4
		 * http://getbootstrap.com/javascript/#popovers
		 * ========================================================================
		 * Copyright 2011-2015 Twitter, Inc.
		 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
		 * ======================================================================== */
        +function (b) {
            var a = function (c, a) {
                this.init("popover", c, a)
            }; if (!b.fn.tooltip) throw Error("Popover requires tooltip.js"); a.VERSION = "3.3.4"; a.DEFAULTS = b.extend({}, b.fn.tooltip.Constructor.DEFAULTS, { placement: "right", trigger: "click", content: "", template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' }); a.prototype = b.extend({}, b.fn.tooltip.Constructor.prototype); a.prototype.constructor = a; a.prototype.getDefaults = function () {
                return a.DEFAULTS
            };
            a.prototype.setContent = function () {
                var c = this.tip(), a = this.getTitle(), b = this.getContent(); c.find(".popover-title")[this.options.html ? "html" : "text"](a); c.find(".popover-content").children().detach().end()[this.options.html ? "string" == typeof b ? "html" : "append" : "text"](b); c.removeClass("fade top bottom left right in"); c.find(".popover-title").html() || c.find(".popover-title").hide()
            }; a.prototype.hasContent = function () {
                return this.getTitle() || this.getContent()
            }; a.prototype.getContent = function () {
                var a = this.$element,
                b = this.options; return a.attr("data-content") || ("function" == typeof b.content ? b.content.call(a[0]) : b.content)
            }; a.prototype.arrow = function () {
                return this.$arrow = this.$arrow || this.tip().find(".arrow")
            }; var e = b.fn.popover; b.fn.popover = function (c) {
                return this.each(function () { var f = b(this), d = f.data("bs.popover"), e = "object" == typeof c && c; if (d || !/destroy|hide/.test(c)) if (d || f.data("bs.popover", d = new a(this, e)), "string" == typeof c) d[c]() })
            }; b.fn.popover.Constructor = a; b.fn.popover.noConflict = function () {
                b.fn.popover =
            e; return this
            }
        }(jQuery);


        /**
         * bootbox.js v4.2.0
         *
         * http://bootboxjs.com/license.txt
         */
        !function (a, b) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], b) : "object" == typeof exports ? module.exports = b(require("jquery")) : HawkSearch.bootbox = b(HawkSearch.jQuery) }(this, function a(b, c) { "use strict"; function d(a) { var b = q[o.locale]; return b ? b[a] : q.en[a] } function e(a, c, d) { a.stopPropagation(), a.preventDefault(); var e = b.isFunction(d) && d(a) === !1; e || c.modal("hide") } function f(a) { var b, c = 0; for (b in a) c++; return c } function g(a, c) { var d = 0; b.each(a, function (a, b) { c(a, b, d++) }) } function h(a) { var c, d; if ("object" != typeof a) throw new Error("Please supply an object of options"); if (!a.message) throw new Error("Please specify a message"); return a = b.extend({}, o, a), a.buttons || (a.buttons = {}), a.backdrop = a.backdrop ? "static" : !1, c = a.buttons, d = f(c), g(c, function (a, e, f) { if (b.isFunction(e) && (e = c[a] = { callback: e }), "object" !== b.type(e)) throw new Error("button with key " + a + " must be an object"); e.label || (e.label = a), e.className || (e.className = 2 >= d && f === d - 1 ? "btn-primary" : "btn-default") }), a } function i(a, b) { var c = a.length, d = {}; if (1 > c || c > 2) throw new Error("Invalid argument length"); return 2 === c || "string" == typeof a[0] ? (d[b[0]] = a[0], d[b[1]] = a[1]) : d = a[0], d } function j(a, c, d) { return b.extend(!0, {}, a, i(c, d)) } function k(a, b, c, d) { var e = { className: "bootbox-" + a, buttons: l.apply(null, b) }; return m(j(e, d, c), b) } function l() { for (var a = {}, b = 0, c = arguments.length; c > b; b++) { var e = arguments[b], f = e.toLowerCase(), g = e.toUpperCase(); a[f] = { label: d(g) } } return a } function m(a, b) { var d = {}; return g(b, function (a, b) { d[b] = !0 }), g(a.buttons, function (a) { if (d[a] === c) throw new Error("button key " + a + " is not allowed (options are " + b.join("\n") + ")") }), a } var n = { dialog: "<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>", header: "<div class='modal-header'><h4 class='modal-title'></h4></div>", footer: "<div class='modal-footer'></div>", closeButton: "<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;</button>", form: "<form class='bootbox-form'></form>", inputs: { text: "<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />", textarea: "<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>", email: "<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />", select: "<select class='bootbox-input bootbox-input-select form-control'></select>", checkbox: "<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>", date: "<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />", time: "<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />", number: "<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />", password: "<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />" } }, o = { locale: "en", backdrop: !0, animate: !0, className: null, closeButton: !0, show: !0, container: "body" }, p = {}; p.alert = function () { var a; if (a = k("alert", ["ok"], ["message", "callback"], arguments), a.callback && !b.isFunction(a.callback)) throw new Error("alert requires callback property to be a function when provided"); return a.buttons.ok.callback = a.onEscape = function () { return b.isFunction(a.callback) ? a.callback() : !0 }, p.dialog(a) }, p.confirm = function () { var a; if (a = k("confirm", ["cancel", "confirm"], ["message", "callback"], arguments), a.buttons.cancel.callback = a.onEscape = function () { return a.callback(!1) }, a.buttons.confirm.callback = function () { return a.callback(!0) }, !b.isFunction(a.callback)) throw new Error("confirm requires a callback"); return p.dialog(a) }, p.prompt = function () { var a, d, e, f, h, i, k; f = b(n.form), d = { className: "bootbox-prompt", buttons: l("cancel", "confirm"), value: "", inputType: "text" }, a = m(j(d, arguments, ["title", "callback"]), ["cancel", "confirm"]), i = a.show === c ? !0 : a.show; var o = ["date", "time", "number"], q = document.createElement("input"); if (q.setAttribute("type", a.inputType), o[a.inputType] && (a.inputType = q.type), a.message = f, a.buttons.cancel.callback = a.onEscape = function () { return a.callback(null) }, a.buttons.confirm.callback = function () { var c; switch (a.inputType) { case "text": case "textarea": case "email": case "select": case "date": case "time": case "number": case "password": c = h.val(); break; case "checkbox": var d = h.find("input:checked"); c = [], g(d, function (a, d) { c.push(b(d).val()) }) } return a.callback(c) }, a.show = !1, !a.title) throw new Error("prompt requires a title"); if (!b.isFunction(a.callback)) throw new Error("prompt requires a callback"); if (!n.inputs[a.inputType]) throw new Error("invalid prompt type"); switch (h = b(n.inputs[a.inputType]), a.inputType) { case "text": case "textarea": case "email": case "date": case "time": case "number": case "password": h.val(a.value); break; case "select": var r = {}; if (k = a.inputOptions || [], !k.length) throw new Error("prompt with select requires options"); g(k, function (a, d) { var e = h; if (d.value === c || d.text === c) throw new Error("given options in wrong format"); d.group && (r[d.group] || (r[d.group] = b("<optgroup/>").attr("label", d.group)), e = r[d.group]), e.append("<option value='" + d.value + "'>" + d.text + "</option>") }), g(r, function (a, b) { h.append(b) }), h.val(a.value); break; case "checkbox": var s = b.isArray(a.value) ? a.value : [a.value]; if (k = a.inputOptions || [], !k.length) throw new Error("prompt with checkbox requires options"); if (!k[0].value || !k[0].text) throw new Error("given options in wrong format"); h = b("<div/>"), g(k, function (c, d) { var e = b(n.inputs[a.inputType]); e.find("input").attr("value", d.value), e.find("label").append(d.text), g(s, function (a, b) { b === d.value && e.find("input").prop("checked", !0) }), h.append(e) }) } return a.placeholder && h.attr("placeholder", a.placeholder), a.pattern && h.attr("pattern", a.pattern), f.append(h), f.on("submit", function (a) { a.preventDefault(), e.find(".btn-primary").click() }), e = p.dialog(a), e.off("shown.bs.modal"), e.on("shown.bs.modal", function () { h.focus() }), i === !0 && e.modal("show"), e }, p.dialog = function (a) { a = h(a); var c = b(n.dialog), d = c.find(".modal-body"), f = a.buttons, i = "", j = { onEscape: a.onEscape }; if (g(f, function (a, b) { i += "<button data-bb-handler='" + a + "' type='button' class='btn " + b.className + "'>" + b.label + "</button>", j[a] = b.callback }), d.find(".bootbox-body").html(a.message), a.animate === !0 && c.addClass("fade"), a.className && c.addClass(a.className), a.title && d.before(n.header), a.closeButton) { var k = b(n.closeButton); a.title ? c.find(".modal-header").prepend(k) : k.css("margin-top", "-10px").prependTo(d) } return a.title && c.find(".modal-title").html(a.title), i.length && (d.after(n.footer), c.find(".modal-footer").html(i)), c.on("hidden.bs.modal", function (a) { a.target === this && c.remove() }), c.on("shown.bs.modal", function () { c.find(".btn-primary:first").focus() }), c.on("escape.close.bb", function (a) { j.onEscape && e(a, c, j.onEscape) }), c.on("click", ".modal-footer button", function (a) { var d = b(this).data("bb-handler"); e(a, c, j[d]) }), c.on("click", ".bootbox-close-button", function (a) { e(a, c, j.onEscape) }), c.on("keyup", function (a) { 27 === a.which && c.trigger("escape.close.bb") }), b(a.container).append(c), c.modal({ backdrop: a.backdrop, keyboard: !1, show: !1 }), a.show && c.modal("show"), c }, p.setDefaults = function () { var a = {}; 2 === arguments.length ? a[arguments[0]] = arguments[1] : a = arguments[0], b.extend(o, a) }, p.hideAll = function () { b(".bootbox").modal("hide") }; var q = { br: { OK: "OK", CANCEL: "Cancelar", CONFIRM: "Sim" }, da: { OK: "OK", CANCEL: "Annuller", CONFIRM: "Accepter" }, de: { OK: "OK", CANCEL: "Abbrechen", CONFIRM: "Akzeptieren" }, en: { OK: "OK", CANCEL: "Cancel", CONFIRM: "OK" }, es: { OK: "OK", CANCEL: "Cancelar", CONFIRM: "Aceptar" }, fi: { OK: "OK", CANCEL: "Peruuta", CONFIRM: "OK" }, fr: { OK: "OK", CANCEL: "Annuler", CONFIRM: "D'accord" }, he: { OK: "אישור", CANCEL: "ביטול", CONFIRM: "אישור" }, it: { OK: "OK", CANCEL: "Annulla", CONFIRM: "Conferma" }, lt: { OK: "Gerai", CANCEL: "Atšaukti", CONFIRM: "Patvirtinti" }, lv: { OK: "Labi", CANCEL: "Atcelt", CONFIRM: "Apstiprināt" }, nl: { OK: "OK", CANCEL: "Annuleren", CONFIRM: "Accepteren" }, no: { OK: "OK", CANCEL: "Avbryt", CONFIRM: "OK" }, pl: { OK: "OK", CANCEL: "Anuluj", CONFIRM: "Potwierdź" }, ru: { OK: "OK", CANCEL: "Отмена", CONFIRM: "Применить" }, sv: { OK: "OK", CANCEL: "Avbryt", CONFIRM: "OK" }, tr: { OK: "Tamam", CANCEL: "İptal", CONFIRM: "Onayla" }, zh_CN: { OK: "OK", CANCEL: "取消", CONFIRM: "确认" }, zh_TW: { OK: "OK", CANCEL: "取消", CONFIRM: "確認" } }; return p.init = function (c) { return a(c || b) }, p });

        /*
         * debouncedresize: special jQuery event that happens once after a window resize
         *
         * latest version and complete README available on Github:
         * https://github.com/louisremi/jquery-smartresize
         *
         * Copyright 2012 @louis_remi
         * Licensed under the MIT license.
         *
         * This saved you an hour of work? 
         * Send me music http://www.amazon.co.uk/wishlist/HNTU0468LQON
         */
        (function ($) {

            var $event = $.event,
                $special,
                resizeTimeout;

            $special = $event.special.debouncedresize = {
                setup: function () {
                    $(this).on("resize", $special.handler);
                },
                teardown: function () {
                    $(this).off("resize", $special.handler);
                },
                handler: function (event, execAsap) {
                    // Save the context
                    var context = this,
                        args = arguments,
                        dispatch = function () {
                            // set correct event type
                            event.type = "debouncedresize";
                            $event.dispatch.apply(context, args);
                        };

                    if (resizeTimeout) {
                        clearTimeout(resizeTimeout);
                    }

                    execAsap ?
                        dispatch() :
                        resizeTimeout = setTimeout(dispatch, $special.threshold);
                },
                threshold: 150
            };

        })(jQuery);

        /*
             _ _      _       _
         ___| (_) ___| | __  (_)___
        / __| | |/ __| |/ /  | / __|
        \__ \ | | (__|   < _ | \__ \
        |___/_|_|\___|_|\_(_)/ |___/
                           |__/

         Version: 1.4.1
          Author: Ken Wheeler
         Website: http://kenwheeler.github.io
            Docs: http://kenwheeler.github.io/slick
            Repo: http://github.com/kenwheeler/slick
          Issues: http://github.com/kenwheeler/slick/issues

         */

        !function (a) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], a) : "undefined" != typeof exports ? module.exports = a(require("jquery")) : a(jQuery) }(function (a) {
            "use strict"; var b = window.Slick || {
            }; b = function () { function c(c, d) { var f, g, h, e = this; if (e.defaults = { accessibility: !0, adaptiveHeight: !1, appendArrows: a(c), appendDots: a(c), arrows: !0, asNavFor: null, prevArrow: '<button type="button" data-role="none" class="slick-prev">Previous</button>', nextArrow: '<button type="button" data-role="none" class="slick-next">Next</button>', autoplay: !1, autoplaySpeed: 3e3, centerMode: !1, centerPadding: "50px", cssEase: "ease", customPaging: function (a, b) { return '<button type="button" data-role="none">' + (b + 1) + "</button>" }, dots: !1, dotsClass: "slick-dots", draggable: !0, easing: "linear", edgeFriction: .35, fade: !1, focusOnSelect: !1, infinite: !0, initialSlide: 0, lazyLoad: "ondemand", mobileFirst: !1, pauseOnHover: !0, pauseOnDotsHover: !1, respondTo: "window", responsive: null, rtl: !1, slide: "", slidesToShow: 1, slidesToScroll: 1, speed: 500, swipe: !0, swipeToSlide: !1, touchMove: !0, touchThreshold: 5, useCSS: !0, variableWidth: !1, vertical: !1, waitForAnimate: !0 }, e.initials = { animating: !1, dragging: !1, autoPlayTimer: null, currentDirection: 0, currentLeft: null, currentSlide: 0, direction: 1, $dots: null, listWidth: null, listHeight: null, loadIndex: 0, $nextArrow: null, $prevArrow: null, slideCount: null, slideWidth: null, $slideTrack: null, $slides: null, sliding: !1, slideOffset: 0, swipeLeft: null, $list: null, touchObject: {}, transformsEnabled: !1 }, a.extend(e, e.initials), e.activeBreakpoint = null, e.animType = null, e.animProp = null, e.breakpoints = [], e.breakpointSettings = [], e.cssTransitions = !1, e.hidden = "hidden", e.paused = !1, e.positionProp = null, e.respondTo = null, e.shouldClick = !0, e.$slider = a(c), e.$slidesCache = null, e.transformType = null, e.transitionType = null, e.visibilityChange = "visibilitychange", e.windowWidth = 0, e.windowTimer = null, f = a(c).data("slick") || {}, e.options = a.extend({}, e.defaults, f, d), e.currentSlide = e.options.initialSlide, e.originalSettings = e.options, g = e.options.responsive || null, g && g.length > -1) { e.respondTo = e.options.respondTo || "window"; for (h in g) g.hasOwnProperty(h) && (e.breakpoints.push(g[h].breakpoint), e.breakpointSettings[g[h].breakpoint] = g[h].settings); e.breakpoints.sort(function (a, b) { return e.options.mobileFirst === !0 ? a - b : b - a }) } "undefined" != typeof document.mozHidden ? (e.hidden = "mozHidden", e.visibilityChange = "mozvisibilitychange") : "undefined" != typeof document.msHidden ? (e.hidden = "msHidden", e.visibilityChange = "msvisibilitychange") : "undefined" != typeof document.webkitHidden && (e.hidden = "webkitHidden", e.visibilityChange = "webkitvisibilitychange"), e.autoPlay = a.proxy(e.autoPlay, e), e.autoPlayClear = a.proxy(e.autoPlayClear, e), e.changeSlide = a.proxy(e.changeSlide, e), e.clickHandler = a.proxy(e.clickHandler, e), e.selectHandler = a.proxy(e.selectHandler, e), e.setPosition = a.proxy(e.setPosition, e), e.swipeHandler = a.proxy(e.swipeHandler, e), e.dragHandler = a.proxy(e.dragHandler, e), e.keyHandler = a.proxy(e.keyHandler, e), e.autoPlayIterator = a.proxy(e.autoPlayIterator, e), e.instanceUid = b++, e.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/, e.init(), e.checkResponsive(!0) } var b = 0; return c }(), b.prototype.addSlide = b.prototype.slickAdd = function (b, c, d) { var e = this; if ("boolean" == typeof c) d = c, c = null; else if (0 > c || c >= e.slideCount) return !1; e.unload(), "number" == typeof c ? 0 === c && 0 === e.$slides.length ? a(b).appendTo(e.$slideTrack) : d ? a(b).insertBefore(e.$slides.eq(c)) : a(b).insertAfter(e.$slides.eq(c)) : d === !0 ? a(b).prependTo(e.$slideTrack) : a(b).appendTo(e.$slideTrack), e.$slides = e.$slideTrack.children(this.options.slide), e.$slideTrack.children(this.options.slide).detach(), e.$slideTrack.append(e.$slides), e.$slides.each(function (b, c) { a(c).attr("data-slick-index", b) }), e.$slidesCache = e.$slides, e.reinit() }, b.prototype.animateHeight = function () { var a = this; if (1 === a.options.slidesToShow && a.options.adaptiveHeight === !0 && a.options.vertical === !1) { var b = a.$slides.eq(a.currentSlide).outerHeight(!0); a.$list.animate({ height: b }, a.options.speed) } }, b.prototype.animateSlide = function (b, c) { var d = {}, e = this; e.animateHeight(), e.options.rtl === !0 && e.options.vertical === !1 && (b = -b), e.transformsEnabled === !1 ? e.options.vertical === !1 ? e.$slideTrack.animate({ left: b }, e.options.speed, e.options.easing, c) : e.$slideTrack.animate({ top: b }, e.options.speed, e.options.easing, c) : e.cssTransitions === !1 ? (e.options.rtl === !0 && (e.currentLeft = -e.currentLeft), a({ animStart: e.currentLeft }).animate({ animStart: b }, { duration: e.options.speed, easing: e.options.easing, step: function (a) { a = Math.ceil(a), e.options.vertical === !1 ? (d[e.animType] = "translate(" + a + "px, 0px)", e.$slideTrack.css(d)) : (d[e.animType] = "translate(0px," + a + "px)", e.$slideTrack.css(d)) }, complete: function () { c && c.call() } })) : (e.applyTransition(), b = Math.ceil(b), d[e.animType] = e.options.vertical === !1 ? "translate3d(" + b + "px, 0px, 0px)" : "translate3d(0px," + b + "px, 0px)", e.$slideTrack.css(d), c && setTimeout(function () { e.disableTransition(), c.call() }, e.options.speed)) }, b.prototype.asNavFor = function (b) { var c = this, d = null !== c.options.asNavFor ? a(c.options.asNavFor).slick("getSlick") : null; null !== d && d.slideHandler(b, !0) }, b.prototype.applyTransition = function (a) { var b = this, c = {}; c[b.transitionType] = b.options.fade === !1 ? b.transformType + " " + b.options.speed + "ms " + b.options.cssEase : "opacity " + b.options.speed + "ms " + b.options.cssEase, b.options.fade === !1 ? b.$slideTrack.css(c) : b.$slides.eq(a).css(c) }, b.prototype.autoPlay = function () { var a = this; a.autoPlayTimer && clearInterval(a.autoPlayTimer), a.slideCount > a.options.slidesToShow && a.paused !== !0 && (a.autoPlayTimer = setInterval(a.autoPlayIterator, a.options.autoplaySpeed)) }, b.prototype.autoPlayClear = function () { var a = this; a.autoPlayTimer && clearInterval(a.autoPlayTimer) }, b.prototype.autoPlayIterator = function () { var a = this; a.options.infinite === !1 ? 1 === a.direction ? (a.currentSlide + 1 === a.slideCount - 1 && (a.direction = 0), a.slideHandler(a.currentSlide + a.options.slidesToScroll)) : (0 === a.currentSlide - 1 && (a.direction = 1), a.slideHandler(a.currentSlide - a.options.slidesToScroll)) : a.slideHandler(a.currentSlide + a.options.slidesToScroll) }, b.prototype.buildArrows = function () { var b = this; b.options.arrows === !0 && b.slideCount > b.options.slidesToShow && (b.$prevArrow = a(b.options.prevArrow), b.$nextArrow = a(b.options.nextArrow), b.htmlExpr.test(b.options.prevArrow) && b.$prevArrow.appendTo(b.options.appendArrows), b.htmlExpr.test(b.options.nextArrow) && b.$nextArrow.appendTo(b.options.appendArrows), b.options.infinite !== !0 && b.$prevArrow.addClass("slick-disabled")) }, b.prototype.buildDots = function () { var c, d, b = this; if (b.options.dots === !0 && b.slideCount > b.options.slidesToShow) { for (d = '<ul class="' + b.options.dotsClass + '">', c = 0; c <= b.getDotCount() ; c += 1) d += "<li>" + b.options.customPaging.call(this, b, c) + "</li>"; d += "</ul>", b.$dots = a(d).appendTo(b.options.appendDots), b.$dots.find("li").first().addClass("slick-active") } }, b.prototype.buildOut = function () { var b = this; b.$slides = b.$slider.children(b.options.slide + ":not(.slick-cloned)").addClass("slick-slide"), b.slideCount = b.$slides.length, b.$slides.each(function (b, c) { a(c).attr("data-slick-index", b) }), b.$slidesCache = b.$slides, b.$slider.addClass("slick-slider"), b.$slideTrack = 0 === b.slideCount ? a('<div class="slick-track"/>').appendTo(b.$slider) : b.$slides.wrapAll('<div class="slick-track"/>').parent(), b.$list = b.$slideTrack.wrap('<div class="slick-list"/>').parent(), b.$slideTrack.css("opacity", 0), (b.options.centerMode === !0 || b.options.swipeToSlide === !0) && (b.options.slidesToScroll = 1), a("img[data-lazy]", b.$slider).not("[src]").addClass("slick-loading"), b.setupInfinite(), b.buildArrows(), b.buildDots(), b.updateDots(), b.options.accessibility === !0 && b.$list.prop("tabIndex", 0), b.setSlideClasses("number" == typeof this.currentSlide ? this.currentSlide : 0), b.options.draggable === !0 && b.$list.addClass("draggable") }, b.prototype.checkResponsive = function (b) { var d, e, f, c = this, g = c.$slider.width(), h = window.innerWidth || a(window).width(); if ("window" === c.respondTo ? f = h : "slider" === c.respondTo ? f = g : "min" === c.respondTo && (f = Math.min(h, g)), c.originalSettings.responsive && c.originalSettings.responsive.length > -1 && null !== c.originalSettings.responsive) { e = null; for (d in c.breakpoints) c.breakpoints.hasOwnProperty(d) && (c.originalSettings.mobileFirst === !1 ? f < c.breakpoints[d] && (e = c.breakpoints[d]) : f > c.breakpoints[d] && (e = c.breakpoints[d])); null !== e ? null !== c.activeBreakpoint ? e !== c.activeBreakpoint && (c.activeBreakpoint = e, "unslick" === c.breakpointSettings[e] ? c.unslick() : (c.options = a.extend({}, c.originalSettings, c.breakpointSettings[e]), b === !0 && (c.currentSlide = c.options.initialSlide), c.refresh())) : (c.activeBreakpoint = e, "unslick" === c.breakpointSettings[e] ? c.unslick() : (c.options = a.extend({}, c.originalSettings, c.breakpointSettings[e]), b === !0 && (c.currentSlide = c.options.initialSlide), c.refresh())) : null !== c.activeBreakpoint && (c.activeBreakpoint = null, c.options = c.originalSettings, b === !0 && (c.currentSlide = c.options.initialSlide), c.refresh()) } }, b.prototype.changeSlide = function (b, c) { var f, g, h, d = this, e = a(b.target); switch (e.is("a") && b.preventDefault(), h = 0 !== d.slideCount % d.options.slidesToScroll, f = h ? 0 : (d.slideCount - d.currentSlide) % d.options.slidesToScroll, b.data.message) { case "previous": g = 0 === f ? d.options.slidesToScroll : d.options.slidesToShow - f, d.slideCount > d.options.slidesToShow && d.slideHandler(d.currentSlide - g, !1, c); break; case "next": g = 0 === f ? d.options.slidesToScroll : f, d.slideCount > d.options.slidesToShow && d.slideHandler(d.currentSlide + g, !1, c); break; case "index": var i = 0 === b.data.index ? 0 : b.data.index || a(b.target).parent().index() * d.options.slidesToScroll; d.slideHandler(d.checkNavigable(i), !1, c); break; default: return } }, b.prototype.checkNavigable = function (a) { var c, d, b = this; if (c = b.getNavigableIndexes(), d = 0, a > c[c.length - 1]) a = c[c.length - 1]; else for (var e in c) { if (a < c[e]) { a = d; break } d = c[e] } return a }, b.prototype.clickHandler = function (a) { var b = this; b.shouldClick === !1 && (a.stopImmediatePropagation(), a.stopPropagation(), a.preventDefault()) }, b.prototype.destroy = function () { var b = this; b.autoPlayClear(), b.touchObject = {}, a(".slick-cloned", b.$slider).remove(), b.$dots && b.$dots.remove(), b.$prevArrow && "object" != typeof b.options.prevArrow && b.$prevArrow.remove(), b.$nextArrow && "object" != typeof b.options.nextArrow && b.$nextArrow.remove(), b.$slides.removeClass("slick-slide slick-active slick-center slick-visible").removeAttr("data-slick-index").css({ position: "", left: "", top: "", zIndex: "", opacity: "", width: "" }), b.$slider.removeClass("slick-slider"), b.$slider.removeClass("slick-initialized"), b.$list.off(".slick"), a(window).off(".slick-" + b.instanceUid), a(document).off(".slick-" + b.instanceUid), b.$slider.html(b.$slides) }, b.prototype.disableTransition = function (a) { var b = this, c = {}; c[b.transitionType] = "", b.options.fade === !1 ? b.$slideTrack.css(c) : b.$slides.eq(a).css(c) }, b.prototype.fadeSlide = function (a, b) { var c = this; c.cssTransitions === !1 ? (c.$slides.eq(a).css({ zIndex: 1e3 }), c.$slides.eq(a).animate({ opacity: 1 }, c.options.speed, c.options.easing, b)) : (c.applyTransition(a), c.$slides.eq(a).css({ opacity: 1, zIndex: 1e3 }), b && setTimeout(function () { c.disableTransition(a), b.call() }, c.options.speed)) }, b.prototype.filterSlides = b.prototype.slickFilter = function (a) { var b = this; null !== a && (b.unload(), b.$slideTrack.children(this.options.slide).detach(), b.$slidesCache.filter(a).appendTo(b.$slideTrack), b.reinit()) }, b.prototype.getCurrent = b.prototype.slickCurrentSlide = function () { var a = this; return a.currentSlide }, b.prototype.getDotCount = function () { var a = this, b = 0, c = 0, d = 0; if (a.options.infinite === !0) d = Math.ceil(a.slideCount / a.options.slidesToScroll); else if (a.options.centerMode === !0) d = a.slideCount; else for (; b < a.slideCount;)++d, b = c + a.options.slidesToShow, c += a.options.slidesToScroll <= a.options.slidesToShow ? a.options.slidesToScroll : a.options.slidesToShow; return d - 1 }, b.prototype.getLeft = function (a) { var c, d, f, b = this, e = 0; return b.slideOffset = 0, d = b.$slides.first().outerHeight(), b.options.infinite === !0 ? (b.slideCount > b.options.slidesToShow && (b.slideOffset = -1 * b.slideWidth * b.options.slidesToShow, e = -1 * d * b.options.slidesToShow), 0 !== b.slideCount % b.options.slidesToScroll && a + b.options.slidesToScroll > b.slideCount && b.slideCount > b.options.slidesToShow && (a > b.slideCount ? (b.slideOffset = -1 * (b.options.slidesToShow - (a - b.slideCount)) * b.slideWidth, e = -1 * (b.options.slidesToShow - (a - b.slideCount)) * d) : (b.slideOffset = -1 * b.slideCount % b.options.slidesToScroll * b.slideWidth, e = -1 * b.slideCount % b.options.slidesToScroll * d))) : a + b.options.slidesToShow > b.slideCount && (b.slideOffset = (a + b.options.slidesToShow - b.slideCount) * b.slideWidth, e = (a + b.options.slidesToShow - b.slideCount) * d), b.slideCount <= b.options.slidesToShow && (b.slideOffset = 0, e = 0), b.options.centerMode === !0 && b.options.infinite === !0 ? b.slideOffset += b.slideWidth * Math.floor(b.options.slidesToShow / 2) - b.slideWidth : b.options.centerMode === !0 && (b.slideOffset = 0, b.slideOffset += b.slideWidth * Math.floor(b.options.slidesToShow / 2)), c = b.options.vertical === !1 ? -1 * a * b.slideWidth + b.slideOffset : -1 * a * d + e, b.options.variableWidth === !0 && (f = b.slideCount <= b.options.slidesToShow || b.options.infinite === !1 ? b.$slideTrack.children(".slick-slide").eq(a) : b.$slideTrack.children(".slick-slide").eq(a + b.options.slidesToShow), c = f[0] ? -1 * f[0].offsetLeft : 0, b.options.centerMode === !0 && (f = b.options.infinite === !1 ? b.$slideTrack.children(".slick-slide").eq(a) : b.$slideTrack.children(".slick-slide").eq(a + b.options.slidesToShow + 1), c = f[0] ? -1 * f[0].offsetLeft : 0, c += (b.$list.width() - f.outerWidth()) / 2)), c }, b.prototype.getOption = b.prototype.slickGetOption = function (a) { var b = this; return b.options[a] }, b.prototype.getNavigableIndexes = function () { var e, a = this, b = 0, c = 0, d = []; for (a.options.infinite === !1 ? (e = a.slideCount - a.options.slidesToShow + 1, a.options.centerMode === !0 && (e = a.slideCount)) : (b = -1 * a.slideCount, c = -1 * a.slideCount, e = 2 * a.slideCount) ; e > b;) d.push(b), b = c + a.options.slidesToScroll, c += a.options.slidesToScroll <= a.options.slidesToShow ? a.options.slidesToScroll : a.options.slidesToShow; return d }, b.prototype.getSlick = function () { return this }, b.prototype.getSlideCount = function () { var c, d, e, b = this; return e = b.options.centerMode === !0 ? b.slideWidth * Math.floor(b.options.slidesToShow / 2) : 0, b.options.swipeToSlide === !0 ? (b.$slideTrack.find(".slick-slide").each(function (c, f) { return f.offsetLeft - e + a(f).outerWidth() / 2 > -1 * b.swipeLeft ? (d = f, !1) : void 0 }), c = Math.abs(a(d).attr("data-slick-index") - b.currentSlide) || 1) : b.options.slidesToScroll }, b.prototype.goTo = b.prototype.slickGoTo = function (a, b) { var c = this; c.changeSlide({ data: { message: "index", index: parseInt(a) } }, b) }, b.prototype.init = function () { var b = this; a(b.$slider).hasClass("slick-initialized") || (a(b.$slider).addClass("slick-initialized"), b.buildOut(), b.setProps(), b.startLoad(), b.loadSlider(), b.initializeEvents(), b.updateArrows(), b.updateDots()), b.$slider.trigger("init", [b]) }, b.prototype.initArrowEvents = function () { var a = this; a.options.arrows === !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.on("click.slick", { message: "previous" }, a.changeSlide), a.$nextArrow.on("click.slick", { message: "next" }, a.changeSlide)) }, b.prototype.initDotEvents = function () { var b = this; b.options.dots === !0 && b.slideCount > b.options.slidesToShow && a("li", b.$dots).on("click.slick", { message: "index" }, b.changeSlide), b.options.dots === !0 && b.options.pauseOnDotsHover === !0 && b.options.autoplay === !0 && a("li", b.$dots).on("mouseenter.slick", function () { b.paused = !0, b.autoPlayClear() }).on("mouseleave.slick", function () { b.paused = !1, b.autoPlay() }) }, b.prototype.initializeEvents = function () { var b = this; b.initArrowEvents(), b.initDotEvents(), b.$list.on("touchstart.slick mousedown.slick", { action: "start" }, b.swipeHandler), b.$list.on("touchmove.slick mousemove.slick", { action: "move" }, b.swipeHandler), b.$list.on("touchend.slick mouseup.slick", { action: "end" }, b.swipeHandler), b.$list.on("touchcancel.slick mouseleave.slick", { action: "end" }, b.swipeHandler), b.$list.on("click.slick", b.clickHandler), b.options.autoplay === !0 && (a(document).on(b.visibilityChange, function () { b.visibility() }), b.options.pauseOnHover === !0 && (b.$list.on("mouseenter.slick", function () { b.paused = !0, b.autoPlayClear() }), b.$list.on("mouseleave.slick", function () { b.paused = !1, b.autoPlay() }))), b.options.accessibility === !0 && b.$list.on("keydown.slick", b.keyHandler), b.options.focusOnSelect === !0 && a(b.$slideTrack).children().on("click.slick", b.selectHandler), a(window).on("orientationchange.slick.slick-" + b.instanceUid, function () { b.checkResponsive(), b.setPosition() }), a(window).on("resize.slick.slick-" + b.instanceUid, function () { a(window).width() !== b.windowWidth && (clearTimeout(b.windowDelay), b.windowDelay = window.setTimeout(function () { b.windowWidth = a(window).width(), b.checkResponsive(), b.setPosition() }, 50)) }), a("*[draggable!=true]", b.$slideTrack).on("dragstart", function (a) { a.preventDefault() }), a(window).on("load.slick.slick-" + b.instanceUid, b.setPosition), a(document).on("ready.slick.slick-" + b.instanceUid, b.setPosition) }, b.prototype.initUI = function () { var a = this; a.options.arrows === !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.show(), a.$nextArrow.show()), a.options.dots === !0 && a.slideCount > a.options.slidesToShow && a.$dots.show(), a.options.autoplay === !0 && a.autoPlay() }, b.prototype.keyHandler = function (a) { var b = this; 37 === a.keyCode && b.options.accessibility === !0 ? b.changeSlide({ data: { message: "previous" } }) : 39 === a.keyCode && b.options.accessibility === !0 && b.changeSlide({ data: { message: "next" } }) }, b.prototype.lazyLoad = function () { function g(b) { a("img[data-lazy]", b).each(function () { var b = a(this), c = a(this).attr("data-lazy"); b.load(function () { b.animate({ opacity: 1 }, 200) }).css({ opacity: 0 }).attr("src", c).removeAttr("data-lazy").removeClass("slick-loading") }) } var c, d, e, f, b = this; b.options.centerMode === !0 ? b.options.infinite === !0 ? (e = b.currentSlide + (b.options.slidesToShow / 2 + 1), f = e + b.options.slidesToShow + 2) : (e = Math.max(0, b.currentSlide - (b.options.slidesToShow / 2 + 1)), f = 2 + (b.options.slidesToShow / 2 + 1) + b.currentSlide) : (e = b.options.infinite ? b.options.slidesToShow + b.currentSlide : b.currentSlide, f = e + b.options.slidesToShow, b.options.fade === !0 && (e > 0 && e--, f <= b.slideCount && f++)), c = b.$slider.find(".slick-slide").slice(e, f), g(c), b.slideCount <= b.options.slidesToShow ? (d = b.$slider.find(".slick-slide"), g(d)) : b.currentSlide >= b.slideCount - b.options.slidesToShow ? (d = b.$slider.find(".slick-cloned").slice(0, b.options.slidesToShow), g(d)) : 0 === b.currentSlide && (d = b.$slider.find(".slick-cloned").slice(-1 * b.options.slidesToShow), g(d)) }, b.prototype.loadSlider = function () { var a = this; a.setPosition(), a.$slideTrack.css({ opacity: 1 }), a.$slider.removeClass("slick-loading"), a.initUI(), "progressive" === a.options.lazyLoad && a.progressiveLazyLoad() }, b.prototype.next = b.prototype.slickNext = function () { var a = this; a.changeSlide({ data: { message: "next" } }) }, b.prototype.pause = b.prototype.slickPause = function () { var a = this; a.autoPlayClear(), a.paused = !0 }, b.prototype.play = b.prototype.slickPlay = function () { var a = this; a.paused = !1, a.autoPlay() }, b.prototype.postSlide = function (a) { var b = this; b.$slider.trigger("afterChange", [b, a]), b.animating = !1, b.setPosition(), b.swipeLeft = null, b.options.autoplay === !0 && b.paused === !1 && b.autoPlay() }, b.prototype.prev = b.prototype.slickPrev = function () { var a = this; a.changeSlide({ data: { message: "previous" } }) }, b.prototype.progressiveLazyLoad = function () { var c, d, b = this; c = a("img[data-lazy]", b.$slider).length, c > 0 && (d = a("img[data-lazy]", b.$slider).first(), d.attr("src", d.attr("data-lazy")).removeClass("slick-loading").load(function () { d.removeAttr("data-lazy"), b.progressiveLazyLoad() }).error(function () { d.removeAttr("data-lazy"), b.progressiveLazyLoad() })) }, b.prototype.refresh = function () { var b = this, c = b.currentSlide; b.destroy(), a.extend(b, b.initials), b.init(), b.changeSlide({ data: { message: "index", index: c } }, !0) }, b.prototype.reinit = function () { var b = this; b.$slides = b.$slideTrack.children(b.options.slide).addClass("slick-slide"), b.slideCount = b.$slides.length, b.currentSlide >= b.slideCount && 0 !== b.currentSlide && (b.currentSlide = b.currentSlide - b.options.slidesToScroll), b.slideCount <= b.options.slidesToShow && (b.currentSlide = 0), b.setProps(), b.setupInfinite(), b.buildArrows(), b.updateArrows(), b.initArrowEvents(), b.buildDots(), b.updateDots(), b.initDotEvents(), b.options.focusOnSelect === !0 && a(b.$slideTrack).children().on("click.slick", b.selectHandler), b.setSlideClasses(0), b.setPosition(), b.$slider.trigger("reInit", [b]) }, b.prototype.removeSlide = b.prototype.slickRemove = function (a, b, c) { var d = this; return "boolean" == typeof a ? (b = a, a = b === !0 ? 0 : d.slideCount - 1) : a = b === !0 ? --a : a, d.slideCount < 1 || 0 > a || a > d.slideCount - 1 ? !1 : (d.unload(), c === !0 ? d.$slideTrack.children().remove() : d.$slideTrack.children(this.options.slide).eq(a).remove(), d.$slides = d.$slideTrack.children(this.options.slide), d.$slideTrack.children(this.options.slide).detach(), d.$slideTrack.append(d.$slides), d.$slidesCache = d.$slides, d.reinit(), void 0) }, b.prototype.setCSS = function (a) { var d, e, b = this, c = {}; b.options.rtl === !0 && (a = -a), d = "left" == b.positionProp ? Math.ceil(a) + "px" : "0px", e = "top" == b.positionProp ? Math.ceil(a) + "px" : "0px", c[b.positionProp] = a, b.transformsEnabled === !1 ? b.$slideTrack.css(c) : (c = {}, b.cssTransitions === !1 ? (c[b.animType] = "translate(" + d + ", " + e + ")", b.$slideTrack.css(c)) : (c[b.animType] = "translate3d(" + d + ", " + e + ", 0px)", b.$slideTrack.css(c))) }, b.prototype.setDimensions = function () { var a = this; if (a.options.vertical === !1 ? a.options.centerMode === !0 && a.$list.css({ padding: "0px " + a.options.centerPadding }) : (a.$list.height(a.$slides.first().outerHeight(!0) * a.options.slidesToShow), a.options.centerMode === !0 && a.$list.css({ padding: a.options.centerPadding + " 0px" })), a.listWidth = a.$list.width(), a.listHeight = a.$list.height(), a.options.vertical === !1 && a.options.variableWidth === !1) a.slideWidth = Math.ceil(a.listWidth / a.options.slidesToShow), a.$slideTrack.width(Math.ceil(a.slideWidth * a.$slideTrack.children(".slick-slide").length)); else if (a.options.variableWidth === !0) { var b = 0; a.slideWidth = Math.ceil(a.listWidth / a.options.slidesToShow), a.$slideTrack.children(".slick-slide").each(function () { b += a.listWidth }), a.$slideTrack.width(Math.ceil(b) + 1) } else a.slideWidth = Math.ceil(a.listWidth), a.$slideTrack.height(Math.ceil(a.$slides.first().outerHeight(!0) * a.$slideTrack.children(".slick-slide").length)); var c = a.$slides.first().outerWidth(!0) - a.$slides.first().width(); a.options.variableWidth === !1 && a.$slideTrack.children(".slick-slide").width(a.slideWidth - c) }, b.prototype.setFade = function () { var c, b = this; b.$slides.each(function (d, e) { c = -1 * b.slideWidth * d, b.options.rtl === !0 ? a(e).css({ position: "relative", right: c, top: 0, zIndex: 800, opacity: 0 }) : a(e).css({ position: "relative", left: c, top: 0, zIndex: 800, opacity: 0 }) }), b.$slides.eq(b.currentSlide).css({ zIndex: 900, opacity: 1 }) }, b.prototype.setHeight = function () { var a = this; if (1 === a.options.slidesToShow && a.options.adaptiveHeight === !0 && a.options.vertical === !1) { var b = a.$slides.eq(a.currentSlide).outerHeight(!0); a.$list.css("height", b) } }, b.prototype.setOption = b.prototype.slickSetOption = function (a, b, c) { var d = this; d.options[a] = b, c === !0 && (d.unload(), d.reinit()) }, b.prototype.setPosition = function () { var a = this; a.setDimensions(), a.setHeight(), a.options.fade === !1 ? a.setCSS(a.getLeft(a.currentSlide)) : a.setFade(), a.$slider.trigger("setPosition", [a]) }, b.prototype.setProps = function () { var a = this, b = document.body.style; a.positionProp = a.options.vertical === !0 ? "top" : "left", "top" === a.positionProp ? a.$slider.addClass("slick-vertical") : a.$slider.removeClass("slick-vertical"), (void 0 !== b.WebkitTransition || void 0 !== b.MozTransition || void 0 !== b.msTransition) && a.options.useCSS === !0 && (a.cssTransitions = !0), void 0 !== b.OTransform && (a.animType = "OTransform", a.transformType = "-o-transform", a.transitionType = "OTransition", void 0 === b.perspectiveProperty && void 0 === b.webkitPerspective && (a.animType = !1)), void 0 !== b.MozTransform && (a.animType = "MozTransform", a.transformType = "-moz-transform", a.transitionType = "MozTransition", void 0 === b.perspectiveProperty && void 0 === b.MozPerspective && (a.animType = !1)), void 0 !== b.webkitTransform && (a.animType = "webkitTransform", a.transformType = "-webkit-transform", a.transitionType = "webkitTransition", void 0 === b.perspectiveProperty && void 0 === b.webkitPerspective && (a.animType = !1)), void 0 !== b.msTransform && (a.animType = "msTransform", a.transformType = "-ms-transform", a.transitionType = "msTransition", void 0 === b.msTransform && (a.animType = !1)), void 0 !== b.transform && a.animType !== !1 && (a.animType = "transform", a.transformType = "transform", a.transitionType = "transition"), a.transformsEnabled = null !== a.animType && a.animType !== !1 }, b.prototype.setSlideClasses = function (a) { var c, d, e, f, b = this; b.$slider.find(".slick-slide").removeClass("slick-active").removeClass("slick-center"), d = b.$slider.find(".slick-slide"), b.options.centerMode === !0 ? (c = Math.floor(b.options.slidesToShow / 2), b.options.infinite === !0 && (a >= c && a <= b.slideCount - 1 - c ? b.$slides.slice(a - c, a + c + 1).addClass("slick-active") : (e = b.options.slidesToShow + a, d.slice(e - c + 1, e + c + 2).addClass("slick-active")), 0 === a ? d.eq(d.length - 1 - b.options.slidesToShow).addClass("slick-center") : a === b.slideCount - 1 && d.eq(b.options.slidesToShow).addClass("slick-center")), b.$slides.eq(a).addClass("slick-center")) : a >= 0 && a <= b.slideCount - b.options.slidesToShow ? b.$slides.slice(a, a + b.options.slidesToShow).addClass("slick-active") : d.length <= b.options.slidesToShow ? d.addClass("slick-active") : (f = b.slideCount % b.options.slidesToShow, e = b.options.infinite === !0 ? b.options.slidesToShow + a : a, b.options.slidesToShow == b.options.slidesToScroll && b.slideCount - a < b.options.slidesToShow ? d.slice(e - (b.options.slidesToShow - f), e + f).addClass("slick-active") : d.slice(e, e + b.options.slidesToShow).addClass("slick-active")), "ondemand" === b.options.lazyLoad && b.lazyLoad() }, b.prototype.setupInfinite = function () { var c, d, e, b = this; if (b.options.fade === !0 && (b.options.centerMode = !1), b.options.infinite === !0 && b.options.fade === !1 && (d = null, b.slideCount > b.options.slidesToShow)) { for (e = b.options.centerMode === !0 ? b.options.slidesToShow + 1 : b.options.slidesToShow, c = b.slideCount; c > b.slideCount - e; c -= 1) d = c - 1, a(b.$slides[d]).clone(!0).attr("id", "").attr("data-slick-index", d - b.slideCount).prependTo(b.$slideTrack).addClass("slick-cloned"); for (c = 0; e > c; c += 1) d = c, a(b.$slides[d]).clone(!0).attr("id", "").attr("data-slick-index", d + b.slideCount).appendTo(b.$slideTrack).addClass("slick-cloned"); b.$slideTrack.find(".slick-cloned").find("[id]").each(function () { a(this).attr("id", "") }) } }, b.prototype.selectHandler = function (b) { var c = this, d = parseInt(a(b.target).parents(".slick-slide").attr("data-slick-index")); return d || (d = 0), c.slideCount <= c.options.slidesToShow ? (c.$slider.find(".slick-slide").removeClass("slick-active"), c.$slides.eq(d).addClass("slick-active"), c.options.centerMode === !0 && (c.$slider.find(".slick-slide").removeClass("slick-center"), c.$slides.eq(d).addClass("slick-center")), c.asNavFor(d), void 0) : (c.slideHandler(d), void 0) }, b.prototype.slideHandler = function (a, b, c) { var d, e, f, g, h = null, i = this; return b = b || !1, i.animating === !0 && i.options.waitForAnimate === !0 || i.options.fade === !0 && i.currentSlide === a || i.slideCount <= i.options.slidesToShow ? void 0 : (b === !1 && i.asNavFor(a), d = a, h = i.getLeft(d), g = i.getLeft(i.currentSlide), i.currentLeft = null === i.swipeLeft ? g : i.swipeLeft, i.options.infinite === !1 && i.options.centerMode === !1 && (0 > a || a > i.getDotCount() * i.options.slidesToScroll) ? (i.options.fade === !1 && (d = i.currentSlide, c !== !0 ? i.animateSlide(g, function () { i.postSlide(d) }) : i.postSlide(d)), void 0) : i.options.infinite === !1 && i.options.centerMode === !0 && (0 > a || a > i.slideCount - i.options.slidesToScroll) ? (i.options.fade === !1 && (d = i.currentSlide, c !== !0 ? i.animateSlide(g, function () { i.postSlide(d) }) : i.postSlide(d)), void 0) : (i.options.autoplay === !0 && clearInterval(i.autoPlayTimer), e = 0 > d ? 0 !== i.slideCount % i.options.slidesToScroll ? i.slideCount - i.slideCount % i.options.slidesToScroll : i.slideCount + d : d >= i.slideCount ? 0 !== i.slideCount % i.options.slidesToScroll ? 0 : d - i.slideCount : d, i.animating = !0, i.$slider.trigger("beforeChange", [i, i.currentSlide, e]), f = i.currentSlide, i.currentSlide = e, i.setSlideClasses(i.currentSlide), i.updateDots(), i.updateArrows(), i.options.fade === !0 ? (c !== !0 ? i.fadeSlide(e, function () { i.postSlide(e) }) : i.postSlide(e), i.animateHeight(), void 0) : (c !== !0 ? i.animateSlide(h, function () { i.postSlide(e) }) : i.postSlide(e), void 0))) }, b.prototype.startLoad = function () { var a = this; a.options.arrows === !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.hide(), a.$nextArrow.hide()), a.options.dots === !0 && a.slideCount > a.options.slidesToShow && a.$dots.hide(), a.$slider.addClass("slick-loading") }, b.prototype.swipeDirection = function () { var a, b, c, d, e = this; return a = e.touchObject.startX - e.touchObject.curX, b = e.touchObject.startY - e.touchObject.curY, c = Math.atan2(b, a), d = Math.round(180 * c / Math.PI), 0 > d && (d = 360 - Math.abs(d)), 45 >= d && d >= 0 ? e.options.rtl === !1 ? "left" : "right" : 360 >= d && d >= 315 ? e.options.rtl === !1 ? "left" : "right" : d >= 135 && 225 >= d ? e.options.rtl === !1 ? "right" : "left" : "vertical" }, b.prototype.swipeEnd = function () { var c, b = this; if (b.dragging = !1, b.shouldClick = b.touchObject.swipeLength > 10 ? !1 : !0, void 0 === b.touchObject.curX) return !1; if (b.touchObject.edgeHit === !0 && b.$slider.trigger("edge", [b, b.swipeDirection()]), b.touchObject.swipeLength >= b.touchObject.minSwipe) switch (b.swipeDirection()) { case "left": c = b.options.swipeToSlide ? b.checkNavigable(b.currentSlide + b.getSlideCount()) : b.currentSlide + b.getSlideCount(), b.slideHandler(c), b.currentDirection = 0, b.touchObject = {}, b.$slider.trigger("swipe", [b, "left"]); break; case "right": c = b.options.swipeToSlide ? b.checkNavigable(b.currentSlide - b.getSlideCount()) : b.currentSlide - b.getSlideCount(), b.slideHandler(c), b.currentDirection = 1, b.touchObject = {}, b.$slider.trigger("swipe", [b, "right"]) } else b.touchObject.startX !== b.touchObject.curX && (b.slideHandler(b.currentSlide), b.touchObject = {}) }, b.prototype.swipeHandler = function (a) { var b = this; if (!(b.options.swipe === !1 || "ontouchend" in document && b.options.swipe === !1 || b.options.draggable === !1 && -1 !== a.type.indexOf("mouse"))) switch (b.touchObject.fingerCount = a.originalEvent && void 0 !== a.originalEvent.touches ? a.originalEvent.touches.length : 1, b.touchObject.minSwipe = b.listWidth / b.options.touchThreshold, a.data.action) { case "start": b.swipeStart(a); break; case "move": b.swipeMove(a); break; case "end": b.swipeEnd(a) } }, b.prototype.swipeMove = function (a) { var d, e, f, g, h, b = this; return h = void 0 !== a.originalEvent ? a.originalEvent.touches : null, !b.dragging || h && 1 !== h.length ? !1 : (d = b.getLeft(b.currentSlide), b.touchObject.curX = void 0 !== h ? h[0].pageX : a.clientX, b.touchObject.curY = void 0 !== h ? h[0].pageY : a.clientY, b.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(b.touchObject.curX - b.touchObject.startX, 2))), e = b.swipeDirection(), "vertical" !== e ? (void 0 !== a.originalEvent && b.touchObject.swipeLength > 4 && a.preventDefault(), g = (b.options.rtl === !1 ? 1 : -1) * (b.touchObject.curX > b.touchObject.startX ? 1 : -1), f = b.touchObject.swipeLength, b.touchObject.edgeHit = !1, b.options.infinite === !1 && (0 === b.currentSlide && "right" === e || b.currentSlide >= b.getDotCount() && "left" === e) && (f = b.touchObject.swipeLength * b.options.edgeFriction, b.touchObject.edgeHit = !0), b.swipeLeft = b.options.vertical === !1 ? d + f * g : d + f * (b.$list.height() / b.listWidth) * g, b.options.fade === !0 || b.options.touchMove === !1 ? !1 : b.animating === !0 ? (b.swipeLeft = null, !1) : (b.setCSS(b.swipeLeft), void 0)) : void 0) }, b.prototype.swipeStart = function (a) { var c, b = this; return 1 !== b.touchObject.fingerCount || b.slideCount <= b.options.slidesToShow ? (b.touchObject = {}, !1) : (void 0 !== a.originalEvent && void 0 !== a.originalEvent.touches && (c = a.originalEvent.touches[0]), b.touchObject.startX = b.touchObject.curX = void 0 !== c ? c.pageX : a.clientX, b.touchObject.startY = b.touchObject.curY = void 0 !== c ? c.pageY : a.clientY, b.dragging = !0, void 0) }, b.prototype.unfilterSlides = b.prototype.slickUnfilter = function () { var a = this; null !== a.$slidesCache && (a.unload(), a.$slideTrack.children(this.options.slide).detach(), a.$slidesCache.appendTo(a.$slideTrack), a.reinit()) }, b.prototype.unload = function () { var b = this; a(".slick-cloned", b.$slider).remove(), b.$dots && b.$dots.remove(), b.$prevArrow && "object" != typeof b.options.prevArrow && b.$prevArrow.remove(), b.$nextArrow && "object" != typeof b.options.nextArrow && b.$nextArrow.remove(), b.$slides.removeClass("slick-slide slick-active slick-visible").css("width", "") }, b.prototype.unslick = function () { var a = this; a.destroy() }, b.prototype.updateArrows = function () {
                var b, a = this; b = Math.floor(a.options.slidesToShow / 2), a.options.arrows === !0 && a.options.infinite !== !0 && a.slideCount > a.options.slidesToShow && (a.$prevArrow.removeClass("slick-disabled"), a.$nextArrow.removeClass("slick-disabled"), 0 === a.currentSlide ? (a.$prevArrow.addClass("slick-disabled"), a.$nextArrow.removeClass("slick-disabled")) : a.currentSlide >= a.slideCount - a.options.slidesToShow && a.options.centerMode === !1 ? (a.$nextArrow.addClass("slick-disabled"), a.$prevArrow.removeClass("slick-disabled")) : a.currentSlide >= a.slideCount - 1 && a.options.centerMode === !0 && (a.$nextArrow.addClass("slick-disabled"), a.$prevArrow.removeClass("slick-disabled")))
            }, b.prototype.updateDots = function () { var a = this; null !== a.$dots && (a.$dots.find("li").removeClass("slick-active"), a.$dots.find("li").eq(Math.floor(a.currentSlide / a.options.slidesToScroll)).addClass("slick-active")) }, b.prototype.visibility = function () { var a = this; document[a.hidden] ? (a.paused = !0, a.autoPlayClear()) : (a.paused = !1, a.autoPlay()) }, a.fn.slick = function () { var g, a = this, c = arguments[0], d = Array.prototype.slice.call(arguments, 1), e = a.length, f = 0; for (f; e > f; f++) if ("object" == typeof c || "undefined" == typeof c ? a[f].slick = new b(a[f], c) : g = a[f].slick[c].apply(a[f].slick, d), "undefined" != typeof g) return g; return a }, a(function () { a("[data-slick]").slick() })
        });


        /*
         *
         * Copyright (c) 2006-2011 Sam Collett (http://www.texotela.co.uk)
         * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
         * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
         * 
         * Version 1.3
         * samhealth: http://www.texotela.co.uk/code/jquery/numeric/
         *
         */
        (function (e) { e.fn.numeric = function (t, n) { if (typeof t === "boolean") { t = { decimal: t } } t = t || {}; if (typeof t.negative == "undefined") t.negative = true; var r = t.decimal === false ? "" : t.decimal || "."; var i = t.negative === true ? true : false; var n = typeof n == "function" ? n : function () { }; return this.data("numeric.decimal", r).data("numeric.negative", i).data("numeric.callback", n).keypress(e.fn.numeric.keypress).keyup(e.fn.numeric.keyup).blur(e.fn.numeric.blur) }; e.fn.numeric.keypress = function (t) { var n = e.data(this, "numeric.decimal"); var r = e.data(this, "numeric.negative"); var i = t.charCode ? t.charCode : t.keyCode ? t.keyCode : 0; if (i == 13 && this.nodeName.toLowerCase() == "input") { return true } else if (i == 13) { return false } var s = false; if (t.ctrlKey && i == 97 || t.ctrlKey && i == 65) return true; if (t.ctrlKey && i == 120 || t.ctrlKey && i == 88) return true; if (t.ctrlKey && i == 99 || t.ctrlKey && i == 67) return true; if (t.ctrlKey && i == 122 || t.ctrlKey && i == 90) return true; if (t.ctrlKey && i == 118 || t.ctrlKey && i == 86 || t.shiftKey && i == 45) return true; if (i < 48 || i > 57) { if (this.value.indexOf("-") != 0 && r && i == 45 && (this.value.length == 0 || e.fn.getSelectionStart(this) == 0)) return true; if (n && i == n.charCodeAt(0) && this.value.indexOf(n) != -1) { s = false } if (i != 8 && i != 9 && i != 13 && i != 35 && i != 36 && i != 37 && i != 39 && i != 46) { s = false } else { if (typeof t.charCode != "undefined") { if (t.keyCode == t.which && t.which != 0) { s = true; if (t.which == 46) s = false } else if (t.keyCode != 0 && t.charCode == 0 && t.which == 0) { s = true } } } if (n && i == n.charCodeAt(0)) { if (this.value.indexOf(n) == -1) { s = true } else { s = false } } } else { s = true } return s }; e.fn.numeric.keyup = function (t) { var n = this.value; if (n.length > 0) { var r = e.fn.getSelectionStart(this); var i = e.data(this, "numeric.decimal"); var s = e.data(this, "numeric.negative"); if (i != "") { var o = n.indexOf(i); if (o == 0) { this.value = "0" + n } if (o == 1 && n.charAt(0) == "-") { this.value = "-0" + n.substring(1) } n = this.value } var u = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, "-", i]; var a = n.length; for (var f = a - 1; f >= 0; f--) { var l = n.charAt(f); if (f != 0 && l == "-") { n = n.substring(0, f) + n.substring(f + 1) } else if (f == 0 && !s && l == "-") { n = n.substring(1) } var c = false; for (var h = 0; h < u.length; h++) { if (l == u[h]) { c = true; break } } if (!c || l == " ") { n = n.substring(0, f) + n.substring(f + 1) } } var p = n.indexOf(i); if (p > 0) { for (var f = a - 1; f > p; f--) { var l = n.charAt(f); if (l == i) { n = n.substring(0, f) + n.substring(f + 1) } } } this.value = n; e.fn.setSelection(this, r) } }; e.fn.numeric.blur = function () { var t = e.data(this, "numeric.decimal"); var n = e.data(this, "numeric.callback"); var r = this.value; if (r != "") { var i = new RegExp("^\\d+$|\\d*" + t + "\\d+"); if (!i.exec(r)) { n.apply(this) } } }; e.fn.removeNumeric = function () { return this.data("numeric.decimal", null).data("numeric.negative", null).data("numeric.callback", null).unbind("keypress", e.fn.numeric.keypress).unbind("blur", e.fn.numeric.blur) }; e.fn.getSelectionStart = function (e) { if (e.createTextRange) { var t = document.selection.createRange().duplicate(); t.moveEnd("character", e.value.length); if (t.text == "") return e.value.length; return e.value.lastIndexOf(t.text) } else return e.selectionStart }; e.fn.setSelection = function (e, t) { if (typeof t == "number") t = [t, t]; if (t && t.constructor == Array && t.length == 2) { if (e.createTextRange) { var n = e.createTextRange(); n.collapse(true); n.moveStart("character", t[0]); n.moveEnd("character", t[1]); n.select() } else if (e.setSelectionRange) { e.focus(); e.setSelectionRange(t[0], t[1]) } } } })(jQuery)

        /*! waitForImages jQuery Plugin 2013-07-20 */
        !function (a) { var b = "waitForImages"; a.waitForImages = { hasImageProperties: ["backgroundImage", "listStyleImage", "borderImage", "borderCornerImage", "cursor"] }, a.expr[":"].uncached = function (b) { if (!a(b).is('img[src!=""]')) return !1; var c = new Image; return c.src = b.src, !c.complete }, a.fn.waitForImages = function (c, d, e) { var f = 0, g = 0; if (a.isPlainObject(arguments[0]) && (e = arguments[0].waitForAll, d = arguments[0].each, c = arguments[0].finished), c = c || a.noop, d = d || a.noop, e = !!e, !a.isFunction(c) || !a.isFunction(d)) throw new TypeError("An invalid callback was supplied."); return this.each(function () { var h = a(this), i = [], j = a.waitForImages.hasImageProperties || [], k = /url\(\s*(['"]?)(.*?)\1\s*\)/g; e ? h.find("*").addBack().each(function () { var b = a(this); b.is("img:uncached") && i.push({ src: b.attr("src"), element: b[0] }), a.each(j, function (a, c) { var d, e = b.css(c); if (!e) return !0; for (; d = k.exec(e) ;) i.push({ src: d[2], element: b[0] }) }) }) : h.find("img:uncached").each(function () { i.push({ src: this.src, element: this }) }), f = i.length, g = 0, 0 === f && c.call(h[0]), a.each(i, function (e, i) { var j = new Image; a(j).on("load." + b + " error." + b, function (a) { return g++, d.call(i.element, g, f, "load" == a.type), g == f ? (c.call(h[0]), !1) : void 0 }), j.src = i.src }) }) } }(jQuery);

        //! moment.js
        //! version : 2.10.3
        //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
        //! license : MIT
        //! momentjs.com
        !function (a, b) { "object" == typeof exports && "undefined" != typeof module ? module.exports = b() : "function" == typeof define && define.amd ? define(b) : a.moment = b() }(this, function () {
            "use strict"; function a() {
                return Dc.apply(null, arguments)
            } function b(a) {
                Dc = a
            } function c(a) {
                return "[object Array]" === Object.prototype.toString.call(a)
            } function d(a) {
                return a instanceof Date || "[object Date]" === Object.prototype.toString.call(a)
            } function e(a, b) {
                var c, d = []; for (c = 0; c < a.length; ++c) d.push(b(a[c], c)); return d
            } function f(a, b) {
                return Object.prototype.hasOwnProperty.call(a, b)
            } function g(a, b) {
                for (var c in b) f(b, c) && (a[c] = b[c]); return f(b, "toString") && (a.toString = b.toString), f(b, "valueOf") && (a.valueOf = b.valueOf), a
            } function h(a, b, c, d) {
                return za(a, b, c, d, !0).utc()
            } function i() {
                return { empty: !1, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: !1, invalidMonth: null, invalidFormat: !1, userInvalidated: !1, iso: !1 }
            } function j(a) {
                return null == a._pf && (a._pf = i()), a._pf
            } function k(a) {
                if (null == a._isValid) { var b = j(a); a._isValid = !isNaN(a._d.getTime()) && b.overflow < 0 && !b.empty && !b.invalidMonth && !b.nullInput && !b.invalidFormat && !b.userInvalidated, a._strict && (a._isValid = a._isValid && 0 === b.charsLeftOver && 0 === b.unusedTokens.length && void 0 === b.bigHour) } return a._isValid
            } function l(a) {
                var b = h(0 / 0); return null != a ? g(j(b), a) : j(b).userInvalidated = !0, b
            } function m(a, b) {
                var c, d, e; if ("undefined" != typeof b._isAMomentObject && (a._isAMomentObject = b._isAMomentObject), "undefined" != typeof b._i && (a._i = b._i), "undefined" != typeof b._f && (a._f = b._f), "undefined" != typeof b._l && (a._l = b._l), "undefined" != typeof b._strict && (a._strict = b._strict), "undefined" != typeof b._tzm && (a._tzm = b._tzm), "undefined" != typeof b._isUTC && (a._isUTC = b._isUTC), "undefined" != typeof b._offset && (a._offset = b._offset), "undefined" != typeof b._pf && (a._pf = j(b)), "undefined" != typeof b._locale && (a._locale = b._locale), Fc.length > 0) for (c in Fc) d = Fc[c], e = b[d], "undefined" != typeof e && (a[d] = e); return a
            } function n(b) {
                m(this, b), this._d = new Date(+b._d), Gc === !1 && (Gc = !0, a.updateOffset(this), Gc = !1)
            } function o(a) {
                return a instanceof n || null != a && null != a._isAMomentObject
            } function p(a) {
                var b = +a, c = 0; return 0 !== b && isFinite(b) && (c = b >= 0 ? Math.floor(b) : Math.ceil(b)), c
            } function q(a, b, c) {
                var d, e = Math.min(a.length, b.length), f = Math.abs(a.length - b.length), g = 0; for (d = 0; e > d; d++) (c && a[d] !== b[d] || !c && p(a[d]) !== p(b[d])) && g++; return g + f
            } function r() {
            } function s(a) {
                return a ? a.toLowerCase().replace("_", "-") : a
            } function t(a) {
                for (var b, c, d, e, f = 0; f < a.length;) { for (e = s(a[f]).split("-"), b = e.length, c = s(a[f + 1]), c = c ? c.split("-") : null; b > 0;) { if (d = u(e.slice(0, b).join("-"))) return d; if (c && c.length >= b && q(e, c, !0) >= b - 1) break; b-- } f++ } return null
            } function u(a) {
                var b = null; if (!Hc[a] && "undefined" != typeof module && module && module.exports) try { b = Ec._abbr, require("./locale/" + a), v(b) } catch (c) { } return Hc[a]
            } function v(a, b) {
                var c; return a && (c = "undefined" == typeof b ? x(a) : w(a, b), c && (Ec = c)), Ec._abbr
            } function w(a, b) {
                return null !== b ? (b.abbr = a, Hc[a] || (Hc[a] = new r), Hc[a].set(b), v(a), Hc[a]) : (delete Hc[a], null)
            } function x(a) {
                var b; if (a && a._locale && a._locale._abbr && (a = a._locale._abbr), !a) return Ec; if (!c(a)) { if (b = u(a)) return b; a = [a] } return t(a)
            } function y(a, b) {
                var c = a.toLowerCase(); Ic[c] = Ic[c + "s"] = Ic[b] = a
            } function z(a) {
                return "string" == typeof a ? Ic[a] || Ic[a.toLowerCase()] : void 0
            } function A(a) {
                var b, c, d = {}; for (c in a) f(a, c) && (b = z(c), b && (d[b] = a[c])); return d
            } function B(b, c) {
                return function (d) { return null != d ? (D(this, b, d), a.updateOffset(this, c), this) : C(this, b) }
            } function C(a, b) {
                return a._d["get" + (a._isUTC ? "UTC" : "") + b]()
            } function D(a, b, c) {
                return a._d["set" + (a._isUTC ? "UTC" : "") + b](c)
            } function E(a, b) {
                var c; if ("object" == typeof a) for (c in a) this.set(c, a[c]); else if (a = z(a), "function" == typeof this[a]) return this[a](b); return this
            } function F(a, b, c) {
                for (var d = "" + Math.abs(a), e = a >= 0; d.length < b;) d = "0" + d; return (e ? c ? "+" : "" : "-") + d
            } function G(a, b, c, d) {
                var e = d; "string" == typeof d && (e = function () { return this[d]() }), a && (Mc[a] = e), b && (Mc[b[0]] = function () { return F(e.apply(this, arguments), b[1], b[2]) }), c && (Mc[c] = function () { return this.localeData().ordinal(e.apply(this, arguments), a) })
            } function H(a) {
                return a.match(/\[[\s\S]/) ? a.replace(/^\[|\]$/g, "") : a.replace(/\\/g, "")
            } function I(a) {
                var b, c, d = a.match(Jc); for (b = 0, c = d.length; c > b; b++) Mc[d[b]] ? d[b] = Mc[d[b]] : d[b] = H(d[b]); return function (e) { var f = ""; for (b = 0; c > b; b++) f += d[b] instanceof Function ? d[b].call(e, a) : d[b]; return f }
            } function J(a, b) {
                return a.isValid() ? (b = K(b, a.localeData()), Lc[b] || (Lc[b] = I(b)), Lc[b](a)) : a.localeData().invalidDate()
            } function K(a, b) {
                function c(a) { return b.longDateFormat(a) || a } var d = 5; for (Kc.lastIndex = 0; d >= 0 && Kc.test(a) ;) a = a.replace(Kc, c), Kc.lastIndex = 0, d -= 1; return a
            } function L(a, b, c) {
                _c[a] = "function" == typeof b ? b : function (a) { return a && c ? c : b }
            } function M(a, b) {
                return f(_c, a) ? _c[a](b._strict, b._locale) : new RegExp(N(a))
            } function N(a) {
                return a.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (a, b, c, d, e) { return b || c || d || e }).replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
            } function O(a, b) {
                var c, d = b; for ("string" == typeof a && (a = [a]), "number" == typeof b && (d = function (a, c) { c[b] = p(a) }), c = 0; c < a.length; c++) ad[a[c]] = d
            } function P(a, b) {
                O(a, function (a, c, d, e) { d._w = d._w || {}, b(a, d._w, d, e) })
            } function Q(a, b, c) {
                null != b && f(ad, a) && ad[a](b, c._a, c, a)
            } function R(a, b) {
                return new Date(Date.UTC(a, b + 1, 0)).getUTCDate()
            } function S(a) {
                return this._months[a.month()]
            } function T(a) {
                return this._monthsShort[a.month()]
            } function U(a, b, c) {
                var d, e, f; for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), d = 0; 12 > d; d++) { if (e = h([2e3, d]), c && !this._longMonthsParse[d] && (this._longMonthsParse[d] = new RegExp("^" + this.months(e, "").replace(".", "") + "$", "i"), this._shortMonthsParse[d] = new RegExp("^" + this.monthsShort(e, "").replace(".", "") + "$", "i")), c || this._monthsParse[d] || (f = "^" + this.months(e, "") + "|^" + this.monthsShort(e, ""), this._monthsParse[d] = new RegExp(f.replace(".", ""), "i")), c && "MMMM" === b && this._longMonthsParse[d].test(a)) return d; if (c && "MMM" === b && this._shortMonthsParse[d].test(a)) return d; if (!c && this._monthsParse[d].test(a)) return d }
            } function V(a, b) {
                var c; return "string" == typeof b && (b = a.localeData().monthsParse(b), "number" != typeof b) ? a : (c = Math.min(a.date(), R(a.year(), b)), a._d["set" + (a._isUTC ? "UTC" : "") + "Month"](b, c), a)
            } function W(b) {
                return null != b ? (V(this, b), a.updateOffset(this, !0), this) : C(this, "Month")
            } function X() {
                return R(this.year(), this.month())
            } function Y(a) {
                var b, c = a._a; return c && -2 === j(a).overflow && (b = c[cd] < 0 || c[cd] > 11 ? cd : c[dd] < 1 || c[dd] > R(c[bd], c[cd]) ? dd : c[ed] < 0 || c[ed] > 24 || 24 === c[ed] && (0 !== c[fd] || 0 !== c[gd] || 0 !== c[hd]) ? ed : c[fd] < 0 || c[fd] > 59 ? fd : c[gd] < 0 || c[gd] > 59 ? gd : c[hd] < 0 || c[hd] > 999 ? hd : -1, j(a)._overflowDayOfYear && (bd > b || b > dd) && (b = dd), j(a).overflow = b), a
            } function Z(b) {
                a.suppressDeprecationWarnings === !1 && "undefined" != typeof console && console.warn && console.warn("Deprecation warning: " + b)
            } function $(a, b) {
                var c = !0, d = a + "\n" + (new Error).stack; return g(function () { return c && (Z(d), c = !1), b.apply(this, arguments) }, b)
            } function _(a, b) {
                kd[a] || (Z(b), kd[a] = !0)
            } function aa(a) {
                var b, c, d = a._i, e = ld.exec(d); if (e) { for (j(a).iso = !0, b = 0, c = md.length; c > b; b++) if (md[b][1].exec(d)) { a._f = md[b][0] + (e[6] || " "); break } for (b = 0, c = nd.length; c > b; b++) if (nd[b][1].exec(d)) { a._f += nd[b][0]; break } d.match(Yc) && (a._f += "Z"), ta(a) } else a._isValid = !1
            } function ba(b) {
                var c = od.exec(b._i); return null !== c ? void (b._d = new Date(+c[1])) : (aa(b), void (b._isValid === !1 && (delete b._isValid, a.createFromInputFallback(b))))
            } function ca(a, b, c, d, e, f, g) {
                var h = new Date(a, b, c, d, e, f, g); return 1970 > a && h.setFullYear(a), h
            } function da(a) {
                var b = new Date(Date.UTC.apply(null, arguments)); return 1970 > a && b.setUTCFullYear(a), b
            } function ea(a) {
                return fa(a) ? 366 : 365
            } function fa(a) {
                return a % 4 === 0 && a % 100 !== 0 || a % 400 === 0
            } function ga() {
                return fa(this.year())
            } function ha(a, b, c) {
                var d, e = c - b, f = c - a.day(); return f > e && (f -= 7), e - 7 > f && (f += 7), d = Aa(a).add(f, "d"), { week: Math.ceil(d.dayOfYear() / 7), year: d.year() }
            } function ia(a) {
                return ha(a, this._week.dow, this._week.doy).week
            } function ja() {
                return this._week.dow
            } function ka() {
                return this._week.doy
            } function la(a) {
                var b = this.localeData().week(this); return null == a ? b : this.add(7 * (a - b), "d")
            } function ma(a) {
                var b = ha(this, 1, 4).week; return null == a ? b : this.add(7 * (a - b), "d")
            } function na(a, b, c, d, e) {
                var f, g, h = da(a, 0, 1).getUTCDay(); return h = 0 === h ? 7 : h, c = null != c ? c : e, f = e - h + (h > d ? 7 : 0) - (e > h ? 7 : 0), g = 7 * (b - 1) + (c - e) + f + 1, { year: g > 0 ? a : a - 1, dayOfYear: g > 0 ? g : ea(a - 1) + g }
            } function oa(a) {
                var b = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1; return null == a ? b : this.add(a - b, "d")
            } function pa(a, b, c) {
                return null != a ? a : null != b ? b : c
            } function qa(a) {
                var b = new Date; return a._useUTC ? [b.getUTCFullYear(), b.getUTCMonth(), b.getUTCDate()] : [b.getFullYear(), b.getMonth(), b.getDate()]
            } function ra(a) {
                var b, c, d, e, f = []; if (!a._d) { for (d = qa(a), a._w && null == a._a[dd] && null == a._a[cd] && sa(a), a._dayOfYear && (e = pa(a._a[bd], d[bd]), a._dayOfYear > ea(e) && (j(a)._overflowDayOfYear = !0), c = da(e, 0, a._dayOfYear), a._a[cd] = c.getUTCMonth(), a._a[dd] = c.getUTCDate()), b = 0; 3 > b && null == a._a[b]; ++b) a._a[b] = f[b] = d[b]; for (; 7 > b; b++) a._a[b] = f[b] = null == a._a[b] ? 2 === b ? 1 : 0 : a._a[b]; 24 === a._a[ed] && 0 === a._a[fd] && 0 === a._a[gd] && 0 === a._a[hd] && (a._nextDay = !0, a._a[ed] = 0), a._d = (a._useUTC ? da : ca).apply(null, f), null != a._tzm && a._d.setUTCMinutes(a._d.getUTCMinutes() - a._tzm), a._nextDay && (a._a[ed] = 24) }
            } function sa(a) {
                var b, c, d, e, f, g, h; b = a._w, null != b.GG || null != b.W || null != b.E ? (f = 1, g = 4, c = pa(b.GG, a._a[bd], ha(Aa(), 1, 4).year), d = pa(b.W, 1), e = pa(b.E, 1)) : (f = a._locale._week.dow, g = a._locale._week.doy, c = pa(b.gg, a._a[bd], ha(Aa(), f, g).year), d = pa(b.w, 1), null != b.d ? (e = b.d, f > e && ++d) : e = null != b.e ? b.e + f : f), h = na(c, d, e, g, f), a._a[bd] = h.year, a._dayOfYear = h.dayOfYear
            } function ta(b) {
                if (b._f === a.ISO_8601) return void aa(b); b._a = [], j(b).empty = !0; var c, d, e, f, g, h = "" + b._i, i = h.length, k = 0; for (e = K(b._f, b._locale).match(Jc) || [], c = 0; c < e.length; c++) f = e[c], d = (h.match(M(f, b)) || [])[0], d && (g = h.substr(0, h.indexOf(d)), g.length > 0 && j(b).unusedInput.push(g), h = h.slice(h.indexOf(d) + d.length), k += d.length), Mc[f] ? (d ? j(b).empty = !1 : j(b).unusedTokens.push(f), Q(f, d, b)) : b._strict && !d && j(b).unusedTokens.push(f); j(b).charsLeftOver = i - k, h.length > 0 && j(b).unusedInput.push(h), j(b).bigHour === !0 && b._a[ed] <= 12 && b._a[ed] > 0 && (j(b).bigHour = void 0), b._a[ed] = ua(b._locale, b._a[ed], b._meridiem), ra(b), Y(b)
            } function ua(a, b, c) {
                var d; return null == c ? b : null != a.meridiemHour ? a.meridiemHour(b, c) : null != a.isPM ? (d = a.isPM(c), d && 12 > b && (b += 12), d || 12 !== b || (b = 0), b) : b
            } function va(a) {
                var b, c, d, e, f; if (0 === a._f.length) return j(a).invalidFormat = !0, void (a._d = new Date(0 / 0)); for (e = 0; e < a._f.length; e++) f = 0, b = m({}, a), null != a._useUTC && (b._useUTC = a._useUTC), b._f = a._f[e], ta(b), k(b) && (f += j(b).charsLeftOver, f += 10 * j(b).unusedTokens.length, j(b).score = f, (null == d || d > f) && (d = f, c = b)); g(a, c || b)
            } function wa(a) {
                if (!a._d) { var b = A(a._i); a._a = [b.year, b.month, b.day || b.date, b.hour, b.minute, b.second, b.millisecond], ra(a) }
            } function xa(a) {
                var b, e = a._i, f = a._f; return a._locale = a._locale || x(a._l), null === e || void 0 === f && "" === e ? l({ nullInput: !0 }) : ("string" == typeof e && (a._i = e = a._locale.preparse(e)), o(e) ? new n(Y(e)) : (c(f) ? va(a) : f ? ta(a) : d(e) ? a._d = e : ya(a), b = new n(Y(a)), b._nextDay && (b.add(1, "d"), b._nextDay = void 0), b))
            } function ya(b) {
                var f = b._i; void 0 === f ? b._d = new Date : d(f) ? b._d = new Date(+f) : "string" == typeof f ? ba(b) : c(f) ? (b._a = e(f.slice(0), function (a) { return parseInt(a, 10) }), ra(b)) : "object" == typeof f ? wa(b) : "number" == typeof f ? b._d = new Date(f) : a.createFromInputFallback(b)
            } function za(a, b, c, d, e) {
                var f = {}; return "boolean" == typeof c && (d = c, c = void 0), f._isAMomentObject = !0, f._useUTC = f._isUTC = e, f._l = c, f._i = a, f._f = b, f._strict = d, xa(f)
            } function Aa(a, b, c, d) {
                return za(a, b, c, d, !1)
            } function Ba(a, b) {
                var d, e; if (1 === b.length && c(b[0]) && (b = b[0]), !b.length) return Aa(); for (d = b[0], e = 1; e < b.length; ++e) b[e][a](d) && (d = b[e]); return d
            } function Ca() {
                var a = [].slice.call(arguments, 0); return Ba("isBefore", a)
            } function Da() {
                var a = [].slice.call(arguments, 0); return Ba("isAfter", a)
            } function Ea(a) {
                var b = A(a), c = b.year || 0, d = b.quarter || 0, e = b.month || 0, f = b.week || 0, g = b.day || 0, h = b.hour || 0, i = b.minute || 0, j = b.second || 0, k = b.millisecond || 0; this._milliseconds = +k + 1e3 * j + 6e4 * i + 36e5 * h, this._days = +g + 7 * f, this._months = +e + 3 * d + 12 * c, this._data = {}, this._locale = x(), this._bubble()
            } function Fa(a) {
                return a instanceof Ea
            } function Ga(a, b) {
                G(a, 0, 0, function () { var a = this.utcOffset(), c = "+"; return 0 > a && (a = -a, c = "-"), c + F(~~(a / 60), 2) + b + F(~~a % 60, 2) })
            } function Ha(a) {
                var b = (a || "").match(Yc) || [], c = b[b.length - 1] || [], d = (c + "").match(td) || ["-", 0, 0], e = +(60 * d[1]) + p(d[2]); return "+" === d[0] ? e : -e
            } function Ia(b, c) {
                var e, f; return c._isUTC ? (e = c.clone(), f = (o(b) || d(b) ? +b : +Aa(b)) - +e, e._d.setTime(+e._d + f), a.updateOffset(e, !1), e) : Aa(b).local(); return c._isUTC ? Aa(b).zone(c._offset || 0) : Aa(b).local()
            } function Ja(a) {
                return 15 * -Math.round(a._d.getTimezoneOffset() / 15)
            } function Ka(b, c) {
                var d, e = this._offset || 0; return null != b ? ("string" == typeof b && (b = Ha(b)), Math.abs(b) < 16 && (b = 60 * b), !this._isUTC && c && (d = Ja(this)), this._offset = b, this._isUTC = !0, null != d && this.add(d, "m"), e !== b && (!c || this._changeInProgress ? $a(this, Va(b - e, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, a.updateOffset(this, !0), this._changeInProgress = null)), this) : this._isUTC ? e : Ja(this)
            } function La(a, b) {
                return null != a ? ("string" != typeof a && (a = -a), this.utcOffset(a, b), this) : -this.utcOffset()
            } function Ma(a) {
                return this.utcOffset(0, a)
            } function Na(a) {
                return this._isUTC && (this.utcOffset(0, a), this._isUTC = !1, a && this.subtract(Ja(this), "m")), this
            } function Oa() {
                return this._tzm ? this.utcOffset(this._tzm) : "string" == typeof this._i && this.utcOffset(Ha(this._i)), this
            } function Pa(a) {
                return a = a ? Aa(a).utcOffset() : 0, (this.utcOffset() - a) % 60 === 0
            } function Qa() {
                return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset()
            } function Ra() {
                if (this._a) { var a = this._isUTC ? h(this._a) : Aa(this._a); return this.isValid() && q(this._a, a.toArray()) > 0 } return !1
            } function Sa() {
                return !this._isUTC
            } function Ta() {
                return this._isUTC
            } function Ua() {
                return this._isUTC && 0 === this._offset
            } function Va(a, b) {
                var c, d, e, g = a, h = null; return Fa(a) ? g = { ms: a._milliseconds, d: a._days, M: a._months } : "number" == typeof a ? (g = {}, b ? g[b] = a : g.milliseconds = a) : (h = ud.exec(a)) ? (c = "-" === h[1] ? -1 : 1, g = { y: 0, d: p(h[dd]) * c, h: p(h[ed]) * c, m: p(h[fd]) * c, s: p(h[gd]) * c, ms: p(h[hd]) * c }) : (h = vd.exec(a)) ? (c = "-" === h[1] ? -1 : 1, g = { y: Wa(h[2], c), M: Wa(h[3], c), d: Wa(h[4], c), h: Wa(h[5], c), m: Wa(h[6], c), s: Wa(h[7], c), w: Wa(h[8], c) }) : null == g ? g = {} : "object" == typeof g && ("from" in g || "to" in g) && (e = Ya(Aa(g.from), Aa(g.to)), g = {}, g.ms = e.milliseconds, g.M = e.months), d = new Ea(g), Fa(a) && f(a, "_locale") && (d._locale = a._locale), d
            } function Wa(a, b) {
                var c = a && parseFloat(a.replace(",", ".")); return (isNaN(c) ? 0 : c) * b
            } function Xa(a, b) {
                var c = { milliseconds: 0, months: 0 }; return c.months = b.month() - a.month() + 12 * (b.year() - a.year()), a.clone().add(c.months, "M").isAfter(b) && --c.months, c.milliseconds = +b - +a.clone().add(c.months, "M"), c
            } function Ya(a, b) {
                var c; return b = Ia(b, a), a.isBefore(b) ? c = Xa(a, b) : (c = Xa(b, a), c.milliseconds = -c.milliseconds, c.months = -c.months), c
            } function Za(a, b) {
                return function (c, d) { var e, f; return null === d || isNaN(+d) || (_(b, "moment()." + b + "(period, number) is deprecated. Please use moment()." + b + "(number, period)."), f = c, c = d, d = f), c = "string" == typeof c ? +c : c, e = Va(c, d), $a(this, e, a), this }
            } function $a(b, c, d, e) {
                var f = c._milliseconds, g = c._days, h = c._months; e = null == e ? !0 : e, f && b._d.setTime(+b._d + f * d), g && D(b, "Date", C(b, "Date") + g * d), h && V(b, C(b, "Month") + h * d), e && a.updateOffset(b, g || h)
            } function _a(a) {
                var b = a || Aa(), c = Ia(b, this).startOf("day"), d = this.diff(c, "days", !0), e = -6 > d ? "sameElse" : -1 > d ? "lastWeek" : 0 > d ? "lastDay" : 1 > d ? "sameDay" : 2 > d ? "nextDay" : 7 > d ? "nextWeek" : "sameElse"; return this.format(this.localeData().calendar(e, this, Aa(b)))
            } function ab() {
                return new n(this)
            } function bb(a, b) {
                var c; return b = z("undefined" != typeof b ? b : "millisecond"), "millisecond" === b ? (a = o(a) ? a : Aa(a), +this > +a) : (c = o(a) ? +a : +Aa(a), c < +this.clone().startOf(b))
            } function cb(a, b) {
                var c; return b = z("undefined" != typeof b ? b : "millisecond"), "millisecond" === b ? (a = o(a) ? a : Aa(a), +a > +this) : (c = o(a) ? +a : +Aa(a), +this.clone().endOf(b) < c)
            } function db(a, b, c) {
                return this.isAfter(a, c) && this.isBefore(b, c)
            } function eb(a, b) {
                var c; return b = z(b || "millisecond"), "millisecond" === b ? (a = o(a) ? a : Aa(a), +this === +a) : (c = +Aa(a), +this.clone().startOf(b) <= c && c <= +this.clone().endOf(b))
            } function fb(a) {
                return 0 > a ? Math.ceil(a) : Math.floor(a)
            } function gb(a, b, c) {
                var d, e, f = Ia(a, this), g = 6e4 * (f.utcOffset() - this.utcOffset()); return b = z(b), "year" === b || "month" === b || "quarter" === b ? (e = hb(this, f), "quarter" === b ? e /= 3 : "year" === b && (e /= 12)) : (d = this - f, e = "second" === b ? d / 1e3 : "minute" === b ? d / 6e4 : "hour" === b ? d / 36e5 : "day" === b ? (d - g) / 864e5 : "week" === b ? (d - g) / 6048e5 : d), c ? e : fb(e)
            } function hb(a, b) {
                var c, d, e = 12 * (b.year() - a.year()) + (b.month() - a.month()), f = a.clone().add(e, "months"); return 0 > b - f ? (c = a.clone().add(e - 1, "months"), d = (b - f) / (f - c)) : (c = a.clone().add(e + 1, "months"), d = (b - f) / (c - f)), -(e + d)
            } function ib() {
                return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")
            } function jb() {
                var a = this.clone().utc(); return 0 < a.year() && a.year() <= 9999 ? "function" == typeof Date.prototype.toISOString ? this.toDate().toISOString() : J(a, "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]") : J(a, "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")
            } function kb(b) {
                var c = J(this, b || a.defaultFormat); return this.localeData().postformat(c)
            } function lb(a, b) {
                return this.isValid() ? Va({ to: this, from: a }).locale(this.locale()).humanize(!b) : this.localeData().invalidDate()
            } function mb(a) {
                return this.from(Aa(), a)
            } function nb(a, b) {
                return this.isValid() ? Va({ from: this, to: a }).locale(this.locale()).humanize(!b) : this.localeData().invalidDate()
            } function ob(a) {
                return this.to(Aa(), a)
            } function pb(a) {
                var b; return void 0 === a ? this._locale._abbr : (b = x(a), null != b && (this._locale = b), this)
            } function qb() {
                return this._locale
            } function rb(a) {
                switch (a = z(a)) { case "year": this.month(0); case "quarter": case "month": this.date(1); case "week": case "isoWeek": case "day": this.hours(0); case "hour": this.minutes(0); case "minute": this.seconds(0); case "second": this.milliseconds(0) } return "week" === a && this.weekday(0), "isoWeek" === a && this.isoWeekday(1), "quarter" === a && this.month(3 * Math.floor(this.month() / 3)), this
            } function sb(a) {
                return a = z(a), void 0 === a || "millisecond" === a ? this : this.startOf(a).add(1, "isoWeek" === a ? "week" : a).subtract(1, "ms")
            } function tb() {
                return +this._d - 6e4 * (this._offset || 0)
            } function ub() {
                return Math.floor(+this / 1e3)
            } function vb() {
                return this._offset ? new Date(+this) : this._d
            } function wb() {
                var a = this; return [a.year(), a.month(), a.date(), a.hour(), a.minute(), a.second(), a.millisecond()]
            } function xb() {
                return k(this)
            } function yb() {
                return g({}, j(this))
            } function zb() {
                return j(this).overflow
            } function Ab(a, b) {
                G(0, [a, a.length], 0, b)
            } function Bb(a, b, c) {
                return ha(Aa([a, 11, 31 + b - c]), b, c).week
            } function Cb(a) {
                var b = ha(this, this.localeData()._week.dow, this.localeData()._week.doy).year; return null == a ? b : this.add(a - b, "y")
            } function Db(a) {
                var b = ha(this, 1, 4).year; return null == a ? b : this.add(a - b, "y")
            } function Eb() {
                return Bb(this.year(), 1, 4)
            } function Fb() {
                var a = this.localeData()._week; return Bb(this.year(), a.dow, a.doy)
            } function Gb(a) {
                return null == a ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (a - 1) + this.month() % 3)
            } function Hb(a, b) {
                if ("string" == typeof a) if (isNaN(a)) { if (a = b.weekdaysParse(a), "number" != typeof a) return null } else a = parseInt(a, 10); return a
            } function Ib(a) {
                return this._weekdays[a.day()]
            } function Jb(a) {
                return this._weekdaysShort[a.day()]
            } function Kb(a) {
                return this._weekdaysMin[a.day()]
            } function Lb(a) {
                var b, c, d; for (this._weekdaysParse || (this._weekdaysParse = []), b = 0; 7 > b; b++) if (this._weekdaysParse[b] || (c = Aa([2e3, 1]).day(b), d = "^" + this.weekdays(c, "") + "|^" + this.weekdaysShort(c, "") + "|^" + this.weekdaysMin(c, ""), this._weekdaysParse[b] = new RegExp(d.replace(".", ""), "i")), this._weekdaysParse[b].test(a)) return b
            } function Mb(a) {
                var b = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); return null != a ? (a = Hb(a, this.localeData()), this.add(a - b, "d")) : b
            } function Nb(a) {
                var b = (this.day() + 7 - this.localeData()._week.dow) % 7; return null == a ? b : this.add(a - b, "d")
            } function Ob(a) {
                return null == a ? this.day() || 7 : this.day(this.day() % 7 ? a : a - 7)
            } function Pb(a, b) {
                G(a, 0, 0, function () { return this.localeData().meridiem(this.hours(), this.minutes(), b) })
            } function Qb(a, b) {
                return b._meridiemParse
            } function Rb(a) {
                return "p" === (a + "").toLowerCase().charAt(0)
            } function Sb(a, b, c) {
                return a > 11 ? c ? "pm" : "PM" : c ? "am" : "AM"
            } function Tb(a) {
                G(0, [a, 3], 0, "millisecond")
            } function Ub() {
                return this._isUTC ? "UTC" : ""
            } function Vb() {
                return this._isUTC ? "Coordinated Universal Time" : ""
            } function Wb(a) {
                return Aa(1e3 * a)
            } function Xb() {
                return Aa.apply(null, arguments).parseZone()
            } function Yb(a, b, c) {
                var d = this._calendar[a]; return "function" == typeof d ? d.call(b, c) : d
            } function Zb(a) {
                var b = this._longDateFormat[a]; return !b && this._longDateFormat[a.toUpperCase()] && (b = this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (a) { return a.slice(1) }), this._longDateFormat[a] = b), b
            } function $b() {
                return this._invalidDate
            } function _b(a) {
                return this._ordinal.replace("%d", a)
            } function ac(a) {
                return a
            } function bc(a, b, c, d) {
                var e = this._relativeTime[c]; return "function" == typeof e ? e(a, b, c, d) : e.replace(/%d/i, a)
            } function cc(a, b) {
                var c = this._relativeTime[a > 0 ? "future" : "past"]; return "function" == typeof c ? c(b) : c.replace(/%s/i, b)
            } function dc(a) {
                var b, c; for (c in a) b = a[c], "function" == typeof b ? this[c] = b : this["_" + c] = b; this._ordinalParseLenient = new RegExp(this._ordinalParse.source + "|" + /\d{1,2}/.source)
            } function ec(a, b, c, d) {
                var e = x(), f = h().set(d, b); return e[c](f, a)
            } function fc(a, b, c, d, e) {
                if ("number" == typeof a && (b = a, a = void 0), a = a || "", null != b) return ec(a, b, c, e); var f, g = []; for (f = 0; d > f; f++) g[f] = ec(a, f, c, e); return g
            } function gc(a, b) {
                return fc(a, b, "months", 12, "month")
            } function hc(a, b) {
                return fc(a, b, "monthsShort", 12, "month")
            } function ic(a, b) {
                return fc(a, b, "weekdays", 7, "day")
            } function jc(a, b) {
                return fc(a, b, "weekdaysShort", 7, "day")
            } function kc(a, b) {
                return fc(a, b, "weekdaysMin", 7, "day")
            } function lc() {
                var a = this._data; return this._milliseconds = Rd(this._milliseconds), this._days = Rd(this._days), this._months = Rd(this._months), a.milliseconds = Rd(a.milliseconds), a.seconds = Rd(a.seconds), a.minutes = Rd(a.minutes), a.hours = Rd(a.hours), a.months = Rd(a.months), a.years = Rd(a.years), this
            } function mc(a, b, c, d) {
                var e = Va(b, c); return a._milliseconds += d * e._milliseconds, a._days += d * e._days, a._months += d * e._months, a._bubble()
            } function nc(a, b) {
                return mc(this, a, b, 1)
            } function oc(a, b) {
                return mc(this, a, b, -1)
            } function pc() {
                var a, b, c, d = this._milliseconds, e = this._days, f = this._months, g = this._data, h = 0; return g.milliseconds = d % 1e3, a = fb(d / 1e3), g.seconds = a % 60, b = fb(a / 60), g.minutes = b % 60, c = fb(b / 60), g.hours = c % 24, e += fb(c / 24), h = fb(qc(e)), e -= fb(rc(h)), f += fb(e / 30), e %= 30, h += fb(f / 12), f %= 12, g.days = e, g.months = f, g.years = h, this
            } function qc(a) {
                return 400 * a / 146097
            } function rc(a) {
                return 146097 * a / 400
            } function sc(a) {
                var b, c, d = this._milliseconds; if (a = z(a), "month" === a || "year" === a) return b = this._days + d / 864e5, c = this._months + 12 * qc(b), "month" === a ? c : c / 12; switch (b = this._days + Math.round(rc(this._months / 12)), a) { case "week": return b / 7 + d / 6048e5; case "day": return b + d / 864e5; case "hour": return 24 * b + d / 36e5; case "minute": return 1440 * b + d / 6e4; case "second": return 86400 * b + d / 1e3; case "millisecond": return Math.floor(864e5 * b) + d; default: throw new Error("Unknown unit " + a) }
            } function tc() {
                return this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * p(this._months / 12)
            } function uc(a) {
                return function () { return this.as(a) }
            } function vc(a) {
                return a = z(a), this[a + "s"]()
            } function wc(a) {
                return function () { return this._data[a] }
            } function xc() {
                return fb(this.days() / 7)
            } function yc(a, b, c, d, e) {
                return e.relativeTime(b || 1, !!c, a, d)
            } function zc(a, b, c) {
                var d = Va(a).abs(), e = fe(d.as("s")), f = fe(d.as("m")), g = fe(d.as("h")), h = fe(d.as("d")), i = fe(d.as("M")), j = fe(d.as("y")), k = e < ge.s && ["s", e] || 1 === f && ["m"] || f < ge.m && ["mm", f] || 1 === g && ["h"] || g < ge.h && ["hh", g] || 1 === h && ["d"] || h < ge.d && ["dd", h] || 1 === i && ["M"] || i < ge.M && ["MM", i] || 1 === j && ["y"] || ["yy", j]; return k[2] = b, k[3] = +a > 0, k[4] = c, yc.apply(null, k)
            } function Ac(a, b) {
                return void 0 === ge[a] ? !1 : void 0 === b ? ge[a] : (ge[a] = b, !0)
            } function Bc(a) {
                var b = this.localeData(), c = zc(this, !a, b); return a && (c = b.pastFuture(+this, c)), b.postformat(c)
            } function Cc() {
                var a = he(this.years()), b = he(this.months()), c = he(this.days()), d = he(this.hours()), e = he(this.minutes()), f = he(this.seconds() + this.milliseconds() / 1e3), g = this.asSeconds(); return g ? (0 > g ? "-" : "") + "P" + (a ? a + "Y" : "") + (b ? b + "M" : "") + (c ? c + "D" : "") + (d || e || f ? "T" : "") + (d ? d + "H" : "") + (e ? e + "M" : "") + (f ? f + "S" : "") : "P0D"
            } var Dc, Ec, Fc = a.momentProperties = [], Gc = !1, Hc = {}, Ic = {}, Jc = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g, Kc = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, Lc = {}, Mc = {}, Nc = /\d/, Oc = /\d\d/, Pc = /\d{3}/, Qc = /\d{4}/, Rc = /[+-]?\d{6}/, Sc = /\d\d?/, Tc = /\d{1,3}/, Uc = /\d{1,4}/, Vc = /[+-]?\d{1,6}/, Wc = /\d+/, Xc = /[+-]?\d+/, Yc = /Z|[+-]\d\d:?\d\d/gi, Zc = /[+-]?\d+(\.\d{1,3})?/, $c = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, _c = {}, ad = {}, bd = 0, cd = 1, dd = 2, ed = 3, fd = 4, gd = 5, hd = 6; G("M", ["MM", 2], "Mo", function () { return this.month() + 1 }), G("MMM", 0, 0, function (a) { return this.localeData().monthsShort(this, a) }), G("MMMM", 0, 0, function (a) { return this.localeData().months(this, a) }), y("month", "M"), L("M", Sc), L("MM", Sc, Oc), L("MMM", $c), L("MMMM", $c), O(["M", "MM"], function (a, b) { b[cd] = p(a) - 1 }), O(["MMM", "MMMM"], function (a, b, c, d) { var e = c._locale.monthsParse(a, d, c._strict); null != e ? b[cd] = e : j(c).invalidMonth = a }); var id = "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), jd = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), kd = {
            }; a.suppressDeprecationWarnings = !1; var ld = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, md = [["YYYYYY-MM-DD", /[+-]\d{6}-\d{2}-\d{2}/], ["YYYY-MM-DD", /\d{4}-\d{2}-\d{2}/], ["GGGG-[W]WW-E", /\d{4}-W\d{2}-\d/], ["GGGG-[W]WW", /\d{4}-W\d{2}/], ["YYYY-DDD", /\d{4}-\d{3}/]], nd = [["HH:mm:ss.SSSS", /(T| )\d\d:\d\d:\d\d\.\d+/], ["HH:mm:ss", /(T| )\d\d:\d\d:\d\d/], ["HH:mm", /(T| )\d\d:\d\d/], ["HH", /(T| )\d\d/]], od = /^\/?Date\((\-?\d+)/i; a.createFromInputFallback = $("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.", function (a) { a._d = new Date(a._i + (a._useUTC ? " UTC" : "")) }), G(0, ["YY", 2], 0, function () { return this.year() % 100 }), G(0, ["YYYY", 4], 0, "year"), G(0, ["YYYYY", 5], 0, "year"), G(0, ["YYYYYY", 6, !0], 0, "year"), y("year", "y"), L("Y", Xc), L("YY", Sc, Oc), L("YYYY", Uc, Qc), L("YYYYY", Vc, Rc), L("YYYYYY", Vc, Rc), O(["YYYY", "YYYYY", "YYYYYY"], bd), O("YY", function (b, c) { c[bd] = a.parseTwoDigitYear(b) }), a.parseTwoDigitYear = function (a) {
                return p(a) + (p(a) > 68 ? 1900 : 2e3)
            }; var pd = B("FullYear", !1); G("w", ["ww", 2], "wo", "week"), G("W", ["WW", 2], "Wo", "isoWeek"), y("week", "w"), y("isoWeek", "W"), L("w", Sc), L("ww", Sc, Oc), L("W", Sc), L("WW", Sc, Oc), P(["w", "ww", "W", "WW"], function (a, b, c, d) { b[d.substr(0, 1)] = p(a) }); var qd = {
                dow: 0, doy: 6
            }; G("DDD", ["DDDD", 3], "DDDo", "dayOfYear"), y("dayOfYear", "DDD"), L("DDD", Tc), L("DDDD", Pc), O(["DDD", "DDDD"], function (a, b, c) { c._dayOfYear = p(a) }), a.ISO_8601 = function () {
            }; var rd = $("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548", function () { var a = Aa.apply(null, arguments); return this > a ? this : a }), sd = $("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548", function () { var a = Aa.apply(null, arguments); return a > this ? this : a }); Ga("Z", ":"), Ga("ZZ", ""), L("Z", Yc), L("ZZ", Yc), O(["Z", "ZZ"], function (a, b, c) { c._useUTC = !0, c._tzm = Ha(a) }); var td = /([\+\-]|\d\d)/gi; a.updateOffset = function () {
            }; var ud = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, vd = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; Va.fn = Ea.prototype; var wd = Za(1, "add"), xd = Za(-1, "subtract"); a.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ"; var yd = $("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function (a) { return void 0 === a ? this.localeData() : this.locale(a) }); G(0, ["gg", 2], 0, function () { return this.weekYear() % 100 }), G(0, ["GG", 2], 0, function () { return this.isoWeekYear() % 100 }), Ab("gggg", "weekYear"), Ab("ggggg", "weekYear"), Ab("GGGG", "isoWeekYear"), Ab("GGGGG", "isoWeekYear"), y("weekYear", "gg"), y("isoWeekYear", "GG"), L("G", Xc), L("g", Xc), L("GG", Sc, Oc), L("gg", Sc, Oc), L("GGGG", Uc, Qc), L("gggg", Uc, Qc), L("GGGGG", Vc, Rc), L("ggggg", Vc, Rc), P(["gggg", "ggggg", "GGGG", "GGGGG"], function (a, b, c, d) { b[d.substr(0, 2)] = p(a) }), P(["gg", "GG"], function (b, c, d, e) { c[e] = a.parseTwoDigitYear(b) }), G("Q", 0, 0, "quarter"), y("quarter", "Q"), L("Q", Nc), O("Q", function (a, b) { b[cd] = 3 * (p(a) - 1) }), G("D", ["DD", 2], "Do", "date"), y("date", "D"), L("D", Sc), L("DD", Sc, Oc), L("Do", function (a, b) { return a ? b._ordinalParse : b._ordinalParseLenient }), O(["D", "DD"], dd), O("Do", function (a, b) { b[dd] = p(a.match(Sc)[0], 10) }); var zd = B("Date", !0); G("d", 0, "do", "day"), G("dd", 0, 0, function (a) { return this.localeData().weekdaysMin(this, a) }), G("ddd", 0, 0, function (a) { return this.localeData().weekdaysShort(this, a) }), G("dddd", 0, 0, function (a) { return this.localeData().weekdays(this, a) }), G("e", 0, 0, "weekday"), G("E", 0, 0, "isoWeekday"), y("day", "d"), y("weekday", "e"), y("isoWeekday", "E"), L("d", Sc), L("e", Sc), L("E", Sc), L("dd", $c), L("ddd", $c), L("dddd", $c), P(["dd", "ddd", "dddd"], function (a, b, c) { var d = c._locale.weekdaysParse(a); null != d ? b.d = d : j(c).invalidWeekday = a }), P(["d", "e", "E"], function (a, b, c, d) { b[d] = p(a) }); var Ad = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), Bd = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), Cd = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"); G("H", ["HH", 2], 0, "hour"), G("h", ["hh", 2], 0, function () { return this.hours() % 12 || 12 }), Pb("a", !0), Pb("A", !1), y("hour", "h"), L("a", Qb), L("A", Qb), L("H", Sc), L("h", Sc), L("HH", Sc, Oc), L("hh", Sc, Oc), O(["H", "HH"], ed), O(["a", "A"], function (a, b, c) { c._isPm = c._locale.isPM(a), c._meridiem = a }), O(["h", "hh"], function (a, b, c) { b[ed] = p(a), j(c).bigHour = !0 }); var Dd = /[ap]\.?m?\.?/i, Ed = B("Hours", !0); G("m", ["mm", 2], 0, "minute"), y("minute", "m"), L("m", Sc), L("mm", Sc, Oc), O(["m", "mm"], fd); var Fd = B("Minutes", !1); G("s", ["ss", 2], 0, "second"), y("second", "s"), L("s", Sc), L("ss", Sc, Oc), O(["s", "ss"], gd); var Gd = B("Seconds", !1); G("S", 0, 0, function () { return ~~(this.millisecond() / 100) }), G(0, ["SS", 2], 0, function () { return ~~(this.millisecond() / 10) }), Tb("SSS"), Tb("SSSS"), y("millisecond", "ms"), L("S", Tc, Nc), L("SS", Tc, Oc), L("SSS", Tc, Pc), L("SSSS", Wc), O(["S", "SS", "SSS", "SSSS"], function (a, b) { b[hd] = p(1e3 * ("0." + a)) }); var Hd = B("Milliseconds", !1); G("z", 0, 0, "zoneAbbr"), G("zz", 0, 0, "zoneName"); var Id = n.prototype; Id.add = wd, Id.calendar = _a, Id.clone = ab, Id.diff = gb, Id.endOf = sb, Id.format = kb, Id.from = lb, Id.fromNow = mb, Id.to = nb, Id.toNow = ob, Id.get = E, Id.invalidAt = zb, Id.isAfter = bb, Id.isBefore = cb, Id.isBetween = db, Id.isSame = eb, Id.isValid = xb, Id.lang = yd, Id.locale = pb, Id.localeData = qb, Id.max = sd, Id.min = rd, Id.parsingFlags = yb, Id.set = E, Id.startOf = rb, Id.subtract = xd, Id.toArray = wb, Id.toDate = vb, Id.toISOString = jb, Id.toJSON = jb, Id.toString = ib, Id.unix = ub, Id.valueOf = tb, Id.year = pd, Id.isLeapYear = ga, Id.weekYear = Cb, Id.isoWeekYear = Db, Id.quarter = Id.quarters = Gb, Id.month = W, Id.daysInMonth = X, Id.week = Id.weeks = la, Id.isoWeek = Id.isoWeeks = ma, Id.weeksInYear = Fb, Id.isoWeeksInYear = Eb, Id.date = zd, Id.day = Id.days = Mb, Id.weekday = Nb, Id.isoWeekday = Ob, Id.dayOfYear = oa, Id.hour = Id.hours = Ed, Id.minute = Id.minutes = Fd, Id.second = Id.seconds = Gd, Id.millisecond = Id.milliseconds = Hd, Id.utcOffset = Ka, Id.utc = Ma, Id.local = Na, Id.parseZone = Oa, Id.hasAlignedHourOffset = Pa, Id.isDST = Qa, Id.isDSTShifted = Ra, Id.isLocal = Sa, Id.isUtcOffset = Ta, Id.isUtc = Ua, Id.isUTC = Ua, Id.zoneAbbr = Ub, Id.zoneName = Vb, Id.dates = $("dates accessor is deprecated. Use date instead.", zd), Id.months = $("months accessor is deprecated. Use month instead", W), Id.years = $("years accessor is deprecated. Use year instead", pd), Id.zone = $("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779", La); var Jd = Id, Kd = { sameDay: "[Today at] LT", nextDay: "[Tomorrow at] LT", nextWeek: "dddd [at] LT", lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", sameElse: "L" }, Ld = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY LT", LLLL: "dddd, MMMM D, YYYY LT" }, Md = "Invalid date", Nd = "%d", Od = /\d{1,2}/, Pd = {
                future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour",
                hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years"
            }, Qd = r.prototype; Qd._calendar = Kd, Qd.calendar = Yb, Qd._longDateFormat = Ld, Qd.longDateFormat = Zb, Qd._invalidDate = Md, Qd.invalidDate = $b, Qd._ordinal = Nd, Qd.ordinal = _b, Qd._ordinalParse = Od, Qd.preparse = ac, Qd.postformat = ac, Qd._relativeTime = Pd, Qd.relativeTime = bc, Qd.pastFuture = cc, Qd.set = dc, Qd.months = S, Qd._months = id, Qd.monthsShort = T, Qd._monthsShort = jd, Qd.monthsParse = U, Qd.week = ia, Qd._week = qd, Qd.firstDayOfYear = ka, Qd.firstDayOfWeek = ja, Qd.weekdays = Ib, Qd._weekdays = Ad, Qd.weekdaysMin = Kb, Qd._weekdaysMin = Cd, Qd.weekdaysShort = Jb, Qd._weekdaysShort = Bd, Qd.weekdaysParse = Lb, Qd.isPM = Rb, Qd._meridiemParse = Dd, Qd.meridiem = Sb, v("en", { ordinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (a) { var b = a % 10, c = 1 === p(a % 100 / 10) ? "th" : 1 === b ? "st" : 2 === b ? "nd" : 3 === b ? "rd" : "th"; return a + c } }), a.lang = $("moment.lang is deprecated. Use moment.locale instead.", v), a.langData = $("moment.langData is deprecated. Use moment.localeData instead.", x); var Rd = Math.abs, Sd = uc("ms"), Td = uc("s"), Ud = uc("m"), Vd = uc("h"), Wd = uc("d"), Xd = uc("w"), Yd = uc("M"), Zd = uc("y"), $d = wc("milliseconds"), _d = wc("seconds"), ae = wc("minutes"), be = wc("hours"), ce = wc("days"), de = wc("months"), ee = wc("years"), fe = Math.round, ge = { s: 45, m: 45, h: 22, d: 26, M: 11 }, he = Math.abs, ie = Ea.prototype; ie.abs = lc, ie.add = nc, ie.subtract = oc, ie.as = sc, ie.asMilliseconds = Sd, ie.asSeconds = Td, ie.asMinutes = Ud, ie.asHours = Vd, ie.asDays = Wd, ie.asWeeks = Xd, ie.asMonths = Yd, ie.asYears = Zd, ie.valueOf = tc, ie._bubble = pc, ie.get = vc, ie.milliseconds = $d, ie.seconds = _d, ie.minutes = ae, ie.hours = be, ie.days = ce, ie.weeks = xc, ie.months = de, ie.years = ee, ie.humanize = Bc, ie.toISOString = Cc, ie.toString = Cc, ie.toJSON = Cc, ie.locale = pb, ie.localeData = qb, ie.toIsoString = $("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", Cc), ie.lang = yd, G("X", 0, 0, "unix"), G("x", 0, 0, "valueOf"), L("x", Xc), L("X", Zc), O("X", function (a, b, c) { c._d = new Date(1e3 * parseFloat(a, 10)) }), O("x", function (a, b, c) { c._d = new Date(p(a)) }), a.version = "2.10.3", b(Aa), a.fn = Jd, a.min = Ca, a.max = Da, a.utc = h, a.unix = Wb, a.months = gc, a.isDate = d, a.locale = v, a.invalid = l, a.duration = Va, a.isMoment = o, a.weekdays = ic, a.parseZone = Xb, a.localeData = x, a.isDuration = Fa, a.monthsShort = hc, a.weekdaysMin = kc, a.defineLocale = w, a.weekdaysShort = jc, a.normalizeUnits = z, a.relativeTimeThreshold = Ac; var je = a; return je
        });


        /*
         The MIT License (MIT)
        
         Copyright (c) 2015 Jonathan Peterson
        
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
        
         The above copyright notice and this permission notice shall be included in
         all copies or substantial portions of the Software.
        
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
         THE SOFTWARE.
         */
        !function (e) { "use strict"; if ("function" == typeof define && define.amd) define(["jquery", "moment"], e); else if ("object" == typeof exports) e(require("jquery"), require("moment")); else { if ("undefined" == typeof jQuery) throw "bootstrap-datetimepicker requires jQuery to be loaded first"; if ("undefined" == typeof moment) throw "bootstrap-datetimepicker requires Moment.js to be loaded first"; e(jQuery, moment) } }(function (e, t) { "use strict"; if (!t) throw new Error("bootstrap-datetimepicker requires Moment.js to be loaded first"); var a = function (a, n) { var r, i, o, s, d, p = {}, l = t().startOf("d"), c = l.clone(), u = !0, f = !1, m = !1, h = 0, g = [{ clsName: "days", navFnc: "M", navStep: 1 }, { clsName: "months", navFnc: "y", navStep: 1 }, { clsName: "years", navFnc: "y", navStep: 10 }], y = ["days", "months", "years"], w = ["top", "bottom", "auto"], b = ["left", "right", "auto"], v = ["default", "top", "bottom"], k = { up: 38, 38: "up", down: 40, 40: "down", left: 37, 37: "left", right: 39, 39: "right", tab: 9, 9: "tab", escape: 27, 27: "escape", enter: 13, 13: "enter", pageUp: 33, 33: "pageUp", pageDown: 34, 34: "pageDown", shift: 16, 16: "shift", control: 17, 17: "control", space: 32, 32: "space", t: 84, 84: "t", "delete": 46, 46: "delete" }, C = {}, x = function (e) { if ("string" != typeof e || e.length > 1) throw new TypeError("isEnabled expects a single character string parameter"); switch (e) { case "y": return -1 !== o.indexOf("Y"); case "M": return -1 !== o.indexOf("M"); case "d": return -1 !== o.toLowerCase().indexOf("d"); case "h": case "H": return -1 !== o.toLowerCase().indexOf("h"); case "m": return -1 !== o.indexOf("m"); case "s": return -1 !== o.indexOf("s"); default: return !1 } }, D = function () { return x("h") || x("m") || x("s") }, T = function () { return x("y") || x("M") || x("d") }, M = function () { var t = e("<thead>").append(e("<tr>").append(e("<th>").addClass("prev").attr("data-action", "previous").append(e("<span>").addClass(n.icons.previous))).append(e("<th>").addClass("picker-switch").attr("data-action", "pickerSwitch").attr("colspan", n.calendarWeeks ? "6" : "5")).append(e("<th>").addClass("next").attr("data-action", "next").append(e("<span>").addClass(n.icons.next)))), a = e("<tbody>").append(e("<tr>").append(e("<td>").attr("colspan", n.calendarWeeks ? "8" : "7"))); return [e("<div>").addClass("datepicker-days").append(e("<table>").addClass("table-condensed").append(t).append(e("<tbody>"))), e("<div>").addClass("datepicker-months").append(e("<table>").addClass("table-condensed").append(t.clone()).append(a.clone())), e("<div>").addClass("datepicker-years").append(e("<table>").addClass("table-condensed").append(t.clone()).append(a.clone()))] }, O = function () { var t = e("<tr>"), a = e("<tr>"), r = e("<tr>"); return x("h") && (t.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "incrementHours").append(e("<span>").addClass(n.icons.up)))), a.append(e("<td>").append(e("<span>").addClass("timepicker-hour").attr("data-time-component", "hours").attr("data-action", "showHours"))), r.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "decrementHours").append(e("<span>").addClass(n.icons.down))))), x("m") && (x("h") && (t.append(e("<td>").addClass("separator")), a.append(e("<td>").addClass("separator").html(":")), r.append(e("<td>").addClass("separator"))), t.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "incrementMinutes").append(e("<span>").addClass(n.icons.up)))), a.append(e("<td>").append(e("<span>").addClass("timepicker-minute").attr("data-time-component", "minutes").attr("data-action", "showMinutes"))), r.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "decrementMinutes").append(e("<span>").addClass(n.icons.down))))), x("s") && (x("m") && (t.append(e("<td>").addClass("separator")), a.append(e("<td>").addClass("separator").html(":")), r.append(e("<td>").addClass("separator"))), t.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "incrementSeconds").append(e("<span>").addClass(n.icons.up)))), a.append(e("<td>").append(e("<span>").addClass("timepicker-second").attr("data-time-component", "seconds").attr("data-action", "showSeconds"))), r.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "decrementSeconds").append(e("<span>").addClass(n.icons.down))))), i || (t.append(e("<td>").addClass("separator")), a.append(e("<td>").append(e("<button>").addClass("btn btn-primary").attr("data-action", "togglePeriod"))), r.append(e("<td>").addClass("separator"))), e("<div>").addClass("timepicker-picker").append(e("<table>").addClass("table-condensed").append([t, a, r])) }, E = function () { var t = e("<div>").addClass("timepicker-hours").append(e("<table>").addClass("table-condensed")), a = e("<div>").addClass("timepicker-minutes").append(e("<table>").addClass("table-condensed")), n = e("<div>").addClass("timepicker-seconds").append(e("<table>").addClass("table-condensed")), r = [O()]; return x("h") && r.push(t), x("m") && r.push(a), x("s") && r.push(n), r }, P = function () { var t = []; return n.showTodayButton && t.push(e("<td>").append(e("<a>").attr("data-action", "today").append(e("<span>").addClass(n.icons.today)))), !n.sideBySide && T() && D() && t.push(e("<td>").append(e("<a>").attr("data-action", "togglePicker").append(e("<span>").addClass(n.icons.time)))), n.showClear && t.push(e("<td>").append(e("<a>").attr("data-action", "clear").append(e("<span>").addClass(n.icons.clear)))), n.showClose && t.push(e("<td>").append(e("<a>").attr("data-action", "close").append(e("<span>").addClass(n.icons.close)))), e("<table>").addClass("table-condensed").append(e("<tbody>").append(e("<tr>").append(t))) }, S = function () { var t = e("<div>").addClass("bootstrap-datetimepicker-widget dropdown-menu"), a = e("<div>").addClass("datepicker").append(M()), r = e("<div>").addClass("timepicker").append(E()), o = e("<ul>").addClass("list-unstyled"), s = e("<li>").addClass("picker-switch" + (n.collapse ? " accordion-toggle" : "")).append(P()); return n.inline && t.removeClass("dropdown-menu"), i && t.addClass("usetwentyfour"), n.sideBySide && T() && D() ? (t.addClass("timepicker-sbs"), t.append(e("<div>").addClass("row").append(a.addClass("col-sm-6")).append(r.addClass("col-sm-6"))), t.append(s), t) : ("top" === n.toolbarPlacement && o.append(s), T() && o.append(e("<li>").addClass(n.collapse && D() ? "collapse in" : "").append(a)), "default" === n.toolbarPlacement && o.append(s), D() && o.append(e("<li>").addClass(n.collapse && T() ? "collapse" : "").append(r)), "bottom" === n.toolbarPlacement && o.append(s), t.append(o)) }, B = function () { var t, r = {}; return t = a.is("input") || n.inline ? a.data() : a.find("input").data(), t.dateOptions && t.dateOptions instanceof Object && (r = e.extend(!0, r, t.dateOptions)), e.each(n, function (e) { var a = "date" + e.charAt(0).toUpperCase() + e.slice(1); void 0 !== t[a] && (r[e] = t[a]) }), r }, j = function () { var t, r = (f || a).position(), i = (f || a).offset(), o = n.widgetPositioning.vertical, s = n.widgetPositioning.horizontal; if (n.widgetParent) t = n.widgetParent.append(m); else if (a.is("input")) t = a.parent().append(m); else { if (n.inline) return void (t = a.append(m)); t = a, a.children().first().after(m) } if ("auto" === o && (o = i.top + 1.5 * m.height() >= e(window).height() + e(window).scrollTop() && m.height() + a.outerHeight() < i.top ? "top" : "bottom"), "auto" === s && (s = t.width() < i.left + m.outerWidth() / 2 && i.left + m.outerWidth() > e(window).width() ? "right" : "left"), "top" === o ? m.addClass("top").removeClass("bottom") : m.addClass("bottom").removeClass("top"), "right" === s ? m.addClass("pull-right") : m.removeClass("pull-right"), "relative" !== t.css("position") && (t = t.parents().filter(function () { return "relative" === e(this).css("position") }).first()), 0 === t.length) throw new Error("datetimepicker component should be placed within a relative positioned container"); var d = e(a).parents().filter(function () { return "fixed" === e(this).css("position") }).length > 0; if ("fixed" === m.css("position") && d) { var i = a.offset(), p = i.left, l = jQuery(window).height() - (jQuery(a).offset().top - jQuery(window).scrollTop()); m.css({ bottom: l, left: p }) } else m.css({ top: "top" === o ? "auto" : r.top + a.outerHeight(), bottom: "top" === o ? r.top + a.outerHeight() : "auto", left: "left" === s ? t.css("padding-left") : "auto", right: "left" === s ? "auto" : t.width() - a.outerWidth() }) }, H = function (e) { "dp.change" === e.type && (e.date && e.date.isSame(e.oldDate) || !e.date && !e.oldDate) || a.trigger(e) }, I = function (e) { m && (e && (d = Math.max(h, Math.min(2, d + e))), m.find(".datepicker > div").hide().filter(".datepicker-" + g[d].clsName).show()) }, F = function () { var t = e("<tr>"), a = c.clone().startOf("w"); for (n.calendarWeeks === !0 && t.append(e("<th>").addClass("cw").text("#")) ; a.isBefore(c.clone().endOf("w")) ;) t.append(e("<th>").addClass("dow").text(a.format("dd"))), a.add(1, "d"); m.find(".datepicker-days thead").append(t) }, L = function (e) { return n.disabledDates[e.format("YYYY-MM-DD")] === !0 }, Y = function (e) { return n.enabledDates[e.format("YYYY-MM-DD")] === !0 }, W = function (e, t) { return e.isValid() ? n.disabledDates && L(e) && "M" !== t ? !1 : n.enabledDates && !Y(e) && "M" !== t ? !1 : n.minDate && e.isBefore(n.minDate, t) ? !1 : n.maxDate && e.isAfter(n.maxDate, t) ? !1 : "d" === t && -1 !== n.daysOfWeekDisabled.indexOf(e.day()) ? !1 : !0 : !1 }, q = function () { for (var t = [], a = c.clone().startOf("y").hour(12) ; a.isSame(c, "y") ;) t.push(e("<span>").attr("data-action", "selectMonth").addClass("month").text(a.format("MMM"))), a.add(1, "M"); m.find(".datepicker-months td").empty().append(t) }, z = function () { var t = m.find(".datepicker-months"), a = t.find("th"), n = t.find("tbody").find("span"); t.find(".disabled").removeClass("disabled"), W(c.clone().subtract(1, "y"), "y") || a.eq(0).addClass("disabled"), a.eq(1).text(c.year()), W(c.clone().add(1, "y"), "y") || a.eq(2).addClass("disabled"), n.removeClass("active"), l.isSame(c, "y") && n.eq(l.month()).addClass("active"), n.each(function (t) { W(c.clone().month(t), "M") || e(this).addClass("disabled") }) }, A = function () { var e = m.find(".datepicker-years"), t = e.find("th"), a = c.clone().subtract(5, "y"), r = c.clone().add(6, "y"), i = ""; for (e.find(".disabled").removeClass("disabled"), n.minDate && n.minDate.isAfter(a, "y") && t.eq(0).addClass("disabled"), t.eq(1).text(a.year() + "-" + r.year()), n.maxDate && n.maxDate.isBefore(r, "y") && t.eq(2).addClass("disabled") ; !a.isAfter(r, "y") ;) i += '<span data-action="selectYear" class="year' + (a.isSame(l, "y") ? " active" : "") + (W(a, "y") ? "" : " disabled") + '">' + a.year() + "</span>", a.add(1, "y"); e.find("td").html(i) }, V = function () { var a, r, i, o = m.find(".datepicker-days"), s = o.find("th"), d = []; if (T()) { for (o.find(".disabled").removeClass("disabled"), s.eq(1).text(c.format(n.dayViewHeaderFormat)), W(c.clone().subtract(1, "M"), "M") || s.eq(0).addClass("disabled"), W(c.clone().add(1, "M"), "M") || s.eq(2).addClass("disabled"), a = c.clone().startOf("M").startOf("week") ; !c.clone().endOf("M").endOf("w").isBefore(a, "d") ;) 0 === a.weekday() && (r = e("<tr>"), n.calendarWeeks && r.append('<td class="cw">' + a.week() + "</td>"), d.push(r)), i = "", a.isBefore(c, "M") && (i += " old"), a.isAfter(c, "M") && (i += " new"), a.isSame(l, "d") && !u && (i += " active"), W(a, "d") || (i += " disabled"), a.isSame(t(), "d") && (i += " today"), (0 === a.day() || 6 === a.day()) && (i += " weekend"), r.append('<td data-action="selectDay" class="day' + i + '">' + a.date() + "</td>"), a.add(1, "d"); o.find("tbody").empty().append(d), z(), A() } }, N = function () { var t = m.find(".timepicker-hours table"), a = c.clone().startOf("d"), n = [], r = e("<tr>"); for (c.hour() > 11 && !i && a.hour(12) ; a.isSame(c, "d") && (i || c.hour() < 12 && a.hour() < 12 || c.hour() > 11) ;) a.hour() % 4 === 0 && (r = e("<tr>"), n.push(r)), r.append('<td data-action="selectHour" class="hour' + (W(a, "h") ? "" : " disabled") + '">' + a.format(i ? "HH" : "hh") + "</td>"), a.add(1, "h"); t.empty().append(n) }, Q = function () { for (var t = m.find(".timepicker-minutes table"), a = c.clone().startOf("h"), r = [], i = e("<tr>"), o = 1 === n.stepping ? 5 : n.stepping; c.isSame(a, "h") ;) a.minute() % (4 * o) === 0 && (i = e("<tr>"), r.push(i)), i.append('<td data-action="selectMinute" class="minute' + (W(a, "m") ? "" : " disabled") + '">' + a.format("mm") + "</td>"), a.add(o, "m"); t.empty().append(r) }, R = function () { for (var t = m.find(".timepicker-seconds table"), a = c.clone().startOf("m"), n = [], r = e("<tr>") ; c.isSame(a, "m") ;) a.second() % 20 === 0 && (r = e("<tr>"), n.push(r)), r.append('<td data-action="selectSecond" class="second' + (W(a, "s") ? "" : " disabled") + '">' + a.format("ss") + "</td>"), a.add(5, "s"); t.empty().append(n) }, U = function () { var e = m.find(".timepicker span[data-time-component]"); i || m.find(".timepicker [data-action=togglePeriod]").text(l.format("A")), e.filter("[data-time-component=hours]").text(l.format(i ? "HH" : "hh")), e.filter("[data-time-component=minutes]").text(l.format("mm")), e.filter("[data-time-component=seconds]").text(l.format("ss")), N(), Q(), R() }, G = function () { m && (V(), U()) }, J = function (e) { var t = u ? null : l; return e ? (e = e.clone().locale(n.locale), 1 !== n.stepping && e.minutes(Math.round(e.minutes() / n.stepping) * n.stepping % 60).seconds(0), void (W(e) ? (l = e, c = l.clone(), r.val(l.format(o)), a.data("date", l.format(o)), G(), u = !1, H({ type: "dp.change", date: l.clone(), oldDate: t })) : (n.keepInvalid || r.val(u ? "" : l.format(o)), H({ type: "dp.error", date: e })))) : (u = !0, r.val(""), a.data("date", ""), H({ type: "dp.change", date: null, oldDate: t }), void G()) }, K = function () { var t = !1; return m ? (m.find(".collapse").each(function () { var a = e(this).data("collapse"); return a && a.transitioning ? (t = !0, !1) : !0 }), t ? p : (f && f.hasClass("btn") && f.toggleClass("active"), m.hide(), e(window).off("resize", j), m.off("click", "[data-action]"), m.off("mousedown", !1), m.remove(), m = !1, H({ type: "dp.hide", date: l.clone() }), p)) : p }, X = function () { J(null) }, Z = { next: function () { c.add(g[d].navStep, g[d].navFnc), V() }, previous: function () { c.subtract(g[d].navStep, g[d].navFnc), V() }, pickerSwitch: function () { I(1) }, selectMonth: function (t) { var a = e(t.target).closest("tbody").find("span").index(e(t.target)); c.month(a), d === h ? (J(l.clone().year(c.year()).month(c.month())), n.inline || K()) : (I(-1), V()) }, selectYear: function (t) { var a = parseInt(e(t.target).text(), 10) || 0; c.year(a), d === h ? (J(l.clone().year(c.year())), n.inline || K()) : (I(-1), V()) }, selectDay: function (t) { var a = c.clone(); e(t.target).is(".old") && a.subtract(1, "M"), e(t.target).is(".new") && a.add(1, "M"), J(a.date(parseInt(e(t.target).text(), 10))), D() || n.keepOpen || n.inline || K() }, incrementHours: function () { J(l.clone().add(1, "h")) }, incrementMinutes: function () { J(l.clone().add(n.stepping, "m")) }, incrementSeconds: function () { J(l.clone().add(1, "s")) }, decrementHours: function () { J(l.clone().subtract(1, "h")) }, decrementMinutes: function () { J(l.clone().subtract(n.stepping, "m")) }, decrementSeconds: function () { J(l.clone().subtract(1, "s")) }, togglePeriod: function () { J(l.clone().add(l.hours() >= 12 ? -12 : 12, "h")) }, togglePicker: function (t) { var a, r = e(t.target), i = r.closest("ul"), o = i.find(".in"), s = i.find(".collapse:not(.in)"); if (o && o.length) { if (a = o.data("collapse"), a && a.transitioning) return; o.collapse ? (o.collapse("hide"), s.collapse("show")) : (o.removeClass("in"), s.addClass("in")), r.is("span") ? r.toggleClass(n.icons.time + " " + n.icons.date) : r.find("span").toggleClass(n.icons.time + " " + n.icons.date) } }, showPicker: function () { m.find(".timepicker > div:not(.timepicker-picker)").hide(), m.find(".timepicker .timepicker-picker").show() }, showHours: function () { m.find(".timepicker .timepicker-picker").hide(), m.find(".timepicker .timepicker-hours").show() }, showMinutes: function () { m.find(".timepicker .timepicker-picker").hide(), m.find(".timepicker .timepicker-minutes").show() }, showSeconds: function () { m.find(".timepicker .timepicker-picker").hide(), m.find(".timepicker .timepicker-seconds").show() }, selectHour: function (t) { var a = parseInt(e(t.target).text(), 10); i || (l.hours() >= 12 ? 12 !== a && (a += 12) : 12 === a && (a = 0)), J(l.clone().hours(a)), Z.showPicker.call(p) }, selectMinute: function (t) { J(l.clone().minutes(parseInt(e(t.target).text(), 10))), Z.showPicker.call(p) }, selectSecond: function (t) { J(l.clone().seconds(parseInt(e(t.target).text(), 10))), Z.showPicker.call(p) }, clear: X, today: function () { J(t()) }, close: K }, $ = function (t) { return e(t.currentTarget).is(".disabled") ? !1 : (Z[e(t.currentTarget).data("action")].apply(p, arguments), !1) }, _ = function () { var a, i = { year: function (e) { return e.month(0).date(1).hours(0).seconds(0).minutes(0) }, month: function (e) { return e.date(1).hours(0).seconds(0).minutes(0) }, day: function (e) { return e.hours(0).seconds(0).minutes(0) }, hour: function (e) { return e.seconds(0).minutes(0) }, minute: function (e) { return e.seconds(0) } }; return r.prop("disabled") || !n.ignoreReadonly && r.prop("readonly") || m ? p : (n.useCurrent && u && (r.is("input") && 0 === r.val().trim().length || n.inline) && (a = t(), "string" == typeof n.useCurrent && (a = i[n.useCurrent](a)), J(a)), m = S(), F(), q(), m.find(".timepicker-hours").hide(), m.find(".timepicker-minutes").hide(), m.find(".timepicker-seconds").hide(), G(), I(), e(window).on("resize", j), m.on("click", "[data-action]", $), m.on("mousedown", !1), f && f.hasClass("btn") && f.toggleClass("active"), m.show(), j(), r.is(":focus") || r.focus(), H({ type: "dp.show" }), p) }, et = function () { return m ? K() : _() }, tt = function (e) { return e = t.isMoment(e) || e instanceof Date ? t(e) : t(e, s, n.useStrict), e.locale(n.locale), e }, at = function (e) { var t, a, r, i, o = null, s = [], d = {}, l = e.which, c = "p"; C[l] = c; for (t in C) C.hasOwnProperty(t) && C[t] === c && (s.push(t), parseInt(t, 10) !== l && (d[t] = !0)); for (t in n.keyBinds) if (n.keyBinds.hasOwnProperty(t) && "function" == typeof n.keyBinds[t] && (r = t.split(" "), r.length === s.length && k[l] === r[r.length - 1])) { for (i = !0, a = r.length - 2; a >= 0; a--) if (!(k[r[a]] in d)) { i = !1; break } if (i) { o = n.keyBinds[t]; break } } o && (o.call(p, m), e.stopPropagation(), e.preventDefault()) }, nt = function (e) { C[e.which] = "r", e.stopPropagation(), e.preventDefault() }, rt = function (t) { var a = e(t.target).val().trim(), n = a ? tt(a) : null; return J(n), t.stopImmediatePropagation(), !1 }, it = function () { r.on({ change: rt, blur: n.debug ? "" : K, keydown: at, keyup: nt }), a.is("input") ? r.on({ focus: _ }) : f && (f.on("click", et), f.on("mousedown", !1)) }, ot = function () { r.off({ change: rt, blur: K, keydown: at, keyup: nt }), a.is("input") ? r.off({ focus: _ }) : f && (f.off("click", et), f.off("mousedown", !1)) }, st = function (t) { var a = {}; return e.each(t, function () { var e = tt(this); e.isValid() && (a[e.format("YYYY-MM-DD")] = !0) }), Object.keys(a).length ? a : !1 }, dt = function () { var e = n.format || "L LT"; o = e.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (e) { var t = l.localeData().longDateFormat(e) || e; return t.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (e) { return l.localeData().longDateFormat(e) || e }) }), s = n.extraFormats ? n.extraFormats.slice() : [], s.indexOf(e) < 0 && s.indexOf(o) < 0 && s.push(o), i = o.toLowerCase().indexOf("a") < 1 && o.indexOf("h") < 1, x("y") && (h = 2), x("M") && (h = 1), x("d") && (h = 0), d = Math.max(h, d), u || J(l) }; if (p.destroy = function () { K(), ot(), a.removeData("DateTimePicker"), a.removeData("date") }, p.toggle = et, p.show = _, p.hide = K, p.disable = function () { return K(), f && f.hasClass("btn") && f.addClass("disabled"), r.prop("disabled", !0), p }, p.enable = function () { return f && f.hasClass("btn") && f.removeClass("disabled"), r.prop("disabled", !1), p }, p.ignoreReadonly = function (e) { if (0 === arguments.length) return n.ignoreReadonly; if ("boolean" != typeof e) throw new TypeError("ignoreReadonly () expects a boolean parameter"); return n.ignoreReadonly = e, p }, p.options = function (t) { if (0 === arguments.length) return e.extend(!0, {}, n); if (!(t instanceof Object)) throw new TypeError("options() options parameter should be an object"); return e.extend(!0, n, t), e.each(n, function (e, t) { if (void 0 === p[e]) throw new TypeError("option " + e + " is not recognized!"); p[e](t) }), p }, p.date = function (e) { if (0 === arguments.length) return u ? null : l.clone(); if (!(null === e || "string" == typeof e || t.isMoment(e) || e instanceof Date)) throw new TypeError("date() parameter must be one of [null, string, moment or Date]"); return J(null === e ? null : tt(e)), p }, p.format = function (e) { if (0 === arguments.length) return n.format; if ("string" != typeof e && ("boolean" != typeof e || e !== !1)) throw new TypeError("format() expects a sting or boolean:false parameter " + e); return n.format = e, o && dt(), p }, p.dayViewHeaderFormat = function (e) { if (0 === arguments.length) return n.dayViewHeaderFormat; if ("string" != typeof e) throw new TypeError("dayViewHeaderFormat() expects a string parameter"); return n.dayViewHeaderFormat = e, p }, p.extraFormats = function (e) { if (0 === arguments.length) return n.extraFormats; if (e !== !1 && !(e instanceof Array)) throw new TypeError("extraFormats() expects an array or false parameter"); return n.extraFormats = e, s && dt(), p }, p.disabledDates = function (t) { if (0 === arguments.length) return n.disabledDates ? e.extend({}, n.disabledDates) : n.disabledDates; if (!t) return n.disabledDates = !1, G(), p; if (!(t instanceof Array)) throw new TypeError("disabledDates() expects an array parameter"); return n.disabledDates = st(t), n.enabledDates = !1, G(), p }, p.enabledDates = function (t) { if (0 === arguments.length) return n.enabledDates ? e.extend({}, n.enabledDates) : n.enabledDates; if (!t) return n.enabledDates = !1, G(), p; if (!(t instanceof Array)) throw new TypeError("enabledDates() expects an array parameter"); return n.enabledDates = st(t), n.disabledDates = !1, G(), p }, p.daysOfWeekDisabled = function (e) { if (0 === arguments.length) return n.daysOfWeekDisabled.splice(0); if (!(e instanceof Array)) throw new TypeError("daysOfWeekDisabled() expects an array parameter"); return n.daysOfWeekDisabled = e.reduce(function (e, t) { return t = parseInt(t, 10), t > 6 || 0 > t || isNaN(t) ? e : (-1 === e.indexOf(t) && e.push(t), e) }, []).sort(), G(), p }, p.maxDate = function (e) { if (0 === arguments.length) return n.maxDate ? n.maxDate.clone() : n.maxDate; if ("boolean" == typeof e && e === !1) return n.maxDate = !1, G(), p; "string" == typeof e && ("now" === e || "moment" === e) && (e = t()); var a = tt(e); if (!a.isValid()) throw new TypeError("maxDate() Could not parse date parameter: " + e); if (n.minDate && a.isBefore(n.minDate)) throw new TypeError("maxDate() date parameter is before options.minDate: " + a.format(o)); return n.maxDate = a, n.maxDate.isBefore(e) && J(n.maxDate), c.isAfter(a) && (c = a.clone()), G(), p }, p.minDate = function (e) { if (0 === arguments.length) return n.minDate ? n.minDate.clone() : n.minDate; if ("boolean" == typeof e && e === !1) return n.minDate = !1, G(), p; "string" == typeof e && ("now" === e || "moment" === e) && (e = t()); var a = tt(e); if (!a.isValid()) throw new TypeError("minDate() Could not parse date parameter: " + e); if (n.maxDate && a.isAfter(n.maxDate)) throw new TypeError("minDate() date parameter is after options.maxDate: " + a.format(o)); return n.minDate = a, n.minDate.isAfter(e) && J(n.minDate), c.isBefore(a) && (c = a.clone()), G(), p }, p.defaultDate = function (e) { if (0 === arguments.length) return n.defaultDate ? n.defaultDate.clone() : n.defaultDate; if (!e) return n.defaultDate = !1, p; "string" == typeof e && ("now" === e || "moment" === e) && (e = t()); var a = tt(e); if (!a.isValid()) throw new TypeError("defaultDate() Could not parse date parameter: " + e); if (!W(a)) throw new TypeError("defaultDate() date passed is invalid according to component setup validations"); return n.defaultDate = a, n.defaultDate && "" === r.val().trim() && void 0 === r.attr("placeholder") && J(n.defaultDate), p }, p.locale = function (e) { if (0 === arguments.length) return n.locale; if (!t.localeData(e)) throw new TypeError("locale() locale " + e + " is not loaded from moment locales!"); return n.locale = e, l.locale(n.locale), c.locale(n.locale), o && dt(), m && (K(), _()), p }, p.stepping = function (e) { return 0 === arguments.length ? n.stepping : (e = parseInt(e, 10), (isNaN(e) || 1 > e) && (e = 1), n.stepping = e, p) }, p.useCurrent = function (e) { var t = ["year", "month", "day", "hour", "minute"]; if (0 === arguments.length) return n.useCurrent; if ("boolean" != typeof e && "string" != typeof e) throw new TypeError("useCurrent() expects a boolean or string parameter"); if ("string" == typeof e && -1 === t.indexOf(e.toLowerCase())) throw new TypeError("useCurrent() expects a string parameter of " + t.join(", ")); return n.useCurrent = e, p }, p.collapse = function (e) { if (0 === arguments.length) return n.collapse; if ("boolean" != typeof e) throw new TypeError("collapse() expects a boolean parameter"); return n.collapse === e ? p : (n.collapse = e, m && (K(), _()), p) }, p.icons = function (t) { if (0 === arguments.length) return e.extend({}, n.icons); if (!(t instanceof Object)) throw new TypeError("icons() expects parameter to be an Object"); return e.extend(n.icons, t), m && (K(), _()), p }, p.useStrict = function (e) { if (0 === arguments.length) return n.useStrict; if ("boolean" != typeof e) throw new TypeError("useStrict() expects a boolean parameter"); return n.useStrict = e, p }, p.sideBySide = function (e) { if (0 === arguments.length) return n.sideBySide; if ("boolean" != typeof e) throw new TypeError("sideBySide() expects a boolean parameter"); return n.sideBySide = e, m && (K(), _()), p }, p.viewMode = function (e) { if (0 === arguments.length) return n.viewMode; if ("string" != typeof e) throw new TypeError("viewMode() expects a string parameter"); if (-1 === y.indexOf(e)) throw new TypeError("viewMode() parameter must be one of (" + y.join(", ") + ") value"); return n.viewMode = e, d = Math.max(y.indexOf(e), h), I(), p }, p.toolbarPlacement = function (e) { if (0 === arguments.length) return n.toolbarPlacement; if ("string" != typeof e) throw new TypeError("toolbarPlacement() expects a string parameter"); if (-1 === v.indexOf(e)) throw new TypeError("toolbarPlacement() parameter must be one of (" + v.join(", ") + ") value"); return n.toolbarPlacement = e, m && (K(), _()), p }, p.widgetPositioning = function (t) { if (0 === arguments.length) return e.extend({}, n.widgetPositioning); if ("[object Object]" !== {}.toString.call(t)) throw new TypeError("widgetPositioning() expects an object variable"); if (t.horizontal) { if ("string" != typeof t.horizontal) throw new TypeError("widgetPositioning() horizontal variable must be a string"); if (t.horizontal = t.horizontal.toLowerCase(), -1 === b.indexOf(t.horizontal)) throw new TypeError("widgetPositioning() expects horizontal parameter to be one of (" + b.join(", ") + ")"); n.widgetPositioning.horizontal = t.horizontal } if (t.vertical) { if ("string" != typeof t.vertical) throw new TypeError("widgetPositioning() vertical variable must be a string"); if (t.vertical = t.vertical.toLowerCase(), -1 === w.indexOf(t.vertical)) throw new TypeError("widgetPositioning() expects vertical parameter to be one of (" + w.join(", ") + ")"); n.widgetPositioning.vertical = t.vertical } return G(), p }, p.calendarWeeks = function (e) { if (0 === arguments.length) return n.calendarWeeks; if ("boolean" != typeof e) throw new TypeError("calendarWeeks() expects parameter to be a boolean value"); return n.calendarWeeks = e, G(), p }, p.showTodayButton = function (e) { if (0 === arguments.length) return n.showTodayButton; if ("boolean" != typeof e) throw new TypeError("showTodayButton() expects a boolean parameter"); return n.showTodayButton = e, m && (K(), _()), p }, p.showClear = function (e) { if (0 === arguments.length) return n.showClear; if ("boolean" != typeof e) throw new TypeError("showClear() expects a boolean parameter"); return n.showClear = e, m && (K(), _()), p }, p.widgetParent = function (t) { if (0 === arguments.length) return n.widgetParent; if ("string" == typeof t && (t = e(t)), null !== t && "string" != typeof t && !(t instanceof e)) throw new TypeError("widgetParent() expects a string or a jQuery object parameter"); return n.widgetParent = t, m && (K(), _()), p }, p.keepOpen = function (e) { if (0 === arguments.length) return n.keepOpen; if ("boolean" != typeof e) throw new TypeError("keepOpen() expects a boolean parameter"); return n.keepOpen = e, p }, p.inline = function (e) { if (0 === arguments.length) return n.inline; if ("boolean" != typeof e) throw new TypeError("inline() expects a boolean parameter"); return n.inline = e, p }, p.clear = function () { return X(), p }, p.keyBinds = function (e) { return n.keyBinds = e, p }, p.debug = function (e) { if ("boolean" != typeof e) throw new TypeError("debug() expects a boolean parameter"); return n.debug = e, p }, p.showClose = function (e) { if (0 === arguments.length) return n.showClose; if ("boolean" != typeof e) throw new TypeError("showClose() expects a boolean parameter"); return n.showClose = e, p }, p.keepInvalid = function (e) { if (0 === arguments.length) return n.keepInvalid; if ("boolean" != typeof e) throw new TypeError("keepInvalid() expects a boolean parameter"); return n.keepInvalid = e, p }, p.datepickerInput = function (e) { if (0 === arguments.length) return n.datepickerInput; if ("string" != typeof e) throw new TypeError("datepickerInput() expects a string parameter"); return n.datepickerInput = e, p }, a.is("input")) r = a; else if (r = a.find(n.datepickerInput), 0 === r.size()) r = a.find("input"); else if (!r.is("input")) throw new Error('CSS class "' + n.datepickerInput + '" cannot be applied to non input element'); if (a.hasClass("input-group") && (f = a.find(0 === a.find(".datepickerbutton").size() ? '[class^="input-group-"]' : ".datepickerbutton")), !n.inline && !r.is("input")) throw new Error("Could not initialize DateTimePicker without an input element"); return e.extend(!0, n, B()), p.options(n), dt(), it(), r.prop("disabled") && p.disable(), r.is("input") && 0 !== r.val().trim().length ? J(tt(r.val().trim())) : n.defaultDate && void 0 === r.attr("placeholder") && J(n.defaultDate), n.inline && _(), p }; e.fn.datetimepicker = function (t) { return this.each(function () { var n = e(this); n.data("DateTimePicker") || (t = e.extend(!0, {}, e.fn.datetimepicker.defaults, t), n.data("DateTimePicker", a(n, t))) }) }, e.fn.datetimepicker.defaults = { format: !1, dayViewHeaderFormat: "MMMM YYYY", extraFormats: !1, stepping: 1, minDate: !1, maxDate: !1, useCurrent: !0, collapse: !0, locale: t.locale(), defaultDate: !1, disabledDates: !1, enabledDates: !1, icons: { time: "glyphicon glyphicon-time", date: "glyphicon glyphicon-calendar", up: "glyphicon glyphicon-chevron-up", down: "glyphicon glyphicon-chevron-down", previous: "glyphicon glyphicon-chevron-left", next: "glyphicon glyphicon-chevron-right", today: "glyphicon glyphicon-screenshot", clear: "glyphicon glyphicon-trash", close: "glyphicon glyphicon-remove" }, useStrict: !1, sideBySide: !1, daysOfWeekDisabled: [], calendarWeeks: !1, viewMode: "days", toolbarPlacement: "default", showTodayButton: !1, showClear: !1, showClose: !1, widgetPositioning: { horizontal: "auto", vertical: "auto" }, widgetParent: null, ignoreReadonly: !1, keepOpen: !1, inline: !1, keepInvalid: !1, datepickerInput: ".datepickerinput", keyBinds: { up: function (e) { if (e) { var a = this.date() || t(); this.date(e.find(".datepicker").is(":visible") ? a.clone().subtract(7, "d") : a.clone().add(1, "m")) } }, down: function (e) { if (!e) return void this.show(); var a = this.date() || t(); this.date(e.find(".datepicker").is(":visible") ? a.clone().add(7, "d") : a.clone().subtract(1, "m")) }, "control up": function (e) { if (e) { var a = this.date() || t(); this.date(e.find(".datepicker").is(":visible") ? a.clone().subtract(1, "y") : a.clone().add(1, "h")) } }, "control down": function (e) { if (e) { var a = this.date() || t(); this.date(e.find(".datepicker").is(":visible") ? a.clone().add(1, "y") : a.clone().subtract(1, "h")) } }, left: function (e) { if (e) { var a = this.date() || t(); e.find(".datepicker").is(":visible") && this.date(a.clone().subtract(1, "d")) } }, right: function (e) { if (e) { var a = this.date() || t(); e.find(".datepicker").is(":visible") && this.date(a.clone().add(1, "d")) } }, pageUp: function (e) { if (e) { var a = this.date() || t(); e.find(".datepicker").is(":visible") && this.date(a.clone().subtract(1, "M")) } }, pageDown: function (e) { if (e) { var a = this.date() || t(); e.find(".datepicker").is(":visible") && this.date(a.clone().add(1, "M")) } }, enter: function () { this.hide() }, escape: function () { this.hide() }, "control space": function (e) { e.find(".timepicker").is(":visible") && e.find('.btn[data-action="togglePeriod"]').click() }, t: function () { this.date(t()) }, "delete": function () { this.clear() } }, debug: !1 } });

        /*!
 * Datepicker for Bootstrap v1.6.0 (https://github.com/eternicode/bootstrap-datepicker)
 *
 * Copyright 2012 Stefan Petre
 * Improvements by Andrew Rowls
 * Licensed under the Apache License v2.0 (http://www.apache.org/licenses/LICENSE-2.0)
 */
        !function (a) { "function" == typeof define && define.amd ? define(["jquery"], a) : a("object" == typeof exports ? require("jquery") : jQuery) }(function (a, b) {
            function c() { return new Date(Date.UTC.apply(Date, arguments)) } function d() { var a = new Date; return c(a.getFullYear(), a.getMonth(), a.getDate()) } function e(a, b) { return a.getUTCFullYear() === b.getUTCFullYear() && a.getUTCMonth() === b.getUTCMonth() && a.getUTCDate() === b.getUTCDate() } function f(a) { return function () { return this[a].apply(this, arguments) } } function g(a) { return a && !isNaN(a.getTime()) } function h(b, c) { function d(a, b) { return b.toLowerCase() } var e, f = a(b).data(), g = {}, h = new RegExp("^" + c.toLowerCase() + "([A-Z])"); c = new RegExp("^" + c.toLowerCase()); for (var i in f) c.test(i) && (e = i.replace(h, d), g[e] = f[i]); return g } function i(b) { var c = {}; if (q[b] || (b = b.split("-")[0], q[b])) { var d = q[b]; return a.each(p, function (a, b) { b in d && (c[b] = d[b]) }), c } } var j = function () { var b = { get: function (a) { return this.slice(a)[0] }, contains: function (a) { for (var b = a && a.valueOf(), c = 0, d = this.length; d > c; c++) if (this[c].valueOf() === b) return c; return -1 }, remove: function (a) { this.splice(a, 1) }, replace: function (b) { b && (a.isArray(b) || (b = [b]), this.clear(), this.push.apply(this, b)) }, clear: function () { this.length = 0 }, copy: function () { var a = new j; return a.replace(this), a } }; return function () { var c = []; return c.push.apply(c, arguments), a.extend(c, b), c } }(), k = function (b, c) { a(b).data("datepicker", this), this._process_options(c), this.dates = new j, this.viewDate = this.o.defaultViewDate, this.focusDate = null, this.element = a(b), this.isInline = !1, this.isInput = this.element.is("input"), this.component = this.element.hasClass("date") ? this.element.find(".add-on, .input-group-addon, .btn") : !1, this.hasInput = this.component && this.element.find("input").length, this.component && 0 === this.component.length && (this.component = !1), this.picker = a(r.template), this._check_template(this.o.templates.leftArrow) && this.picker.find(".prev").html(this.o.templates.leftArrow), this._check_template(this.o.templates.rightArrow) && this.picker.find(".next").html(this.o.templates.rightArrow), this._buildEvents(), this._attachEvents(), this.isInline ? this.picker.addClass("datepicker-inline").appendTo(this.element) : this.picker.addClass("datepicker-dropdown dropdown-menu"), this.o.rtl && this.picker.addClass("datepicker-rtl"), this.viewMode = this.o.startView, this.o.calendarWeeks && this.picker.find("thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan", function (a, b) { return parseInt(b) + 1 }), this._allow_update = !1, this.setStartDate(this._o.startDate), this.setEndDate(this._o.endDate), this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled), this.setDaysOfWeekHighlighted(this.o.daysOfWeekHighlighted), this.setDatesDisabled(this.o.datesDisabled), this.fillDow(), this.fillMonths(), this._allow_update = !0, this.update(), this.showMode(), this.isInline && this.show() }; k.prototype = { constructor: k, _resolveViewName: function (a, c) { return 0 === a || "days" === a || "month" === a ? 0 : 1 === a || "months" === a || "year" === a ? 1 : 2 === a || "years" === a || "decade" === a ? 2 : 3 === a || "decades" === a || "century" === a ? 3 : 4 === a || "centuries" === a || "millennium" === a ? 4 : c === b ? !1 : c }, _check_template: function (c) { try { if (c === b || "" === c) return !1; if ((c.match(/[<>]/g) || []).length <= 0) return !0; var d = a(c); return d.length > 0 } catch (e) { return !1 } }, _process_options: function (b) { this._o = a.extend({}, this._o, b); var e = this.o = a.extend({}, this._o), f = e.language; q[f] || (f = f.split("-")[0], q[f] || (f = o.language)), e.language = f, e.startView = this._resolveViewName(e.startView, 0), e.minViewMode = this._resolveViewName(e.minViewMode, 0), e.maxViewMode = this._resolveViewName(e.maxViewMode, 4), e.startView = Math.min(e.startView, e.maxViewMode), e.startView = Math.max(e.startView, e.minViewMode), e.multidate !== !0 && (e.multidate = Number(e.multidate) || !1, e.multidate !== !1 && (e.multidate = Math.max(0, e.multidate))), e.multidateSeparator = String(e.multidateSeparator), e.weekStart %= 7, e.weekEnd = (e.weekStart + 6) % 7; var g = r.parseFormat(e.format); if (e.startDate !== -(1 / 0) && (e.startDate ? e.startDate instanceof Date ? e.startDate = this._local_to_utc(this._zero_time(e.startDate)) : e.startDate = r.parseDate(e.startDate, g, e.language, e.assumeNearbyYear) : e.startDate = -(1 / 0)), e.endDate !== 1 / 0 && (e.endDate ? e.endDate instanceof Date ? e.endDate = this._local_to_utc(this._zero_time(e.endDate)) : e.endDate = r.parseDate(e.endDate, g, e.language, e.assumeNearbyYear) : e.endDate = 1 / 0), e.daysOfWeekDisabled = e.daysOfWeekDisabled || [], a.isArray(e.daysOfWeekDisabled) || (e.daysOfWeekDisabled = e.daysOfWeekDisabled.split(/[,\s]*/)), e.daysOfWeekDisabled = a.map(e.daysOfWeekDisabled, function (a) { return parseInt(a, 10) }), e.daysOfWeekHighlighted = e.daysOfWeekHighlighted || [], a.isArray(e.daysOfWeekHighlighted) || (e.daysOfWeekHighlighted = e.daysOfWeekHighlighted.split(/[,\s]*/)), e.daysOfWeekHighlighted = a.map(e.daysOfWeekHighlighted, function (a) { return parseInt(a, 10) }), e.datesDisabled = e.datesDisabled || [], !a.isArray(e.datesDisabled)) { var h = []; h.push(r.parseDate(e.datesDisabled, g, e.language, e.assumeNearbyYear)), e.datesDisabled = h } e.datesDisabled = a.map(e.datesDisabled, function (a) { return r.parseDate(a, g, e.language, e.assumeNearbyYear) }); var i = String(e.orientation).toLowerCase().split(/\s+/g), j = e.orientation.toLowerCase(); if (i = a.grep(i, function (a) { return /^auto|left|right|top|bottom$/.test(a) }), e.orientation = { x: "auto", y: "auto" }, j && "auto" !== j) if (1 === i.length) switch (i[0]) { case "top": case "bottom": e.orientation.y = i[0]; break; case "left": case "right": e.orientation.x = i[0] } else j = a.grep(i, function (a) { return /^left|right$/.test(a) }), e.orientation.x = j[0] || "auto", j = a.grep(i, function (a) { return /^top|bottom$/.test(a) }), e.orientation.y = j[0] || "auto"; else; if (e.defaultViewDate) { var k = e.defaultViewDate.year || (new Date).getFullYear(), l = e.defaultViewDate.month || 0, m = e.defaultViewDate.day || 1; e.defaultViewDate = c(k, l, m) } else e.defaultViewDate = d() }, _events: [], _secondaryEvents: [], _applyEvents: function (a) { for (var c, d, e, f = 0; f < a.length; f++) c = a[f][0], 2 === a[f].length ? (d = b, e = a[f][1]) : 3 === a[f].length && (d = a[f][1], e = a[f][2]), c.on(e, d) }, _unapplyEvents: function (a) { for (var c, d, e, f = 0; f < a.length; f++) c = a[f][0], 2 === a[f].length ? (e = b, d = a[f][1]) : 3 === a[f].length && (e = a[f][1], d = a[f][2]), c.off(d, e) }, _buildEvents: function () { var b = { keyup: a.proxy(function (b) { -1 === a.inArray(b.keyCode, [27, 37, 39, 38, 40, 32, 13, 9]) && this.update() }, this), keydown: a.proxy(this.keydown, this), paste: a.proxy(this.paste, this) }; this.o.showOnFocus === !0 && (b.focus = a.proxy(this.show, this)), this.isInput ? this._events = [[this.element, b]] : this.component && this.hasInput ? this._events = [[this.element.find("input"), b], [this.component, { click: a.proxy(this.show, this) }]] : this.element.is("div") ? this.isInline = !0 : this._events = [[this.element, { click: a.proxy(this.show, this) }]], this._events.push([this.element, "*", { blur: a.proxy(function (a) { this._focused_from = a.target }, this) }], [this.element, { blur: a.proxy(function (a) { this._focused_from = a.target }, this) }]), this.o.immediateUpdates && this._events.push([this.element, { "changeYear changeMonth": a.proxy(function (a) { this.update(a.date) }, this) }]), this._secondaryEvents = [[this.picker, { click: a.proxy(this.click, this) }], [a(window), { resize: a.proxy(this.place, this) }], [a(document), { mousedown: a.proxy(function (a) { this.element.is(a.target) || this.element.find(a.target).length || this.picker.is(a.target) || this.picker.find(a.target).length || this.picker.hasClass("datepicker-inline") || this.hide() }, this) }]] }, _attachEvents: function () { this._detachEvents(), this._applyEvents(this._events) }, _detachEvents: function () { this._unapplyEvents(this._events) }, _attachSecondaryEvents: function () { this._detachSecondaryEvents(), this._applyEvents(this._secondaryEvents) }, _detachSecondaryEvents: function () { this._unapplyEvents(this._secondaryEvents) }, _trigger: function (b, c) { var d = c || this.dates.get(-1), e = this._utc_to_local(d); this.element.trigger({ type: b, date: e, dates: a.map(this.dates, this._utc_to_local), format: a.proxy(function (a, b) { 0 === arguments.length ? (a = this.dates.length - 1, b = this.o.format) : "string" == typeof a && (b = a, a = this.dates.length - 1), b = b || this.o.format; var c = this.dates.get(a); return r.formatDate(c, b, this.o.language) }, this) }) }, show: function () { var b = this.component ? this.element.find("input") : this.element; if (!b.attr("readonly") || this.o.enableOnReadonly !== !1) return this.isInline || this.picker.appendTo(this.o.container), this.place(), this.picker.show(), this._attachSecondaryEvents(), this._trigger("show"), (window.navigator.msMaxTouchPoints || "ontouchstart" in document) && this.o.disableTouchKeyboard && a(this.element).blur(), this }, hide: function () { return this.isInline ? this : this.picker.is(":visible") ? (this.focusDate = null, this.picker.hide().detach(), this._detachSecondaryEvents(), this.viewMode = this.o.startView, this.showMode(), this.o.forceParse && (this.isInput && this.element.val() || this.hasInput && this.element.find("input").val()) && this.setValue(), this._trigger("hide"), this) : this }, destroy: function () { return this.hide(), this._detachEvents(), this._detachSecondaryEvents(), this.picker.remove(), delete this.element.data().datepicker, this.isInput || delete this.element.data().date, this }, paste: function (b) { var c; if (b.originalEvent.clipboardData && b.originalEvent.clipboardData.types && -1 !== a.inArray("text/plain", b.originalEvent.clipboardData.types)) c = b.originalEvent.clipboardData.getData("text/plain"); else { if (!window.clipboardData) return; c = window.clipboardData.getData("Text") } this.setDate(c), this.update(), b.preventDefault() }, _utc_to_local: function (a) { return a && new Date(a.getTime() + 6e4 * a.getTimezoneOffset()) }, _local_to_utc: function (a) { return a && new Date(a.getTime() - 6e4 * a.getTimezoneOffset()) }, _zero_time: function (a) { return a && new Date(a.getFullYear(), a.getMonth(), a.getDate()) }, _zero_utc_time: function (a) { return a && new Date(Date.UTC(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate())) }, getDates: function () { return a.map(this.dates, this._utc_to_local) }, getUTCDates: function () { return a.map(this.dates, function (a) { return new Date(a) }) }, getDate: function () { return this._utc_to_local(this.getUTCDate()) }, getUTCDate: function () { var a = this.dates.get(-1); return "undefined" != typeof a ? new Date(a) : null }, clearDates: function () { var a; this.isInput ? a = this.element : this.component && (a = this.element.find("input")), a && a.val(""), this.update(), this._trigger("changeDate"), this.o.autoclose && this.hide() }, setDates: function () { var b = a.isArray(arguments[0]) ? arguments[0] : arguments; return this.update.apply(this, b), this._trigger("changeDate"), this.setValue(), this }, setUTCDates: function () { var b = a.isArray(arguments[0]) ? arguments[0] : arguments; return this.update.apply(this, a.map(b, this._utc_to_local)), this._trigger("changeDate"), this.setValue(), this }, setDate: f("setDates"), setUTCDate: f("setUTCDates"), remove: f("destroy"), setValue: function () { var a = this.getFormattedDate(); return this.isInput ? this.element.val(a) : this.component && this.element.find("input").val(a), this }, getFormattedDate: function (c) { c === b && (c = this.o.format); var d = this.o.language; return a.map(this.dates, function (a) { return r.formatDate(a, c, d) }).join(this.o.multidateSeparator) }, getStartDate: function () { return this.o.startDate }, setStartDate: function (a) { return this._process_options({ startDate: a }), this.update(), this.updateNavArrows(), this }, getEndDate: function () { return this.o.endDate }, setEndDate: function (a) { return this._process_options({ endDate: a }), this.update(), this.updateNavArrows(), this }, setDaysOfWeekDisabled: function (a) { return this._process_options({ daysOfWeekDisabled: a }), this.update(), this.updateNavArrows(), this }, setDaysOfWeekHighlighted: function (a) { return this._process_options({ daysOfWeekHighlighted: a }), this.update(), this }, setDatesDisabled: function (a) { this._process_options({ datesDisabled: a }), this.update(), this.updateNavArrows() }, place: function () { if (this.isInline) return this; var b = this.picker.outerWidth(), c = this.picker.outerHeight(), d = 10, e = a(this.o.container), f = e.width(), g = "body" === this.o.container ? a(document).scrollTop() : e.scrollTop(), h = e.offset(), i = []; this.element.parents().each(function () { var b = a(this).css("z-index"); "auto" !== b && 0 !== b && i.push(parseInt(b)) }); var j = Math.max.apply(Math, i) + this.o.zIndexOffset, k = this.component ? this.component.parent().offset() : this.element.offset(), l = this.component ? this.component.outerHeight(!0) : this.element.outerHeight(!1), m = this.component ? this.component.outerWidth(!0) : this.element.outerWidth(!1), n = k.left - h.left, o = k.top - h.top; "body" !== this.o.container && (o += g), this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"), "auto" !== this.o.orientation.x ? (this.picker.addClass("datepicker-orient-" + this.o.orientation.x), "right" === this.o.orientation.x && (n -= b - m)) : k.left < 0 ? (this.picker.addClass("datepicker-orient-left"), n -= k.left - d) : n + b > f ? (this.picker.addClass("datepicker-orient-right"), n += m - b) : this.picker.addClass("datepicker-orient-left"); var p, q = this.o.orientation.y; if ("auto" === q && (p = -g + o - c, q = 0 > p ? "bottom" : "top"), this.picker.addClass("datepicker-orient-" + q), "top" === q ? o -= c + parseInt(this.picker.css("padding-top")) : o += l, this.o.rtl) { var r = f - (n + m); this.picker.css({ top: o, right: r, zIndex: j }) } else this.picker.css({ top: o, left: n, zIndex: j }); return this }, _allow_update: !0, update: function () { if (!this._allow_update) return this; var b = this.dates.copy(), c = [], d = !1; return arguments.length ? (a.each(arguments, a.proxy(function (a, b) { b instanceof Date && (b = this._local_to_utc(b)), c.push(b) }, this)), d = !0) : (c = this.isInput ? this.element.val() : this.element.data("date") || this.element.find("input").val(), c = c && this.o.multidate ? c.split(this.o.multidateSeparator) : [c], delete this.element.data().date), c = a.map(c, a.proxy(function (a) { return r.parseDate(a, this.o.format, this.o.language, this.o.assumeNearbyYear) }, this)), c = a.grep(c, a.proxy(function (a) { return !this.dateWithinRange(a) || !a }, this), !0), this.dates.replace(c), this.dates.length ? this.viewDate = new Date(this.dates.get(-1)) : this.viewDate < this.o.startDate ? this.viewDate = new Date(this.o.startDate) : this.viewDate > this.o.endDate ? this.viewDate = new Date(this.o.endDate) : this.viewDate = this.o.defaultViewDate, d ? this.setValue() : c.length && String(b) !== String(this.dates) && this._trigger("changeDate"), !this.dates.length && b.length && this._trigger("clearDate"), this.fill(), this.element.change(), this }, fillDow: function () { var b = this.o.weekStart, c = "<tr>"; for (this.o.calendarWeeks && (this.picker.find(".datepicker-days .datepicker-switch").attr("colspan", function (a, b) { return parseInt(b) + 1 }), c += '<th class="cw">&#160;</th>') ; b < this.o.weekStart + 7;) c += '<th class="dow', a.inArray(b, this.o.daysOfWeekDisabled) > -1 && (c += " disabled"), c += '">' + q[this.o.language].daysMin[b++ % 7] + "</th>"; c += "</tr>", this.picker.find(".datepicker-days thead").append(c) }, fillMonths: function () { for (var a = this._utc_to_local(this.viewDate), b = "", c = 0; 12 > c;) { var d = a && a.getMonth() === c ? " focused" : ""; b += '<span class="month' + d + '">' + q[this.o.language].monthsShort[c++] + "</span>" } this.picker.find(".datepicker-months td").html(b) }, setRange: function (b) { b && b.length ? this.range = a.map(b, function (a) { return a.valueOf() }) : delete this.range, this.fill() }, getClassNames: function (b) { var c = [], d = this.viewDate.getUTCFullYear(), e = this.viewDate.getUTCMonth(), f = new Date; return b.getUTCFullYear() < d || b.getUTCFullYear() === d && b.getUTCMonth() < e ? c.push("old") : (b.getUTCFullYear() > d || b.getUTCFullYear() === d && b.getUTCMonth() > e) && c.push("new"), this.focusDate && b.valueOf() === this.focusDate.valueOf() && c.push("focused"), this.o.todayHighlight && b.getUTCFullYear() === f.getFullYear() && b.getUTCMonth() === f.getMonth() && b.getUTCDate() === f.getDate() && c.push("today"), -1 !== this.dates.contains(b) && c.push("active"), (!this.dateWithinRange(b) || this.dateIsDisabled(b)) && c.push("disabled"), -1 !== a.inArray(b.getUTCDay(), this.o.daysOfWeekHighlighted) && c.push("highlighted"), this.range && (b > this.range[0] && b < this.range[this.range.length - 1] && c.push("range"), -1 !== a.inArray(b.valueOf(), this.range) && c.push("selected"), b.valueOf() === this.range[0] && c.push("range-start"), b.valueOf() === this.range[this.range.length - 1] && c.push("range-end")), c }, _fill_yearsView: function (c, d, e, f, g, h, i, j) { var k, l, m, n, o, p, q, r, s, t, u; for (k = "", l = this.picker.find(c), m = parseInt(g / e, 10) * e, o = parseInt(h / f, 10) * f, p = parseInt(i / f, 10) * f, n = a.map(this.dates, function (a) { return parseInt(a.getUTCFullYear() / f, 10) * f }), l.find(".datepicker-switch").text(m + "-" + (m + 9 * f)), q = m - f, r = -1; 11 > r; r += 1) s = [d], t = null, -1 === r ? s.push("old") : 10 === r && s.push("new"), -1 !== a.inArray(q, n) && s.push("active"), (o > q || q > p) && s.push("disabled"), q === this.viewDate.getFullYear() && s.push("focused"), j !== a.noop && (u = j(new Date(q, 0, 1)), u === b ? u = {} : "boolean" == typeof u ? u = { enabled: u } : "string" == typeof u && (u = { classes: u }), u.enabled === !1 && s.push("disabled"), u.classes && (s = s.concat(u.classes.split(/\s+/))), u.tooltip && (t = u.tooltip)), k += '<span class="' + s.join(" ") + '"' + (t ? ' title="' + t + '"' : "") + ">" + q + "</span>", q += f; l.find("td").html(k) }, fill: function () { var d, e, f = new Date(this.viewDate), g = f.getUTCFullYear(), h = f.getUTCMonth(), i = this.o.startDate !== -(1 / 0) ? this.o.startDate.getUTCFullYear() : -(1 / 0), j = this.o.startDate !== -(1 / 0) ? this.o.startDate.getUTCMonth() : -(1 / 0), k = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCFullYear() : 1 / 0, l = this.o.endDate !== 1 / 0 ? this.o.endDate.getUTCMonth() : 1 / 0, m = q[this.o.language].today || q.en.today || "", n = q[this.o.language].clear || q.en.clear || "", o = q[this.o.language].titleFormat || q.en.titleFormat; if (!isNaN(g) && !isNaN(h)) { this.picker.find(".datepicker-days .datepicker-switch").text(r.formatDate(f, o, this.o.language)), this.picker.find("tfoot .today").text(m).toggle(this.o.todayBtn !== !1), this.picker.find("tfoot .clear").text(n).toggle(this.o.clearBtn !== !1), this.picker.find("thead .datepicker-title").text(this.o.title).toggle("" !== this.o.title), this.updateNavArrows(), this.fillMonths(); var p = c(g, h - 1, 28), s = r.getDaysInMonth(p.getUTCFullYear(), p.getUTCMonth()); p.setUTCDate(s), p.setUTCDate(s - (p.getUTCDay() - this.o.weekStart + 7) % 7); var t = new Date(p); p.getUTCFullYear() < 100 && t.setUTCFullYear(p.getUTCFullYear()), t.setUTCDate(t.getUTCDate() + 42), t = t.valueOf(); for (var u, v = []; p.valueOf() < t;) { if (p.getUTCDay() === this.o.weekStart && (v.push("<tr>"), this.o.calendarWeeks)) { var w = new Date(+p + (this.o.weekStart - p.getUTCDay() - 7) % 7 * 864e5), x = new Date(Number(w) + (11 - w.getUTCDay()) % 7 * 864e5), y = new Date(Number(y = c(x.getUTCFullYear(), 0, 1)) + (11 - y.getUTCDay()) % 7 * 864e5), z = (x - y) / 864e5 / 7 + 1; v.push('<td class="cw">' + z + "</td>") } u = this.getClassNames(p), u.push("day"), this.o.beforeShowDay !== a.noop && (e = this.o.beforeShowDay(this._utc_to_local(p)), e === b ? e = {} : "boolean" == typeof e ? e = { enabled: e } : "string" == typeof e && (e = { classes: e }), e.enabled === !1 && u.push("disabled"), e.classes && (u = u.concat(e.classes.split(/\s+/))), e.tooltip && (d = e.tooltip)), u = a.unique(u), v.push('<td class="' + u.join(" ") + '"' + (d ? ' title="' + d + '"' : "") + ">" + p.getUTCDate() + "</td>"), d = null, p.getUTCDay() === this.o.weekEnd && v.push("</tr>"), p.setUTCDate(p.getUTCDate() + 1) } this.picker.find(".datepicker-days tbody").empty().append(v.join("")); var A = q[this.o.language].monthsTitle || q.en.monthsTitle || "Months", B = this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode < 2 ? A : g).end().find("span").removeClass("active"); if (a.each(this.dates, function (a, b) { b.getUTCFullYear() === g && B.eq(b.getUTCMonth()).addClass("active") }), (i > g || g > k) && B.addClass("disabled"), g === i && B.slice(0, j).addClass("disabled"), g === k && B.slice(l + 1).addClass("disabled"), this.o.beforeShowMonth !== a.noop) { var C = this; a.each(B, function (c, d) { var e = new Date(g, c, 1), f = C.o.beforeShowMonth(e); f === b ? f = {} : "boolean" == typeof f ? f = { enabled: f } : "string" == typeof f && (f = { classes: f }), f.enabled !== !1 || a(d).hasClass("disabled") || a(d).addClass("disabled"), f.classes && a(d).addClass(f.classes), f.tooltip && a(d).prop("title", f.tooltip) }) } this._fill_yearsView(".datepicker-years", "year", 10, 1, g, i, k, this.o.beforeShowYear), this._fill_yearsView(".datepicker-decades", "decade", 100, 10, g, i, k, this.o.beforeShowDecade), this._fill_yearsView(".datepicker-centuries", "century", 1e3, 100, g, i, k, this.o.beforeShowCentury) } }, updateNavArrows: function () { if (this._allow_update) { var a = new Date(this.viewDate), b = a.getUTCFullYear(), c = a.getUTCMonth(); switch (this.viewMode) { case 0: this.o.startDate !== -(1 / 0) && b <= this.o.startDate.getUTCFullYear() && c <= this.o.startDate.getUTCMonth() ? this.picker.find(".prev").css({ visibility: "hidden" }) : this.picker.find(".prev").css({ visibility: "visible" }), this.o.endDate !== 1 / 0 && b >= this.o.endDate.getUTCFullYear() && c >= this.o.endDate.getUTCMonth() ? this.picker.find(".next").css({ visibility: "hidden" }) : this.picker.find(".next").css({ visibility: "visible" }); break; case 1: case 2: case 3: case 4: this.o.startDate !== -(1 / 0) && b <= this.o.startDate.getUTCFullYear() || this.o.maxViewMode < 2 ? this.picker.find(".prev").css({ visibility: "hidden" }) : this.picker.find(".prev").css({ visibility: "visible" }), this.o.endDate !== 1 / 0 && b >= this.o.endDate.getUTCFullYear() || this.o.maxViewMode < 2 ? this.picker.find(".next").css({ visibility: "hidden" }) : this.picker.find(".next").css({ visibility: "visible" }) } } }, click: function (b) { b.preventDefault(), b.stopPropagation(); var e, f, g, h, i, j, k; e = a(b.target), e.hasClass("datepicker-switch") && this.showMode(1); var l = e.closest(".prev, .next"); l.length > 0 && (f = r.modes[this.viewMode].navStep * (l.hasClass("prev") ? -1 : 1), 0 === this.viewMode ? (this.viewDate = this.moveMonth(this.viewDate, f), this._trigger("changeMonth", this.viewDate)) : (this.viewDate = this.moveYear(this.viewDate, f), 1 === this.viewMode && this._trigger("changeYear", this.viewDate)), this.fill()), e.hasClass("today") && (this.showMode(-2), this._setDate(d(), "linked" === this.o.todayBtn ? null : "view")), e.hasClass("clear") && this.clearDates(), e.hasClass("disabled") || (e.hasClass("day") && (g = parseInt(e.text(), 10) || 1, h = this.viewDate.getUTCFullYear(), i = this.viewDate.getUTCMonth(), e.hasClass("old") && (0 === i ? (i = 11, h -= 1, j = !0, k = !0) : (i -= 1, j = !0)), e.hasClass("new") && (11 === i ? (i = 0, h += 1, j = !0, k = !0) : (i += 1, j = !0)), this._setDate(c(h, i, g)), k && this._trigger("changeYear", this.viewDate), j && this._trigger("changeMonth", this.viewDate)), e.hasClass("month") && (this.viewDate.setUTCDate(1), g = 1, i = e.parent().find("span").index(e), h = this.viewDate.getUTCFullYear(), this.viewDate.setUTCMonth(i), this._trigger("changeMonth", this.viewDate), 1 === this.o.minViewMode ? (this._setDate(c(h, i, g)), this.showMode()) : this.showMode(-1), this.fill()), (e.hasClass("year") || e.hasClass("decade") || e.hasClass("century")) && (this.viewDate.setUTCDate(1), g = 1, i = 0, h = parseInt(e.text(), 10) || 0, this.viewDate.setUTCFullYear(h), e.hasClass("year") && (this._trigger("changeYear", this.viewDate), 2 === this.o.minViewMode && this._setDate(c(h, i, g))), e.hasClass("decade") && (this._trigger("changeDecade", this.viewDate), 3 === this.o.minViewMode && this._setDate(c(h, i, g))), e.hasClass("century") && (this._trigger("changeCentury", this.viewDate), 4 === this.o.minViewMode && this._setDate(c(h, i, g))), this.showMode(-1), this.fill())), this.picker.is(":visible") && this._focused_from && a(this._focused_from).focus(), delete this._focused_from }, _toggle_multidate: function (a) { var b = this.dates.contains(a); if (a || this.dates.clear(), -1 !== b ? (this.o.multidate === !0 || this.o.multidate > 1 || this.o.toggleActive) && this.dates.remove(b) : this.o.multidate === !1 ? (this.dates.clear(), this.dates.push(a)) : this.dates.push(a), "number" == typeof this.o.multidate) for (; this.dates.length > this.o.multidate;) this.dates.remove(0) }, _setDate: function (a, b) { b && "date" !== b || this._toggle_multidate(a && new Date(a)), b && "view" !== b || (this.viewDate = a && new Date(a)), this.fill(), this.setValue(), b && "view" === b || this._trigger("changeDate"); var c; this.isInput ? c = this.element : this.component && (c = this.element.find("input")), c && c.change(), !this.o.autoclose || b && "date" !== b || this.hide() }, moveDay: function (a, b) { var c = new Date(a); return c.setUTCDate(a.getUTCDate() + b), c }, moveWeek: function (a, b) { return this.moveDay(a, 7 * b) }, moveMonth: function (a, b) { if (!g(a)) return this.o.defaultViewDate; if (!b) return a; var c, d, e = new Date(a.valueOf()), f = e.getUTCDate(), h = e.getUTCMonth(), i = Math.abs(b); if (b = b > 0 ? 1 : -1, 1 === i) d = -1 === b ? function () { return e.getUTCMonth() === h } : function () { return e.getUTCMonth() !== c }, c = h + b, e.setUTCMonth(c), (0 > c || c > 11) && (c = (c + 12) % 12); else { for (var j = 0; i > j; j++) e = this.moveMonth(e, b); c = e.getUTCMonth(), e.setUTCDate(f), d = function () { return c !== e.getUTCMonth() } } for (; d() ;) e.setUTCDate(--f), e.setUTCMonth(c); return e }, moveYear: function (a, b) { return this.moveMonth(a, 12 * b) }, moveAvailableDate: function (a, b, c) { do { if (a = this[c](a, b), !this.dateWithinRange(a)) return !1; c = "moveDay" } while (this.dateIsDisabled(a)); return a }, weekOfDateIsDisabled: function (b) { return -1 !== a.inArray(b.getUTCDay(), this.o.daysOfWeekDisabled) }, dateIsDisabled: function (b) { return this.weekOfDateIsDisabled(b) || a.grep(this.o.datesDisabled, function (a) { return e(b, a) }).length > 0 }, dateWithinRange: function (a) { return a >= this.o.startDate && a <= this.o.endDate }, keydown: function (a) { if (!this.picker.is(":visible")) return void ((40 === a.keyCode || 27 === a.keyCode) && (this.show(), a.stopPropagation())); var b, c, d = !1, e = this.focusDate || this.viewDate; switch (a.keyCode) { case 27: this.focusDate ? (this.focusDate = null, this.viewDate = this.dates.get(-1) || this.viewDate, this.fill()) : this.hide(), a.preventDefault(), a.stopPropagation(); break; case 37: case 38: case 39: case 40: if (!this.o.keyboardNavigation || 7 === this.o.daysOfWeekDisabled.length) break; b = 37 === a.keyCode || 38 === a.keyCode ? -1 : 1, 0 === this.viewMode ? a.ctrlKey ? (c = this.moveAvailableDate(e, b, "moveYear"), c && this._trigger("changeYear", this.viewDate)) : a.shiftKey ? (c = this.moveAvailableDate(e, b, "moveMonth"), c && this._trigger("changeMonth", this.viewDate)) : 37 === a.keyCode || 39 === a.keyCode ? c = this.moveAvailableDate(e, b, "moveDay") : this.weekOfDateIsDisabled(e) || (c = this.moveAvailableDate(e, b, "moveWeek")) : 1 === this.viewMode ? ((38 === a.keyCode || 40 === a.keyCode) && (b = 4 * b), c = this.moveAvailableDate(e, b, "moveMonth")) : 2 === this.viewMode && ((38 === a.keyCode || 40 === a.keyCode) && (b = 4 * b), c = this.moveAvailableDate(e, b, "moveYear")), c && (this.focusDate = this.viewDate = c, this.setValue(), this.fill(), a.preventDefault()); break; case 13: if (!this.o.forceParse) break; e = this.focusDate || this.dates.get(-1) || this.viewDate, this.o.keyboardNavigation && (this._toggle_multidate(e), d = !0), this.focusDate = null, this.viewDate = this.dates.get(-1) || this.viewDate, this.setValue(), this.fill(), this.picker.is(":visible") && (a.preventDefault(), a.stopPropagation(), this.o.autoclose && this.hide()); break; case 9: this.focusDate = null, this.viewDate = this.dates.get(-1) || this.viewDate, this.fill(), this.hide() } if (d) { this.dates.length ? this._trigger("changeDate") : this._trigger("clearDate"); var f; this.isInput ? f = this.element : this.component && (f = this.element.find("input")), f && f.change() } }, showMode: function (a) { a && (this.viewMode = Math.max(this.o.minViewMode, Math.min(this.o.maxViewMode, this.viewMode + a))), this.picker.children("div").hide().filter(".datepicker-" + r.modes[this.viewMode].clsName).show(), this.updateNavArrows() } }; var l = function (b, c) { a(b).data("datepicker", this), this.element = a(b), this.inputs = a.map(c.inputs, function (a) { return a.jquery ? a[0] : a }), delete c.inputs, n.call(a(this.inputs), c).on("changeDate", a.proxy(this.dateUpdated, this)), this.pickers = a.map(this.inputs, function (b) { return a(b).data("datepicker") }), this.updateDates() }; l.prototype = { updateDates: function () { this.dates = a.map(this.pickers, function (a) { return a.getUTCDate() }), this.updateRanges() }, updateRanges: function () { var b = a.map(this.dates, function (a) { return a.valueOf() }); a.each(this.pickers, function (a, c) { c.setRange(b) }) }, dateUpdated: function (b) { if (!this.updating) { this.updating = !0; var c = a(b.target).data("datepicker"); if ("undefined" != typeof c) { var d = c.getUTCDate(), e = a.inArray(b.target, this.inputs), f = e - 1, g = e + 1, h = this.inputs.length; if (-1 !== e) { if (a.each(this.pickers, function (a, b) { b.getUTCDate() || b.setUTCDate(d) }), d < this.dates[f]) for (; f >= 0 && d < this.dates[f];) this.pickers[f--].setUTCDate(d); else if (d > this.dates[g]) for (; h > g && d > this.dates[g];) this.pickers[g++].setUTCDate(d); this.updateDates(), delete this.updating } } } }, remove: function () { a.map(this.pickers, function (a) { a.remove() }), delete this.element.data().datepicker } }; var m = a.fn.datepicker, n = function (c) { var d = Array.apply(null, arguments); d.shift(); var e; if (this.each(function () { var b = a(this), f = b.data("datepicker"), g = "object" == typeof c && c; if (!f) { var j = h(this, "date"), m = a.extend({}, o, j, g), n = i(m.language), p = a.extend({}, o, n, j, g); b.hasClass("input-daterange") || p.inputs ? (a.extend(p, { inputs: p.inputs || b.find("input").toArray() }), f = new l(this, p)) : f = new k(this, p), b.data("datepicker", f) } "string" == typeof c && "function" == typeof f[c] && (e = f[c].apply(f, d)) }), e === b || e instanceof k || e instanceof l) return this; if (this.length > 1) throw new Error("Using only allowed for the collection of a single element (" + c + " function)"); return e }; a.fn.datepicker = n; var o = a.fn.datepicker.defaults = { assumeNearbyYear: !1, autoclose: !1, beforeShowDay: a.noop, beforeShowMonth: a.noop, beforeShowYear: a.noop, beforeShowDecade: a.noop, beforeShowCentury: a.noop, calendarWeeks: !1, clearBtn: !1, toggleActive: !1, daysOfWeekDisabled: [], daysOfWeekHighlighted: [], datesDisabled: [], endDate: 1 / 0, forceParse: !0, format: "mm/dd/yyyy", keyboardNavigation: !0, language: "en", minViewMode: 0, maxViewMode: 4, multidate: !1, multidateSeparator: ",", orientation: "auto", rtl: !1, startDate: -(1 / 0), startView: 0, todayBtn: !1, todayHighlight: !1, weekStart: 0, disableTouchKeyboard: !1, enableOnReadonly: !0, showOnFocus: !0, zIndexOffset: 10, container: "body", immediateUpdates: !1, title: "", templates: { leftArrow: "&laquo;", rightArrow: "&raquo;" } }, p = a.fn.datepicker.locale_opts = ["format", "rtl", "weekStart"]; a.fn.datepicker.Constructor = k; var q = a.fn.datepicker.dates = { en: { days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], today: "Today", clear: "Clear", titleFormat: "MM yyyy" } }, r = {
                modes: [{ clsName: "days", navFnc: "Month", navStep: 1 }, { clsName: "months", navFnc: "FullYear", navStep: 1 }, { clsName: "years", navFnc: "FullYear", navStep: 10 }, { clsName: "decades", navFnc: "FullDecade", navStep: 100 }, { clsName: "centuries", navFnc: "FullCentury", navStep: 1e3 }], isLeapYear: function (a) { return a % 4 === 0 && a % 100 !== 0 || a % 400 === 0 }, getDaysInMonth: function (a, b) { return [31, r.isLeapYear(a) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][b] }, validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g, nonpunctuation: /[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g, parseFormat: function (a) { if ("function" == typeof a.toValue && "function" == typeof a.toDisplay) return a; var b = a.replace(this.validParts, "\x00").split("\x00"), c = a.match(this.validParts); if (!b || !b.length || !c || 0 === c.length) throw new Error("Invalid date format."); return { separators: b, parts: c } }, parseDate: function (e, f, g, h) {
                    function i(a, b) { return b === !0 && (b = 10), 100 > a && (a += 2e3, a > (new Date).getFullYear() + b && (a -= 100)), a } function j() { var a = this.slice(0, s[n].length), b = s[n].slice(0, a.length); return a.toLowerCase() === b.toLowerCase() } if (!e) return b; if (e instanceof Date) return e; if ("string" == typeof f && (f = r.parseFormat(f)), f.toValue) return f.toValue(e, f, g); var l, m, n, o, p = /([\-+]\d+)([dmwy])/, s = e.match(/([\-+]\d+)([dmwy])/g), t = { d: "moveDay", m: "moveMonth", w: "moveWeek", y: "moveYear" }, u = { yesterday: "-1d", today: "+0d", tomorrow: "+1d" }; if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e)) { for (e = new Date, n = 0; n < s.length; n++) l = p.exec(s[n]), m = parseInt(l[1]), o = t[l[2]], e = k.prototype[o](e, m); return c(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate()) } if ("undefined" != typeof u[e] && (e = u[e], s = e.match(/([\-+]\d+)([dmwy])/g), /^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e))) { for (e = new Date, n = 0; n < s.length; n++) l = p.exec(s[n]), m = parseInt(l[1]), o = t[l[2]], e = k.prototype[o](e, m); return c(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate()) } s = e && e.match(this.nonpunctuation) || [], e = new Date; var v, w, x = {}, y = ["yyyy", "yy", "M", "MM", "m", "mm", "d", "dd"], z = { yyyy: function (a, b) { return a.setUTCFullYear(h ? i(b, h) : b) }, yy: function (a, b) { return a.setUTCFullYear(h ? i(b, h) : b) }, m: function (a, b) { if (isNaN(a)) return a; for (b -= 1; 0 > b;) b += 12; for (b %= 12, a.setUTCMonth(b) ; a.getUTCMonth() !== b;) a.setUTCDate(a.getUTCDate() - 1); return a }, d: function (a, b) { return a.setUTCDate(b) } }; z.M = z.MM = z.mm = z.m, z.dd = z.d, e = d(); var A = f.parts.slice(); if (s.length !== A.length && (A = a(A).filter(function (b, c) { return -1 !== a.inArray(c, y) }).toArray()), s.length === A.length) {
                        var B; for (n = 0, B = A.length; B > n; n++) {
                            if (v = parseInt(s[n], 10), l = A[n], isNaN(v)) switch (l) {
                                case "MM": w = a(q[g].months).filter(j), v = a.inArray(w[0], q[g].months) + 1; break; case "M": w = a(q[g].monthsShort).filter(j), v = a.inArray(w[0], q[g].monthsShort) + 1;
                            } x[l] = v
                        } var C, D; for (n = 0; n < y.length; n++) D = y[n], D in x && !isNaN(x[D]) && (C = new Date(e), z[D](C, x[D]), isNaN(C) || (e = C))
                    } return e
                }, formatDate: function (b, c, d) { if (!b) return ""; if ("string" == typeof c && (c = r.parseFormat(c)), c.toDisplay) return c.toDisplay(b, c, d); var e = { d: b.getUTCDate(), D: q[d].daysShort[b.getUTCDay()], DD: q[d].days[b.getUTCDay()], m: b.getUTCMonth() + 1, M: q[d].monthsShort[b.getUTCMonth()], MM: q[d].months[b.getUTCMonth()], yy: b.getUTCFullYear().toString().substring(2), yyyy: b.getUTCFullYear() }; e.dd = (e.d < 10 ? "0" : "") + e.d, e.mm = (e.m < 10 ? "0" : "") + e.m, b = []; for (var f = a.extend([], c.separators), g = 0, h = c.parts.length; h >= g; g++) f.length && b.push(f.shift()), b.push(e[c.parts[g]]); return b.join("") }, headTemplate: '<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">&laquo;</th><th colspan="5" class="datepicker-switch"></th><th class="next">&raquo;</th></tr></thead>', contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>', footTemplate: '<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'
            }; r.template = '<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">' + r.headTemplate + "<tbody></tbody>" + r.footTemplate + '</table></div><div class="datepicker-months"><table class="table-condensed">' + r.headTemplate + r.contTemplate + r.footTemplate + '</table></div><div class="datepicker-years"><table class="table-condensed">' + r.headTemplate + r.contTemplate + r.footTemplate + '</table></div><div class="datepicker-decades"><table class="table-condensed">' + r.headTemplate + r.contTemplate + r.footTemplate + '</table></div><div class="datepicker-centuries"><table class="table-condensed">' + r.headTemplate + r.contTemplate + r.footTemplate + "</table></div></div>", a.fn.datepicker.DPGlobal = r, a.fn.datepicker.noConflict = function () { return a.fn.datepicker = m, this }, a.fn.datepicker.version = "1.6.0", a(document).on("focus.datepicker.data-api click.datepicker.data-api", '[data-provide="datepicker"]', function (b) { var c = a(this); c.data("datepicker") || (b.preventDefault(), n.call(c, "show")) }), a(function () { n.call(a('[data-provide="datepicker-inline"]')) })
        });


        /** jquery.onoff - v0.3.5 - 2014-05-12
        * https://github.com/timmywil/jquery.onoff
        * Copyright (c) 2014 Timmy Willison; Licensed MIT */
        !function (a, b) { "function" == typeof define && define.amd ? define(["jquery"], b) : "object" == typeof exports ? b(require("jquery")) : b(a.HawkSearch.jQuery) }(this, function (a) { "use strict"; function b(c, d) { if (!(this instanceof b)) return new b(c, d); if ("input" !== c.nodeName.toLowerCase() || "checkbox" !== c.type) return a.error("OnOff should be called on checkboxes"); var e = a.data(c, b.datakey); return e ? e : (this.options = d = a.extend({}, b.defaults, d), this.elem = c, this.$elem = a(c).addClass(d.className), this.$doc = a(c.ownerDocument || document), d.namespace += a.guid++, c.id || (c.id = "onoffswitch" + g++), this.enable(), a.data(c, b.datakey, this), void 0) } var c = "over out down up move enter leave cancel".split(" "), d = a.extend({}, a.event.mouseHooks), e = {}; if (window.PointerEvent) a.each(c, function (b, c) { a.event.fixHooks[e[c] = "pointer" + c] = d }); else { var f = d.props; d.props = f.concat(["touches", "changedTouches", "targetTouches", "altKey", "ctrlKey", "metaKey", "shiftKey"]), d.filter = function (a, b) { var c, d = f.length; if (!b.pageX && b.touches && (c = b.touches[0])) for (; d--;) a[f[d]] = c[f[d]]; return a }, a.each(c, function (b, c) { if (2 > b) e[c] = "mouse" + c; else { var f = "touch" + ("down" === c ? "start" : "up" === c ? "end" : c); a.event.fixHooks[f] = d, e[c] = f + " mouse" + c } }) } a.pointertouch = e; var g = 1, h = Array.prototype.slice; return b.datakey = "_onoff", b.defaults = { namespace: ".onoff", className: "onoffswitch-checkbox" }, b.prototype = { constructor: b, instance: function () { return this }, wrap: function () { var b = this.elem, c = this.$elem, d = this.options, e = c.parent(".onoffswitch"); e.length || (c.wrap('<div class="onoffswitch"></div>'), e = c.parent().addClass(b.className.replace(d.className, ""))), this.$con = e; var f = c.next('label[for="' + b.id + '"]'); f.length || (f = a("<label/>").attr("for", b.id).insertAfter(b)), this.$label = f.addClass("onoffswitch-label"); var g = f.find(".onoffswitch-inner"); g.length || (g = a("<div/>").addClass("onoffswitch-inner").prependTo(f)), this.$inner = g; var h = f.find(".onoffswitch-switch"); h.length || (h = a("<div/>").addClass("onoffswitch-switch").appendTo(f)), this.$switch = h }, _handleMove: function (a) { if (!this.disabled) { this.moved = !0, this.lastX = a.pageX; var b = Math.max(Math.min(this.startX - this.lastX, this.maxRight), 0); this.$switch.css("right", b), this.$inner.css("marginLeft", 100 * -(b / this.maxRight) + "%") } }, _startMove: function (b) { b.preventDefault(); var c, d; "pointerdown" === b.type ? (c = "pointermove", d = "pointerup") : "touchstart" === b.type ? (c = "touchmove", d = "touchend") : (c = "mousemove", d = "mouseup"); var e = this.elem, f = this.$elem, g = this.options.namespace, h = this.$switch, i = h[0], j = this.$inner.add(h).css("transition", "none"); this.maxRight = this.$con.width() - h.width() - a.css(i, "margin-left", !0) - a.css(i, "margin-right", !0) - a.css(i, "border-left-width", !0) - a.css(i, "border-right-width", !0); var k = e.checked; this.moved = !1, this.startX = b.pageX + (k ? 0 : this.maxRight); var l = this, m = this.$doc.on(c + g, a.proxy(this._handleMove, this)).on(d + g, function () { j.css("transition", ""), m.off(g), setTimeout(function () { if (l.moved) { var a = l.lastX > l.startX - l.maxRight / 2; e.checked !== a && (e.checked = a, f.trigger("change")) } l.$switch.css("right", ""), l.$inner.css("marginLeft", "") }) }) }, _bind: function () { this._unbind(), this.$switch.on(a.pointertouch.down, a.proxy(this._startMove, this)) }, enable: function () { this.wrap(), this._bind(), this.disabled = !1 }, _unbind: function () { this.$doc.add(this.$switch).off(this.options.namespace) }, disable: function () { this.disabled = !0, this._unbind() }, unwrap: function () { this.disable(), this.$label.remove(), this.$elem.unwrap().removeClass(this.options.className) }, isDisabled: function () { return this.disabled }, destroy: function () { this.disable(), a.removeData(this.elem, b.datakey) }, option: function (b, c) { var d, e = this.options; if (!b) return a.extend({}, e); if ("string" == typeof b) { if (1 === arguments.length) return void 0 !== e[b] ? e[b] : null; d = {}, d[b] = c } else d = b; a.each(d, a.proxy(function (a, b) { switch (a) { case "namespace": this._unbind(); break; case "className": this.$elem.removeClass(e.className) } switch (e[a] = b, a) { case "namespace": this._bind(); break; case "className": this.$elem.addClass(b) } }, this)) } }, a.fn.onoff = function (c) { var d, e, f, g; return "string" == typeof c ? (g = [], e = h.call(arguments, 1), this.each(function () { d = a.data(this, b.datakey), d ? "_" !== c.charAt(0) && "function" == typeof (f = d[c]) && void 0 !== (f = f.apply(d, e)) && g.push(f) : g.push(void 0) }), g.length ? 1 === g.length ? g[0] : g : this) : this.each(function () { new b(this, c) }) }, a.OnOff = b });

        // END Plugins

        
        //$(document).ready(function () {
            // initialize auto-suggest
            if (HawkSearch.initAutoSuggest !== undefined) {
                HawkSearch.initAutoSuggest();
            }

            HawkSearch.loadRecommender();
            HawkSearch.Tracking.writeSearch();
            HawkSearch.regTracking();

            $("#divSmartBug").delegate(".bugExplain", "click", function () {
                $("#hdnhawkadv").val($(this).attr("href"));
                HawkSearch.refreshUrl(null, true);
                return false;
            });

            if (!$("#hawkitemlist").length) {
                HawkSearch.regSmartBug();
                return;
            }
            // load items to compare
            var items = decodeURIComponent(HawkSearch.getHashOrQueryVariable("items"));
            if (items != "") {
                window['hawktocompare'] = items.split(",");
                if ($.isFunction(window.HawkCompare.reload)) HawkCompare.reload();
            } else {
                window['hawktocompare'] = new Array();
            }

            HawkSearch.regFacets();

            // bind the click event to the anchor tags
            $("#hawkfacets").on("click", ".slider-clear, .hawk-facetFilters a", function (event) {

                // clear the current page
                $("#hdnhawkpg").val("");
                var options = $(this).data().options;
                var ul = $(this).parents("ul.hawk-facetFilters");
                if (ul.hasClass("singlefacet")) {
                    ul.find(".hawkFacet-active a").each(function () {
                        var opt = $(this).data().options;
                        if (options.value !== opt.value) {
                            $(this).parent().removeClass("hawkFacet-active");
                        }
                    });
                }

                if (typeof (options.hash) !== "undefined") {
                    if (HawkSearch.disableAjax()) {
                        window.location = $(this).attr("href");
                    } else {
                        window.location.hash = options.hash;
                    }
                } else {
                    HawkSearch.refreshUrl
                        (event);
                }

                return false;
            });

            if (!HawkSearch.disableAjax()) {
                var newHash = window.location.search.substring(1);
                if (newHash === "" || (window.location.search.substring(1) !== "" && window.location.href.indexOf("#") > -1)) newHash = HawkSearch.getHash();
                if (window.location.search.substring(1) !== newHash) {
                    window.location.hash = newHash;
                    // window.onhashchange;
                    // broadcast hashchange event for custom add-ons
                    $(window).trigger("hashchange");
                }
            }

            // hawk pagination
            $("#hawktoppager, #hawkbottompager").on("click", ".hawk-pageLink", function (e) {
                e.preventDefault();
                if ($(this).hasClass("disabled") || $("#hdnhawkpg").val() === $(this).attr("page")) return false;

                $("#hdnhawkpg").val($(this).attr("page"));
                HawkSearch.refreshUrl();
                return false;
            });

            // hawk tabs
            $("#hawktoppager, #hawkbottompager").on("click", ".hawktab", function (e) {
                e.preventDefault();
                if ($(this).hasClass("disabled") || $("#hdnhawktabvalue").val() === $(this).attr("tab")) return false;

                $("#hdnhawktabvalue").val($(this).attr("tab"));
                HawkSearch.refreshUrl();
                return false;
            });

            // hawk sorting
            $("#hawktoppager, #hawkbottompager").on("change", ".hawksortby", function (e) {
                // clear the current page
                $("#hdnhawkpg").val("");

                $("#hdnhawksortby").val($(this).val());
                $(".hawksortby").val($(this).val());

                HawkSearch.refreshUrl(e);
                return false;
            });

            // hawk change per page
            $("#hawktoppager, #hawkbottompager").on("change", ".hawkmpp", function (event) {
                // clear the current page
                $("#hdnhawkpg").val("");

                $("#hdnhawkmpp").val($(this).val());
                $(".hawkmpp").val($(this).val());

                HawkSearch.refreshUrl(event);
                return false;
            });

            // hawk change per page
            $("#hawktoppager, #hawkbottompager").on("change", ".hawkdistance", function (event) {
                // clear the current page
                $("#hdnhawkpg").val("");

                $("#hdnhawkdistance").val($(this).val());
                $(".hawkdistance").val($(this).val());

                HawkSearch.refreshUrl(event);
                return false;
            });


            var hawkmpp = $(".hawkmpp");
            if (hawkmpp.length > 0 && hawkmpp.eq(0).val() !== "" && $("#hdnhawkmpp").val() === "") {
                $("#hdnhawkmpp").val(hawkmpp.eq(0).val());
                hawkmpp.val($("#hdnhawkmpp").val());
            }

            $("#hawkfacets").on("click", ".hawk-selectedGroup a", function (e) {
                e.preventDefault();
                if (HawkSearch.disableAjax()) {
                    window.location = $(this).attr("href");
                } else {
                    var options = $(this).data().options;
                    if (window.location.hash == options.hash) {
                        window.location.hash = " ";
                    } else {
                        window.location.hash = options.hash;
                    }

                }
                return false;
            });

            $("#hawktoppager, #hawkbottompager").on("click", ".btnCompareItems", function () {
                if (HawkCompare.countItems() < 2) {
                    alert('You should select at least 2 items');
                    return false;
                } else {
                    $("#hdnhawkcompare").val(window['hawktocompare'].join(","));
                    HawkCompare.process();
                }
                return true;
            });

            $("#hawkitemlist").on("change", "input.ckbItemCompare", function () {
                if ($(this).is(':checked')) {
                    if (HawkCompare.countItems() >= 5) {
                        alert('You can compare up to 5 items');
                        $(this).attr('checked', false);
                        return false;
                    } else {
                        HawkCompare.getImage($(this).val());
                        HawkCompare.addItem($(this).val());
                    }
                } else {
                    HawkCompare.removeItem($(this).val());
                }
                return true;
            });

            $("#hawkfacets").on("click", ".hawk-searchWithinButton", function (event) {
                $("#hdnhawkpg").val("");
                HawkSearch.refreshUrl(event);
            });

            //initial load
            if ($("#hawkitemlist").html() == '' || (!HawkSearch.disableAjax() && window.location.hash)) {
                HawkSearch.refreshResults();
            }

            if (HawkSearch.GetRecentSearches !== undefined) {
                HawkSearch.GetRecentSearches();
            }

            $(window).on("debouncedresize", function (event) {
                $("#hawkitemlist .itemWrapper").css("min-height", 0);
                $("#hawkbannertop .itemWrapper").css("min-height", 0);
                HawkSearch.normalizeHeights();
                log("resize");
            });

            HawkSearch.BindPreviewInformation();
            HawkSearch.BindFacetTooltip();

            if ($(".hawk-facetScollingContainer").length) {
                HawkSearch.FacetContainerScrollable();
            }

            HawkSearch.BindBackToTop();

        // });
    }

}(window.HawkSearchLoader = window.HawkSearchLoader || {}));

// LilBro schemas
(function () {

    var root = this;

    root.LilBro = root.LilBro || {
    };
    root.LilBro.Schema = {
    };

    root.LilBro.Schema.version = "default";

    root.LilBro.Schema.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        mouse_x: 6,
        mouse_y: 7,
        viewport_width: 8,
        viewport_height: 9,
        scroll_x: 10,
        scroll_y: 11,
        element_id: 12,
        element_id_from: 13,
        element_class: 14,
        element_class_from: 15,
        element_name: 16,
        element_tag: 17,
        element_type: 18,
        element_checked: 19,
        element_value: 20,
        element_x: 21,
        element_y: 22,
        browser: 23,
        browser_version: 24,
        operating_system: 25,
        request_path: 26,
        qs: 27,
        tracking_id: 28,
        unique_id: 29,
        element_no: 30,
        mlt: 31,
        keyword: 32,
        current_page: 33,
        max_per_page: 34,
        items_count: 35,
        sorting: 36,
        is_custom: 37
    };

    root.LilBro.Schema.type_map = {
        PageLoad: 1,
        Search: 2,
        Click: 3,
        Add2Cart: 4,
        Rate: 5,
        Sale: 6,
        BannerClick: 7,
        BannerImpression: 8,
        Login: 9,
        RecommendationClick: 10,
        AutoCompleteClick: 11
    };

    root.LilBro.Schema.PageLoad = {
    };
    root.LilBro.Schema.PageLoad.version = "pl01a";
    root.LilBro.Schema.PageLoad.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        viewport_width: 6,
        viewport_height: 7,
        browser: 8,
        browser_version: 9,
        operating_system: 10,
        request_path: 11,
        qs: 12,
        tracking_properties: 13,
        page_type_id: 14
    }
    root.LilBro.Schema.PageLoad.PageType = {
        itemDetails: 1,
        landingPage: 2,
        shoppingCart: 3,
        orderConfirmation: 4,
        custom: 5
    }

    root.LilBro.Schema.Search = {
    };
    root.LilBro.Schema.Search.version = "ref01a";
    root.LilBro.Schema.Search.SearchType = {
        Search: 1,
        Refinement: 2
    };

    root.LilBro.Schema.Search.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        viewport_width: 6,
        viewport_height: 7,
        browser: 8,
        browser_version: 9,
        operating_system: 10,
        request_path: 11,
        qs: 12,
        tracking_id: 13,
        query_id: 14,
        type_id: 15
    }

    root.LilBro.Schema.Click = {
    };
    root.LilBro.Schema.Click.version = "cli01a";
    root.LilBro.Schema.Click.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        mouse_x: 6,
        mouse_y: 7,
        viewport_width: 8,
        viewport_height: 9,
        scroll_x: 10,
        scroll_y: 11,
        element_id: 12,
        element_id_from: 13,
        element_class: 14,
        element_class_from: 15,
        element_name: 16,
        element_tag: 17,
        element_type: 18,
        element_checked: 19,
        element_value: 20,
        element_x: 21,
        element_y: 22,
        browser: 23,
        browser_version: 24,
        operating_system: 25,
        request_path: 26,
        qs: 27,
        tracking_id: 28,
        unique_id: 29,
        mlt: 30,
        element_no: 31,
        url: 32
    }

    root.LilBro.Schema.Rate = {
    };
    root.LilBro.Schema.Rate.version = "rat01a";
    root.LilBro.Schema.Rate.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        value: 6,
        unique_id: 7
    }

    root.LilBro.Schema.Sale = {
    };
    root.LilBro.Schema.Sale.version = "sal01a";
    root.LilBro.Schema.Sale.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        order_no: 6,
        item_list: 7,
        total: 8,
        tax: 9,
        currency: 10,
        sub_total: 11
    }

    root.LilBro.Schema.Add2Cart = {
    };
    root.LilBro.Schema.Add2Cart.version = "a2c01a";
    root.LilBro.Schema.Add2Cart.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        unique_id: 6,
        price: 7,
        quantity: 8,
        currency: 9
    }

    root.LilBro.Schema.BannerClick = {
    }
    root.LilBro.Schema.BannerClick.version = "banclk01a";
    root.LilBro.Schema.BannerClick.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        tracking_id: 6,
        banner_id: 7
    }

    root.LilBro.Schema.BannerImpression = {
    }
    root.LilBro.Schema.BannerImpression.version = "banimp01a";
    root.LilBro.Schema.BannerImpression.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        tracking_id: 6,
        banner_id: 7
    }



    root.LilBro.Schema.RecommendationClick = {
    }
    root.LilBro.Schema.RecommendationClick.version = "recClick01a";
    root.LilBro.Schema.RecommendationClick.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        widget_guid: 6,
        unique_id: 7,
        item_index: 8,
        request_id: 9
    }

    root.LilBro.Schema.AutoCompleteClick = {
    }
    root.LilBro.Schema.AutoCompleteClick.version = "autoComplClick01a";
    root.LilBro.Schema.AutoCompleteClick.key_map = {
        // leave slot 0 for the server timestamp
        version: 1,
        timestamp: 2,
        event_type: 3,
        visitor_id: 4,
        visit_id: 5,
        suggest_type: 6,
        url: 7,
        name: 8,
        keyword: 9
    }
    root.LilBro.Schema.AutoCompleteClick.AutoCompleteType = {
        popular: 1,
        category: 2,
        product: 3,
        content: 4
    }

}).call(HawkSearch);

HawkSearch.Dictionary = (function () {
    function Dictionary() {
        if (!(this instanceof Dictionary))
            return new Dictionary();
    }

    Dictionary.prototype.count = function () {
        var key,
            count = 0;

        for (key in this) {
            if (this.hasOwnProperty(key))
                count += 1;
        }
        return count;
    };

    Dictionary.prototype.keys = function () {
        var key,
            keys = [];

        for (key in this) {
            if (this.hasOwnProperty(key))
                keys.push(key);
        }
        return keys;
    };

    Dictionary.prototype.values = function () {
        var key,
            values = [];

        for (key in this) {
            if (this.hasOwnProperty(key))
                values.push(this[key]);
        }
        return values;
    };

    Dictionary.prototype.keyValuePairs = function () {
        var key,
            keyValuePairs = [];

        for (key in this) {
            if (this.hasOwnProperty(key))
                keyValuePairs.push({
                    Key: key,
                    Value: this[key]
                });
        }
        return keyValuePairs;
    };

    Dictionary.prototype.add = function (key, value) {
        this[key] = value;
    }

    Dictionary.prototype.clear = function () {
        var key,
            dummy;

        for (key in this) {
            if (this.hasOwnProperty(key))
                dummy = delete this[key];
        }
    }

    Dictionary.prototype.containsKey = function (key) {
        return this.hasOwnProperty(key);
    }

    Dictionary.prototype.containsValue = function (value) {
        var key;

        for (key in this) {
            if (this.hasOwnProperty(key) && this[key] === value)
                return true;
        }
        return false;
    }

    Dictionary.prototype.remove = function (key) {
        var dummy;

        if (this.hasOwnProperty(key)) {
            dummy = delete this[key];
            return true;
        } else
            return false;
    }

    return Dictionary;
}());
HawkSearch.ContextObj = function () {
};
HawkSearch.ContextObj.prototype = new HawkSearch.Dictionary();
HawkSearch.ContextObj.prototype.Custom = new HawkSearch.Dictionary();
HawkSearch.Context = new HawkSearch.ContextObj();;
(function (PreviewDateTimeLoader, HawkSearchLoader, undefined) {
    var jQuery;

    PreviewDateTimeLoader.loadjQuery = "loadjQuery" in PreviewDateTimeLoader ? PreviewDateTimeLoader.loadjQuery : ("loadjQuery" in HawkSearchLoader ? HawkSearchLoader.loadjQuery : true);

    if (PreviewDateTimeLoader.loadjQuery)
    {
        var head = (document.getElementsByTagName("head")[0] || document.documentElement),
		    script = "//manage.hawksearch.com/sites/shared/includes/jquery-1.11.0_jquery-ui-slider-1.10.4.min.js";

        var jqScriptTag = document.createElement('script');
        jqScriptTag.type = 'text/javascript';
        jqScriptTag.src = script;
        var jqLoadDone = false;

        jqScriptTag.onload = jqScriptTag.onreadystatechange = function () {
            if (!jqLoadDone && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
                jqLoadDone = true;


                jQueryLoaded();
                jqScriptTag.onload = jqScriptTag.onreadystatechange = null;
                if (head && jqScriptTag.parentNode) {
                    head.removeChild(jqScriptTag);
                }
            }
        };

        head.insertBefore(jqScriptTag, head.firstChild);


        function jQueryLoaded() {
            jQuery = window.jQuery.noConflict(true);
            window.jQuery = jQuery;
            containedPreviewDateTimeInitializer(jQuery);
        };

    } else {
        jQuery = window.jQuery;
        jQuery(function () {
            containedPreviewDateTimeInitializer(jQuery);
        });
    }

    function containedPreviewDateTimeInitializer($) {
        (function (HawkPreviewDateTime, $) {
        HawkPreviewDateTime.registerPreviewDatetime = function () {

            if (typeof (smartbugDatetimepicker) === "undefined") {
                return;
            }

            // console.log('registering preview date');

            var searchUrl = smartbugDatetimepicker.searchUrl;
            var $form = $('form[action="' + searchUrl + '"]');
            var clientId = smartbugDatetimepicker.clientId;
            var pickerId = '#previewdatetime_' + clientId;

            var hawkDate = smartbugDatetimepicker.hawkDate;
            if (hawkDate && hawkDate - new Date().getTime() < 1000 * 60 * 10) {
                hawkDate = '';
            }

            $form.each(function () {
                var $this = $(this);
                var $input;

                if (!($input = $this.find('input[name="HawkDate"]')).length) {
                    $this.append('<input type="hidden" name="HawkDate" value="' + hawkDate + '"/>');
                } else {
                    $input.val(hawkDate);
                }
            });

            function updateQueryStringParameter(uri, key, value) {
                var re = new RegExp("([?&])" + key + "=.*?(&|$|#)", "ig");
                var separator = uri.indexOf('?') !== -1 ? "&" : "?";
                if (uri.match(re)) {
                    return uri.replace(re, '$1' + key + "=" + value + '$2');
                } else {
                    return uri + separator + key + "=" + value;
                }
            }

            $(pickerId).datetimepicker({
                defaultDate: hawkDate ? new Date(hawkDate) : new Date(),
                minDate: new Date(),
                widgetParent: $('#hawksmartbug')
            });

            $(pickerId).find('.input-go').on('click', function () {
                var date = moment($(pickerId).find('input').val());
                var value = date.toDate().getTime();
                smartbugDatetimepicker.hawkDate = value;
                window.location.href = updateQueryStringParameter(window.location.href, 'HawkDate', value);
            });
        }
        }(window.HawkPreviewDateTime = window.HawkPreviewDateTime || {}, jQuery));


        /************************/
        /* Custom Plugins Below */
        /************************/


        //! moment.js
        //! version : 2.10.3
        //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
        //! license : MIT
        //! momentjs.com
        !function (a, b) { "object" == typeof exports && "undefined" != typeof module ? module.exports = b() : "function" == typeof define && define.amd ? define(b) : a.moment = b() }(this, function () {
            "use strict"; function a() { return Dc.apply(null, arguments) } function b(a) { Dc = a } function c(a) { return "[object Array]" === Object.prototype.toString.call(a) } function d(a) { return a instanceof Date || "[object Date]" === Object.prototype.toString.call(a) } function e(a, b) { var c, d = []; for (c = 0; c < a.length; ++c) d.push(b(a[c], c)); return d } function f(a, b) { return Object.prototype.hasOwnProperty.call(a, b) } function g(a, b) { for (var c in b) f(b, c) && (a[c] = b[c]); return f(b, "toString") && (a.toString = b.toString), f(b, "valueOf") && (a.valueOf = b.valueOf), a } function h(a, b, c, d) { return za(a, b, c, d, !0).utc() } function i() { return { empty: !1, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: !1, invalidMonth: null, invalidFormat: !1, userInvalidated: !1, iso: !1 } } function j(a) { return null == a._pf && (a._pf = i()), a._pf } function k(a) { if (null == a._isValid) { var b = j(a); a._isValid = !isNaN(a._d.getTime()) && b.overflow < 0 && !b.empty && !b.invalidMonth && !b.nullInput && !b.invalidFormat && !b.userInvalidated, a._strict && (a._isValid = a._isValid && 0 === b.charsLeftOver && 0 === b.unusedTokens.length && void 0 === b.bigHour) } return a._isValid } function l(a) { var b = h(0 / 0); return null != a ? g(j(b), a) : j(b).userInvalidated = !0, b } function m(a, b) { var c, d, e; if ("undefined" != typeof b._isAMomentObject && (a._isAMomentObject = b._isAMomentObject), "undefined" != typeof b._i && (a._i = b._i), "undefined" != typeof b._f && (a._f = b._f), "undefined" != typeof b._l && (a._l = b._l), "undefined" != typeof b._strict && (a._strict = b._strict), "undefined" != typeof b._tzm && (a._tzm = b._tzm), "undefined" != typeof b._isUTC && (a._isUTC = b._isUTC), "undefined" != typeof b._offset && (a._offset = b._offset), "undefined" != typeof b._pf && (a._pf = j(b)), "undefined" != typeof b._locale && (a._locale = b._locale), Fc.length > 0) for (c in Fc) d = Fc[c], e = b[d], "undefined" != typeof e && (a[d] = e); return a } function n(b) { m(this, b), this._d = new Date(+b._d), Gc === !1 && (Gc = !0, a.updateOffset(this), Gc = !1) } function o(a) { return a instanceof n || null != a && null != a._isAMomentObject } function p(a) { var b = +a, c = 0; return 0 !== b && isFinite(b) && (c = b >= 0 ? Math.floor(b) : Math.ceil(b)), c } function q(a, b, c) { var d, e = Math.min(a.length, b.length), f = Math.abs(a.length - b.length), g = 0; for (d = 0; e > d; d++) (c && a[d] !== b[d] || !c && p(a[d]) !== p(b[d])) && g++; return g + f } function r() { } function s(a) { return a ? a.toLowerCase().replace("_", "-") : a } function t(a) { for (var b, c, d, e, f = 0; f < a.length;) { for (e = s(a[f]).split("-"), b = e.length, c = s(a[f + 1]), c = c ? c.split("-") : null; b > 0;) { if (d = u(e.slice(0, b).join("-"))) return d; if (c && c.length >= b && q(e, c, !0) >= b - 1) break; b-- } f++ } return null } function u(a) { var b = null; if (!Hc[a] && "undefined" != typeof module && module && module.exports) try { b = Ec._abbr, require("./locale/" + a), v(b) } catch (c) { } return Hc[a] } function v(a, b) { var c; return a && (c = "undefined" == typeof b ? x(a) : w(a, b), c && (Ec = c)), Ec._abbr } function w(a, b) { return null !== b ? (b.abbr = a, Hc[a] || (Hc[a] = new r), Hc[a].set(b), v(a), Hc[a]) : (delete Hc[a], null) } function x(a) { var b; if (a && a._locale && a._locale._abbr && (a = a._locale._abbr), !a) return Ec; if (!c(a)) { if (b = u(a)) return b; a = [a] } return t(a) } function y(a, b) { var c = a.toLowerCase(); Ic[c] = Ic[c + "s"] = Ic[b] = a } function z(a) { return "string" == typeof a ? Ic[a] || Ic[a.toLowerCase()] : void 0 } function A(a) { var b, c, d = {}; for (c in a) f(a, c) && (b = z(c), b && (d[b] = a[c])); return d } function B(b, c) { return function (d) { return null != d ? (D(this, b, d), a.updateOffset(this, c), this) : C(this, b) } } function C(a, b) { return a._d["get" + (a._isUTC ? "UTC" : "") + b]() } function D(a, b, c) { return a._d["set" + (a._isUTC ? "UTC" : "") + b](c) } function E(a, b) { var c; if ("object" == typeof a) for (c in a) this.set(c, a[c]); else if (a = z(a), "function" == typeof this[a]) return this[a](b); return this } function F(a, b, c) { for (var d = "" + Math.abs(a), e = a >= 0; d.length < b;) d = "0" + d; return (e ? c ? "+" : "" : "-") + d } function G(a, b, c, d) { var e = d; "string" == typeof d && (e = function () { return this[d]() }), a && (Mc[a] = e), b && (Mc[b[0]] = function () { return F(e.apply(this, arguments), b[1], b[2]) }), c && (Mc[c] = function () { return this.localeData().ordinal(e.apply(this, arguments), a) }) } function H(a) { return a.match(/\[[\s\S]/) ? a.replace(/^\[|\]$/g, "") : a.replace(/\\/g, "") } function I(a) { var b, c, d = a.match(Jc); for (b = 0, c = d.length; c > b; b++) Mc[d[b]] ? d[b] = Mc[d[b]] : d[b] = H(d[b]); return function (e) { var f = ""; for (b = 0; c > b; b++) f += d[b] instanceof Function ? d[b].call(e, a) : d[b]; return f } } function J(a, b) { return a.isValid() ? (b = K(b, a.localeData()), Lc[b] || (Lc[b] = I(b)), Lc[b](a)) : a.localeData().invalidDate() } function K(a, b) { function c(a) { return b.longDateFormat(a) || a } var d = 5; for (Kc.lastIndex = 0; d >= 0 && Kc.test(a) ;) a = a.replace(Kc, c), Kc.lastIndex = 0, d -= 1; return a } function L(a, b, c) { _c[a] = "function" == typeof b ? b : function (a) { return a && c ? c : b } } function M(a, b) { return f(_c, a) ? _c[a](b._strict, b._locale) : new RegExp(N(a)) } function N(a) { return a.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (a, b, c, d, e) { return b || c || d || e }).replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&") } function O(a, b) { var c, d = b; for ("string" == typeof a && (a = [a]), "number" == typeof b && (d = function (a, c) { c[b] = p(a) }), c = 0; c < a.length; c++) ad[a[c]] = d } function P(a, b) { O(a, function (a, c, d, e) { d._w = d._w || {}, b(a, d._w, d, e) }) } function Q(a, b, c) { null != b && f(ad, a) && ad[a](b, c._a, c, a) } function R(a, b) { return new Date(Date.UTC(a, b + 1, 0)).getUTCDate() } function S(a) { return this._months[a.month()] } function T(a) { return this._monthsShort[a.month()] } function U(a, b, c) { var d, e, f; for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), d = 0; 12 > d; d++) { if (e = h([2e3, d]), c && !this._longMonthsParse[d] && (this._longMonthsParse[d] = new RegExp("^" + this.months(e, "").replace(".", "") + "$", "i"), this._shortMonthsParse[d] = new RegExp("^" + this.monthsShort(e, "").replace(".", "") + "$", "i")), c || this._monthsParse[d] || (f = "^" + this.months(e, "") + "|^" + this.monthsShort(e, ""), this._monthsParse[d] = new RegExp(f.replace(".", ""), "i")), c && "MMMM" === b && this._longMonthsParse[d].test(a)) return d; if (c && "MMM" === b && this._shortMonthsParse[d].test(a)) return d; if (!c && this._monthsParse[d].test(a)) return d } } function V(a, b) { var c; return "string" == typeof b && (b = a.localeData().monthsParse(b), "number" != typeof b) ? a : (c = Math.min(a.date(), R(a.year(), b)), a._d["set" + (a._isUTC ? "UTC" : "") + "Month"](b, c), a) } function W(b) { return null != b ? (V(this, b), a.updateOffset(this, !0), this) : C(this, "Month") } function X() { return R(this.year(), this.month()) } function Y(a) { var b, c = a._a; return c && -2 === j(a).overflow && (b = c[cd] < 0 || c[cd] > 11 ? cd : c[dd] < 1 || c[dd] > R(c[bd], c[cd]) ? dd : c[ed] < 0 || c[ed] > 24 || 24 === c[ed] && (0 !== c[fd] || 0 !== c[gd] || 0 !== c[hd]) ? ed : c[fd] < 0 || c[fd] > 59 ? fd : c[gd] < 0 || c[gd] > 59 ? gd : c[hd] < 0 || c[hd] > 999 ? hd : -1, j(a)._overflowDayOfYear && (bd > b || b > dd) && (b = dd), j(a).overflow = b), a } function Z(b) { a.suppressDeprecationWarnings === !1 && "undefined" != typeof console && console.warn && console.warn("Deprecation warning: " + b) } function $(a, b) { var c = !0, d = a + "\n" + (new Error).stack; return g(function () { return c && (Z(d), c = !1), b.apply(this, arguments) }, b) } function _(a, b) { kd[a] || (Z(b), kd[a] = !0) } function aa(a) { var b, c, d = a._i, e = ld.exec(d); if (e) { for (j(a).iso = !0, b = 0, c = md.length; c > b; b++) if (md[b][1].exec(d)) { a._f = md[b][0] + (e[6] || " "); break } for (b = 0, c = nd.length; c > b; b++) if (nd[b][1].exec(d)) { a._f += nd[b][0]; break } d.match(Yc) && (a._f += "Z"), ta(a) } else a._isValid = !1 } function ba(b) { var c = od.exec(b._i); return null !== c ? void (b._d = new Date(+c[1])) : (aa(b), void (b._isValid === !1 && (delete b._isValid, a.createFromInputFallback(b)))) } function ca(a, b, c, d, e, f, g) { var h = new Date(a, b, c, d, e, f, g); return 1970 > a && h.setFullYear(a), h } function da(a) { var b = new Date(Date.UTC.apply(null, arguments)); return 1970 > a && b.setUTCFullYear(a), b } function ea(a) { return fa(a) ? 366 : 365 } function fa(a) { return a % 4 === 0 && a % 100 !== 0 || a % 400 === 0 } function ga() { return fa(this.year()) } function ha(a, b, c) { var d, e = c - b, f = c - a.day(); return f > e && (f -= 7), e - 7 > f && (f += 7), d = Aa(a).add(f, "d"), { week: Math.ceil(d.dayOfYear() / 7), year: d.year() } } function ia(a) { return ha(a, this._week.dow, this._week.doy).week } function ja() { return this._week.dow } function ka() { return this._week.doy } function la(a) { var b = this.localeData().week(this); return null == a ? b : this.add(7 * (a - b), "d") } function ma(a) { var b = ha(this, 1, 4).week; return null == a ? b : this.add(7 * (a - b), "d") } function na(a, b, c, d, e) { var f, g, h = da(a, 0, 1).getUTCDay(); return h = 0 === h ? 7 : h, c = null != c ? c : e, f = e - h + (h > d ? 7 : 0) - (e > h ? 7 : 0), g = 7 * (b - 1) + (c - e) + f + 1, { year: g > 0 ? a : a - 1, dayOfYear: g > 0 ? g : ea(a - 1) + g } } function oa(a) { var b = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1; return null == a ? b : this.add(a - b, "d") } function pa(a, b, c) { return null != a ? a : null != b ? b : c } function qa(a) { var b = new Date; return a._useUTC ? [b.getUTCFullYear(), b.getUTCMonth(), b.getUTCDate()] : [b.getFullYear(), b.getMonth(), b.getDate()] } function ra(a) { var b, c, d, e, f = []; if (!a._d) { for (d = qa(a), a._w && null == a._a[dd] && null == a._a[cd] && sa(a), a._dayOfYear && (e = pa(a._a[bd], d[bd]), a._dayOfYear > ea(e) && (j(a)._overflowDayOfYear = !0), c = da(e, 0, a._dayOfYear), a._a[cd] = c.getUTCMonth(), a._a[dd] = c.getUTCDate()), b = 0; 3 > b && null == a._a[b]; ++b) a._a[b] = f[b] = d[b]; for (; 7 > b; b++) a._a[b] = f[b] = null == a._a[b] ? 2 === b ? 1 : 0 : a._a[b]; 24 === a._a[ed] && 0 === a._a[fd] && 0 === a._a[gd] && 0 === a._a[hd] && (a._nextDay = !0, a._a[ed] = 0), a._d = (a._useUTC ? da : ca).apply(null, f), null != a._tzm && a._d.setUTCMinutes(a._d.getUTCMinutes() - a._tzm), a._nextDay && (a._a[ed] = 24) } } function sa(a) { var b, c, d, e, f, g, h; b = a._w, null != b.GG || null != b.W || null != b.E ? (f = 1, g = 4, c = pa(b.GG, a._a[bd], ha(Aa(), 1, 4).year), d = pa(b.W, 1), e = pa(b.E, 1)) : (f = a._locale._week.dow, g = a._locale._week.doy, c = pa(b.gg, a._a[bd], ha(Aa(), f, g).year), d = pa(b.w, 1), null != b.d ? (e = b.d, f > e && ++d) : e = null != b.e ? b.e + f : f), h = na(c, d, e, g, f), a._a[bd] = h.year, a._dayOfYear = h.dayOfYear } function ta(b) { if (b._f === a.ISO_8601) return void aa(b); b._a = [], j(b).empty = !0; var c, d, e, f, g, h = "" + b._i, i = h.length, k = 0; for (e = K(b._f, b._locale).match(Jc) || [], c = 0; c < e.length; c++) f = e[c], d = (h.match(M(f, b)) || [])[0], d && (g = h.substr(0, h.indexOf(d)), g.length > 0 && j(b).unusedInput.push(g), h = h.slice(h.indexOf(d) + d.length), k += d.length), Mc[f] ? (d ? j(b).empty = !1 : j(b).unusedTokens.push(f), Q(f, d, b)) : b._strict && !d && j(b).unusedTokens.push(f); j(b).charsLeftOver = i - k, h.length > 0 && j(b).unusedInput.push(h), j(b).bigHour === !0 && b._a[ed] <= 12 && b._a[ed] > 0 && (j(b).bigHour = void 0), b._a[ed] = ua(b._locale, b._a[ed], b._meridiem), ra(b), Y(b) } function ua(a, b, c) { var d; return null == c ? b : null != a.meridiemHour ? a.meridiemHour(b, c) : null != a.isPM ? (d = a.isPM(c), d && 12 > b && (b += 12), d || 12 !== b || (b = 0), b) : b } function va(a) { var b, c, d, e, f; if (0 === a._f.length) return j(a).invalidFormat = !0, void (a._d = new Date(0 / 0)); for (e = 0; e < a._f.length; e++) f = 0, b = m({}, a), null != a._useUTC && (b._useUTC = a._useUTC), b._f = a._f[e], ta(b), k(b) && (f += j(b).charsLeftOver, f += 10 * j(b).unusedTokens.length, j(b).score = f, (null == d || d > f) && (d = f, c = b)); g(a, c || b) } function wa(a) { if (!a._d) { var b = A(a._i); a._a = [b.year, b.month, b.day || b.date, b.hour, b.minute, b.second, b.millisecond], ra(a) } } function xa(a) { var b, e = a._i, f = a._f; return a._locale = a._locale || x(a._l), null === e || void 0 === f && "" === e ? l({ nullInput: !0 }) : ("string" == typeof e && (a._i = e = a._locale.preparse(e)), o(e) ? new n(Y(e)) : (c(f) ? va(a) : f ? ta(a) : d(e) ? a._d = e : ya(a), b = new n(Y(a)), b._nextDay && (b.add(1, "d"), b._nextDay = void 0), b)) } function ya(b) { var f = b._i; void 0 === f ? b._d = new Date : d(f) ? b._d = new Date(+f) : "string" == typeof f ? ba(b) : c(f) ? (b._a = e(f.slice(0), function (a) { return parseInt(a, 10) }), ra(b)) : "object" == typeof f ? wa(b) : "number" == typeof f ? b._d = new Date(f) : a.createFromInputFallback(b) } function za(a, b, c, d, e) { var f = {}; return "boolean" == typeof c && (d = c, c = void 0), f._isAMomentObject = !0, f._useUTC = f._isUTC = e, f._l = c, f._i = a, f._f = b, f._strict = d, xa(f) } function Aa(a, b, c, d) { return za(a, b, c, d, !1) } function Ba(a, b) { var d, e; if (1 === b.length && c(b[0]) && (b = b[0]), !b.length) return Aa(); for (d = b[0], e = 1; e < b.length; ++e) b[e][a](d) && (d = b[e]); return d } function Ca() { var a = [].slice.call(arguments, 0); return Ba("isBefore", a) } function Da() { var a = [].slice.call(arguments, 0); return Ba("isAfter", a) } function Ea(a) { var b = A(a), c = b.year || 0, d = b.quarter || 0, e = b.month || 0, f = b.week || 0, g = b.day || 0, h = b.hour || 0, i = b.minute || 0, j = b.second || 0, k = b.millisecond || 0; this._milliseconds = +k + 1e3 * j + 6e4 * i + 36e5 * h, this._days = +g + 7 * f, this._months = +e + 3 * d + 12 * c, this._data = {}, this._locale = x(), this._bubble() } function Fa(a) { return a instanceof Ea } function Ga(a, b) { G(a, 0, 0, function () { var a = this.utcOffset(), c = "+"; return 0 > a && (a = -a, c = "-"), c + F(~~(a / 60), 2) + b + F(~~a % 60, 2) }) } function Ha(a) { var b = (a || "").match(Yc) || [], c = b[b.length - 1] || [], d = (c + "").match(td) || ["-", 0, 0], e = +(60 * d[1]) + p(d[2]); return "+" === d[0] ? e : -e } function Ia(b, c) { var e, f; return c._isUTC ? (e = c.clone(), f = (o(b) || d(b) ? +b : +Aa(b)) - +e, e._d.setTime(+e._d + f), a.updateOffset(e, !1), e) : Aa(b).local(); return c._isUTC ? Aa(b).zone(c._offset || 0) : Aa(b).local() } function Ja(a) { return 15 * -Math.round(a._d.getTimezoneOffset() / 15) } function Ka(b, c) { var d, e = this._offset || 0; return null != b ? ("string" == typeof b && (b = Ha(b)), Math.abs(b) < 16 && (b = 60 * b), !this._isUTC && c && (d = Ja(this)), this._offset = b, this._isUTC = !0, null != d && this.add(d, "m"), e !== b && (!c || this._changeInProgress ? $a(this, Va(b - e, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, a.updateOffset(this, !0), this._changeInProgress = null)), this) : this._isUTC ? e : Ja(this) } function La(a, b) { return null != a ? ("string" != typeof a && (a = -a), this.utcOffset(a, b), this) : -this.utcOffset() } function Ma(a) { return this.utcOffset(0, a) } function Na(a) { return this._isUTC && (this.utcOffset(0, a), this._isUTC = !1, a && this.subtract(Ja(this), "m")), this } function Oa() { return this._tzm ? this.utcOffset(this._tzm) : "string" == typeof this._i && this.utcOffset(Ha(this._i)), this } function Pa(a) { return a = a ? Aa(a).utcOffset() : 0, (this.utcOffset() - a) % 60 === 0 } function Qa() { return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() } function Ra() { if (this._a) { var a = this._isUTC ? h(this._a) : Aa(this._a); return this.isValid() && q(this._a, a.toArray()) > 0 } return !1 } function Sa() { return !this._isUTC } function Ta() { return this._isUTC } function Ua() { return this._isUTC && 0 === this._offset } function Va(a, b) { var c, d, e, g = a, h = null; return Fa(a) ? g = { ms: a._milliseconds, d: a._days, M: a._months } : "number" == typeof a ? (g = {}, b ? g[b] = a : g.milliseconds = a) : (h = ud.exec(a)) ? (c = "-" === h[1] ? -1 : 1, g = { y: 0, d: p(h[dd]) * c, h: p(h[ed]) * c, m: p(h[fd]) * c, s: p(h[gd]) * c, ms: p(h[hd]) * c }) : (h = vd.exec(a)) ? (c = "-" === h[1] ? -1 : 1, g = { y: Wa(h[2], c), M: Wa(h[3], c), d: Wa(h[4], c), h: Wa(h[5], c), m: Wa(h[6], c), s: Wa(h[7], c), w: Wa(h[8], c) }) : null == g ? g = {} : "object" == typeof g && ("from" in g || "to" in g) && (e = Ya(Aa(g.from), Aa(g.to)), g = {}, g.ms = e.milliseconds, g.M = e.months), d = new Ea(g), Fa(a) && f(a, "_locale") && (d._locale = a._locale), d } function Wa(a, b) { var c = a && parseFloat(a.replace(",", ".")); return (isNaN(c) ? 0 : c) * b } function Xa(a, b) { var c = { milliseconds: 0, months: 0 }; return c.months = b.month() - a.month() + 12 * (b.year() - a.year()), a.clone().add(c.months, "M").isAfter(b) && --c.months, c.milliseconds = +b - +a.clone().add(c.months, "M"), c } function Ya(a, b) { var c; return b = Ia(b, a), a.isBefore(b) ? c = Xa(a, b) : (c = Xa(b, a), c.milliseconds = -c.milliseconds, c.months = -c.months), c } function Za(a, b) { return function (c, d) { var e, f; return null === d || isNaN(+d) || (_(b, "moment()." + b + "(period, number) is deprecated. Please use moment()." + b + "(number, period)."), f = c, c = d, d = f), c = "string" == typeof c ? +c : c, e = Va(c, d), $a(this, e, a), this } } function $a(b, c, d, e) { var f = c._milliseconds, g = c._days, h = c._months; e = null == e ? !0 : e, f && b._d.setTime(+b._d + f * d), g && D(b, "Date", C(b, "Date") + g * d), h && V(b, C(b, "Month") + h * d), e && a.updateOffset(b, g || h) } function _a(a) { var b = a || Aa(), c = Ia(b, this).startOf("day"), d = this.diff(c, "days", !0), e = -6 > d ? "sameElse" : -1 > d ? "lastWeek" : 0 > d ? "lastDay" : 1 > d ? "sameDay" : 2 > d ? "nextDay" : 7 > d ? "nextWeek" : "sameElse"; return this.format(this.localeData().calendar(e, this, Aa(b))) } function ab() { return new n(this) } function bb(a, b) { var c; return b = z("undefined" != typeof b ? b : "millisecond"), "millisecond" === b ? (a = o(a) ? a : Aa(a), +this > +a) : (c = o(a) ? +a : +Aa(a), c < +this.clone().startOf(b)) } function cb(a, b) { var c; return b = z("undefined" != typeof b ? b : "millisecond"), "millisecond" === b ? (a = o(a) ? a : Aa(a), +a > +this) : (c = o(a) ? +a : +Aa(a), +this.clone().endOf(b) < c) } function db(a, b, c) { return this.isAfter(a, c) && this.isBefore(b, c) } function eb(a, b) { var c; return b = z(b || "millisecond"), "millisecond" === b ? (a = o(a) ? a : Aa(a), +this === +a) : (c = +Aa(a), +this.clone().startOf(b) <= c && c <= +this.clone().endOf(b)) } function fb(a) { return 0 > a ? Math.ceil(a) : Math.floor(a) } function gb(a, b, c) { var d, e, f = Ia(a, this), g = 6e4 * (f.utcOffset() - this.utcOffset()); return b = z(b), "year" === b || "month" === b || "quarter" === b ? (e = hb(this, f), "quarter" === b ? e /= 3 : "year" === b && (e /= 12)) : (d = this - f, e = "second" === b ? d / 1e3 : "minute" === b ? d / 6e4 : "hour" === b ? d / 36e5 : "day" === b ? (d - g) / 864e5 : "week" === b ? (d - g) / 6048e5 : d), c ? e : fb(e) } function hb(a, b) { var c, d, e = 12 * (b.year() - a.year()) + (b.month() - a.month()), f = a.clone().add(e, "months"); return 0 > b - f ? (c = a.clone().add(e - 1, "months"), d = (b - f) / (f - c)) : (c = a.clone().add(e + 1, "months"), d = (b - f) / (c - f)), -(e + d) } function ib() { return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ") } function jb() { var a = this.clone().utc(); return 0 < a.year() && a.year() <= 9999 ? "function" == typeof Date.prototype.toISOString ? this.toDate().toISOString() : J(a, "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]") : J(a, "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]") } function kb(b) { var c = J(this, b || a.defaultFormat); return this.localeData().postformat(c) } function lb(a, b) { return this.isValid() ? Va({ to: this, from: a }).locale(this.locale()).humanize(!b) : this.localeData().invalidDate() } function mb(a) { return this.from(Aa(), a) } function nb(a, b) { return this.isValid() ? Va({ from: this, to: a }).locale(this.locale()).humanize(!b) : this.localeData().invalidDate() } function ob(a) { return this.to(Aa(), a) } function pb(a) { var b; return void 0 === a ? this._locale._abbr : (b = x(a), null != b && (this._locale = b), this) } function qb() { return this._locale } function rb(a) { switch (a = z(a)) { case "year": this.month(0); case "quarter": case "month": this.date(1); case "week": case "isoWeek": case "day": this.hours(0); case "hour": this.minutes(0); case "minute": this.seconds(0); case "second": this.milliseconds(0) } return "week" === a && this.weekday(0), "isoWeek" === a && this.isoWeekday(1), "quarter" === a && this.month(3 * Math.floor(this.month() / 3)), this } function sb(a) { return a = z(a), void 0 === a || "millisecond" === a ? this : this.startOf(a).add(1, "isoWeek" === a ? "week" : a).subtract(1, "ms") } function tb() { return +this._d - 6e4 * (this._offset || 0) } function ub() { return Math.floor(+this / 1e3) } function vb() { return this._offset ? new Date(+this) : this._d } function wb() { var a = this; return [a.year(), a.month(), a.date(), a.hour(), a.minute(), a.second(), a.millisecond()] } function xb() { return k(this) } function yb() { return g({}, j(this)) } function zb() { return j(this).overflow } function Ab(a, b) { G(0, [a, a.length], 0, b) } function Bb(a, b, c) { return ha(Aa([a, 11, 31 + b - c]), b, c).week } function Cb(a) { var b = ha(this, this.localeData()._week.dow, this.localeData()._week.doy).year; return null == a ? b : this.add(a - b, "y") } function Db(a) { var b = ha(this, 1, 4).year; return null == a ? b : this.add(a - b, "y") } function Eb() { return Bb(this.year(), 1, 4) } function Fb() { var a = this.localeData()._week; return Bb(this.year(), a.dow, a.doy) } function Gb(a) { return null == a ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (a - 1) + this.month() % 3) } function Hb(a, b) { if ("string" == typeof a) if (isNaN(a)) { if (a = b.weekdaysParse(a), "number" != typeof a) return null } else a = parseInt(a, 10); return a } function Ib(a) { return this._weekdays[a.day()] } function Jb(a) { return this._weekdaysShort[a.day()] } function Kb(a) { return this._weekdaysMin[a.day()] } function Lb(a) { var b, c, d; for (this._weekdaysParse || (this._weekdaysParse = []), b = 0; 7 > b; b++) if (this._weekdaysParse[b] || (c = Aa([2e3, 1]).day(b), d = "^" + this.weekdays(c, "") + "|^" + this.weekdaysShort(c, "") + "|^" + this.weekdaysMin(c, ""), this._weekdaysParse[b] = new RegExp(d.replace(".", ""), "i")), this._weekdaysParse[b].test(a)) return b } function Mb(a) { var b = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); return null != a ? (a = Hb(a, this.localeData()), this.add(a - b, "d")) : b } function Nb(a) { var b = (this.day() + 7 - this.localeData()._week.dow) % 7; return null == a ? b : this.add(a - b, "d") } function Ob(a) { return null == a ? this.day() || 7 : this.day(this.day() % 7 ? a : a - 7) } function Pb(a, b) { G(a, 0, 0, function () { return this.localeData().meridiem(this.hours(), this.minutes(), b) }) } function Qb(a, b) { return b._meridiemParse } function Rb(a) { return "p" === (a + "").toLowerCase().charAt(0) } function Sb(a, b, c) { return a > 11 ? c ? "pm" : "PM" : c ? "am" : "AM" } function Tb(a) { G(0, [a, 3], 0, "millisecond") } function Ub() { return this._isUTC ? "UTC" : "" } function Vb() { return this._isUTC ? "Coordinated Universal Time" : "" } function Wb(a) { return Aa(1e3 * a) } function Xb() { return Aa.apply(null, arguments).parseZone() } function Yb(a, b, c) { var d = this._calendar[a]; return "function" == typeof d ? d.call(b, c) : d } function Zb(a) { var b = this._longDateFormat[a]; return !b && this._longDateFormat[a.toUpperCase()] && (b = this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function (a) { return a.slice(1) }), this._longDateFormat[a] = b), b } function $b() { return this._invalidDate } function _b(a) { return this._ordinal.replace("%d", a) } function ac(a) { return a } function bc(a, b, c, d) { var e = this._relativeTime[c]; return "function" == typeof e ? e(a, b, c, d) : e.replace(/%d/i, a) } function cc(a, b) { var c = this._relativeTime[a > 0 ? "future" : "past"]; return "function" == typeof c ? c(b) : c.replace(/%s/i, b) } function dc(a) { var b, c; for (c in a) b = a[c], "function" == typeof b ? this[c] = b : this["_" + c] = b; this._ordinalParseLenient = new RegExp(this._ordinalParse.source + "|" + /\d{1,2}/.source) } function ec(a, b, c, d) { var e = x(), f = h().set(d, b); return e[c](f, a) } function fc(a, b, c, d, e) { if ("number" == typeof a && (b = a, a = void 0), a = a || "", null != b) return ec(a, b, c, e); var f, g = []; for (f = 0; d > f; f++) g[f] = ec(a, f, c, e); return g } function gc(a, b) { return fc(a, b, "months", 12, "month") } function hc(a, b) { return fc(a, b, "monthsShort", 12, "month") } function ic(a, b) { return fc(a, b, "weekdays", 7, "day") } function jc(a, b) { return fc(a, b, "weekdaysShort", 7, "day") } function kc(a, b) { return fc(a, b, "weekdaysMin", 7, "day") } function lc() { var a = this._data; return this._milliseconds = Rd(this._milliseconds), this._days = Rd(this._days), this._months = Rd(this._months), a.milliseconds = Rd(a.milliseconds), a.seconds = Rd(a.seconds), a.minutes = Rd(a.minutes), a.hours = Rd(a.hours), a.months = Rd(a.months), a.years = Rd(a.years), this } function mc(a, b, c, d) { var e = Va(b, c); return a._milliseconds += d * e._milliseconds, a._days += d * e._days, a._months += d * e._months, a._bubble() } function nc(a, b) { return mc(this, a, b, 1) } function oc(a, b) { return mc(this, a, b, -1) } function pc() { var a, b, c, d = this._milliseconds, e = this._days, f = this._months, g = this._data, h = 0; return g.milliseconds = d % 1e3, a = fb(d / 1e3), g.seconds = a % 60, b = fb(a / 60), g.minutes = b % 60, c = fb(b / 60), g.hours = c % 24, e += fb(c / 24), h = fb(qc(e)), e -= fb(rc(h)), f += fb(e / 30), e %= 30, h += fb(f / 12), f %= 12, g.days = e, g.months = f, g.years = h, this } function qc(a) { return 400 * a / 146097 } function rc(a) { return 146097 * a / 400 } function sc(a) { var b, c, d = this._milliseconds; if (a = z(a), "month" === a || "year" === a) return b = this._days + d / 864e5, c = this._months + 12 * qc(b), "month" === a ? c : c / 12; switch (b = this._days + Math.round(rc(this._months / 12)), a) { case "week": return b / 7 + d / 6048e5; case "day": return b + d / 864e5; case "hour": return 24 * b + d / 36e5; case "minute": return 1440 * b + d / 6e4; case "second": return 86400 * b + d / 1e3; case "millisecond": return Math.floor(864e5 * b) + d; default: throw new Error("Unknown unit " + a) } } function tc() { return this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * p(this._months / 12) } function uc(a) { return function () { return this.as(a) } } function vc(a) { return a = z(a), this[a + "s"]() } function wc(a) { return function () { return this._data[a] } } function xc() { return fb(this.days() / 7) } function yc(a, b, c, d, e) { return e.relativeTime(b || 1, !!c, a, d) } function zc(a, b, c) { var d = Va(a).abs(), e = fe(d.as("s")), f = fe(d.as("m")), g = fe(d.as("h")), h = fe(d.as("d")), i = fe(d.as("M")), j = fe(d.as("y")), k = e < ge.s && ["s", e] || 1 === f && ["m"] || f < ge.m && ["mm", f] || 1 === g && ["h"] || g < ge.h && ["hh", g] || 1 === h && ["d"] || h < ge.d && ["dd", h] || 1 === i && ["M"] || i < ge.M && ["MM", i] || 1 === j && ["y"] || ["yy", j]; return k[2] = b, k[3] = +a > 0, k[4] = c, yc.apply(null, k) } function Ac(a, b) { return void 0 === ge[a] ? !1 : void 0 === b ? ge[a] : (ge[a] = b, !0) } function Bc(a) { var b = this.localeData(), c = zc(this, !a, b); return a && (c = b.pastFuture(+this, c)), b.postformat(c) } function Cc() { var a = he(this.years()), b = he(this.months()), c = he(this.days()), d = he(this.hours()), e = he(this.minutes()), f = he(this.seconds() + this.milliseconds() / 1e3), g = this.asSeconds(); return g ? (0 > g ? "-" : "") + "P" + (a ? a + "Y" : "") + (b ? b + "M" : "") + (c ? c + "D" : "") + (d || e || f ? "T" : "") + (d ? d + "H" : "") + (e ? e + "M" : "") + (f ? f + "S" : "") : "P0D" } var Dc, Ec, Fc = a.momentProperties = [], Gc = !1, Hc = {}, Ic = {}, Jc = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g, Kc = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, Lc = {}, Mc = {}, Nc = /\d/, Oc = /\d\d/, Pc = /\d{3}/, Qc = /\d{4}/, Rc = /[+-]?\d{6}/, Sc = /\d\d?/, Tc = /\d{1,3}/, Uc = /\d{1,4}/, Vc = /[+-]?\d{1,6}/, Wc = /\d+/, Xc = /[+-]?\d+/, Yc = /Z|[+-]\d\d:?\d\d/gi, Zc = /[+-]?\d+(\.\d{1,3})?/, $c = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, _c = {}, ad = {}, bd = 0, cd = 1, dd = 2, ed = 3, fd = 4, gd = 5, hd = 6; G("M", ["MM", 2], "Mo", function () { return this.month() + 1 }), G("MMM", 0, 0, function (a) { return this.localeData().monthsShort(this, a) }), G("MMMM", 0, 0, function (a) { return this.localeData().months(this, a) }), y("month", "M"), L("M", Sc), L("MM", Sc, Oc), L("MMM", $c), L("MMMM", $c), O(["M", "MM"], function (a, b) { b[cd] = p(a) - 1 }), O(["MMM", "MMMM"], function (a, b, c, d) { var e = c._locale.monthsParse(a, d, c._strict); null != e ? b[cd] = e : j(c).invalidMonth = a }); var id = "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), jd = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), kd = {}; a.suppressDeprecationWarnings = !1; var ld = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, md = [["YYYYYY-MM-DD", /[+-]\d{6}-\d{2}-\d{2}/], ["YYYY-MM-DD", /\d{4}-\d{2}-\d{2}/], ["GGGG-[W]WW-E", /\d{4}-W\d{2}-\d/], ["GGGG-[W]WW", /\d{4}-W\d{2}/], ["YYYY-DDD", /\d{4}-\d{3}/]], nd = [["HH:mm:ss.SSSS", /(T| )\d\d:\d\d:\d\d\.\d+/], ["HH:mm:ss", /(T| )\d\d:\d\d:\d\d/], ["HH:mm", /(T| )\d\d:\d\d/], ["HH", /(T| )\d\d/]], od = /^\/?Date\((\-?\d+)/i; a.createFromInputFallback = $("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.", function (a) { a._d = new Date(a._i + (a._useUTC ? " UTC" : "")) }), G(0, ["YY", 2], 0, function () { return this.year() % 100 }), G(0, ["YYYY", 4], 0, "year"), G(0, ["YYYYY", 5], 0, "year"), G(0, ["YYYYYY", 6, !0], 0, "year"), y("year", "y"), L("Y", Xc), L("YY", Sc, Oc), L("YYYY", Uc, Qc), L("YYYYY", Vc, Rc), L("YYYYYY", Vc, Rc), O(["YYYY", "YYYYY", "YYYYYY"], bd), O("YY", function (b, c) { c[bd] = a.parseTwoDigitYear(b) }), a.parseTwoDigitYear = function (a) { return p(a) + (p(a) > 68 ? 1900 : 2e3) }; var pd = B("FullYear", !1); G("w", ["ww", 2], "wo", "week"), G("W", ["WW", 2], "Wo", "isoWeek"), y("week", "w"), y("isoWeek", "W"), L("w", Sc), L("ww", Sc, Oc), L("W", Sc), L("WW", Sc, Oc), P(["w", "ww", "W", "WW"], function (a, b, c, d) { b[d.substr(0, 1)] = p(a) }); var qd = { dow: 0, doy: 6 }; G("DDD", ["DDDD", 3], "DDDo", "dayOfYear"), y("dayOfYear", "DDD"), L("DDD", Tc), L("DDDD", Pc), O(["DDD", "DDDD"], function (a, b, c) { c._dayOfYear = p(a) }), a.ISO_8601 = function () { }; var rd = $("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548", function () { var a = Aa.apply(null, arguments); return this > a ? this : a }), sd = $("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548", function () { var a = Aa.apply(null, arguments); return a > this ? this : a }); Ga("Z", ":"), Ga("ZZ", ""), L("Z", Yc), L("ZZ", Yc), O(["Z", "ZZ"], function (a, b, c) { c._useUTC = !0, c._tzm = Ha(a) }); var td = /([\+\-]|\d\d)/gi; a.updateOffset = function () { }; var ud = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, vd = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; Va.fn = Ea.prototype; var wd = Za(1, "add"), xd = Za(-1, "subtract"); a.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ"; var yd = $("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function (a) { return void 0 === a ? this.localeData() : this.locale(a) }); G(0, ["gg", 2], 0, function () { return this.weekYear() % 100 }), G(0, ["GG", 2], 0, function () { return this.isoWeekYear() % 100 }), Ab("gggg", "weekYear"), Ab("ggggg", "weekYear"), Ab("GGGG", "isoWeekYear"), Ab("GGGGG", "isoWeekYear"), y("weekYear", "gg"), y("isoWeekYear", "GG"), L("G", Xc), L("g", Xc), L("GG", Sc, Oc), L("gg", Sc, Oc), L("GGGG", Uc, Qc), L("gggg", Uc, Qc), L("GGGGG", Vc, Rc), L("ggggg", Vc, Rc), P(["gggg", "ggggg", "GGGG", "GGGGG"], function (a, b, c, d) { b[d.substr(0, 2)] = p(a) }), P(["gg", "GG"], function (b, c, d, e) { c[e] = a.parseTwoDigitYear(b) }), G("Q", 0, 0, "quarter"), y("quarter", "Q"), L("Q", Nc), O("Q", function (a, b) { b[cd] = 3 * (p(a) - 1) }), G("D", ["DD", 2], "Do", "date"), y("date", "D"), L("D", Sc), L("DD", Sc, Oc), L("Do", function (a, b) { return a ? b._ordinalParse : b._ordinalParseLenient }), O(["D", "DD"], dd), O("Do", function (a, b) { b[dd] = p(a.match(Sc)[0], 10) }); var zd = B("Date", !0); G("d", 0, "do", "day"), G("dd", 0, 0, function (a) { return this.localeData().weekdaysMin(this, a) }), G("ddd", 0, 0, function (a) { return this.localeData().weekdaysShort(this, a) }), G("dddd", 0, 0, function (a) { return this.localeData().weekdays(this, a) }), G("e", 0, 0, "weekday"), G("E", 0, 0, "isoWeekday"), y("day", "d"), y("weekday", "e"), y("isoWeekday", "E"), L("d", Sc), L("e", Sc), L("E", Sc), L("dd", $c), L("ddd", $c), L("dddd", $c), P(["dd", "ddd", "dddd"], function (a, b, c) { var d = c._locale.weekdaysParse(a); null != d ? b.d = d : j(c).invalidWeekday = a }), P(["d", "e", "E"], function (a, b, c, d) { b[d] = p(a) }); var Ad = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), Bd = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), Cd = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"); G("H", ["HH", 2], 0, "hour"), G("h", ["hh", 2], 0, function () { return this.hours() % 12 || 12 }), Pb("a", !0), Pb("A", !1), y("hour", "h"), L("a", Qb), L("A", Qb), L("H", Sc), L("h", Sc), L("HH", Sc, Oc), L("hh", Sc, Oc), O(["H", "HH"], ed), O(["a", "A"], function (a, b, c) { c._isPm = c._locale.isPM(a), c._meridiem = a }), O(["h", "hh"], function (a, b, c) { b[ed] = p(a), j(c).bigHour = !0 }); var Dd = /[ap]\.?m?\.?/i, Ed = B("Hours", !0); G("m", ["mm", 2], 0, "minute"), y("minute", "m"), L("m", Sc), L("mm", Sc, Oc), O(["m", "mm"], fd); var Fd = B("Minutes", !1); G("s", ["ss", 2], 0, "second"), y("second", "s"), L("s", Sc), L("ss", Sc, Oc), O(["s", "ss"], gd); var Gd = B("Seconds", !1); G("S", 0, 0, function () { return ~~(this.millisecond() / 100) }), G(0, ["SS", 2], 0, function () { return ~~(this.millisecond() / 10) }), Tb("SSS"), Tb("SSSS"), y("millisecond", "ms"), L("S", Tc, Nc), L("SS", Tc, Oc), L("SSS", Tc, Pc), L("SSSS", Wc), O(["S", "SS", "SSS", "SSSS"], function (a, b) { b[hd] = p(1e3 * ("0." + a)) }); var Hd = B("Milliseconds", !1); G("z", 0, 0, "zoneAbbr"), G("zz", 0, 0, "zoneName"); var Id = n.prototype; Id.add = wd, Id.calendar = _a, Id.clone = ab, Id.diff = gb, Id.endOf = sb, Id.format = kb, Id.from = lb, Id.fromNow = mb, Id.to = nb, Id.toNow = ob, Id.get = E, Id.invalidAt = zb, Id.isAfter = bb, Id.isBefore = cb, Id.isBetween = db, Id.isSame = eb, Id.isValid = xb, Id.lang = yd, Id.locale = pb, Id.localeData = qb, Id.max = sd, Id.min = rd, Id.parsingFlags = yb, Id.set = E, Id.startOf = rb, Id.subtract = xd, Id.toArray = wb, Id.toDate = vb, Id.toISOString = jb, Id.toJSON = jb, Id.toString = ib, Id.unix = ub, Id.valueOf = tb, Id.year = pd, Id.isLeapYear = ga, Id.weekYear = Cb, Id.isoWeekYear = Db, Id.quarter = Id.quarters = Gb, Id.month = W, Id.daysInMonth = X, Id.week = Id.weeks = la, Id.isoWeek = Id.isoWeeks = ma, Id.weeksInYear = Fb, Id.isoWeeksInYear = Eb, Id.date = zd, Id.day = Id.days = Mb, Id.weekday = Nb, Id.isoWeekday = Ob, Id.dayOfYear = oa, Id.hour = Id.hours = Ed, Id.minute = Id.minutes = Fd, Id.second = Id.seconds = Gd, Id.millisecond = Id.milliseconds = Hd, Id.utcOffset = Ka, Id.utc = Ma, Id.local = Na, Id.parseZone = Oa, Id.hasAlignedHourOffset = Pa, Id.isDST = Qa, Id.isDSTShifted = Ra, Id.isLocal = Sa, Id.isUtcOffset = Ta, Id.isUtc = Ua, Id.isUTC = Ua, Id.zoneAbbr = Ub, Id.zoneName = Vb, Id.dates = $("dates accessor is deprecated. Use date instead.", zd), Id.months = $("months accessor is deprecated. Use month instead", W), Id.years = $("years accessor is deprecated. Use year instead", pd), Id.zone = $("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779", La); var Jd = Id, Kd = { sameDay: "[Today at] LT", nextDay: "[Tomorrow at] LT", nextWeek: "dddd [at] LT", lastDay: "[Yesterday at] LT", lastWeek: "[Last] dddd [at] LT", sameElse: "L" }, Ld = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY LT", LLLL: "dddd, MMMM D, YYYY LT" }, Md = "Invalid date", Nd = "%d", Od = /\d{1,2}/, Pd = {
                future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour",
                hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years"
            }, Qd = r.prototype; Qd._calendar = Kd, Qd.calendar = Yb, Qd._longDateFormat = Ld, Qd.longDateFormat = Zb, Qd._invalidDate = Md, Qd.invalidDate = $b, Qd._ordinal = Nd, Qd.ordinal = _b, Qd._ordinalParse = Od, Qd.preparse = ac, Qd.postformat = ac, Qd._relativeTime = Pd, Qd.relativeTime = bc, Qd.pastFuture = cc, Qd.set = dc, Qd.months = S, Qd._months = id, Qd.monthsShort = T, Qd._monthsShort = jd, Qd.monthsParse = U, Qd.week = ia, Qd._week = qd, Qd.firstDayOfYear = ka, Qd.firstDayOfWeek = ja, Qd.weekdays = Ib, Qd._weekdays = Ad, Qd.weekdaysMin = Kb, Qd._weekdaysMin = Cd, Qd.weekdaysShort = Jb, Qd._weekdaysShort = Bd, Qd.weekdaysParse = Lb, Qd.isPM = Rb, Qd._meridiemParse = Dd, Qd.meridiem = Sb, v("en", { ordinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (a) { var b = a % 10, c = 1 === p(a % 100 / 10) ? "th" : 1 === b ? "st" : 2 === b ? "nd" : 3 === b ? "rd" : "th"; return a + c } }), a.lang = $("moment.lang is deprecated. Use moment.locale instead.", v), a.langData = $("moment.langData is deprecated. Use moment.localeData instead.", x); var Rd = Math.abs, Sd = uc("ms"), Td = uc("s"), Ud = uc("m"), Vd = uc("h"), Wd = uc("d"), Xd = uc("w"), Yd = uc("M"), Zd = uc("y"), $d = wc("milliseconds"), _d = wc("seconds"), ae = wc("minutes"), be = wc("hours"), ce = wc("days"), de = wc("months"), ee = wc("years"), fe = Math.round, ge = { s: 45, m: 45, h: 22, d: 26, M: 11 }, he = Math.abs, ie = Ea.prototype; ie.abs = lc, ie.add = nc, ie.subtract = oc, ie.as = sc, ie.asMilliseconds = Sd, ie.asSeconds = Td, ie.asMinutes = Ud, ie.asHours = Vd, ie.asDays = Wd, ie.asWeeks = Xd, ie.asMonths = Yd, ie.asYears = Zd, ie.valueOf = tc, ie._bubble = pc, ie.get = vc, ie.milliseconds = $d, ie.seconds = _d, ie.minutes = ae, ie.hours = be, ie.days = ce, ie.weeks = xc, ie.months = de, ie.years = ee, ie.humanize = Bc, ie.toISOString = Cc, ie.toString = Cc, ie.toJSON = Cc, ie.locale = pb, ie.localeData = qb, ie.toIsoString = $("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", Cc), ie.lang = yd, G("X", 0, 0, "unix"), G("x", 0, 0, "valueOf"), L("x", Xc), L("X", Zc), O("X", function (a, b, c) { c._d = new Date(1e3 * parseFloat(a, 10)) }), O("x", function (a, b, c) { c._d = new Date(p(a)) }), a.version = "2.10.3", b(Aa), a.fn = Jd, a.min = Ca, a.max = Da, a.utc = h, a.unix = Wb, a.months = gc, a.isDate = d, a.locale = v, a.invalid = l, a.duration = Va, a.isMoment = o, a.weekdays = ic, a.parseZone = Xb, a.localeData = x, a.isDuration = Fa, a.monthsShort = hc, a.weekdaysMin = kc, a.defineLocale = w, a.weekdaysShort = jc, a.normalizeUnits = z, a.relativeTimeThreshold = Ac; var je = a; return je
        });

        /*
       The MIT License (MIT)
      
       Copyright (c) 2015 Jonathan Peterson
      
       Permission is hereby granted, free of charge, to any person obtaining a copy
       of this software and associated documentation files (the "Software"), to deal
       in the Software without restriction, including without limitation the rights
       to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
       copies of the Software, and to permit persons to whom the Software is
       furnished to do so, subject to the following conditions:
      
       The above copyright notice and this permission notice shall be included in
       all copies or substantial portions of the Software.
      
       THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
       IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
       FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
       AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
       LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
       OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
       THE SOFTWARE.
       */
        !function (e) { "use strict"; if ("function" == typeof define && define.amd) define(["jquery", "moment"], e); else if ("object" == typeof exports) e(require("jquery"), require("moment")); else { if ("undefined" == typeof jQuery) throw "bootstrap-datetimepicker requires jQuery to be loaded first"; if ("undefined" == typeof moment) throw "bootstrap-datetimepicker requires Moment.js to be loaded first"; e(jQuery, moment) } }(function (e, t) { "use strict"; if (!t) throw new Error("bootstrap-datetimepicker requires Moment.js to be loaded first"); var a = function (a, n) { var r, i, o, s, d, p = {}, l = t().startOf("d"), c = l.clone(), u = !0, f = !1, m = !1, h = 0, g = [{ clsName: "days", navFnc: "M", navStep: 1 }, { clsName: "months", navFnc: "y", navStep: 1 }, { clsName: "years", navFnc: "y", navStep: 10 }], y = ["days", "months", "years"], w = ["top", "bottom", "auto"], b = ["left", "right", "auto"], v = ["default", "top", "bottom"], k = { up: 38, 38: "up", down: 40, 40: "down", left: 37, 37: "left", right: 39, 39: "right", tab: 9, 9: "tab", escape: 27, 27: "escape", enter: 13, 13: "enter", pageUp: 33, 33: "pageUp", pageDown: 34, 34: "pageDown", shift: 16, 16: "shift", control: 17, 17: "control", space: 32, 32: "space", t: 84, 84: "t", "delete": 46, 46: "delete" }, C = {}, x = function (e) { if ("string" != typeof e || e.length > 1) throw new TypeError("isEnabled expects a single character string parameter"); switch (e) { case "y": return -1 !== o.indexOf("Y"); case "M": return -1 !== o.indexOf("M"); case "d": return -1 !== o.toLowerCase().indexOf("d"); case "h": case "H": return -1 !== o.toLowerCase().indexOf("h"); case "m": return -1 !== o.indexOf("m"); case "s": return -1 !== o.indexOf("s"); default: return !1 } }, D = function () { return x("h") || x("m") || x("s") }, T = function () { return x("y") || x("M") || x("d") }, M = function () { var t = e("<thead>").append(e("<tr>").append(e("<th>").addClass("prev").attr("data-action", "previous").append(e("<span>").addClass(n.icons.previous))).append(e("<th>").addClass("picker-switch").attr("data-action", "pickerSwitch").attr("colspan", n.calendarWeeks ? "6" : "5")).append(e("<th>").addClass("next").attr("data-action", "next").append(e("<span>").addClass(n.icons.next)))), a = e("<tbody>").append(e("<tr>").append(e("<td>").attr("colspan", n.calendarWeeks ? "8" : "7"))); return [e("<div>").addClass("datepicker-days").append(e("<table>").addClass("table-condensed").append(t).append(e("<tbody>"))), e("<div>").addClass("datepicker-months").append(e("<table>").addClass("table-condensed").append(t.clone()).append(a.clone())), e("<div>").addClass("datepicker-years").append(e("<table>").addClass("table-condensed").append(t.clone()).append(a.clone()))] }, O = function () { var t = e("<tr>"), a = e("<tr>"), r = e("<tr>"); return x("h") && (t.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "incrementHours").append(e("<span>").addClass(n.icons.up)))), a.append(e("<td>").append(e("<span>").addClass("timepicker-hour").attr("data-time-component", "hours").attr("data-action", "showHours"))), r.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "decrementHours").append(e("<span>").addClass(n.icons.down))))), x("m") && (x("h") && (t.append(e("<td>").addClass("separator")), a.append(e("<td>").addClass("separator").html(":")), r.append(e("<td>").addClass("separator"))), t.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "incrementMinutes").append(e("<span>").addClass(n.icons.up)))), a.append(e("<td>").append(e("<span>").addClass("timepicker-minute").attr("data-time-component", "minutes").attr("data-action", "showMinutes"))), r.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "decrementMinutes").append(e("<span>").addClass(n.icons.down))))), x("s") && (x("m") && (t.append(e("<td>").addClass("separator")), a.append(e("<td>").addClass("separator").html(":")), r.append(e("<td>").addClass("separator"))), t.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "incrementSeconds").append(e("<span>").addClass(n.icons.up)))), a.append(e("<td>").append(e("<span>").addClass("timepicker-second").attr("data-time-component", "seconds").attr("data-action", "showSeconds"))), r.append(e("<td>").append(e("<a>").attr({ href: "#", tabindex: "-1" }).addClass("btn").attr("data-action", "decrementSeconds").append(e("<span>").addClass(n.icons.down))))), i || (t.append(e("<td>").addClass("separator")), a.append(e("<td>").append(e("<button>").addClass("btn btn-primary").attr("data-action", "togglePeriod"))), r.append(e("<td>").addClass("separator"))), e("<div>").addClass("timepicker-picker").append(e("<table>").addClass("table-condensed").append([t, a, r])) }, E = function () { var t = e("<div>").addClass("timepicker-hours").append(e("<table>").addClass("table-condensed")), a = e("<div>").addClass("timepicker-minutes").append(e("<table>").addClass("table-condensed")), n = e("<div>").addClass("timepicker-seconds").append(e("<table>").addClass("table-condensed")), r = [O()]; return x("h") && r.push(t), x("m") && r.push(a), x("s") && r.push(n), r }, P = function () { var t = []; return n.showTodayButton && t.push(e("<td>").append(e("<a>").attr("data-action", "today").append(e("<span>").addClass(n.icons.today)))), !n.sideBySide && T() && D() && t.push(e("<td>").append(e("<a>").attr("data-action", "togglePicker").append(e("<span>").addClass(n.icons.time)))), n.showClear && t.push(e("<td>").append(e("<a>").attr("data-action", "clear").append(e("<span>").addClass(n.icons.clear)))), n.showClose && t.push(e("<td>").append(e("<a>").attr("data-action", "close").append(e("<span>").addClass(n.icons.close)))), e("<table>").addClass("table-condensed").append(e("<tbody>").append(e("<tr>").append(t))) }, S = function () { var t = e("<div>").addClass("bootstrap-datetimepicker-widget dropdown-menu"), a = e("<div>").addClass("datepicker").append(M()), r = e("<div>").addClass("timepicker").append(E()), o = e("<ul>").addClass("list-unstyled"), s = e("<li>").addClass("picker-switch" + (n.collapse ? " accordion-toggle" : "")).append(P()); return n.inline && t.removeClass("dropdown-menu"), i && t.addClass("usetwentyfour"), n.sideBySide && T() && D() ? (t.addClass("timepicker-sbs"), t.append(e("<div>").addClass("row").append(a.addClass("col-sm-6")).append(r.addClass("col-sm-6"))), t.append(s), t) : ("top" === n.toolbarPlacement && o.append(s), T() && o.append(e("<li>").addClass(n.collapse && D() ? "collapse in" : "").append(a)), "default" === n.toolbarPlacement && o.append(s), D() && o.append(e("<li>").addClass(n.collapse && T() ? "collapse" : "").append(r)), "bottom" === n.toolbarPlacement && o.append(s), t.append(o)) }, B = function () { var t, r = {}; return t = a.is("input") || n.inline ? a.data() : a.find("input").data(), t.dateOptions && t.dateOptions instanceof Object && (r = e.extend(!0, r, t.dateOptions)), e.each(n, function (e) { var a = "date" + e.charAt(0).toUpperCase() + e.slice(1); void 0 !== t[a] && (r[e] = t[a]) }), r }, j = function () { var t, r = (f || a).position(), i = (f || a).offset(), o = n.widgetPositioning.vertical, s = n.widgetPositioning.horizontal; if (n.widgetParent) t = n.widgetParent.append(m); else if (a.is("input")) t = a.parent().append(m); else { if (n.inline) return void (t = a.append(m)); t = a, a.children().first().after(m) } if ("auto" === o && (o = i.top + 1.5 * m.height() >= e(window).height() + e(window).scrollTop() && m.height() + a.outerHeight() < i.top ? "top" : "bottom"), "auto" === s && (s = t.width() < i.left + m.outerWidth() / 2 && i.left + m.outerWidth() > e(window).width() ? "right" : "left"), "top" === o ? m.addClass("top").removeClass("bottom") : m.addClass("bottom").removeClass("top"), "right" === s ? m.addClass("pull-right") : m.removeClass("pull-right"), "relative" !== t.css("position") && (t = t.parents().filter(function () { return "relative" === e(this).css("position") }).first()), 0 === t.length) throw new Error("datetimepicker component should be placed within a relative positioned container"); var d = e(a).parents().filter(function () { return "fixed" === e(this).css("position") }).length > 0; if ("fixed" === m.css("position") && d) { var i = a.offset(), p = i.left, l = jQuery(window).height() - (jQuery(a).offset().top - jQuery(window).scrollTop()); m.css({ bottom: l, left: p }) } else m.css({ top: "top" === o ? "auto" : r.top + a.outerHeight(), bottom: "top" === o ? r.top + a.outerHeight() : "auto", left: "left" === s ? t.css("padding-left") : "auto", right: "left" === s ? "auto" : t.width() - a.outerWidth() }) }, H = function (e) { "dp.change" === e.type && (e.date && e.date.isSame(e.oldDate) || !e.date && !e.oldDate) || a.trigger(e) }, I = function (e) { m && (e && (d = Math.max(h, Math.min(2, d + e))), m.find(".datepicker > div").hide().filter(".datepicker-" + g[d].clsName).show()) }, F = function () { var t = e("<tr>"), a = c.clone().startOf("w"); for (n.calendarWeeks === !0 && t.append(e("<th>").addClass("cw").text("#")) ; a.isBefore(c.clone().endOf("w")) ;) t.append(e("<th>").addClass("dow").text(a.format("dd"))), a.add(1, "d"); m.find(".datepicker-days thead").append(t) }, L = function (e) { return n.disabledDates[e.format("YYYY-MM-DD")] === !0 }, Y = function (e) { return n.enabledDates[e.format("YYYY-MM-DD")] === !0 }, W = function (e, t) { return e.isValid() ? n.disabledDates && L(e) && "M" !== t ? !1 : n.enabledDates && !Y(e) && "M" !== t ? !1 : n.minDate && e.isBefore(n.minDate, t) ? !1 : n.maxDate && e.isAfter(n.maxDate, t) ? !1 : "d" === t && -1 !== n.daysOfWeekDisabled.indexOf(e.day()) ? !1 : !0 : !1 }, q = function () { for (var t = [], a = c.clone().startOf("y").hour(12) ; a.isSame(c, "y") ;) t.push(e("<span>").attr("data-action", "selectMonth").addClass("month").text(a.format("MMM"))), a.add(1, "M"); m.find(".datepicker-months td").empty().append(t) }, z = function () { var t = m.find(".datepicker-months"), a = t.find("th"), n = t.find("tbody").find("span"); t.find(".disabled").removeClass("disabled"), W(c.clone().subtract(1, "y"), "y") || a.eq(0).addClass("disabled"), a.eq(1).text(c.year()), W(c.clone().add(1, "y"), "y") || a.eq(2).addClass("disabled"), n.removeClass("active"), l.isSame(c, "y") && n.eq(l.month()).addClass("active"), n.each(function (t) { W(c.clone().month(t), "M") || e(this).addClass("disabled") }) }, A = function () { var e = m.find(".datepicker-years"), t = e.find("th"), a = c.clone().subtract(5, "y"), r = c.clone().add(6, "y"), i = ""; for (e.find(".disabled").removeClass("disabled"), n.minDate && n.minDate.isAfter(a, "y") && t.eq(0).addClass("disabled"), t.eq(1).text(a.year() + "-" + r.year()), n.maxDate && n.maxDate.isBefore(r, "y") && t.eq(2).addClass("disabled") ; !a.isAfter(r, "y") ;) i += '<span data-action="selectYear" class="year' + (a.isSame(l, "y") ? " active" : "") + (W(a, "y") ? "" : " disabled") + '">' + a.year() + "</span>", a.add(1, "y"); e.find("td").html(i) }, V = function () { var a, r, i, o = m.find(".datepicker-days"), s = o.find("th"), d = []; if (T()) { for (o.find(".disabled").removeClass("disabled"), s.eq(1).text(c.format(n.dayViewHeaderFormat)), W(c.clone().subtract(1, "M"), "M") || s.eq(0).addClass("disabled"), W(c.clone().add(1, "M"), "M") || s.eq(2).addClass("disabled"), a = c.clone().startOf("M").startOf("week") ; !c.clone().endOf("M").endOf("w").isBefore(a, "d") ;) 0 === a.weekday() && (r = e("<tr>"), n.calendarWeeks && r.append('<td class="cw">' + a.week() + "</td>"), d.push(r)), i = "", a.isBefore(c, "M") && (i += " old"), a.isAfter(c, "M") && (i += " new"), a.isSame(l, "d") && !u && (i += " active"), W(a, "d") || (i += " disabled"), a.isSame(t(), "d") && (i += " today"), (0 === a.day() || 6 === a.day()) && (i += " weekend"), r.append('<td data-action="selectDay" class="day' + i + '">' + a.date() + "</td>"), a.add(1, "d"); o.find("tbody").empty().append(d), z(), A() } }, N = function () { var t = m.find(".timepicker-hours table"), a = c.clone().startOf("d"), n = [], r = e("<tr>"); for (c.hour() > 11 && !i && a.hour(12) ; a.isSame(c, "d") && (i || c.hour() < 12 && a.hour() < 12 || c.hour() > 11) ;) a.hour() % 4 === 0 && (r = e("<tr>"), n.push(r)), r.append('<td data-action="selectHour" class="hour' + (W(a, "h") ? "" : " disabled") + '">' + a.format(i ? "HH" : "hh") + "</td>"), a.add(1, "h"); t.empty().append(n) }, Q = function () { for (var t = m.find(".timepicker-minutes table"), a = c.clone().startOf("h"), r = [], i = e("<tr>"), o = 1 === n.stepping ? 5 : n.stepping; c.isSame(a, "h") ;) a.minute() % (4 * o) === 0 && (i = e("<tr>"), r.push(i)), i.append('<td data-action="selectMinute" class="minute' + (W(a, "m") ? "" : " disabled") + '">' + a.format("mm") + "</td>"), a.add(o, "m"); t.empty().append(r) }, R = function () { for (var t = m.find(".timepicker-seconds table"), a = c.clone().startOf("m"), n = [], r = e("<tr>") ; c.isSame(a, "m") ;) a.second() % 20 === 0 && (r = e("<tr>"), n.push(r)), r.append('<td data-action="selectSecond" class="second' + (W(a, "s") ? "" : " disabled") + '">' + a.format("ss") + "</td>"), a.add(5, "s"); t.empty().append(n) }, U = function () { var e = m.find(".timepicker span[data-time-component]"); i || m.find(".timepicker [data-action=togglePeriod]").text(l.format("A")), e.filter("[data-time-component=hours]").text(l.format(i ? "HH" : "hh")), e.filter("[data-time-component=minutes]").text(l.format("mm")), e.filter("[data-time-component=seconds]").text(l.format("ss")), N(), Q(), R() }, G = function () { m && (V(), U()) }, J = function (e) { var t = u ? null : l; return e ? (e = e.clone().locale(n.locale), 1 !== n.stepping && e.minutes(Math.round(e.minutes() / n.stepping) * n.stepping % 60).seconds(0), void (W(e) ? (l = e, c = l.clone(), r.val(l.format(o)), a.data("date", l.format(o)), G(), u = !1, H({ type: "dp.change", date: l.clone(), oldDate: t })) : (n.keepInvalid || r.val(u ? "" : l.format(o)), H({ type: "dp.error", date: e })))) : (u = !0, r.val(""), a.data("date", ""), H({ type: "dp.change", date: null, oldDate: t }), void G()) }, K = function () { var t = !1; return m ? (m.find(".collapse").each(function () { var a = e(this).data("collapse"); return a && a.transitioning ? (t = !0, !1) : !0 }), t ? p : (f && f.hasClass("btn") && f.toggleClass("active"), m.hide(), e(window).off("resize", j), m.off("click", "[data-action]"), m.off("mousedown", !1), m.remove(), m = !1, H({ type: "dp.hide", date: l.clone() }), p)) : p }, X = function () { J(null) }, Z = { next: function () { c.add(g[d].navStep, g[d].navFnc), V() }, previous: function () { c.subtract(g[d].navStep, g[d].navFnc), V() }, pickerSwitch: function () { I(1) }, selectMonth: function (t) { var a = e(t.target).closest("tbody").find("span").index(e(t.target)); c.month(a), d === h ? (J(l.clone().year(c.year()).month(c.month())), n.inline || K()) : (I(-1), V()) }, selectYear: function (t) { var a = parseInt(e(t.target).text(), 10) || 0; c.year(a), d === h ? (J(l.clone().year(c.year())), n.inline || K()) : (I(-1), V()) }, selectDay: function (t) { var a = c.clone(); e(t.target).is(".old") && a.subtract(1, "M"), e(t.target).is(".new") && a.add(1, "M"), J(a.date(parseInt(e(t.target).text(), 10))), D() || n.keepOpen || n.inline || K() }, incrementHours: function () { J(l.clone().add(1, "h")) }, incrementMinutes: function () { J(l.clone().add(n.stepping, "m")) }, incrementSeconds: function () { J(l.clone().add(1, "s")) }, decrementHours: function () { J(l.clone().subtract(1, "h")) }, decrementMinutes: function () { J(l.clone().subtract(n.stepping, "m")) }, decrementSeconds: function () { J(l.clone().subtract(1, "s")) }, togglePeriod: function () { J(l.clone().add(l.hours() >= 12 ? -12 : 12, "h")) }, togglePicker: function (t) { var a, r = e(t.target), i = r.closest("ul"), o = i.find(".in"), s = i.find(".collapse:not(.in)"); if (o && o.length) { if (a = o.data("collapse"), a && a.transitioning) return; o.collapse ? (o.collapse("hide"), s.collapse("show")) : (o.removeClass("in"), s.addClass("in")), r.is("span") ? r.toggleClass(n.icons.time + " " + n.icons.date) : r.find("span").toggleClass(n.icons.time + " " + n.icons.date) } }, showPicker: function () { m.find(".timepicker > div:not(.timepicker-picker)").hide(), m.find(".timepicker .timepicker-picker").show() }, showHours: function () { m.find(".timepicker .timepicker-picker").hide(), m.find(".timepicker .timepicker-hours").show() }, showMinutes: function () { m.find(".timepicker .timepicker-picker").hide(), m.find(".timepicker .timepicker-minutes").show() }, showSeconds: function () { m.find(".timepicker .timepicker-picker").hide(), m.find(".timepicker .timepicker-seconds").show() }, selectHour: function (t) { var a = parseInt(e(t.target).text(), 10); i || (l.hours() >= 12 ? 12 !== a && (a += 12) : 12 === a && (a = 0)), J(l.clone().hours(a)), Z.showPicker.call(p) }, selectMinute: function (t) { J(l.clone().minutes(parseInt(e(t.target).text(), 10))), Z.showPicker.call(p) }, selectSecond: function (t) { J(l.clone().seconds(parseInt(e(t.target).text(), 10))), Z.showPicker.call(p) }, clear: X, today: function () { J(t()) }, close: K }, $ = function (t) { return e(t.currentTarget).is(".disabled") ? !1 : (Z[e(t.currentTarget).data("action")].apply(p, arguments), !1) }, _ = function () { var a, i = { year: function (e) { return e.month(0).date(1).hours(0).seconds(0).minutes(0) }, month: function (e) { return e.date(1).hours(0).seconds(0).minutes(0) }, day: function (e) { return e.hours(0).seconds(0).minutes(0) }, hour: function (e) { return e.seconds(0).minutes(0) }, minute: function (e) { return e.seconds(0) } }; return r.prop("disabled") || !n.ignoreReadonly && r.prop("readonly") || m ? p : (n.useCurrent && u && (r.is("input") && 0 === r.val().trim().length || n.inline) && (a = t(), "string" == typeof n.useCurrent && (a = i[n.useCurrent](a)), J(a)), m = S(), F(), q(), m.find(".timepicker-hours").hide(), m.find(".timepicker-minutes").hide(), m.find(".timepicker-seconds").hide(), G(), I(), e(window).on("resize", j), m.on("click", "[data-action]", $), m.on("mousedown", !1), f && f.hasClass("btn") && f.toggleClass("active"), m.show(), j(), r.is(":focus") || r.focus(), H({ type: "dp.show" }), p) }, et = function () { return m ? K() : _() }, tt = function (e) { return e = t.isMoment(e) || e instanceof Date ? t(e) : t(e, s, n.useStrict), e.locale(n.locale), e }, at = function (e) { var t, a, r, i, o = null, s = [], d = {}, l = e.which, c = "p"; C[l] = c; for (t in C) C.hasOwnProperty(t) && C[t] === c && (s.push(t), parseInt(t, 10) !== l && (d[t] = !0)); for (t in n.keyBinds) if (n.keyBinds.hasOwnProperty(t) && "function" == typeof n.keyBinds[t] && (r = t.split(" "), r.length === s.length && k[l] === r[r.length - 1])) { for (i = !0, a = r.length - 2; a >= 0; a--) if (!(k[r[a]] in d)) { i = !1; break } if (i) { o = n.keyBinds[t]; break } } o && (o.call(p, m), e.stopPropagation(), e.preventDefault()) }, nt = function (e) { C[e.which] = "r", e.stopPropagation(), e.preventDefault() }, rt = function (t) { var a = e(t.target).val().trim(), n = a ? tt(a) : null; return J(n), t.stopImmediatePropagation(), !1 }, it = function () { r.on({ change: rt, blur: n.debug ? "" : K, keydown: at, keyup: nt }), a.is("input") ? r.on({ focus: _ }) : f && (f.on("click", et), f.on("mousedown", !1)) }, ot = function () { r.off({ change: rt, blur: K, keydown: at, keyup: nt }), a.is("input") ? r.off({ focus: _ }) : f && (f.off("click", et), f.off("mousedown", !1)) }, st = function (t) { var a = {}; return e.each(t, function () { var e = tt(this); e.isValid() && (a[e.format("YYYY-MM-DD")] = !0) }), Object.keys(a).length ? a : !1 }, dt = function () { var e = n.format || "L LT"; o = e.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (e) { var t = l.localeData().longDateFormat(e) || e; return t.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, function (e) { return l.localeData().longDateFormat(e) || e }) }), s = n.extraFormats ? n.extraFormats.slice() : [], s.indexOf(e) < 0 && s.indexOf(o) < 0 && s.push(o), i = o.toLowerCase().indexOf("a") < 1 && o.indexOf("h") < 1, x("y") && (h = 2), x("M") && (h = 1), x("d") && (h = 0), d = Math.max(h, d), u || J(l) }; if (p.destroy = function () { K(), ot(), a.removeData("DateTimePicker"), a.removeData("date") }, p.toggle = et, p.show = _, p.hide = K, p.disable = function () { return K(), f && f.hasClass("btn") && f.addClass("disabled"), r.prop("disabled", !0), p }, p.enable = function () { return f && f.hasClass("btn") && f.removeClass("disabled"), r.prop("disabled", !1), p }, p.ignoreReadonly = function (e) { if (0 === arguments.length) return n.ignoreReadonly; if ("boolean" != typeof e) throw new TypeError("ignoreReadonly () expects a boolean parameter"); return n.ignoreReadonly = e, p }, p.options = function (t) { if (0 === arguments.length) return e.extend(!0, {}, n); if (!(t instanceof Object)) throw new TypeError("options() options parameter should be an object"); return e.extend(!0, n, t), e.each(n, function (e, t) { if (void 0 === p[e]) throw new TypeError("option " + e + " is not recognized!"); p[e](t) }), p }, p.date = function (e) { if (0 === arguments.length) return u ? null : l.clone(); if (!(null === e || "string" == typeof e || t.isMoment(e) || e instanceof Date)) throw new TypeError("date() parameter must be one of [null, string, moment or Date]"); return J(null === e ? null : tt(e)), p }, p.format = function (e) { if (0 === arguments.length) return n.format; if ("string" != typeof e && ("boolean" != typeof e || e !== !1)) throw new TypeError("format() expects a sting or boolean:false parameter " + e); return n.format = e, o && dt(), p }, p.dayViewHeaderFormat = function (e) { if (0 === arguments.length) return n.dayViewHeaderFormat; if ("string" != typeof e) throw new TypeError("dayViewHeaderFormat() expects a string parameter"); return n.dayViewHeaderFormat = e, p }, p.extraFormats = function (e) { if (0 === arguments.length) return n.extraFormats; if (e !== !1 && !(e instanceof Array)) throw new TypeError("extraFormats() expects an array or false parameter"); return n.extraFormats = e, s && dt(), p }, p.disabledDates = function (t) { if (0 === arguments.length) return n.disabledDates ? e.extend({}, n.disabledDates) : n.disabledDates; if (!t) return n.disabledDates = !1, G(), p; if (!(t instanceof Array)) throw new TypeError("disabledDates() expects an array parameter"); return n.disabledDates = st(t), n.enabledDates = !1, G(), p }, p.enabledDates = function (t) { if (0 === arguments.length) return n.enabledDates ? e.extend({}, n.enabledDates) : n.enabledDates; if (!t) return n.enabledDates = !1, G(), p; if (!(t instanceof Array)) throw new TypeError("enabledDates() expects an array parameter"); return n.enabledDates = st(t), n.disabledDates = !1, G(), p }, p.daysOfWeekDisabled = function (e) { if (0 === arguments.length) return n.daysOfWeekDisabled.splice(0); if (!(e instanceof Array)) throw new TypeError("daysOfWeekDisabled() expects an array parameter"); return n.daysOfWeekDisabled = e.reduce(function (e, t) { return t = parseInt(t, 10), t > 6 || 0 > t || isNaN(t) ? e : (-1 === e.indexOf(t) && e.push(t), e) }, []).sort(), G(), p }, p.maxDate = function (e) { if (0 === arguments.length) return n.maxDate ? n.maxDate.clone() : n.maxDate; if ("boolean" == typeof e && e === !1) return n.maxDate = !1, G(), p; "string" == typeof e && ("now" === e || "moment" === e) && (e = t()); var a = tt(e); if (!a.isValid()) throw new TypeError("maxDate() Could not parse date parameter: " + e); if (n.minDate && a.isBefore(n.minDate)) throw new TypeError("maxDate() date parameter is before options.minDate: " + a.format(o)); return n.maxDate = a, n.maxDate.isBefore(e) && J(n.maxDate), c.isAfter(a) && (c = a.clone()), G(), p }, p.minDate = function (e) { if (0 === arguments.length) return n.minDate ? n.minDate.clone() : n.minDate; if ("boolean" == typeof e && e === !1) return n.minDate = !1, G(), p; "string" == typeof e && ("now" === e || "moment" === e) && (e = t()); var a = tt(e); if (!a.isValid()) throw new TypeError("minDate() Could not parse date parameter: " + e); if (n.maxDate && a.isAfter(n.maxDate)) throw new TypeError("minDate() date parameter is after options.maxDate: " + a.format(o)); return n.minDate = a, n.minDate.isAfter(e) && J(n.minDate), c.isBefore(a) && (c = a.clone()), G(), p }, p.defaultDate = function (e) { if (0 === arguments.length) return n.defaultDate ? n.defaultDate.clone() : n.defaultDate; if (!e) return n.defaultDate = !1, p; "string" == typeof e && ("now" === e || "moment" === e) && (e = t()); var a = tt(e); if (!a.isValid()) throw new TypeError("defaultDate() Could not parse date parameter: " + e); if (!W(a)) throw new TypeError("defaultDate() date passed is invalid according to component setup validations"); return n.defaultDate = a, n.defaultDate && "" === r.val().trim() && void 0 === r.attr("placeholder") && J(n.defaultDate), p }, p.locale = function (e) { if (0 === arguments.length) return n.locale; if (!t.localeData(e)) throw new TypeError("locale() locale " + e + " is not loaded from moment locales!"); return n.locale = e, l.locale(n.locale), c.locale(n.locale), o && dt(), m && (K(), _()), p }, p.stepping = function (e) { return 0 === arguments.length ? n.stepping : (e = parseInt(e, 10), (isNaN(e) || 1 > e) && (e = 1), n.stepping = e, p) }, p.useCurrent = function (e) { var t = ["year", "month", "day", "hour", "minute"]; if (0 === arguments.length) return n.useCurrent; if ("boolean" != typeof e && "string" != typeof e) throw new TypeError("useCurrent() expects a boolean or string parameter"); if ("string" == typeof e && -1 === t.indexOf(e.toLowerCase())) throw new TypeError("useCurrent() expects a string parameter of " + t.join(", ")); return n.useCurrent = e, p }, p.collapse = function (e) { if (0 === arguments.length) return n.collapse; if ("boolean" != typeof e) throw new TypeError("collapse() expects a boolean parameter"); return n.collapse === e ? p : (n.collapse = e, m && (K(), _()), p) }, p.icons = function (t) { if (0 === arguments.length) return e.extend({}, n.icons); if (!(t instanceof Object)) throw new TypeError("icons() expects parameter to be an Object"); return e.extend(n.icons, t), m && (K(), _()), p }, p.useStrict = function (e) { if (0 === arguments.length) return n.useStrict; if ("boolean" != typeof e) throw new TypeError("useStrict() expects a boolean parameter"); return n.useStrict = e, p }, p.sideBySide = function (e) { if (0 === arguments.length) return n.sideBySide; if ("boolean" != typeof e) throw new TypeError("sideBySide() expects a boolean parameter"); return n.sideBySide = e, m && (K(), _()), p }, p.viewMode = function (e) { if (0 === arguments.length) return n.viewMode; if ("string" != typeof e) throw new TypeError("viewMode() expects a string parameter"); if (-1 === y.indexOf(e)) throw new TypeError("viewMode() parameter must be one of (" + y.join(", ") + ") value"); return n.viewMode = e, d = Math.max(y.indexOf(e), h), I(), p }, p.toolbarPlacement = function (e) { if (0 === arguments.length) return n.toolbarPlacement; if ("string" != typeof e) throw new TypeError("toolbarPlacement() expects a string parameter"); if (-1 === v.indexOf(e)) throw new TypeError("toolbarPlacement() parameter must be one of (" + v.join(", ") + ") value"); return n.toolbarPlacement = e, m && (K(), _()), p }, p.widgetPositioning = function (t) { if (0 === arguments.length) return e.extend({}, n.widgetPositioning); if ("[object Object]" !== {}.toString.call(t)) throw new TypeError("widgetPositioning() expects an object variable"); if (t.horizontal) { if ("string" != typeof t.horizontal) throw new TypeError("widgetPositioning() horizontal variable must be a string"); if (t.horizontal = t.horizontal.toLowerCase(), -1 === b.indexOf(t.horizontal)) throw new TypeError("widgetPositioning() expects horizontal parameter to be one of (" + b.join(", ") + ")"); n.widgetPositioning.horizontal = t.horizontal } if (t.vertical) { if ("string" != typeof t.vertical) throw new TypeError("widgetPositioning() vertical variable must be a string"); if (t.vertical = t.vertical.toLowerCase(), -1 === w.indexOf(t.vertical)) throw new TypeError("widgetPositioning() expects vertical parameter to be one of (" + w.join(", ") + ")"); n.widgetPositioning.vertical = t.vertical } return G(), p }, p.calendarWeeks = function (e) { if (0 === arguments.length) return n.calendarWeeks; if ("boolean" != typeof e) throw new TypeError("calendarWeeks() expects parameter to be a boolean value"); return n.calendarWeeks = e, G(), p }, p.showTodayButton = function (e) { if (0 === arguments.length) return n.showTodayButton; if ("boolean" != typeof e) throw new TypeError("showTodayButton() expects a boolean parameter"); return n.showTodayButton = e, m && (K(), _()), p }, p.showClear = function (e) { if (0 === arguments.length) return n.showClear; if ("boolean" != typeof e) throw new TypeError("showClear() expects a boolean parameter"); return n.showClear = e, m && (K(), _()), p }, p.widgetParent = function (t) { if (0 === arguments.length) return n.widgetParent; if ("string" == typeof t && (t = e(t)), null !== t && "string" != typeof t && !(t instanceof e)) throw new TypeError("widgetParent() expects a string or a jQuery object parameter"); return n.widgetParent = t, m && (K(), _()), p }, p.keepOpen = function (e) { if (0 === arguments.length) return n.keepOpen; if ("boolean" != typeof e) throw new TypeError("keepOpen() expects a boolean parameter"); return n.keepOpen = e, p }, p.inline = function (e) { if (0 === arguments.length) return n.inline; if ("boolean" != typeof e) throw new TypeError("inline() expects a boolean parameter"); return n.inline = e, p }, p.clear = function () { return X(), p }, p.keyBinds = function (e) { return n.keyBinds = e, p }, p.debug = function (e) { if ("boolean" != typeof e) throw new TypeError("debug() expects a boolean parameter"); return n.debug = e, p }, p.showClose = function (e) { if (0 === arguments.length) return n.showClose; if ("boolean" != typeof e) throw new TypeError("showClose() expects a boolean parameter"); return n.showClose = e, p }, p.keepInvalid = function (e) { if (0 === arguments.length) return n.keepInvalid; if ("boolean" != typeof e) throw new TypeError("keepInvalid() expects a boolean parameter"); return n.keepInvalid = e, p }, p.datepickerInput = function (e) { if (0 === arguments.length) return n.datepickerInput; if ("string" != typeof e) throw new TypeError("datepickerInput() expects a string parameter"); return n.datepickerInput = e, p }, a.is("input")) r = a; else if (r = a.find(n.datepickerInput), 0 === r.size()) r = a.find("input"); else if (!r.is("input")) throw new Error('CSS class "' + n.datepickerInput + '" cannot be applied to non input element'); if (a.hasClass("input-group") && (f = a.find(0 === a.find(".datepickerbutton").size() ? '[class^="input-group-"]' : ".datepickerbutton")), !n.inline && !r.is("input")) throw new Error("Could not initialize DateTimePicker without an input element"); return e.extend(!0, n, B()), p.options(n), dt(), it(), r.prop("disabled") && p.disable(), r.is("input") && 0 !== r.val().trim().length ? J(tt(r.val().trim())) : n.defaultDate && void 0 === r.attr("placeholder") && J(n.defaultDate), n.inline && _(), p }; e.fn.datetimepicker = function (t) { return this.each(function () { var n = e(this); n.data("DateTimePicker") || (t = e.extend(!0, {}, e.fn.datetimepicker.defaults, t), n.data("DateTimePicker", a(n, t))) }) }, e.fn.datetimepicker.defaults = { format: !1, dayViewHeaderFormat: "MMMM YYYY", extraFormats: !1, stepping: 1, minDate: !1, maxDate: !1, useCurrent: !0, collapse: !0, locale: t.locale(), defaultDate: !1, disabledDates: !1, enabledDates: !1, icons: { time: "glyphicon glyphicon-time", date: "glyphicon glyphicon-calendar", up: "glyphicon glyphicon-chevron-up", down: "glyphicon glyphicon-chevron-down", previous: "glyphicon glyphicon-chevron-left", next: "glyphicon glyphicon-chevron-right", today: "glyphicon glyphicon-screenshot", clear: "glyphicon glyphicon-trash", close: "glyphicon glyphicon-remove" }, useStrict: !1, sideBySide: !1, daysOfWeekDisabled: [], calendarWeeks: !1, viewMode: "days", toolbarPlacement: "default", showTodayButton: !1, showClear: !1, showClose: !1, widgetPositioning: { horizontal: "auto", vertical: "auto" }, widgetParent: null, ignoreReadonly: !1, keepOpen: !1, inline: !1, keepInvalid: !1, datepickerInput: ".datepickerinput", keyBinds: { up: function (e) { if (e) { var a = this.date() || t(); this.date(e.find(".datepicker").is(":visible") ? a.clone().subtract(7, "d") : a.clone().add(1, "m")) } }, down: function (e) { if (!e) return void this.show(); var a = this.date() || t(); this.date(e.find(".datepicker").is(":visible") ? a.clone().add(7, "d") : a.clone().subtract(1, "m")) }, "control up": function (e) { if (e) { var a = this.date() || t(); this.date(e.find(".datepicker").is(":visible") ? a.clone().subtract(1, "y") : a.clone().add(1, "h")) } }, "control down": function (e) { if (e) { var a = this.date() || t(); this.date(e.find(".datepicker").is(":visible") ? a.clone().add(1, "y") : a.clone().subtract(1, "h")) } }, left: function (e) { if (e) { var a = this.date() || t(); e.find(".datepicker").is(":visible") && this.date(a.clone().subtract(1, "d")) } }, right: function (e) { if (e) { var a = this.date() || t(); e.find(".datepicker").is(":visible") && this.date(a.clone().add(1, "d")) } }, pageUp: function (e) { if (e) { var a = this.date() || t(); e.find(".datepicker").is(":visible") && this.date(a.clone().subtract(1, "M")) } }, pageDown: function (e) { if (e) { var a = this.date() || t(); e.find(".datepicker").is(":visible") && this.date(a.clone().add(1, "M")) } }, enter: function () { this.hide() }, escape: function () { this.hide() }, "control space": function (e) { e.find(".timepicker").is(":visible") && e.find('.btn[data-action="togglePeriod"]').click() }, t: function () { this.date(t()) }, "delete": function () { this.clear() } }, debug: !1 } });

    }

}(window.PreviewDateTimeLoader = window.PreviewDateTimeLoader || {}, window.HawkSearchLoader = window.HawkSearchLoader || {}));;
