var tnt=tnt||{};tnt.templates=tnt.templates||{};tnt.templates.twocolpage={columnResize:function(){$(".left-rail").css("min-height","");$(".twocol-container").css("min-height","");if(767=a?b:a;$(".twocol-container").css("min-height",a);$(".left-rail").css("min-height",a-30)}},bindColumnResize:function(){tnt.templates.twocolpage.columnResize();$(window).resize(function(){tnt.templates.twocolpage.columnResize()})}};
$(document).ready(function(){tnt.templates.twocolpage.bindColumnResize()});$(window).on("load",function(){tnt.templates.twocolpage.bindColumnResize()});tnt=tnt||{};tnt.components=tnt.components||{};tnt.components.aem=tnt.components.aem||{};
tnt.components.aem.compare={selectedProductNum:0,currentTeaser:[{occupied:!1},{occupied:!1},{occupied:!1},{occupied:!1},{occupied:!1},{occupied:!1}],initJQO:function(){this.$arrowIcon=$(".compare-teaser .title .arrow-icon");this.$compareContent=$(".compare-teaser .content");this.$productCount=$(".compare-teaser .title .product-count");this.$message=$(".compare-teaser .title .message");this.$compareBtn=$(".compare-teaser .content .compare-btn");this.$allCompareProductImages=$(".compare-teaser .content .product-image");
this.$removeBtn=$(".compare-teaser .content .remove-btn");this.$checkboxCompare=$(":checkbox.checkbox-compare")},initEvent:function(){var a=tnt.components.aem.compare;this.$arrowIcon.on("click",this.onArrowIconClick);this.$checkboxCompare.each(function(b,c){$(c).on("change",a.onCheckboxChange)});this.$compareBtn.on("click",a.onCompareBtnClick)},onCompareBtnClick:function(){var a=$(this).data("link");if(!a)return!1;var b="";$(".compare-teaser .content .product-image").each(function(){$(this).data("code")&&
(b+="."+($(this).data("code")+"").replace(/[.]/g,"_"))});location.href=a.replace(".html","")+b+".html?"+window.location.hash},onCheckboxChange:function(){var a=tnt.components.aem.compare,b=$(this).val(),c=$(this).closest(".entry").find(".entry-image img").attr("src");$(this).is(":checked")?(b=a.addProduct2Compare(c,b),$(this).data("index",b)):a.removeProductFromCompare($(this).data("index"));$(".compare-teaser .content .remove-btn").each(function(b,c){$(c).off("click");$(c).on("click",function(){a.removeProductFromCompare(b);
a.$checkboxCompare.each(function(){$(this).data("index")==b&&$(this).prop("checked",!1)})})})},onArrowIconClick:function(){var a=tnt.components.aem.compare;a.toggleArrow();a.$compareContent.toggle()},toggleArrow:function(){this.$arrowIcon.hasClass("icon-tennant_icon_up")?(this.$arrowIcon.removeClass("icon-tennant_icon_up"),this.$arrowIcon.addClass("icon-tennant_icon_down")):this.$arrowIcon.hasClass("icon-tennant_icon_down")&&(this.$arrowIcon.removeClass("icon-tennant_icon_down"),this.$arrowIcon.addClass("icon-tennant_icon_up"))},
addProduct2Compare:function(a,b){if(6<=this.selectedProductNum)return console.warn("A maximum of 6 products can be compared at one time."),!1;this.selectedProductNum+=1;var c;$.each(this.currentTeaser,function(a,b){if(0==b.occupied)return b.occupied=!0,c=a,!1});this.$allCompareProductImages.each(function(e,d){e==c&&($(d).attr("src",a),$(d).attr("data-code",b),$(d).removeClass("img-blank"),$(d).after('\x3cspan class\x3d"remove-btn icon-tennant_icon_circle_remove"\x3e\x3c/span\x3e'))});this.triggerUI();
console.info("add product to "+c+" successfully!");return c},removeProductFromCompare:function(a){if(0>a||5this.selectedProductNum)&&this.$message.html("");2>this.selectedProductNum?this.$compareBtn.hide():this.$compareBtn.show();0==this.selectedProductNum?(this.$arrowIcon.hasClass("icon-tennant_icon_down")&&this.$arrowIcon.removeClass("icon-tennant_icon_down"),this.$arrowIcon.hasClass("icon-tennant_icon_up")||this.$arrowIcon.addClass("icon-tennant_icon_up"),this.$compareContent.hide()):0