!function(a){"use strict";function b(){f(),g(),h(),o(),l(),i(),r(),h()}function c(){s().init(),g(),h(),o(),l(),h()}function d(){h()}function e(){}function f(){a("audio.eltd-blog-audio").mediaelementplayer({audioWidth:"100%"})}function g(){if(a(".eltd-blog-holder.eltd-blog-type-masonry").length){var b=a(".eltd-blog-holder.eltd-blog-type-masonry");b.waitForImages(function(){b.isotope({itemSelector:"article",resizable:!1,masonry:{columnWidth:".eltd-blog-masonry-grid-sizer",gutter:".eltd-blog-masonry-grid-gutter"}}),b.addClass("eltd-appeared")});var c=a(".eltd-filter-blog-holder");a(".eltd-filter").on("click",function(){var d=a(this),e=d.attr("data-filter");return c.find(".eltd-active").removeClass("eltd-active"),d.addClass("eltd-active"),b.isotope({filter:e}),!1})}}function h(){var b=a(".eltd-blog-holder.eltd-blog-type-chequered");b.waitForImages(function(){b.isotope({itemSelector:"article",resizable:!1,masonry:{columnWidth:".eltd-blog-chequered-grid-sizer"}}),b.addClass("eltd-appeared");var c=a(".eltd-blog-chequered-grid-sizer").outerWidth();b.children("article").css({height:c+"px"})})}function i(){var b=a(".eltd-blog-holder.eltd-blog-load-more");b.length&&b.each(function(){var c,d,e=a(this),f=e.parent().find(".eltd-load-more-ajax-pagination .eltd-btn");(b.hasClass("eltd-blog-type-masonry")||b.hasClass("eltd-blog-type-masonry-gallery"))&&(f=b.next().find(".eltd-btn")),d=e.data("max-pages"),f.on("click",function(b){b.preventDefault(),b.stopPropagation();var h=j(e);if((c=h.nextPage)<=d){var i=k(h);a.ajax({type:"POST",data:i,url:ElatedAjaxUrl,success:function(b){c++,e.data("next-page",c);var d=a.parseJSON(b),f=d.html;e.waitForImages(function(){e.hasClass("eltd-blog-type-masonry")?(e.append(f).isotope("reloadItems").isotope({sortBy:"original-order"}),g()):e.hasClass("eltd-blog-type-masonry-gallery")?(e.append(f).isotope("reloadItems").isotope({sortBy:"original-order"}),o(),r()):e.hasClass("eltd-blog-type-pinboard")?(e.append(f).isotope("reloadItems").isotope({sortBy:"original-order"}),l()):e.find("article:last").after(f),setTimeout(function(){eltd.modules.blog.eltdInitAudioPlayer(),eltd.modules.common.eltdOwlSlider(),eltd.modules.common.eltdFluidVideo()},400)})}})}c===d&&f.hide()})})}function j(a){var b={};return b.nextPage="",b.number="",b.category="",b.blogType="",b.archiveCategory="",b.archiveAuthor="",b.archiveTag="",b.archiveDay="",b.archiveMonth="",b.archiveYear="",void 0!==a.data("next-page")&&!1!==a.data("next-page")&&(b.nextPage=a.data("next-page")),void 0!==a.data("post-number")&&!1!==a.data("post-number")&&(b.number=a.data("post-number")),void 0!==a.data("category")&&!1!==a.data("category")&&(b.category=a.data("category")),void 0!==a.data("blog-type")&&!1!==a.data("blog-type")&&(b.blogType=a.data("blog-type")),void 0!==a.data("archive-category")&&!1!==a.data("archive-category")&&(b.archiveCategory=a.data("archive-category")),void 0!==a.data("archive-author")&&!1!==a.data("archive-author")&&(b.archiveAuthor=a.data("archive-author")),void 0!==a.data("archive-tag")&&!1!==a.data("archive-tag")&&(b.archiveTag=a.data("archive-tag")),void 0!==a.data("archive-day")&&!1!==a.data("archive-day")&&(b.archiveDay=a.data("archive-day")),void 0!==a.data("archive-month")&&!1!==a.data("archive-month")&&(b.archiveMonth=a.data("archive-month")),void 0!==a.data("archive-year")&&!1!==a.data("archive-year")&&(b.archiveYear=a.data("archive-year")),b}function k(a){return{action:"creator_elated_blog_load_more",nextPage:a.nextPage,number:a.number,category:a.category,blogType:a.blogType,archiveCategory:a.archiveCategory,archiveAuthor:a.archiveAuthor,archiveTag:a.archiveTag,archiveDay:a.archiveDay,archiveMonth:a.archiveMonth,archiveYear:a.archiveYear}}function l(){var b=a(".eltd-blog-holder.eltd-blog-type-pinboard");b.length&&b.each(function(){var b=a(this),c=b.find(".eltd-blog-pinboard-grid-sizer").width();n(c,b),m(b),a(window).resize(function(){n(c,b),m(b)})})}function m(a){a.waitForImages(function(){a.isotope({itemSelector:"article",masonry:{columnWidth:".eltd-blog-pinboard-grid-sizer"}}),a.addClass("eltd-appeared")})}function n(a,b){var c=b.find(".eltd-pinboard-portrait-item"),d=b.find(".eltd-pinboard-landscape-item");eltd.windowWidth>600?(d.css("height",Math.round(.63*a)),c.css("height",Math.round(1.26*a))):(c.css("height",a),d.css("height",a))}function o(){var b=a(".eltd-blog-holder.eltd-blog-type-masonry-gallery");b.length&&b.each(function(){var b=a(this),c=b.find(".eltd-blog-masonry-gallery-grid-sizer").width();q(c,b),p(b),a(window).resize(function(){q(c,b),p(b)})})}function p(a){a.waitForImages(function(){a.isotope({itemSelector:"article",masonry:{columnWidth:".eltd-blog-masonry-gallery-grid-sizer"}}),a.addClass("eltd-appeared")})}function q(a,b){var c=b.find(".eltd-default-masonry-item"),d=b.find(".eltd-large-width-masonry-item"),e=b.find(".eltd-large-height-masonry-item"),f=b.find(".eltd-large-width-height-masonry-item");c.css("height",a),d.css("height",a),e.css("height",Math.round(2*a)),eltd.windowWidth>600?f.css("height",Math.round(2*a)):f.css("height",a)}function r(){var b=a(".eltd-blog-holder.eltd-blog-type-masonry-gallery"),c=b.find("article:not(.format-link):not(.format-quote)");c.length&&c.each(function(){var b=a(this),c=b.find(".eltd-post-text"),d=b.find(".eltd-post-excerpt").outerHeight(),e="translateY("+parseInt(d+15)+"px)";c.css({"-webkit-transform":e}),c.css({transform:e}),setTimeout(function(){c.css({visibility:"visible"})},500),a(window).resize(function(){var a=b.find(".eltd-post-excerpt").outerHeight();e="translateY("+parseInt(a+15)+"px)",c.css({"-webkit-transform":e}),c.css({transform:e})})})}function s(){var b=a(".eltd-blog-holder article.format-gallery"),c=b.find(".eltd-blog-gallery-masonry-holder"),d=c.find(".eltd-blog-gallery-sizer").outerWidth(),e=function(){var a=c.find(".eltd-blog-gallery-item.default"),b=c.find(".eltd-blog-gallery-img-large-height"),e=c.find(".eltd-blog-gallery-img-large-height-width");a.css("height",d),b.css("height",Math.round(2*d)),eltd.windowWidth>600?e.css("height",Math.round(2*d)):e.css("height",d)},f=function(){c.isotope({itemSelector:".eltd-blog-gallery-item",masonry:{columnWidth:".eltd-blog-gallery-sizer",gutter:".eltd-blog-gallery-gutter"}})};return{init:function(){e(),f(),a(window).resize(function(){e()})}}}var t={};eltd.modules.blog=t,t.eltdInitAudioPlayer=f,t.eltdInitBlogMasonry=g,t.eltdInitBlogChequered=h,t.eltdInitBlogMasonryGallery=o,t.eltdInitBlogPinboard=l,t.eltdInitBlogLoadMore=i,t.eltdInitBlogMasonryGalleryContentPosition=r,t.eltdBlogGalleryMasonryImages=s,t.eltdOnDocumentReady=b,t.eltdOnWindowLoad=c,t.eltdOnWindowResize=d,t.eltdOnWindowScroll=e,a(document).ready(b),a(window).on("load",c),a(window).resize(d),a(window).scroll(e)}(jQuery);