/*! 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 t(n){if(!n)throw new error("no options passed to waypoint constructor");if(!n.element)throw new error("no element option passed to waypoint constructor");if(!n.handler)throw new error("no handler option passed to waypoint constructor");this.key="waypoint-"+e,this.options=t.adapter.extend({},t.defaults,n),this.element=this.options.element,this.adapter=new t.adapter(this.element),this.callback=n.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerpoint=null,this.group=t.group.findorcreate({name:this.options.group,axis:this.axis}),this.context=t.context.findorcreatebyelement(this.options.context),t.offsetaliases[this.options.offset]&&(this.options.offset=t.offsetaliases[this.options.offset]),this.group.add(this),this.context.add(this),i[this.key]=this,e+=1}var e=0,i={};t.prototype.queuetrigger=function(t){this.group.queuetrigger(this,t)},t.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},t.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete i[this.key]},t.prototype.disable=function(){return this.enabled=!1,this},t.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},t.prototype.next=function(){return this.group.next(this)},t.prototype.previous=function(){return this.group.previous(this)},t.invokeall=function(t){var e=[];for(var n in i)e.push(i[n]);for(var o=0,r=e.length;r>o;o++)e[o][t]()},t.destroyall=function(){t.invokeall("destroy")},t.disableall=function(){t.invokeall("disable")},t.enableall=function(){t.context.refreshall();for(var e in i)i[e].enabled=!0;return this},t.refreshall=function(){t.context.refreshall()},t.viewportheight=function(){return window.innerheight||document.documentelement.clientheight},t.viewportwidth=function(){return document.documentelement.clientwidth},t.adapters=[],t.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},t.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=t}(),function(){"use strict";function t(t){window.settimeout(t,1e3/60)}function e(t){this.element=t,this.adapter=o.adapter,this.adapter=new this.adapter(t),this.key="waypoint-context-"+i,this.didscroll=!1,this.didresize=!1,this.oldscroll={x:this.adapter.scrollleft(),y:this.adapter.scrolltop()},this.waypoints={vertical:{},horizontal:{}},t.waypointcontextkey=this.key,n[t.waypointcontextkey]=this,i+=1,o.windowcontext||(o.windowcontext=!0,o.windowcontext=new e(window)),this.createthrottledscrollhandler(),this.createthrottledresizehandler()}var i=0,n={},o=window.waypoint,r=window.onload;e.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},e.prototype.checkempty=function(){var t=this.adapter.isemptyobject(this.waypoints.horizontal),e=this.adapter.isemptyobject(this.waypoints.vertical),i=this.element==this.element.window;t&&e&&!i&&(this.adapter.off(".waypoints"),delete n[this.key])},e.prototype.createthrottledresizehandler=function(){function t(){e.handleresize(),e.didresize=!1}var e=this;this.adapter.on("resize.waypoints",function(){e.didresize||(e.didresize=!0,o.requestanimationframe(t))})},e.prototype.createthrottledscrollhandler=function(){function t(){e.handlescroll(),e.didscroll=!1}var e=this;this.adapter.on("scroll.waypoints",function(){(!e.didscroll||o.istouch)&&(e.didscroll=!0,o.requestanimationframe(t))})},e.prototype.handleresize=function(){o.context.refreshall()},e.prototype.handlescroll=function(){var t={},e={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 i in e){var n=e[i],o=n.newscroll>n.oldscroll,r=o?n.forward:n.backward;for(var s in this.waypoints[i]){var l=this.waypoints[i][s];if(null!==l.triggerpoint){var a=n.oldscroll=l.triggerpoint,p=a&&h,u=!a&&!h;(p||u)&&(l.queuetrigger(r),t[l.group.id]=l.group)}}}for(var d in t)t[d].flushtriggers();this.oldscroll={x:e.horizontal.newscroll,y:e.vertical.newscroll}},e.prototype.innerheight=function(){return this.element==this.element.window?o.viewportheight():this.adapter.innerheight()},e.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkempty()},e.prototype.innerwidth=function(){return this.element==this.element.window?o.viewportwidth():this.adapter.innerwidth()},e.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var n=0,o=t.length;o>n;n++)t[n].destroy()},e.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),n={};this.handlescroll(),t={horizontal:{contextoffset:e?0:i.left,contextscroll:e?0:this.oldscroll.x,contextdimension:this.innerwidth(),oldscroll:this.oldscroll.x,forward:"right",backward:"left",offsetprop:"left"},vertical:{contextoffset:e?0:i.top,contextscroll:e?0:this.oldscroll.y,contextdimension:this.innerheight(),oldscroll:this.oldscroll.y,forward:"down",backward:"up",offsetprop:"top"}};for(var r in t){var s=t[r];for(var l in this.waypoints[r]){var a,h,p,u,d,f=this.waypoints[r][l],c=f.options.offset,w=f.triggerpoint,y=0,g=null==w;f.element!==f.element.window&&(y=f.adapter.offset()[s.offsetprop]),"function"==typeof c?c=c.apply(f):"string"==typeof c&&(c=parsefloat(c),f.options.offset.indexof("%")>-1&&(c=math.ceil(s.contextdimension*c/100))),a=s.contextscroll-s.contextoffset,f.triggerpoint=math.floor(y+a-c),h=w=s.oldscroll,u=h&&p,d=!h&&!p,!g&&u?(f.queuetrigger(s.backward),n[f.group.id]=f.group):!g&&d?(f.queuetrigger(s.forward),n[f.group.id]=f.group):g&&s.oldscroll>=f.triggerpoint&&(f.queuetrigger(s.forward),n[f.group.id]=f.group)}}return o.requestanimationframe(function(){for(var t in n)n[t].flushtriggers()}),this},e.findorcreatebyelement=function(t){return e.findbyelement(t)||new e(t)},e.refreshall=function(){for(var t in n)n[t].refresh()},e.findbyelement=function(t){return n[t.waypointcontextkey]},window.onload=function(){r&&r(),e.refreshall()},o.requestanimationframe=function(e){var i=window.requestanimationframe||window.mozrequestanimationframe||window.webkitrequestanimationframe||t;i.call(window,e)},o.context=e}(),function(){"use strict";function t(t,e){return t.triggerpoint-e.triggerpoint}function e(t,e){return e.triggerpoint-t.triggerpoint}function i(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.cleartriggerqueues(),n[this.axis][this.name]=this}var n={vertical:{},horizontal:{}},o=window.waypoint;i.prototype.add=function(t){this.waypoints.push(t)},i.prototype.cleartriggerqueues=function(){this.triggerqueues={up:[],down:[],left:[],right:[]}},i.prototype.flushtriggers=function(){for(var i in this.triggerqueues){var n=this.triggerqueues[i],o="up"===i||"left"===i;n.sort(o?e:t);for(var r=0,s=n.length;s>r;r+=1){var l=n[r];(l.options.continuous||r===n.length-1)&&l.trigger([i])}}this.cleartriggerqueues()},i.prototype.next=function(e){this.waypoints.sort(t);var i=o.adapter.inarray(e,this.waypoints),n=i===this.waypoints.length-1;return n?null:this.waypoints[i+1]},i.prototype.previous=function(e){this.waypoints.sort(t);var i=o.adapter.inarray(e,this.waypoints);return i?this.waypoints[i-1]:null},i.prototype.queuetrigger=function(t,e){this.triggerqueues[e].push(t)},i.prototype.remove=function(t){var e=o.adapter.inarray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},i.prototype.first=function(){return this.waypoints[0]},i.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},i.findorcreate=function(t){return n[t.axis][t.name]||new i(t)},o.group=i}(),function(){"use strict";function t(t){return t===t.window}function e(e){return t(e)?e:e.defaultview}function i(t){this.element=t,this.handlers={}}var n=window.waypoint;i.prototype.innerheight=function(){var e=t(this.element);return e?this.element.innerheight:this.element.clientheight},i.prototype.innerwidth=function(){var e=t(this.element);return e?this.element.innerwidth:this.element.clientwidth},i.prototype.off=function(t,e){function i(t,e,i){for(var n=0,o=e.length-1;o>n;n++){var r=e[n];i&&i!==r||t.removeeventlistener(r)}}var n=t.split("."),o=n[0],r=n[1],s=this.element;if(r&&this.handlers[r]&&o)i(s,this.handlers[r][o],e),this.handlers[r][o]=[];else if(o)for(var l in this.handlers)i(s,this.handlers[l][o]||[],e),this.handlers[l][o]=[];else if(r&&this.handlers[r]){for(var a in this.handlers[r])i(s,this.handlers[r][a],e);this.handlers[r]={}}},i.prototype.offset=function(){if(!this.element.ownerdocument)return null;var t=this.element.ownerdocument.documentelement,i=e(this.element.ownerdocument),n={top:0,left:0};return this.element.getboundingclientrect&&(n=this.element.getboundingclientrect()),{top:n.top+i.pageyoffset-t.clienttop,left:n.left+i.pagexoffset-t.clientleft}},i.prototype.on=function(t,e){var i=t.split("."),n=i[0],o=i[1]||"__default",r=this.handlers[o]=this.handlers[o]||{},s=r[n]=r[n]||[];s.push(e),this.element.addeventlistener(n,e)},i.prototype.outerheight=function(e){var i,n=this.innerheight();return e&&!t(this.element)&&(i=window.getcomputedstyle(this.element),n+=parseint(i.margintop,10),n+=parseint(i.marginbottom,10)),n},i.prototype.outerwidth=function(e){var i,n=this.innerwidth();return e&&!t(this.element)&&(i=window.getcomputedstyle(this.element),n+=parseint(i.marginleft,10),n+=parseint(i.marginright,10)),n},i.prototype.scrollleft=function(){var t=e(this.element);return t?t.pagexoffset:this.element.scrollleft},i.prototype.scrolltop=function(){var t=e(this.element);return t?t.pageyoffset:this.element.scrolltop},i.extend=function(){function t(t,e){if("object"==typeof t&&"object"==typeof e)for(var i in e)e.hasownproperty(i)&&(t[i]=e[i]);return t}for(var e=array.prototype.slice.call(arguments),i=1,n=e.length;n>i;i++)t(e[0],e[i]);return e[0]},i.inarray=function(t,e,i){return null==e?-1:e.indexof(t,i)},i.isemptyobject=function(t){for(var e in t)return!1;return!0},n.adapters.push({name:"noframework",adapter:i}),n.adapter=i}();