function newsletterSubscribe(){$.post("/Newsletter/Subscribe",{email:$("#newsletterEmail").val()},function(n){n.Subscribed?($("#newsletterStatusText").text("All done! Check your inbox to finish subscribing"),$("#newsletterContainer").hide()):$("#newsletterStatusText").text("Whoops! Something has gone wrong, please check your email address and try again")})}function addToCart(n){var t=[],i=!0;$.each($(".pog-selector"),function(n,r){if($(r).val()===0){alert("Please select "+$(r).data("text-name")+" option first");i=!1;return}t.push({Group:$(r).attr("id").replace("pog-id-",""),Id:$(r).val()})});i&&$.ajax({url:"/Cart/Add",data:JSON.stringify({productVariantId:n,productOptions:t}),contentType:"application/json",processData:!1,type:"POST",success:function(n){n.result?location.reload():alert(n.ErrorMessage)}})}function addShippingToCart(n,t){$.post("/Cart/AddShipping",{shippingMethodId:n,service:t,deliveryAddressId:selectedDeliveryAddressId},function(t){t.result?(selectedShippingMethodId=n,$("#PaymentContentsContainer").show(),updateCartSummary(),setIconActive("Payment"),$("html,body").animate({scrollTop:$("#PaymentContentsContainer").offset().top-250})):alert(t.ErrorMessage)})}function deleteFromCart(n){$.post("/Cart/Delete",{productVariantId:n},function(t){if(t.result){if(t.CartTotalItems===0){location.reload();return}$("#miniCart-"+n+", #checkout-"+n).fadeOut();$("#miniCartTotalItems").text(t.CartTotalItems);$("#miniCartSubTotal, #miniCartButtonSubTotal").html(t.CartTotal);$("#checkout-"+n).length&&updateCartSummary()}else alert(t.ErrorMessage)})}function toggleInvoiceAddress(){updateStates("#InvoiceStateId","#InvoiceCountryId");$("#UseCustomInvoice").prop("checked")?(validInvoiceAddress=!1,$("#InvoiceAddressContainer").slideFadeIn(),gotoInvoice()):(validInvoiceAddress=null,$("#InvoiceAddressContainer").slideFadeOut(),validDeliveryAddress&&gotoShipping())}function setIconActive(n){$("#OverviewIcon, #DeliveryAddressIcon, #InvoiceAddressIcon, #ShippingMethodIcon, #PaymentIcon").removeClass("color");$("#"+n+"Icon").addClass("color")}function showDeliveryAddress(){$("#DeliveryAddressContentsContainer").slideFadeIn();setIconActive("DeliveryAddress");$("html,body").animate({scrollTop:$("#DeliveryAddressContentsContainer").offset().top-250});$("#CheckoutStartButton").hide();updateStates("#DeliveryStateId","#DeliveryCountryId")}function validateDeliveryAddress(){$.post("/Checkout/ValidateAndSaveAddress",{FirstName:$("#DeliveryFirstName").val(),LastName:$("#DeliveryLastName").val(),Company:$("#DeliveryCompany").val(),AddressLine1:$("#DeliveryAddressLine1").val(),AddressLine2:$("#DeliveryAddressLine2").val(),City:$("#DeliveryCity").val(),StateId:$("#DeliveryStateId").val(),CountryId:$("#DeliveryCountryId").val(),PostCode:$("#DeliveryPostCode").val(),Email:$("#DeliveryEmail").val(),Phone:$("#DeliveryPhone").val()},function(n){n.Valid?useExistingDeliveryAddress(n.Id,n.DisplayName):($("#DeliveryFirstName, #DeliveryLastName, #DeliveryCompany, #DeliveryAddressLine1, #DeliveryAddressLine2, #DeliveryCity, #DeliveryStateId, #DeliveryCountryId, #DeliveryPostCode, #DeliveryEmail, #DeliveryPhone").removeClass("error-input"),$("#DeliveryFormErrors").show(),$(n.Errors).each(function(){$("#Delivery"+this.Name).addClass("error-input")}))})}function useExistingDeliveryAddress(n,t){validDeliveryAddress=!0;$("#ManualDeliveryAddress").text(t);$("#ManualDeliveryAddressContainer").show();selectedDeliveryAddressId=n;$("#ValidateDeliveryAddressButton, #NewDeliveryAddressContainer, #DeliveryFormErrors, #ExistingDeliveryAddressContainer, #SpecifyDeliveryAddressPrompt").hide();validDeliveryAddress&&(validInvoiceAddress===null||validInvoiceAddress)?gotoShipping():validDeliveryAddress&&!validInvoiceAddress&&gotoInvoice()}function useExistingInvoiceAddress(n,t){validInvoiceAddress=!0;$("#ManualInvoiceAddress").text(t);$("#ManualInvoiceAddressContainer").show();selectedInvoiceAddressId=n;$("#ValidateInvoiceAddressButton, #NewInvoiceAddressContainer, #InvoiceFormErrors, #ExistingInvoiceAddressContainer, #SpecifyInvoiceAddressPrompt").hide();validDeliveryAddress&&validInvoiceAddress?gotoShipping():validDeliveryAddress||(setIconActive("DeliveryAddress"),$("html,body").animate({scrollTop:$("#DeliveryAddressContentsContainer").offset().top-250}))}function validateInvoiceAddress(){$.post("/Checkout/ValidateAndSaveAddress",{FirstName:$("#InvoiceFirstName").val(),LastName:$("#InvoiceLastName").val(),Company:$("#InvoiceCompany").val(),AddressLine1:$("#InvoiceAddressLine1").val(),AddressLine2:$("#InvoiceAddressLine2").val(),City:$("#InvoiceCity").val(),StateId:$("#InvoiceStateId").val(),CountryId:$("#InvoiceCountryId").val(),PostCode:$("#InvoicePostCode").val(),Email:$("#InvoiceEmail").val(),Phone:$("#InvoicePhone").val()},function(n){n.Valid?useExistingInvoiceAddress(n.Id,n.DisplayName):($("#InvoiceFirstName, #InvoiceLastName, #InvoiceCompany, #InvoiceAddressLine1, #InvoiceAddressLine2, #InvoiceCity, #InvoiceStateId, #InvoiceCountryId, #InvoicePostCode, #InvoiceEmail, #InvoicePhone").removeClass("error-input"),$("#InvoiceFormErrors").show(),$(n.Errors).each(function(){$("#Invoice"+this.Name).addClass("error-input")}))})}function gotoInvoice(){setIconActive("InvoiceAddress");$("html,body").animate({scrollTop:$("#InvoiceAddressContentsContainer").offset().top-250})}function gotoShipping(){$("#ShippingMethodContentsContainer").slideFadeIn();setIconActive("ShippingMethod");$("html,body").animate({scrollTop:$("#ShippingMethodContentsContainer").offset().top-250});$.post("/Checkout/GetShippingMethods",{deliveryAddressId:selectedDeliveryAddressId},function(n){n.result?($("#ShippingMethodSpinner").hide(),$("#ShippingMethodOptions").show(),$("#ShippingMethodOptions").html(),$(n.Methods).each(function(n){$("#ShippingMethodOptions").append('<div class="panel panel-default"><div class="panel-heading" role="tab"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" data-parent="#ShippingMethodOptions" href="#collapse'+n+'" onclick="addShippingToCart('+this.Id+","+this.Service+')"><span class="dot"><\/span> '+this.CourierName+" - "+this.Cost+'<\/a> <span class="overflowed pull-right"><img src="'+this.CourierLogo+'" alt="'+this.CourierName+'" /><\/span><\/h4><\/div><div id="collapse'+n+'" class="panel-collapse collapse" role="tabpanel"><\/div><\/div>')})):alert(n.ErrorMessage)})}function updateCartOverview(){$.get("/Checkout/CartOverview",function(n){$("#CartOverview").html(n)})}function updateCartSummary(){$.get("/Checkout/Summary",function(n){$("#ShoppingCartSummary").html(n)})}function updateStates(n,t){$.getJSON("/Checkout/GetStates",{countryId:$(t).val()},function(t){$(n).find("option").remove();$(t.States).each(function(){$(n).append('<option value="'+this.Id+'">'+this.Name+"<\/option>")});$(n).selectpicker("refresh")})}function assignPayPalCheckoutAddresses(){$("#PayPalSubmitDeliveryAddressId").val(selectedDeliveryAddressId);$("#PayPalSubmitInvoiceAddressId").val(selectedInvoiceAddressId)}function recordRating(n,t,i){$.ajax({url:"/Product/Rate",data:JSON.stringify({id:n,rating:t}),contentType:"application/json",processData:!1,type:"POST",success:function(n){$(i).parent().text(n.Message).attr("style","direction: ltr")}})}var selectedDeliveryAddressId=null,selectedInvoiceAddressId=null,selectedShippingMethodId=null,validDeliveryAddress=!1,validInvoiceAddress=null;jQuery(document).ready(function(){$(window).width()>=975&&$("#CheckoutStickyCart").sticky({topSpacing:160,bottomSpacing:500})});$.fn.andSelf=function(){return this.addBack.apply(this,arguments)};jQuery.fn.slideFadeToggle=function(n,t,i){return this.animate({opacity:"toggle",height:"toggle"},n,t,i)};jQuery.fn.slideFadeIn=function(n,t,i){return this.animate({opacity:"show",height:"show"},n,t,i)};jQuery.fn.slideFadeOut=function(n,t,i){return this.animate({opacity:"hide",height:"hide"},n,t,i)};$(document).ready(function(){var i=$("body"),t=$("#to-top"),r=$(".thumbnail"),n=$(".navigation"),u=$("ul.sf-menu");$().sticky&&$(".header.fixed").sticky({topSpacing:0});$().superfish&&u.superfish();$("ul.sf-menu a").click(function(){i.scrollspy("refresh")});$(".menu-toggle").on("click",function(){n.hasClass("opened")?n.removeClass("opened").addClass("closed"):n.removeClass("closed").addClass("opened")});$(".menu-toggle-close").on("click",function(){n.hasClass("opened")?n.removeClass("opened").addClass("closed"):n.removeClass("closed").addClass("opened")});$().selectpicker&&$(".selectpicker").selectpicker();$().prettyPhoto&&$('a[data-gal^="prettyPhoto"]').prettyPhoto({theme:"dark_square"});$(window).scroll(function(){$(this).scrollTop()>1?t.css({bottom:"15px"}):t.css({bottom:"-100px"})});t.click(function(){return $("html, body").animate({scrollTop:"0px"},800),!1});r.hover(function(){$(this).addClass("hover")},function(){$(this).removeClass("hover")});$(".shop-categories .arrow").click(function(){$(this).parent().parent().find("ul.children").removeClass("active");$(this).parent().parent().find(".fa-angle-up").addClass("fa-angle-down").removeClass("fa-angle-up");$(this).parent().find("ul.children").is(":visible")||($(this).find(".fa-angle-down").addClass("fa-angle-up").removeClass("fa-angle-down"),$(this).parent().find("ul.children").addClass("active"));$(this).parent().parent().find("ul.children").each(function(){$(this).hasClass("active")?$(this).slideFadeIn():$(this).slideFadeOut()})});$(".shop-categories ul.children").each(function(){$(this).hasClass("active")||$(this).hide()})});$(window).on("load",function(){var t=$(".owl-carousel"),n;location.hash!=""&&(n="#"+window.location.hash.substr(1),n.length&&body.delay(0).animate({scrollTop:$(n).offset().top},{duration:1200,easing:"easeInOutExpo"}));t.trigger("refresh");t.trigger("refresh.owl.carousel")});$(window).resize(function(){$(".owl-carousel").trigger("refresh");$(".owl-carousel").trigger("refresh.owl.carousel");$().isotope&&isotopeContainer.isotope("reLayout");$().sticky&&$(".header.fixed").sticky("update")});$(window).scroll(function(){$(".owl-carousel").trigger("refresh");$(".owl-carousel").trigger("refresh.owl.carousel");$().sticky&&$(".header.fixed").sticky("update")});$(".multiple-items").slick({autoplay:!0,infinite:!0,slidesToShow:3,slidesToScroll:1});$(".multiple-items-5").slick({autoplay:!0,infinite:!0,slidesToShow:5,slidesToScroll:1});$(".home-slick").slick({slidesToShow:1,slidesToScroll:1,autoplay:!0,autoplaySpeed:5e3,dots:!0,infinite:!0,speed:1e3,fade:!0});$(".center-slick").slick({autoplay:!0,autoplaySpeed:5e3,dots:!0,infinite:!0,centerMode:!0,slidesToShow:3,responsive:[{breakpoint:600,settings:{centerMode:!0,centerPadding:"40px",slidesToShow:1}}]});$(".slider-for").slick({autoplay:!0,slidesToShow:1,slidesToScroll:1,arrows:!1,fade:!0,asNavFor:".slider-nav"});$(".slider-nav").slick({slidesToShow:3,slidesToScroll:1,asNavFor:".slider-for",dots:!0,centerMode:!0,focusOnSelect:!0})