";r+="<\/form>";$(".nopAjaxCartProductVariantAddToCartButton").remove();$("#product-details-form-default").before(r);i===1?($("#add-to-cart-button-"+n).after("<\/button>"),$(".nopAjaxCartProductVariantAddToCartButton").trigger("click")):(AjaxCart.usepopupnotifications=!0,AjaxCart.addproducttocart_details("addproducttocart/details/4320/"+i,"#product-details-form"))}function attribute_change_handler_4320(){var n="#product-details-form";$("#product-details-form-default").length>0&&(n="#product-details-form-default");$.ajax({cache:!1,url:"/shoppingcart/productdetails_attributechange?productId=4320&validateAttributeConditions=False&loadPicture=True",data:$(n).serialize(),type:"POST",success:function(n){var i,t,u,r;if(n.price&&($(".price-value-4320").text(n.price),$(".afterpay-product-info .amount").length>0&&(i=(parseFloat(n.price.replace("$","").replace(",",""))/4).toFixed(2),isNaN(i)||$(".afterpay-product-info .amount").html(i))),n.basepricepangv?$("#base-price-pangv-4320").text(n.basepricepangv):$("#base-price-pangv-4320").hide(),n.sku?$("#sku-4320").text(n.sku).parent(".sku").show():$("#sku-4320").parent(".sku").hide(),n.mpn?$("#mpn-4320").text(n.mpn).parent(".manufacturer-part-number").show():$("#mpn-4320").parent(".manufacturer-part-number").hide(),n.gtin?$("#gtin-4320").text(n.gtin).parent(".gtin").show():$("#gtin-4320").parent(".gtin").hide(),n.stockAvailability&&($("#stock-availability-value-4320").text(n.stockAvailability),$("#stock-availability-value-4320").attr("class","value "+n.stockAvailability.toLowerCase().replaceAll(" ","-"))),n.enabledattributemappingids){for(t=0;t0&&($("#product_attribute_label_0").hide(),$("#product_attribute_input_0").hide(),$("#product_attribute_readmore_0").hide())}u=$(".color-squares li.selected-value").is(":visible");r=$("input[id^='product_attribute_'][value='0']");(r.length>0&&r.prop("checked")||!u)&&$(".price-value-4320").text(n.price);n.pictureDefaultSizeUrl&&$("#main-product-img-4320").attr("src",n.pictureDefaultSizeUrl);n.pictureFullSizeUrl&&$("#main-product-img-lightbox-anchor-4320").attr("href",n.pictureFullSizeUrl);n.message&&alert(n.message);$(document).trigger({type:"product_attributes_changed",changedData:n})}})}var globalResizeTimer=null;$(window).resize(function(){globalResizeTimer!=null&&window.clearTimeout(globalResizeTimer);globalResizeTimer=window.setTimeout(function(){setColourDetailsPosition()},200)});$(document).ready(function(){attribute_change_handler_4320();$("#product_attribute_1580_16621").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16622").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16623").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16624").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16625").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16626").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16627").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16628").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16629").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16630").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16631").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16632").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16633").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16634").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16635").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16636").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16637").on("click",function(n){colourClicked(n);attribute_change_handler_4320()});$("#product_attribute_1580_16638").on("click",function(n){colourClicked(n);attribute_change_handler_4320()})})