/*! waypoints - 4.0.1 copyright © 2011-2016 caleb troughton licensed under the mit license. https://github.com/imakewebthings/waypoints/blob/master/licenses.txt */ !function(){"use strict"; function waypoint(options){if (!options)throw new error("no options passed to waypoint constructor"); if (!options.element)throw new error("no element option passed to waypoint constructor"); if (!options.handler)throw new error("no handler option passed to waypoint constructor"); this.key = "waypoint-" + keycounter, this.options = waypoint.adapter.extend({}, waypoint.defaults, options), this.element = this.options.element, this.adapter = new waypoint.adapter(this.element), this.callback = options.handler, this.axis = this.options.horizontal?"horizontal":"vertical", this.enabled = this.options.enabled, this.triggerpoint = null, this.group = waypoint.group.findorcreate({name:this.options.group, axis:this.axis}), this.context = waypoint.context.findorcreatebyelement(this.options.context), waypoint.offsetaliases[this.options.offset] && (this.options.offset = waypoint.offsetaliases[this.options.offset]), this.group.add(this), this.context.add(this), allwaypoints[this.key] = this, keycounter += 1}var keycounter = 0, allwaypoints = {}; waypoint.prototype.queuetrigger = function(direction){this.group.queuetrigger(this, direction)}, waypoint.prototype.trigger = function(args){this.enabled && this.callback && this.callback.apply(this, args)}, waypoint.prototype.destroy = function(){this.context.remove(this), this.group.remove(this), delete allwaypoints[this.key]}, waypoint.prototype.disable = function(){return this.enabled = !1, this}, waypoint.prototype.enable = function(){return this.context.refresh(), this.enabled = !0, this}, waypoint.prototype.next = function(){return this.group.next(this)}, waypoint.prototype.previous = function(){return this.group.previous(this)}, waypoint.invokeall = function(method){var allwaypointsarray = []; for (var waypointkey in allwaypoints)allwaypointsarray.push(allwaypoints[waypointkey]); for (var i = 0, end = allwaypointsarray.length; i < end; i++)allwaypointsarray[i][method]()}, waypoint.destroyall = function(){waypoint.invokeall("destroy")}, waypoint.disableall = function(){waypoint.invokeall("disable")}, waypoint.enableall = function(){waypoint.context.refreshall(); for (var waypointkey in allwaypoints)allwaypoints[waypointkey].enabled = !0; return this}, waypoint.refreshall = function(){waypoint.context.refreshall()}, waypoint.viewportheight = function(){return window.innerheight || document.documentelement.clientheight}, waypoint.viewportwidth = function(){return document.documentelement.clientwidth}, waypoint.adapters = [], waypoint.defaults = {context:window, continuous:!0, enabled:!0, group:"default", horizontal:!1, offset:0}, waypoint.offsetaliases = {"bottom-in-view":function(){return this.context.innerheight() - this.adapter.outerheight()}, "right-in-view":function(){return this.context.innerwidth() - this.adapter.outerwidth()}}, window.waypoint = waypoint}(), function(){"use strict"; function requestanimationframeshim(callback){window.settimeout(callback, 1e3 / 60)}function context(element){this.element = element, this.adapter = waypoint.adapter, this.adapter = new this.adapter(element), this.key = "waypoint-context-" + keycounter, this.didscroll = !1, this.didresize = !1, this.oldscroll = {x:this.adapter.scrollleft(), y:this.adapter.scrolltop()}, this.waypoints = {vertical:{}, horizontal:{}}, element.waypointcontextkey = this.key, contexts[element.waypointcontextkey] = this, keycounter += 1, waypoint.windowcontext || (waypoint.windowcontext = !0, waypoint.windowcontext = new context(window)), this.createthrottledscrollhandler(), this.createthrottledresizehandler()}var keycounter = 0, contexts = {}, waypoint = window.waypoint, oldwindowload = window.onload; context.prototype.add = function(waypoint){var axis = waypoint.options.horizontal?"horizontal":"vertical"; this.waypoints[axis][waypoint.key] = waypoint, this.refresh()}, context.prototype.checkempty = function(){var horizontalempty = this.adapter.isemptyobject(this.waypoints.horizontal), verticalempty = this.adapter.isemptyobject(this.waypoints.vertical), iswindow = this.element == this.element.window; horizontalempty && verticalempty && !iswindow && (this.adapter.off(".waypoints"), delete contexts[this.key])}, context.prototype.createthrottledresizehandler = function(){function resizehandler(){self.handleresize(), self.didresize = !1}var self = this; this.adapter.on("resize.waypoints", function(){self.didresize || (self.didresize = !0, waypoint.requestanimationframe(resizehandler))})}, context.prototype.createthrottledscrollhandler = function(){function scrollhandler(){self.handlescroll(), self.didscroll = !1}var self = this; this.adapter.on("scroll.waypoints", function(){self.didscroll && !waypoint.istouch || (self.didscroll = !0, waypoint.requestanimationframe(scrollhandler))})}, context.prototype.handleresize = function(){waypoint.context.refreshall()}, context.prototype.handlescroll = function(){var triggeredgroups = {}, axes = {horizontal:{newscroll:this.adapter.scrollleft(), oldscroll:this.oldscroll.x, forward:"right", backward:"left"}, vertical:{newscroll:this.adapter.scrolltop(), oldscroll:this.oldscroll.y, forward:"down", backward:"up"}}; for (var axiskey in axes){var axis = axes[axiskey], isforward = axis.newscroll > axis.oldscroll, direction = isforward?axis.forward:axis.backward; for (var waypointkey in this.waypoints[axiskey]){var waypoint = this.waypoints[axiskey][waypointkey]; if (null !== waypoint.triggerpoint){var wasbeforetriggerpoint = axis.oldscroll < waypoint.triggerpoint, nowaftertriggerpoint = axis.newscroll >= waypoint.triggerpoint, crossedforward = wasbeforetriggerpoint && nowaftertriggerpoint, crossedbackward = !wasbeforetriggerpoint && !nowaftertriggerpoint; (crossedforward || crossedbackward) && (waypoint.queuetrigger(direction), triggeredgroups[waypoint.group.id] = waypoint.group)}}}for (var groupkey in triggeredgroups)triggeredgroups[groupkey].flushtriggers(); this.oldscroll = {x:axes.horizontal.newscroll, y:axes.vertical.newscroll}}, context.prototype.innerheight = function(){return this.element == this.element.window?waypoint.viewportheight():this.adapter.innerheight()}, context.prototype.remove = function(waypoint){delete this.waypoints[waypoint.axis][waypoint.key], this.checkempty()}, context.prototype.innerwidth = function(){return this.element == this.element.window?waypoint.viewportwidth():this.adapter.innerwidth()}, context.prototype.destroy = function(){var allwaypoints = []; for (var axis in this.waypoints)for (var waypointkey in this.waypoints[axis])allwaypoints.push(this.waypoints[axis][waypointkey]); for (var i = 0, end = allwaypoints.length; i < end; i++)allwaypoints[i].destroy()}, context.prototype.refresh = function(){var axes, iswindow = this.element == this.element.window, contextoffset = iswindow?void 0:this.adapter.offset(), triggeredgroups = {}; this.handlescroll(), axes = {horizontal:{contextoffset:iswindow?0:contextoffset.left, contextscroll:iswindow?0:this.oldscroll.x, contextdimension:this.innerwidth(), oldscroll:this.oldscroll.x, forward:"right", backward:"left", offsetprop:"left"}, vertical:{contextoffset:iswindow?0:contextoffset.top, contextscroll:iswindow?0:this.oldscroll.y, contextdimension:this.innerheight(), oldscroll:this.oldscroll.y, forward:"down", backward:"up", offsetprop:"top"}}; for (var axiskey in axes){var axis = axes[axiskey]; for (var waypointkey in this.waypoints[axiskey]){var contextmodifier, wasbeforescroll, nowafterscroll, triggeredbackward, triggeredforward, waypoint = this.waypoints[axiskey][waypointkey], adjustment = waypoint.options.offset, oldtriggerpoint = waypoint.triggerpoint, elementoffset = 0, freshwaypoint = null == oldtriggerpoint; waypoint.element !== waypoint.element.window && (elementoffset = waypoint.adapter.offset()[axis.offsetprop]), "function" == typeof adjustment?adjustment = adjustment.apply(waypoint):"string" == typeof adjustment && (adjustment = parsefloat(adjustment), waypoint.options.offset.indexof("%") > - 1 && (adjustment = math.ceil(axis.contextdimension * adjustment / 100))), contextmodifier = axis.contextscroll - axis.contextoffset, waypoint.triggerpoint = math.floor(elementoffset + contextmodifier - adjustment), wasbeforescroll = oldtriggerpoint < axis.oldscroll, nowafterscroll = waypoint.triggerpoint >= axis.oldscroll, triggeredbackward = wasbeforescroll && nowafterscroll, triggeredforward = !wasbeforescroll && !nowafterscroll, !freshwaypoint && triggeredbackward?(waypoint.queuetrigger(axis.backward), triggeredgroups[waypoint.group.id] = waypoint.group):!freshwaypoint && triggeredforward?(waypoint.queuetrigger(axis.forward), triggeredgroups[waypoint.group.id] = waypoint.group):freshwaypoint && axis.oldscroll >= waypoint.triggerpoint && (waypoint.queuetrigger(axis.forward), triggeredgroups[waypoint.group.id] = waypoint.group)}}return waypoint.requestanimationframe(function(){for (var groupkey in triggeredgroups)triggeredgroups[groupkey].flushtriggers()}), this}, context.findorcreatebyelement = function(element){return context.findbyelement(element) || new context(element)}, context.refreshall = function(){for (var contextid in contexts)contexts[contextid].refresh()}, context.findbyelement = function(element){return contexts[element.waypointcontextkey]}, window.onload = function(){oldwindowload && oldwindowload(), context.refreshall()}, waypoint.requestanimationframe = function(callback){var requestfn = window.requestanimationframe || window.mozrequestanimationframe || window.webkitrequestanimationframe || requestanimationframeshim; requestfn.call(window, callback)}, waypoint.context = context}(), function(){"use strict"; function bytriggerpoint(a, b){return a.triggerpoint - b.triggerpoint}function byreversetriggerpoint(a, b){return b.triggerpoint - a.triggerpoint}function group(options){this.name = options.name, this.axis = options.axis, this.id = this.name + "-" + this.axis, this.waypoints = [], this.cleartriggerqueues(), groups[this.axis][this.name] = this}var groups = {vertical:{}, horizontal:{}}, waypoint = window.waypoint; group.prototype.add = function(waypoint){this.waypoints.push(waypoint)}, group.prototype.cleartriggerqueues = function(){this.triggerqueues = {up:[], down:[], left:[], right:[]}}, group.prototype.flushtriggers = function(){for (var direction in this.triggerqueues){var waypoints = this.triggerqueues[direction], reverse = "up" === direction || "left" === direction; waypoints.sort(reverse?byreversetriggerpoint:bytriggerpoint); for (var i = 0, end = waypoints.length; i < end; i += 1){var waypoint = waypoints[i]; (waypoint.options.continuous || i === waypoints.length - 1) && waypoint.trigger([direction])}}this.cleartriggerqueues()}, group.prototype.next = function(waypoint){this.waypoints.sort(bytriggerpoint); var index = waypoint.adapter.inarray(waypoint, this.waypoints), islast = index === this.waypoints.length - 1; return islast?null:this.waypoints[index + 1]}, group.prototype.previous = function(waypoint){this.waypoints.sort(bytriggerpoint); var index = waypoint.adapter.inarray(waypoint, this.waypoints); return index?this.waypoints[index - 1]:null}, group.prototype.queuetrigger = function(waypoint, direction){this.triggerqueues[direction].push(waypoint)}, group.prototype.remove = function(waypoint){var index = waypoint.adapter.inarray(waypoint, this.waypoints); index > - 1 && this.waypoints.splice(index, 1)}, group.prototype.first = function(){return this.waypoints[0]}, group.prototype.last = function(){return this.waypoints[this.waypoints.length - 1]}, group.findorcreate = function(options){return groups[options.axis][options.name] || new group(options)}, waypoint.group = group}(), function(){"use strict"; function jqueryadapter(element){this.$element = $(element)}var $ = window.jquery, waypoint = window.waypoint; $.each(["innerheight", "innerwidth", "off", "offset", "on", "outerheight", "outerwidth", "scrollleft", "scrolltop"], function(i, method){jqueryadapter.prototype[method] = function(){var args = array.prototype.slice.call(arguments); return this.$element[method].apply(this.$element, args)}}), $.each(["extend", "inarray", "isemptyobject"], function(i, method){jqueryadapter[method] = $[method]}), waypoint.adapters.push({name:"jquery", adapter:jqueryadapter}), waypoint.adapter = jqueryadapter}(), function(){"use strict"; function createextension(framework){return function(){var waypoints = [], overrides = arguments[0]; return framework.isfunction(arguments[0]) && (overrides = framework.extend({}, arguments[1]), overrides.handler = arguments[0]), this.each(function(){var options = framework.extend({}, overrides, {element:this}); "string" == typeof options.context && (options.context = framework(this).closest(options.context)[0]), waypoints.push(new waypoint(options))}), waypoints}}var waypoint = window.waypoint; window.jquery && (window.jquery.fn.elementorwaypoint = createextension(window.jquery)), window.zepto && (window.zepto.fn.elementorwaypoint = createextension(window.zepto))}();