!function(e){"use strict";var t=e("body"),n=e("section","#content"),i=e(".section-overflow"),a=function(){if(i.length){var t=1.5*Math.min(e(window).height(),900);i.each((function(){var n=e(this),i=n.parent("section"),a=i.children(".section-inner"),o=n.find('[data-expand="section"]');i.css("max-height",t+"px"),i.height()<a.height()?n.fadeIn(200):n.fadeOut(200),o.on("click",(function(){return i.animate({"max-height":i.outerHeight()-i.height()+a.height()+"px"},400,(function(){Waypoint.refreshAll()})),n.fadeOut(200),!1}))}))}};a();var o=e(".resume-card-overflow"),r=function(){if(o.length){var t=.75*Math.min(e(window).height(),900);o.each((function(){var n=e(this),i=n.parent(".resume-card"),a=i.children(".resume-card-inner"),o=n.find('[data-expand="resume-card"]');i.css("max-height",t+"px"),i.innerHeight()<a.height()?n.fadeIn(200):n.fadeOut(200),o.on("click",(function(){return i.css("max-height","none"),n.fadeOut(200),Waypoint.refreshAll(),s.masonry("layout"),!1}))}))}};r(),e('[rel="fancybox"]').fancybox({padding:0,margin:20});var s=e(".masonry","#content");s.masonry({columnWidth:".masonry-sizer",itemSelector:".masonry-item",percentPosition:!0}),s.imagesLoaded().progress((function(){s.masonry("layout"),Waypoint.refreshAll()}));var h=e("#header"),c=h.outerHeight(),d=e("#nav-main").outerHeight();e('[data-target="local-scroll"], #mobile-footer').add(h).find("a").on("click",(function(){var t=e(this),n=e(t.attr("href"));if(n.length){var i=n.offset().top;"schedule"===n.attr("id")&&(i-=80),e(window).width()<=1199&&(i-=d),e("html, body").animate({scrollTop:i-c},400,"easeOutQuad")}else console.log("Wrong href...")}));var l=e("#nav-main").find("a"),f=function(t){l.each((function(){var n=e(this).attr("href");t==n?e(this).addClass("active"):e(this).removeClass("active")}))};n.waypoint({handler:function(t){if("up"==t){e(this.element);var n="#"+this.element.id;f(n)}},offset:function(){return e(window).width()<=1199?-(this.element.clientHeight-c-d):-(this.element.clientHeight-c)}}),n.waypoint({handler:function(t){if("down"==t){e(this.element);var n="#"+this.element.id;f(n)}},offset:function(){return e(window).width()<=1199?c+d:c}});var u=h.offset().top,m=e(window).scrollTop(),g=function(){t.hasClass("header-absolute")&&(e("#header").css("top",e("#home").outerHeight()),u=h.offset().top)};g(),e("#back-to-top").on("click",(function(){return e("html,body").animate({scrollTop:0},700),!1})),e(window).on("load",(function(){e("#page-loader").fadeOut(300),e(".animated").appear((function(){e(this).each((function(){var t=e(this),n=e(this).data("animation-delay");setTimeout((function(){t.addClass(t.data("animation")).addClass("visible")}),n)}))}))})),e(window).on("resize",(function(){t.removeClass("nav-open"),c=h.outerHeight(),d=e("#nav-main").outerHeight(),g(),a(),r()})),e(window).scroll((function(){(m=e(window).scrollTop())>u&&!h.hasClass("sticky")?h.addClass("sticky"):m<=u&&h.hasClass("sticky")&&h.removeClass("sticky")}))}(jQuery);