function ShowHideSideMenu(){var n=$(window).width();if(n>999){$("#wrapper").animate({marginLeft:0},450,function(){$("#Head").css("position","fixed")});$(document.body).css("overflow","auto");$(".mobmenufade").fadeOut(1);$("#MenuColumn").hide();return}n>380&&(n=380);$("#MenuColumn").is(":visible")?($(".mobmenufade").fadeOut(1),$(document.body).css("overflow","auto"),$("#wrapper").animate({marginLeft:"-="+n+"px"},900),$("#MenuColumn").animate({width:"toggle"},450,function(){$("#Head").css("position","fixed")})):($(".mobmenufade").fadeIn(1),$(document.body).css("overflow","hidden"),$("#Head").css("position","absolute"),$("#wrapper").animate({marginLeft:"+="+n+"px"},900),$("#MenuColumn").animate({width:"toggle"},450))}function CloseSideMenu(){$("#MenuColumn").is(":visible")&&$("#MenuColumn").css("display","none")}function ShowThankYouModal(){$.get("/action.aspx?set=pop_hide");$(".primepromo").fadeIn(200);$(".primepromo .registration .content .complete").fadeIn(200);ga("send","event","newsletter","subscribe","success",1);console.log("ga send event")}function ShowPop(){$(".primepromo .registration .content .complete").hide();$(".primepromo").fadeIn(200);$(document.body).css({height:"100%","overflow-y":"hidden","overflow-x":"hidden",overflow:"hidden"})}function HidePop(){$(document.body).css({height:"auto","overflow-y":"auto","padding-right":"0px"});$(".primepromo").fadeOut(200);$.get("/action.aspx?set=pop_hide")}function readTerms(){$.get("/action.aspx?set=pop_hide_single");$(location).attr("href","/Terms-PrivacyPolicy")}function closePop(){HidePop()}function product_mobile(n){if(n==1){if($(".productpage").hasClass("mobile_version")==!1){$(".productpage").addClass("mobile_version");return}}else $(".productpage").removeClass("mobile_version")}function product_yesno(n){if(n==1){if($(".yesno").hasClass("mobile_version")==!1){$(".yesno").addClass("mobile_version");return}}else $(".yesno").removeClass("mobile_version")}function ShowLoginPop(){$(".loginrequest").fadeIn(200);$(document.body).css({height:"100%","overflow-y":"hidden","overflow-x":"hidden",overflow:"hidden"})}function HideLoginPop(){$(".loginrequest").fadeOut(200);$(document.body).css({height:"auto","overflow-y":"auto","padding-right":"0px"})}function ShowSuggestPop(){$(".suggestform .registration .complete").hide();$(".suggestform .registration .content").fadeIn(200);$(".suggestform").fadeIn(200);$(document.body).css({height:"100%","overflow-y":"hidden","overflow-x":"hidden",overflow:"hidden"})}function HideSuggestPop(){$(".suggestform").fadeOut(200);$(document.body).css({height:"auto","overflow-y":"auto","padding-right":"0px"})}function ShowSuggestThank(){$(".suggestform .registration .content").hide();$(".suggestform .registration .complete").fadeIn(200)}function ShowReviewPop(){$(".reviewform").fadeIn(200);$(document.body).css({height:"100%","overflow-y":"hidden","overflow-x":"hidden",overflow:"hidden"})}function HideReviewPop(){$(".reviewform").fadeOut(200);$(document.body).css({height:"auto","overflow-y":"auto","padding-right":"0px"})}function ShowHiseSearch(){$(".accountBar .sbox").is(":visible")?$(".accountBar .sbox").animate({width:"hide"}):$(".accountBar .sbox").animate({width:"show"})}function SetSearch(){var n=$("#SearchBox").val().trim();n.length>0&&$(location).attr("href","/Search?keyword:"+n)}function SetMobSearch(){var n=$("#mobSearch").val().trim();n.length>0&&$(location).attr("href","/Search?keyword:"+n)}function SeterrorSearch(){var n=$("#errSearch").val().trim();n.length>0&&$(location).attr("href","/Search?keyword:"+n)}function ShowAccountPop(){$("#accountPop").is(":visible")?clearTimeout(previewAccounttimer):($("#NewsletterPop").hide(),$("#accountPop").fadeIn(100))}function SlideTab(n){if($(n).hasClass("open")&&!$(n).hasClass("color")){$(".slidetab").removeClass("color");$(n).addClass("color");return}if($(n).hasClass("open")){$(n).removeClass("open");$(n).removeClass("color");return}$(".slidetab").removeClass("color");$(n).addClass("open");$(n).addClass("color")}function ShowBagPop(){$("#itemCart").is(":visible")?clearTimeout(previewbagtimer):($("#NewsletterPop").hide(),$("#itemCart").fadeIn(100))}function ShowNewItem(){$("#itemCart").fadeIn(100);clearTimeout(previewbagtimer);previewbagtimer=setTimeout(function(){$("#itemCart").fadeOut(100)},3e3)}function ShowHideNews(){$("#NewsletterPop").is(":visible")?$("#NewsletterPop").hide():($("#NewsletterPop .inner").show(),$("#NewsletterPop .thankyou").hide(),$("#NewsletterPop").show())}function Sizer(){var t=$(window).height(),n=$(window).width(),i=$.getScrollbarWidth()+2,r=$("#Content").width(),n=$(window).width();if(n>800&&$("#MenuColumn").is(":visible")){$(document.body).css("overflow","auto");$("#wrapper").animate({marginLeft:0},450,"linear",function(){$("#Head").css("position","fixed")});$(".mobmenufade").fadeOut();$("#MenuColumn").hide();return}}function buyBoxSet(){$(".buynow").width()<325?($(".quickbuy").css({float:"none"}),$(".pricetags").css({float:"none"})):($(".quickbuy").css({float:"right"}),$(".pricetags").css({float:"left"}))}function HeaderSnap(){}function siteCustomNotify(n,t){toastr.remove();toastr.options={closeButton:!0,debug:!1,newestOnTop:!0,progressBar:!1,positionClass:"toast-top-right",preventDuplicates:!1,onclick:null,showDuration:"300",hideDuration:"1000",timeOut:"5000",extendedTimeOut:"1000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"};switch(t){case"error":toastr.error(n);break;case"info":toastr.info(n);break;case"success":toastr.success(n);break;case"notify":toastr.notify(n);break;case"warning":toastr.warning(n)}}function siteActionNotify(n,t,i){toastr.remove();toastr.options={closeButton:!0,debug:!1,newestOnTop:!0,progressBar:!1,positionClass:"toast-top-right",preventDuplicates:!1,onclick:null,showDuration:"300",hideDuration:"1000",timeOut:"5000",extendedTimeOut:"1000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"};switch(i){case"error":toastr.error(t,n);break;case"info":toastr.info(t,n);break;case"success":toastr.success(t,n);break;case"notify":toastr.notify(t,n);break;case"warning":toastr.warning(t,n)}}function siteNotify(n,t,i){toastr.options={closeButton:!0,debug:!1,newestOnTop:!1,progressBar:!1,positionClass:"toast-top-right",preventDuplicates:!0,onclick:null,showDuration:"300",hideDuration:"1000",timeOut:"5000",extendedTimeOut:"1000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeIn",hideMethod:"fadeOut"};switch(i){case"error":toastr.error(t,n,{closeButton:!1});break;case"info":toastr.info(t,n,{closeButton:!1});break;case"success":toastr.success(t,n,{closeButton:!1});break;case"notify":toastr.notify(t,n,{closeButton:!1});break;case"warning":toastr.warning(t,n,{closeButton:!1})}}function GenerateJsonLD(){$(document).ajaxStop(function(){var n="",t="",r="",u=ko.toJS(ViewModel.SearchResults),r=ko.toJS(ViewModel.Reviews),i;u.length==1&&(t=ko.toJS(ViewModel.CurrentRecord),n+="{",n+='"@context" : "http://schema.org",',n+='"@type" : "Product",',n+='"name" : "'+t.PRODUCT_TITLE+'",',n+='"image" : "'+ViewModel.URL()+"/products/images/"+t.PRODUCT_IMAGE+'",',n+='"description" : "'+t.PRODUCT_DESCRIPTION+'",',t.ratingcount>0&&(n+='"aggregateRating" : {',n+='"@type" : "AggregateRating",',n+='"ratingValue" : "'+t.rating+'",',n+='"reviewCount" : "'+t.ratingcount+'"',n+="},"),n+='"offers" : {',n+='"@type" : "Offer",',n+='"price" : "'+t.PRODUCT_PRICE.replace(",",".")+'",',n+='"priceCurrency" : "USD",',n+=t.PRODUCT_STOCK=="0"?'"availability" : "http://schema.org/OutOfStock"':'"availability" : "http://schema.org/InStock"',n+="}",r.length>0&&(n+=",",n+='"review" : [',jQuery.each(r,function(t,i){n+="{";n+='"@type" : "Review",';n+='"author" : "'+i.Nickname+'",';n+='"datePublished" : "'+i.Created+'",';n+='"description" : "'+i.Message.replace(/\"/g,"'")+'",';n+='"name" : "'+i.Title.replace(/\"/g,"'")+'",';n+='"reviewRating" : {';n+='"@type" : "Rating",';n+='"bestRating" : "5",';n+='"worstRating" : "1",';n+='"ratingValue" : "'+i.Rating+'"';n+="}}";t<r.length-1&&(n+=",")}),n+="]"),n=n+"}");i=document.createElement("script");i.type="application/ld+json";i.text=n;document.body.appendChild(i)})}function ptab(){$("#nav").children("li").first().children("a").addClass("active").next().addClass("is-open").show();$("#nav").on("click","li > a",function(){$(this).hasClass("active")||($("#nav .is-open").removeClass("is-open").hide(),$(this).next().toggleClass("is-open").toggle(),$("#nav").find(".active").removeClass("active"),$(this).addClass("active"))})}$(window).resize(function(){Sizer()});$("html").click(function(n){var i=$("#NewsletterPop"),t,r,u;i.is(n.target)||i.has(n.target).length!==0||i.hide();t=$("#AccountDropPop");t.is(n.target)||t.has(n.target).length!==0||t.hide();r=$(".accountBar .sbox");r.is(n.target)||r.has(n.target).length!==0||$("#headsearch").is(":visible")&&$(".accountBar .sbox").animate({width:"hide"});u=$(".slidetab");u.is(n.target)||u.has(n.target).length!==0||$(".slidetab").removeClass("color")});$("#headsearch").click(function(n){n.stopPropagation();ShowHiseSearch()});$("#errSearch").keypress(function(n){n.which==13&&(n.preventDefault(),SeterrorSearch())});$("#SearchBox").keypress(function(n){n.which==13&&(n.preventDefault(),SetSearch())});$("#mobSearch").keypress(function(n){n.which==13&&(n.preventDefault(),SetMobSearch())});$("#drop_icon").click(function(n){n.stopPropagation();ShowHideAccPop()});$("#drop_icon_over").click(function(n){n.stopPropagation();ShowHideAccPop()});var previewbagtimer,previewAccounttimer;$("#MyAccount").mouseenter(function(){ShowAccountPop()});$("#MyAccount").mouseleave(function(){previewAccounttimer=setTimeout(function(){$("#accountPop").fadeOut(100)},500)});$("#accountPop").mouseenter(function(){ShowAccountPop()});$("#accountPop").mouseleave(function(){previewAccounttimer=setTimeout(function(){$("#accountPop").fadeOut(100)},500)});$("#headbag").mouseenter(function(){ViewModel.Cart().length>0&&ShowBagPop()});$("#headbag").mouseleave(function(){previewbagtimer=setTimeout(function(){$("#itemCart").fadeOut(100)},500)});$("#itemCart").mouseenter(function(){ShowBagPop()});$("#itemCart").mouseleave(function(){previewbagtimer=setTimeout(function(){$("#itemCart").fadeOut(100)},500)}),function(n){var t=0;n.getScrollbarWidth=function(){if(!t){var i=n("<div />").css({width:100,height:100,overflow:"auto",position:"absolute",top:-1e3,left:-1e3}).prependTo("body").append("<div />").find("div").css({width:"100%",height:200});t=100-i.width();i.parent().remove()}return t}}(jQuery),function(n){n.fn.UItoTop=function(t){var i=n.extend({text:"To Top",min:200,inDelay:600,outDelay:400,containerID:"toTop",containerHoverID:"toTopHover",scrollSpeed:1200,easingType:"linear"},t),r="#"+i.containerID,u="#"+i.containerHoverID;n("body").append('<a title="Back to top"  href="#" id="'+i.containerID+'">'+i.text+"<\/a>");n(r).hide().on("click.UItoTop",function(){return n("html, body").animate({scrollTop:0},i.scrollSpeed,i.easingType),n("#"+i.containerHoverID,this).stop().animate({opacity:0},i.inDelay,i.easingType),!1}).prepend('<span title="Back to top"  id="'+i.containerHoverID+'"><\/span>').hover(function(){n(u,this).stop().animate({opacity:1},600,"linear")},function(){n(u,this).stop().animate({opacity:0},700,"linear")});n(window).scroll(function(){var t=n(window).scrollTop();typeof document.body.style.maxHeight=="undefined"&&n(r).css({position:"absolute",top:t+n(window).height()-50});t>i.min?n(r).fadeIn(i.inDelay):n(r).fadeOut(i.Outdelay)})}}(jQuery);$(document).ready(function(){Sizer();$(".Submenu_Slide").dlmenu({animationClasses:{classin:"dl-animate-in-2",classout:"dl-animate-out-2"}});$(".popmenu .sub").BT_Dropccordion();$("ul.menu > li").hover(function(){$(this).find("ul.popmenu").stop().fadeIn()},function(){$(this).find("ul.popmenu").stop().fadeOut(function(){$(".ProductMenu").find(".drillicon").each(function(){$(this).removeClass("drillicon").addClass("dropicon")});$(".ProductMenu").find(".popsubmenu").slideUp()})})});$(window).load(function(){});jQuery.fn.BT_Dropccordion=function(){return this.each(function(){return $(this).click(function(n){n.stopImmediatePropagation();var i=$(this).parent().find("ul"),t=$(this).next("div");i.animate({height:"toggle"});t.hasClass("dropicon")?(t.removeClass("dropicon"),t.addClass("drillicon")):t.hasClass("drillicon")&&(t.removeClass("drillicon"),t.addClass("dropicon"))}),this})}