!function(){"use strict";function n(r){if(!r)throw new Error("No options passed to Waypoint constructor");if(!r.element)throw new Error("No element option passed to Waypoint constructor");if(!r.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+i;this.options=n.Adapter.extend({},n.defaults,r);this.element=this.options.element;this.adapter=new n.Adapter(this.element);this.callback=r.handler;this.axis=this.options.horizontal?"horizontal":"vertical";this.enabled=this.options.enabled;this.triggerPoint=null;this.group=n.Group.findOrCreate({name:this.options.group,axis:this.axis});this.context=n.Context.findOrCreateByElement(this.options.context);n.offsetAliases[this.options.offset]&&(this.options.offset=n.offsetAliases[this.options.offset]);this.group.add(this);this.context.add(this);t[this.key]=this;i+=1}var i=0,t={};n.prototype.queueTrigger=function(n){this.group.queueTrigger(this,n)};n.prototype.trigger=function(n){this.enabled&&this.callback&&this.callback.apply(this,n)};n.prototype.destroy=function(){this.context.remove(this);this.group.remove(this);delete t[this.key]};n.prototype.disable=function(){return this.enabled=!1,this};n.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this};n.prototype.next=function(){return this.group.next(this)};n.prototype.previous=function(){return this.group.previous(this)};n.invokeAll=function(n){var r=[],u,i,f;for(u in t)r.push(t[u]);for(i=0,f=r.length;f>i;i++)r[i][n]()};n.destroyAll=function(){n.invokeAll("destroy")};n.disableAll=function(){n.invokeAll("disable")};n.enableAll=function(){n.invokeAll("enable")};n.refreshAll=function(){n.Context.refreshAll()};n.viewportHeight=function(){return window.innerHeight||document.documentElement.clientHeight};n.viewportWidth=function(){return document.documentElement.clientWidth};n.adapters=[];n.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0};n.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=n}(),function(){"use strict";function f(n){window.setTimeout(n,1e3/60)}function n(n){this.element=n;this.Adapter=t.Adapter;this.adapter=new this.Adapter(n);this.key="waypoint-context-"+r;this.didScroll=!1;this.didResize=!1;this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()};this.waypoints={vertical:{},horizontal:{}};n.waypointContextKey=this.key;i[n.waypointContextKey]=this;r+=1;this.createThrottledScrollHandler();this.createThrottledResizeHandler()}var r=0,i={},t=window.Waypoint,u=window.onload;n.prototype.add=function(n){var t=n.options.horizontal?"horizontal":"vertical";this.waypoints[t][n.key]=n;this.refresh()};n.prototype.checkEmpty=function(){var n=this.Adapter.isEmptyObject(this.waypoints.horizontal),t=this.Adapter.isEmptyObject(this.waypoints.vertical);n&&t&&(this.adapter.off(".waypoints"),delete i[this.key])};n.prototype.createThrottledResizeHandler=function(){function i(){n.handleResize();n.didResize=!1}var n=this;this.adapter.on("resize.waypoints",function(){n.didResize||(n.didResize=!0,t.requestAnimationFrame(i))})};n.prototype.createThrottledScrollHandler=function(){function i(){n.handleScroll();n.didScroll=!1}var n=this;this.adapter.on("scroll.waypoints",function(){(!n.didScroll||t.isTouch)&&(n.didScroll=!0,t.requestAnimationFrame(i))})};n.prototype.handleResize=function(){t.Context.refreshAll()};n.prototype.handleScroll=function(){var u={},i={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"}},r,f,s;for(r in i){var n=i[r],h=n.newScroll>n.oldScroll,c=h?n.forward:n.backward;for(f in this.waypoints[r]){var t=this.waypoints[r][f],e=n.oldScroll=t.triggerPoint,l=e&&o,a=!e&&!o;(l||a)&&(t.queueTrigger(c),u[t.group.id]=t.group)}}for(s in u)u[s].flushTriggers();this.oldScroll={x:i.horizontal.newScroll,y:i.vertical.newScroll}};n.prototype.innerHeight=function(){return this.element==this.element.window?t.viewportHeight():this.adapter.innerHeight()};n.prototype.remove=function(n){delete this.waypoints[n.axis][n.key];this.checkEmpty()};n.prototype.innerWidth=function(){return this.element==this.element.window?t.viewportWidth():this.adapter.innerWidth()};n.prototype.destroy=function(){var t=[],i,r,n,u;for(i in this.waypoints)for(r in this.waypoints[i])t.push(this.waypoints[i][r]);for(n=0,u=t.length;u>n;n++)t[n].destroy()};n.prototype.refresh=function(){var o,u=this.element==this.element.window,l=u?void 0:this.adapter.offset(),f={},e,i,a;this.handleScroll();o={horizontal:{contextOffset:u?0:l.left,contextScroll:u?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:u?0:l.top,contextScroll:u?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};for(e in o){i=o[e];for(a in this.waypoints[e]){var v,s,h,y,p,n=this.waypoints[e][a],r=n.options.offset,w=n.triggerPoint,b=0,c=null==w;n.element!==n.element.window&&(b=n.adapter.offset()[i.offsetProp]);"function"==typeof r?r=r.apply(n):"string"==typeof r&&(r=parseFloat(r),n.options.offset.indexOf("%")>-1&&(r=Math.ceil(i.contextDimension*r/100)));v=i.contextScroll-i.contextOffset;n.triggerPoint=b+v-r;s=w=i.oldScroll;y=s&&h;p=!s&&!h;!c&&y?(n.queueTrigger(i.backward),f[n.group.id]=n.group):!c&&p?(n.queueTrigger(i.forward),f[n.group.id]=n.group):c&&i.oldScroll>=n.triggerPoint&&(n.queueTrigger(i.forward),f[n.group.id]=n.group)}}return t.requestAnimationFrame(function(){for(var n in f)f[n].flushTriggers()}),this};n.findOrCreateByElement=function(t){return n.findByElement(t)||new n(t)};n.refreshAll=function(){for(var n in i)i[n].refresh()};n.findByElement=function(n){return i[n.waypointContextKey]};window.onload=function(){u&&u();n.refreshAll()};t.requestAnimationFrame=function(n){var t=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||f;t.call(window,n)};t.Context=n}(),function(){"use strict";function i(n,t){return n.triggerPoint-t.triggerPoint}function u(n,t){return t.triggerPoint-n.triggerPoint}function n(n){this.name=n.name;this.axis=n.axis;this.id=this.name+"-"+this.axis;this.waypoints=[];this.clearTriggerQueues();r[this.axis][this.name]=this}var r={vertical:{},horizontal:{}},t=window.Waypoint;n.prototype.add=function(n){this.waypoints.push(n)};n.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}};n.prototype.flushTriggers=function(){var n,t,e,r,o,f;for(n in this.triggerQueues)for(t=this.triggerQueues[n],e="up"===n||"left"===n,t.sort(e?u:i),r=0,o=t.length;o>r;r+=1)f=t[r],(f.options.continuous||r===t.length-1)&&f.trigger([n]);this.clearTriggerQueues()};n.prototype.next=function(n){this.waypoints.sort(i);var r=t.Adapter.inArray(n,this.waypoints),u=r===this.waypoints.length-1;return u?null:this.waypoints[r+1]};n.prototype.previous=function(n){this.waypoints.sort(i);var r=t.Adapter.inArray(n,this.waypoints);return r?this.waypoints[r-1]:null};n.prototype.queueTrigger=function(n,t){this.triggerQueues[t].push(n)};n.prototype.remove=function(n){var i=t.Adapter.inArray(n,this.waypoints);i>-1&&this.waypoints.splice(i,1)};n.prototype.first=function(){return this.waypoints[0]};n.prototype.last=function(){return this.waypoints[this.waypoints.length-1]};n.findOrCreate=function(t){return r[t.axis][t.name]||new n(t)};t.Group=n}(),function(){"use strict";function n(n){this.$element=t(n)}var t=window.jQuery,i=window.Waypoint;t.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(t,i){n.prototype[i]=function(){var n=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,n)}});t.each(["extend","inArray","isEmptyObject"],function(i,r){n[r]=t[r]});i.adapters.push({name:"jquery",Adapter:n});i.Adapter=n}(),function(){"use strict";function n(n){return function(){var r=[],i=arguments[0];return n.isFunction(arguments[0])&&(i=n.extend({},arguments[1]),i.handler=arguments[0]),this.each(function(){var u=n.extend({},i,{element:this});"string"==typeof u.context&&(u.context=n(this).closest(u.context)[0]);r.push(new t(u))}),r}}var t=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=n(window.jQuery));window.Zepto&&(window.Zepto.fn.waypoint=n(window.Zepto))}()