function tt_execute_func(func){if("undefined"!=the_tt_js_data.javascript&&null!=the_tt_js_data.javascript&&"undefined"!=typeof func&&func.length>0)try{eval(func)}catch(err){alert("You have some incorrect JavaScript code (Load More Products)")}}!function(t){t(document).ready(function(){function a(a,i){"undefined"==typeof a&&(i=!1),"undefined"==typeof i&&(i=!1);var s=t(the_tt_js_data.next_page);if(s.length>0||i!==!1){_();var o;o=i!==!1?i:s.attr("href"),t.get(o,function(_){var i=t(_);(the_tt_js_data.lazy_load_m&&t(window).width()<=the_tt_js_data.mobile_width||the_tt_js_data.lazy_load&&t(window).width()>the_tt_js_data.mobile_width)&&(i.find(the_tt_js_data.item+", .berocket_lgv_additional_data").find("img").each(function(a,_){t(_).attr("data-src",t(_).attr("src")).removeAttr("src")}),i.find(the_tt_js_data.item+", .berocket_lgv_additional_data").addClass("lazy"));var s=i.find(the_tt_js_data.products).html();if(a)t(the_tt_js_data.products).html(s);else{var o=jQuery(".product_wrap.shop_masonry .tt-products.products");t(the_tt_js_data.products).append(s).each(function(){t(".tt-products").masonry("reloadItems")}),t(the_tt_js_data.products).find("li").hasClass("product-grid")&&(jQuery("#grid-view").trigger("click"),jQuery("li.product").addClass("product-grid")),t(the_tt_js_data.products).find("li").hasClass("product-list")&&(jQuery("#list-view").trigger("click"),jQuery("li.product").addClass("product-list")),o.imagesLoaded(function(){o.masonry()})}t(the_tt_js_data.products).find("img.lazy").lazyload({threshold:1e3}),(the_tt_js_data.lazy_load_m&&t(window).width()<=the_tt_js_data.mobile_width||the_tt_js_data.lazy_load&&t(window).width()>the_tt_js_data.mobile_width)&&(t(the_tt_js_data.products+" .lazy").find("img").lazyLoadXT(),t(the_tt_js_data.products).find(".lazy").on("lazyshow",function(){t(this).removeClass("lazy").addClass("animated").addClass(the_tt_js_data.LLanimation),t(this).is(".berocket_lgv_additional_data")||t(this).next(".berocket_lgv_additional_data").removeClass("lazy").addClass("animated").addClass(the_tt_js_data.LLanimation)}));var r=i.find(the_tt_js_data.pagination);t(the_tt_js_data.pagination).html(r.html()),d(),e()})}}function _(){r=!0,t(the_tt_js_data.products).find("li").hasClass("product-grid")&&(jQuery("#grid-view").trigger("click"),jQuery("li.product").addClass("product-grid")),t(the_tt_js_data.products).find("li").hasClass("product-list")&&(jQuery("#list-view").trigger("click"),jQuery("li.product").addClass("product-list")),tt_execute_func(the_tt_js_data.javascript.before_update),t(the_tt_js_data.products).append(t(the_tt_js_data.load_image))}function e(){t(the_tt_js_data.load_img_class).remove(),tt_execute_func(the_tt_js_data.javascript.after_update),r=!1,t(the_tt_js_data.products).find("li").hasClass("product-grid")&&jQuery("#grid-view").trigger("click"),t(the_tt_js_data.products).find("li").hasClass("product-list")&&jQuery("#list-view").trigger("click");var a=t(the_tt_js_data.next_page);("infinity_scroll"==o||"more_button"==o)&&a.length<=0&&t(the_tt_js_data.products).append(t(the_tt_js_data.end_text))}function d(){t(the_tt_js_data.next_page).length>0&&t(".tt_button").attr("href",t(the_tt_js_data.next_page).attr("href")),i(the_tt_js_data.use_mobile&&t(window).width()<=the_tt_js_data.mobile_width?the_tt_js_data.mobile_type:the_tt_js_data.type)}function i(a){var _=t(the_tt_js_data.next_page);t(the_tt_js_data.pagination).hide(),t(".tt_load_more_button").hide(),"more_button"==a?_.length>0?t(".tt_load_more_button").show():setTimeout(s,2e3):"pagination"==a&&t(the_tt_js_data.pagination).show(),o=a}function s(){var a=t(the_tt_js_data.next_page);a.length>0?d():setTimeout(s,2e3)}var o,r=!1;t(the_tt_js_data.products).length>0&&(t(the_tt_js_data.products).after(t(the_tt_js_data.load_more)),d(),t(window).resize(function(){d()}),t(window).scroll(function(){if("infinity_scroll"==o&&the_tt_js_data.products.length){var _=t(the_tt_js_data.products).offset().top+t(the_tt_js_data.products).height()-the_tt_js_data.buffer,e=t(window).scrollTop()+t(window).height();e>_&&!r&&a()}}),t(document).on("click",".tt_button",function(t){t.preventDefault(),a()})),tt_update_state=function(){d()}})}(jQuery);