function productDetails(){if($(".product-top-section .product-image").length){var i=$(window).outerWidth(),n=$("h1").height()+10,t=$(".product-top-section .product-image img").height(),r=$(".buy-product").height(),u=0;i<923?(u=i>580?r>t?n+r:n+t:n+t,$(".product-details").css("padding-top",u+"px"),$(".buy-product").css("top",n+"px"),$(".product-top-section .product-image").css("padding-top",n+"px")):($(".product-top-section .product-image").css("padding-top","0"),$(".product-details").css("padding-top","0"),$(".buy-product,.book-product").css("top","0"))}}function productCourseDetails(){$(".courseVariants").length&&($(".variant-info").each(function(){$(this).find(".add-to-cart").appendTo($(this).find(".add-to-cart-quantity"));$(this).find(".price-wrap").appendTo($(this).find(".variantPriceContainer"));$(this).find(".variantStep2").appendTo($(this).find(".variantSteps2Container"));$(this).find(".variantStep3").appendTo($(this).find(".variantSteps3Container"));$(this).find(".seats-available").appendTo($(this).find(".variantSeatAvailabilityContainer"))}),$(".color-select").change(function(){$(".js-add-to-cart-errors .alert-danger").remove()}),$(".variant-options .color-select").change(function(){$(".add-to-cart-selectors .color-select").val("");$(".seats-available div").remove()}));$(".elearningVariants").length&&$(".variant-info").each(function(){$(this).find(".price-wrap").appendTo($(this).find(".variantPriceContainer"));$(this).find(".text-under-price").appendTo($(this).find(".variantPriceContainer"))})}function productCourseSelectionSlider(){$(".courseVariants").length&&($(window).width()>967?($(".buyOptionStickyContainer").height($(".product-top-section").height()+$(".mainCourseDetails").height()),$(".buy-product").height($(".product-top-section").height()+$(".mainCourseDetails").height()),$(".buyOptionStickyContainer").width($(".buy-product").width()),$(".courseVariants").width($(".buyOptionStickyContainer").width()),$(".buy-product").appendTo(".buyOptionStickyContainer")):$(".buy-product").appendTo(".courseVariants"));$(".elearningVariants").length&&($(window).width()>967?($(".buyOptionStickyContainer").height($(".product-top-section").height()+$(".mainCourseDetails").height()),$(".buy-product").height($(".product-top-section").height()+$(".mainCourseDetails").height()),$(".buyOptionStickyContainer").width($(".buy-product").width()),$(".elearningVariants").width($(".buyOptionStickyContainer").width()),$(".buy-product").appendTo(".buyOptionStickyContainer")):$(".buy-product").appendTo(".courseVariants"))}function reviews(){$(".reviews a, .rating-stars-wrap a").click(function(){var t=$(this).offset(),n;if(location.pathname.replace(/^\//,"")===this.pathname.replace(/^\//,"")&&location.hostname===this.hostname&&(n=$(this.hash),n=n.length?n:$("[name="+this.hash.slice(1)+"]"),n.length))return $("html,body").animate({scrollTop:n.offset().top-t.top},1e3),!1})}function setEqualHeights(){$(".product-top-section .product-image").length&&(equalHeights($(".varientName")),equalHeights($(".varientDescription")),equalHeights($(".variant-item-content")),equalHeights($(".variant-item-inner")),equalHeights($(".testimonialCopy")),$(".combi-product").length&&(equalHeights($(".combi-product-header")),equalHeights($(".price-wrap"))),equalHeights($(".variantsCourse .nav-tabs li")),equalHeights($(".variantsCourse .nav-tabs li a")))}$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip();productCourseDetails();productCourseSelectionSlider();reviews()});$(document).on("scroll",function(){productDetails()});$(window).resize(function(){productDetails();setEqualHeights()});$(window).on("load resize",function(){productDetails();setEqualHeights();productCourseSelectionSlider()});if($(".topUpAddToCartWrap .customer-entered-price").attr("placeholder","Enter an amount").attr("required","required").attr("value",""),$(".topUpAddToCartWrap .customer-enters-price-wrap").addClass("input-group"),$(".customer-enters-price-label").after('<span class="input-group-addon">&pound;<\/span>'),$(".productName, .bundle-product-wrapper").length){$(document).ready(function(){if($(window).width()<767&&($(".showTabPanel").removeClass("showTabPanel"),$(".tab-pane").hide(),$(".tabTrigger").first().addClass("showTabPanel"),$(".tab-pane").first().show(),$(".tabTrigger").click(function(){$(this).toggleClass("showTabPanel");$(".tabTrigger").not(this).removeClass("showTabPanel");$(".tab-pane").hide();$(this).hasClass("showTabPanel")&&$(this).next().show();var n=$(this);$("html,body").animate({scrollTop:n.offset().top-120},"slow")})),$(window).width()>767){var n=0;$(".tab-content .tab-pane").each(function(){$(this).addClass("active");var t=$(this).height();n=t>n?t:n;$(this).removeClass("active")});$(".tab-content .tab-pane:first").addClass("active");$(".tab-content").height(n)}});$(window).on("load resize",function(){$(".mainDescriptionSection .tab-content").css("min-height",$(".mainDescriptionPurchaseContainer").height()-$(".nav-tabs").height());var n=0,t=0;$(".tab-content").each(function(){n=$(".tab-content").height();n>t&&(t=n)});$(".tab-content").height(t);$(window).width()<768&&$(".mainDescriptionPurchaseContainer").insertBefore(".mainDescriptionTabs");$(window).width()>767&&$(".mainDescriptionPurchaseContainer").insertAfter(".mainDescriptionTabs")});$(".timePromoHigh").appendTo(".containerForTimePromo")}