!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;in.oldScroll?n.forward:n.backward;for(s in this.waypoints[r])t=this.waypoints[r][s],null!==t.triggerPoint&&(f=n.oldScroll=t.triggerPoint,(f&&e||!f&&!e)&&(t.queueTrigger(o),u[t.group.id]=t.group))}for(h in u)u[h].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;n-1&&(r=Math.ceil(i.contextDimension*r/100)));v=i.contextScroll-i.contextOffset;n.triggerPoint=Math.floor(w+v-r);s=p=i.oldScroll;y=!s&&!h;!c&&s&&h?(n.queueTrigger(i.backward),f[n.group.id]=n.group):!c&&y?(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){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||f).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;r-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 t(t){this.$element=n(t)}var n=window.jQuery,i=window.Waypoint;n.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(n,i){t.prototype[i]=function(){var n=Array.prototype.slice.call(arguments);return this.$element[i].apply(this.$element,n)}});n.each(["extend","inArray","isEmptyObject"],function(i,r){t[r]=n[r]});i.adapters.push({name:"jquery",Adapter:t});i.Adapter=t}(),function(){"use strict";function n(n){return function(){var i=[],r=arguments[0];return n.isFunction(arguments[0])&&((r=n.extend({},arguments[1])).handler=arguments[0]),this.each(function(){var u=n.extend({},r,{element:this});"string"==typeof u.context&&(u.context=n(this).closest(u.context)[0]);i.push(new t(u))}),i}}var t=window.Waypoint;window.jQuery&&(window.jQuery.fn.waypoint=n(window.jQuery));window.Zepto&&(window.Zepto.fn.waypoint=n(window.Zepto))}()