!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;iaxis.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,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-1&&(adjustment=math.ceil(axis.contextdimension*adjustment/100))),contextmodifier=axis.contextscroll-axis.contextoffset,waypoint.triggerpoint=math.floor(elementoffset+contextmodifier-adjustment),wasbeforescroll=oldtriggerpoint=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-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))}();