/*! Offscreen.js | (c) 2016 @gijsroge | MIT license | https://github.com/gijsroge/offscreen.js */
!function(a){a.fn.offscreen=function(b){function e(){var b=a(window).width(),e=a(window).height();a(d).each(function(){var d=a(this).offset().top,f=a(this).outerHeight();e<d+f?a(this).addClass(c.bottomClass):e>d+1.5*f&&a(this).removeClass(c.bottomClass),d<0?a(this).addClass(c.topClass):d>f&&a(this).removeClass(c.topClass);var g=a(this).offset().left,h=a(this).outerWidth()+c.offset;b<g+h&&a(this).addClass(c.rightClass),g<0?a(this).addClass(c.leftClass):2*g>h&&a(this).removeClass(c.leftClass)})}var c={rightClass:"right-edge",leftClass:"left-edge",topClass:"top-edge",bottomClass:"bottom-edge",offset:0,smartResize:!0},b=a.extend(c,b),d=a(this);e(),c.smartResize===!0?(!function(a,b){var c=function(a,b,c){var d;return function(){function e(){c||a.apply(f,g),d=null}var f=this,g=arguments;d?clearTimeout(d):c&&a.apply(f,g),d=setTimeout(e,b||100)}};jQuery.fn[b]=function(a){return a?this.bind("resize",c(a)):this.trigger(b)}}(jQuery,"smartresize"),a(window).smartresize(function(){e()})):a(window).resize(function(){e()})},a("[data-offscreen]").offscreen()}(jQuery);
