!function(n,e){function t(e){var t,r=n("
").css({width:"100%"});return e.append(r),t=e.width()-r.width(),r.remove(),t}function r(o,i){var a=o.getBoundingClientRect(),s=a.top,c=a.bottom,u=a.left,l=a.right,d=n.extend({tolerance:0,viewport:e},i),f=!1,p=d.viewport.jquery?d.viewport:n(d.viewport);p.length||(console.warn("isInViewport: The viewport selector you have provided matches no element on page."),console.warn("isInViewport: Defaulting to viewport as window"),p=n(e));var w=p.height(),h=p.width(),v=p[0].toString();if(p[0]!==e&&"[object Window]"!==v&&"[object DOMWindow]"!==v){var g=p[0].getBoundingClientRect();s-=g.top,c-=g.top,u-=g.left,l-=g.left,r.scrollBarWidth=r.scrollBarWidth||t(p),h-=r.scrollBarWidth}return d.tolerance=~~Math.round(parseFloat(d.tolerance)),d.tolerance<0&&(d.tolerance=w+d.tolerance),l<=0||u>=h?f:f=d.tolerance?s<=d.tolerance&&c>=d.tolerance:c>0&&s<=w}String.prototype.hasOwnProperty("trim")||(String.prototype.trim=function(){return this.replace(/^\s*(.*?)\s*$/,"$1")});var o=function(e){if(1===arguments.length&&"function"==typeof e&&(e=[e]),!(e instanceof Array))throw new SyntaxError("isInViewport: Argument(s) passed to .do/.run should be a function or an array of functions");for(var t=0;t