text: /*!====================================================
   * rustic.js 1.0.1  (http://pratinav.tk/rustic.js/)
   *=====================================================
   * @author: Pratinav Bagla (http://pratinav.tk)
   * @license: The MIT License (https://github.com/Pratinav/rustic.js/blob/master/LICENSE.txt)
   *=====================================================*/
  !function($){$.extend($.easing,{easeInOutQuad:function(n,t,i,e,a){return(t/=a/2)<1?e/2*t*t+i:-e/2*(--t*(t-2)-1)+i}}),$.fn.rustic=function(n){var t=$.extend({element:"section",looping:!1,defaultCallback:[function(){},function(){}],specificCallbacks:{},breakingPoint:0,easing:"easeInOutQuad",transitionDuration:500,pagination:!0,paginationWrapper:'<div class="rustic-pagination"></div>',paginationPoint:'<span class="rustic-pagination-point"></span>',paginationCss:!0,specificPaginationPoints:{}},n);return this.each(function(){function n(n){var t=n.parents().map(function(){return this.tagName.toLowerCase()}).get().reverse().concat([this.nodeName]).join(">");t+=n.prop("tagName").toLowerCase();var i=n.attr("id");i&&(t+="#"+i);var e=n.attr("class");return e&&(t+="."+$.trim(e).replace(/\s/gi,".")),t}function i(){for(var n=0;m>n;n++)if(b.eq(n).hasClass("current"))return n}function e(){C=!0,v.append(t.paginationWrapper),g=v.children().last();for(var i=0;m>i;i++)g.append(t.specificPaginationPoints.hasOwnProperty(i+1)?t.specificPaginationPoints[i+1]:t.paginationPoint);if(h=g.children(),t.paginationCss){var e=n(g),a=n(h.not(".active"));$("style").length||$("head").append('<style type="text/css"></style>');var o=$("style");o.append(e+"{position: fixed;top: 50%;-webkit-transform: translateY(-50%);-ms-transform: translateY(-50%);transform: translateY(-50%);left: 10px;}"+a+"{box-sizing: border-box;height: 16px;width: 16px;border-radius: 50%;border: 3px solid rgba(255,255,255,0.4);display: block;margin: 10px 0;cursor: pointer;background: none;transition: all 200ms ease-in-out;}"+a+".active {background: white;}"+a+":hover {border-color: white;}")}}function a(){$(window).scroll(function(){for(var n=0,i=$(window).scrollTop(),e=$(document).height()-$(window).height(),a=0;m>a;a++){var o=b.eq(a).offset().top;if(!(i>=o))break;n=a}i>=e&&(n=m-1),b.eq(n).addClass("current"),k=b.eq(n).offset.top,t.pagination&&h.eq(n).addClass("active"),$(window).unbind("scroll")}),$(window).scroll(),p()}function o(){if(t.pagination||!w){var n=h.filter(".active"),e=w?i():0;if(!w){var a=$(window).scrollTop();if(a>=$(document).height()-$(window).height())e=m-1;else for(var o=0;m>o;o++){var r=b.eq(o).offset().top-.5*$(window).height();if(!(a>=r))break;e=o}e!==i()&&(b.filter(".current").removeClass("current"),b.eq(e).addClass("current"))}n.removeClass("active"),h.eq(e).addClass("active")}}function r(){C&&(t.pagination&&(t.pagination=!1,o()),"none"!==g.css("display")&&g.hide())}function s(){t.pagination||(t.pagination=!0,C||e(),o()),"none"===g.css("display")&&g.show()}function c(){var n,e,a=b.filter(".current"),r=i();if(t.looping||r+1!==m){y=!0,e=r+1===m?0:r+1,n=b.eq(e);var s=t.specificCallbacks.hasOwnProperty(e+1)?t.specificCallbacks[e+1]:t.defaultCallback,c=$(document).height()-$(window).height(),l=n.offset().top;l>=c&&(e=m-1,n=b.eq(e),l=c),a.removeClass("current"),n.addClass("current"),s[0](),$("html body").animate({scrollTop:l},t.transitionDuration,t.easing,function(){s[1](),setTimeout(function(){y=!1},500)}),o()}}function l(){var n,e,a=b.filter(".current"),r=i();if(t.looping||0!==r){y=!0,e=0===r?m-1:r-1,n=b.eq(e);var s=t.specificCallbacks.hasOwnProperty(e+1)?t.specificCallbacks[e+1]:t.defaultCallback,c=$(document).height()-$(window).height(),l=n.offset().top>=c?c:n.offset().top;if(a.offset().top>=c)for(var u=r;u>=0;u--)if(b.eq(u).offset().top<c){e=u,n=b.eq(e),l=n.offset().top;break}a.removeClass("current"),n.addClass("current"),s[0](),$("html body").animate({scrollTop:l},t.transitionDuration,t.easing,function(){s[1](),setTimeout(function(){y=!1},500)}),o()}}function u(n){var e=b.filter(".current"),a=(i(),n-1),r=b.eq(a);if(r.length>0){y=!0;var s=t.specificCallbacks.hasOwnProperty(a+1)?t.specificCallbacks[a+1]:t.defaultCallback,c=$(document).height()-$(window).height(),l=r.offset().top;l>=c&&(a=m-1,r=b.eq(a),l=c),e.removeClass("current"),r.addClass("current"),s[0](),$("html body").animate({scrollTop:l},t.transitionDuration,t.easing,function(){s[1](),setTimeout(function(){y=!1},500)}),o()}}function f(){w&&(w=!1,$(window).bind("scroll",o))}function d(n){w||(w=!0,$(window).unbind("scroll",o));for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])}function p(n){var i=$(window).width();i<=t.breakingPoint?f():d()}var g,h,w=!0,v=$(this),b=v.children(t.element),m=b.length,C=(v.children().length-m,!1),k=0;t.pagination&&e(),$(document).ready(function(){setTimeout(a,100),$(window).load(function(){var n=$(window).scrollTop();0!==n&&(w?!0:n<b.eq(0).outerHeight())&&0===i()&&a()})}),$(window).resize(p),t.pagination&&h.bind("click",function(n){var t=i(),e=$(this).index();e!==t&&(u($(this).index()+1),o())});var y=!1,P=k;v.on({"DOMMouseScroll mousewheel wheel":function(n){return w?(y||(n.originalEvent.wheelDelta<0||n.originalEvent.detail>0?c():l()),n.preventDefault&&n.preventDefault(),n.stopPropagation(),n.returnValue=!1,!1):void 0},touchstart:function(n){w&&(P=n.originalEvent.touches[0].clientY)},touchend:function(n){if(w){var t=n.originalEvent.changedTouches[0].clientY;P>t+5?c():t-5>P&&l()}}}),$(document).keydown(function(n){if(w){var t=n.target.tagName.toLowerCase();switch(n.which){case 33:case 38:"input"!=t&&"textarea"!=t&&(n.preventDefault(),l());break;case 32:case 34:case 40:"input"!=t&&"textarea"!=t&&(n.preventDefault(),c());break;case 35:u(m);break;case 36:u(1);break;default:return}}}),$.fn.rustic.moveUp=l,$.fn.rustic.moveDown=c,$.fn.rustic.moveTo=u,$.fn.rustic.hidePagination=r,$.fn.rustic.showPagination=s,$.fn.rustic.togglePagination=function(){t.pagination?t.pagination=!1:t.pagination=!0,"none"===g.css("display")?g.show():g.hide()},$.fn.unrustic=f,$.fn.rerustic=d,$.fn.rustic.toggle=function(){w?(w=!1,$(window).bind("scroll",o)):(w=!0,$(window).unbind("scroll",o))}})}}(jQuery);