").addClass("dis"),i.carouselList.after(i.prev),i.prev.after(i.next),i.prev.click(function(){i.scrollTo(-1)}),i.next.click(function(){i.scrollTo(1)}),i.dots=e("
')),i.resize(),i.scrollTo(i.activeIndex,0),window.addEventListener("resize",function(){clearTimeout(i.resizeTimer),i.resizeTimer=setTimeout(i.resize,100)}),window.addEventListener("keydown",function(e){switch(e.keyCode){case 37:case 39:!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.preventDefault()}}),e(".clip",i.carousel).on("scroll",function(){if(window.clearTimeout(i.isScrolling),i.breakpoint.settings.vertical){var t=e(".clip",i.carousel).scrollTop();i.activeIndex=Math.round(t/i.itemHeight)}else{t=e(".clip",i.carousel).scrollLeft();i.activeIndex=Math.round(t/i.itemWidth)}i.pageIndex=Math.ceil(i.activeIndex/i.breakpoint.settings.pageSize),i.toggleNav(),i.isScrolling=setTimeout(function(){i.carouselList.get(0).dispatchEvent(new CustomEvent("scroll",{detail:{activeIndex:i.activeIndex}}))},50)}),i.toggleNav()})},e.fn.carouselH.defaults={className:"carouselH",prevButtonHtml:"Previous",nextButtonHtml:"Next",pageSize:3,stepSize:3,startIndex:0,showDots:!1,vertical:!1,autoStepSize:!0,animateSpeed:300,enabled:!0,responsive:[]}}(jQuery),function(e){e.fn.hoverIntent=function(t,a,i){var n,s,r,o,l={interval:100,sensitivity:6,timeout:0};l="object"==typeof t?e.extend(l,t):e.isFunction(a)?e.extend(l,{over:t,out:a,selector:i}):e.extend(l,{over:t,out:t,selector:a});var d=function(e){n=e.pageX,s=e.pageY},c=function(t,a){if(a.hoverIntent_t=clearTimeout(a.hoverIntent_t),Math.sqrt((r-n)*(r-n)+(o-s)*(o-s))
0&&e("html, body").animate({scrollTop:e("."+t.toolTipClassName).first().offset().top-10},"fast"),a},e.fn.jqValidateField=function(t){t=e.extend({},e.fn.jqValidate.defaults,t);var a=!0;return this.each(function(){var i=e(this).attr("data-jqvalidate-target")?e(e(this).attr("data-jqvalidate-target")):e(this);return"jqValidate"!=i.parent().attr("class")&&i.wrap(e('').css({position:"relative","min-height":e(this).attr("data-jqvalidate-height")?e(this).attr("data-jqvalidate-height"):(e(this).attr("data-jqvalidate-target")?e(e(this).attr("data-jqvalidate-target")):e(this)).outerHeight()+"px"})),new RegExp(t.requiredPattern).test(e(this).val())?e(this).attr("data-jqvalidate-pattern")&&!new RegExp(e(this).attr("data-jqvalidate-pattern")).test(e(this).val())?(e(".jqValidateResult",e(this).parent()).fadeOut("fast",function(){e(this).remove()}),/(INPUT|TEXTAREA|SELECT)/.test(i[0].tagName)&&i.attr("style","border: "+t.css.txtBoxWarning.border+" !important"),i.parent().append(t.msgTemplate.clone().css(t.css.overlay).css(t.css.overlayWarning).append(e(""+(e(this).attr("data-jqvalidate-invalidMessage")?e(this).attr("data-jqvalidate-invalidMessage"):"invalid")+"").addClass(null!=t.toolTipClassName?t.toolTipClassName:"").css(t.css.toolTip)).fadeIn("fast")),a=!1,!1):(e(".jqValidateResult",e(this).parent()).fadeOut("fast",function(){e(this).remove()}),/(INPUT|TEXTAREA|SELECT)/.test(i[0].tagName)&&i.attr("style","border: "+t.css.txtBoxOk.border+" !important"),i.parent().append(t.msgTemplate.clone().css(t.css.overlay).css(t.css.overlayOk).fadeIn("fast")),!0):(e(".jqValidateResult",e(this).parent()).fadeOut("fast",function(){e(this).remove()}),/(INPUT|TEXTAREA|SELECT)/.test(i[0].tagName)&&i.attr("style","border: "+t.css.txtBoxWarning.border+" !important"),i.parent().append(t.msgTemplate.clone().css(t.css.overlay).css(t.css.overlayWarning).append(e(""+(e(this).attr("data-jqvalidate-requiredMessage")?e(this).attr("data-jqvalidate-requiredMessage"):"required")+"").addClass(null!=t.toolTipClassName?t.toolTipClassName:"").css(t.css.toolTip)).fadeIn("fast")),a=!1,!1)}),a},e.fn.jqValidate.defaults={groupName:null,toolTipClassName:"jqValidateToolTip",requiredPattern:"^.+$",css:{txtBoxWarning:{border:"1px solid #c00"},txtBoxOk:{},overlay:{position:"absolute",top:"0",right:"0","font-weight":"normal","font-size":"11px",width:"32px",height:"32px",background:"#f2f2f2","z-index":"20"},overlayWarning:{background:"transparent"},overlayOk:{background:"url("+FolderRoot+"Img/jqValOk.png) no-repeat 4px 50%"},toolTip:{"background-color":"#ffe0e0",border:"1px solid #c00",padding:"7px","min-height":"32px","line-height":"16px",display:"inline-block","white-space":"pre",color:"#c00","font-weight":"bold","font-size":"11px","z-index":"20","margin-left":"31px"}},msgTemplate:e('')},e(document.forms[0]).jqValidate()}(jQuery),function(e){e.fn.jqTextLimiter=function(t){return e.fn.defaults={showCount:!0,showProgressBar:!0,countSpaces:!1},e.fn.options=e.extend({},e(this).defaults,t||{}),e.fn.checkField=function(t){var a=e(this),i=t?e(this).getCaretPos(t):null,n=parseInt(a.attr("data-maxchars")),s=a.attr("data-case"),r=a.val().replace(/[‘’`]/g,"'").replace(/“”/g,'"').replace(/[^0-9a-zA-Z!"£$%\^\&\*\(\)\[\]\{\};'#:@~\<\>\?,\.\/\-\+\_\=\\\|\s]+/g,""),o=r,l=e.fn.options.countSpaces?r.replace(/[\r\n]+/g,""):r.replace(/[\r\n\s]+/g,"");if(l.length>n)if(!t||"paste"!=t.type&&null==!a.attr("data-snapshot"))o=a.attr("data-snapshot");else{var d=o.split("");for(o="";(e.fn.options.countSpaces?o.length:o.replace(/\s+/g,"").length)100?100:u)+"%",height:"4px"}).fadeIn("fast"))}e.fn.options.showCount&&e(".count",a.siblings(".chrLimit")).html(c<0?0:c),a.attr("data-snapshot",o),o!=a.val()&&(a.val(o),e(this).setCaretPos(t,i))},e.fn.getCaretPos=function(e){var t=0;if(void 0!==e.target.selectionStart)t=e.target.selectionEnd;else if(document.selection){e.target.focus();var a=document.selection.createRange();a.moveStart("character",-e.target.value.length),t=a.text.length}return t},e.fn.setCaretPos=function(t,a){try{if(e(t.target).get(0).setSelectionRange)e(t.target).get(0).setSelectionRange(a,a);else if(e(t.target).get(0).createTextRange){var i=e(t.target).get(0).createTextRange();i.collapse(!0),i.moveEnd("character",a),i.moveStart("character",a),i.select()}}catch(t){}},e(this).each(function(){e.fn.options.showCount?e(".count",e(this).siblings(".chrLimit")).html(e(this).attr("data-maxchars")-e(this).val().length):e(".count",e(this).siblings(".chrLimit")).hide(),e(this).on("keydown keyup mousedown mouseup blur focus paste input",e(this).checkField),e(this).checkField()})}}(jQuery),function(e){e.fn.jqEngraveLimiter=function(){return e.fn.checkField=function(t){var a=e(this),i=t?e(this).getCaretPos(t):null,n=e(".bar",a.siblings(".chrLimit")),s=parseInt(a.attr("data-maxchars")),r=parseInt(a.attr("data-maxfreechars")),o=parseInt(a.attr("data-maxlines")),l=parseInt(a.attr("data-productid")),d=parseFloat(a.attr("data-unitprice")),c="[^"+a.attr("data-allowedchars")+'\\"\\s]+',u=a.val(),p=u.replace(/[‘’`]/g,"'").replace(/“”/g,'"').replace(/\r+/g,"").replace(new RegExp(c,"g"),"");u.length>p.length&&(modalHtml("UnsupportedChars",700,null,null),t.preventDefault());var h=p,m=p.replace(/[\r\n\s]+/g,""),f=p.replace(/\r+/g,"").length-p.replace(/[\r\n]+/g,"").length+1,v=e("#engraveItems");if(t&&("keydown"==t.type||"keyup"==t.type)&&13==t.keyCode&&f>=o)return t.preventDefault(),!1;if(m.length>s)if(!t||"paste"!=t.type&&null==!a.attr("data-snapshot"))h=a.attr("data-snapshot");else{var g=h.split("");for(h="";h.replace(/\s+/g,"").length=o){var y=1;g=h.split("");for(h="";g.length>0;){var w=g.shift();(10!=w.charCodeAt(0)||++y<=o)&&(h+=w)}}var b=parseInt(100-100*(s-m.length)/s);if(n.parent().attr("data-val",b),n.html('FREE
').attr("data-val",b).css({width:b+"%"}),m.length>0){if(m.length>r){var C=parseInt(100-100*(s-r)/s);n.html("+"+asCurrency(d)).css({backgroundPosition:-100+C+"px 0"})}m.length>r&&v.val().indexOf(","+l+"|0,")>-1?v.val(v.val().replace(","+l+"|0,",",")):v.val().indexOf(","+l+"|"+d+",")>-1&&(v.val(v.val().replace(","+l+"|"+d+",",",")),bundlePrice-=d),v.val().indexOf(","+l+"|")<0&&(m.length>r?(v.val(v.val()+l+"|"+d+","),bundlePrice+=d):v.val(v.val()+l+"|0,"),updatePrice())}else n.html("+"+asCurrency(d)).css({backgroundPosition:"0 0"}),v.val().indexOf(","+l+"|"+d+",")>-1?(v.val(v.val().replace(l+"|"+d+",","")),bundlePrice-=d,updatePrice()):v.val().indexOf(","+l+"|0,")>-1&&(v.val(v.val().replace(l+"|0,","")),updatePrice());a.attr("data-snapshot",h),h!=a.val()&&(a.val(h),e(this).setCaretPos(t,i-1))},e.fn.getCaretPos=function(e){var t=0;if(void 0!==e.target.selectionStart)t=e.target.selectionEnd;else if(document.selection){e.target.focus();var a=document.selection.createRange();a.moveStart("character",-e.target.value.length),t=a.text.length}return t},e.fn.setCaretPos=function(t,a){if(e(t.target).get(0).setSelectionRange)e(t.target).get(0).setSelectionRange(a,a);else if(e(t.target).get(0).createTextRange){var i=e(t.target).get(0).createTextRange();i.collapse(!0),i.moveEnd("character",a),i.moveStart("character",a),i.select()}},e(this).each(function(){e(this).on("keydown keyup mousedown mouseup blur focus paste input",e(this).checkField),e(this).checkField()})}}(jQuery),function(e){e.fn.jqSwipe=function(t){var a={swipeLeft:function(e){console.log(e)},swipeRight:function(e){console.log(e)}};return t&&e.extend(a,t),this.each(function(){var e=null,t=null;function i(a){e=null,t=null}"ontouchstart"in document.documentElement&&(this.addEventListener("touchstart",function(a){a.touches.length&&(e=a.touches[0].pageX,t=a.touches[0].pageY)},!1),this.addEventListener("touchmove",function(n){if(null!=e&&null!=t){var s=e-n.touches[0].pageX,r=t-n.touches[0].pageY;Math.abs(s)>=Math.abs(r)&&(n.preventDefault(),s>0?a.swipeLeft():a.swipeRight()),i()}},!1),this.addEventListener("touchend",i,!1))}),this}}(jQuery),function(e){e.fn.jqRotator=function(t){this.each(function(){const a=this.jqRotator||{el:this,settings:e.extend({},e.fn.jqRotator.defaults,t),data:{itemCount:0,activeIndex:1,autoScrollPause:!1,autoScrollTimer:!1,initTimer:null,lazyLoadTimer:null,images:[],imageWidth:0,imgsLoaded:0},init:function(){if(e(a.settings.childElementType,e(a.el)).length<2)return;let t=0;a.data.initTimer=setInterval(function(){(deferredCssLoadedCount>=deferredCssCount||t++>500)&&(e(a.settings.parentElementType,e(a.el)).append(e(a.settings.childElementType,e(a.el)).first().clone()),a.data.itemCount=e(a.settings.childElementType,e(a.el)).length,e(a.settings.parentElementType,e(a.el)).css({"-webkit-transition":"all 0s ease","-moz-transition":"all 0s ease","-o-transition":"all 0s ease","-ms-transition":"all 0s ease",transition:"all 0s ease"}),a.resize(),a.data.images=document.querySelectorAll("img[data-lazy]",e(a.el)),a.data.images.forEach(function(e){const t=new Image;t.onload=function(){e.src=t.src,e.removeAttribute("data-lazy"),a.data.imgsLoaded++},t.src=e.attributes["data-lazy"].value}),a.data.lazyLoadTimer=setInterval(function(){a.data.imgsLoaded==a.data.images.length&&(clearInterval(a.data.lazyLoadTimer),e("").addClass("prev").attr("href","javascript:").attr("aria-label","Previous").appendTo(a.el).on("click",function(){a.rotate(-1)}),e("").addClass("next").attr("href","javascript:").attr("aria-label","Next").appendTo(a.el).on("click",function(){a.rotate(1)}),e(a.el).addClass("jqRotator"))},200),a.settings.autoScroll&&(e(a.el).on("mouseenter touchstart",function(){a.toggleTimer(!1)}),e(a.el).on("mouseleave touchend",function(){a.toggleTimer(!0)}),setTimeout(function(){a.toggleTimer(!0)},a.settings.autoScrollStartDelay)),null!=e.fn.jqSwipe&&e(a.el).jqSwipe({swipeLeft:function(){a.rotate(1)},swipeRight:function(){a.rotate(-1)}}),clearInterval(a.data.initTimer))},10),window.addEventListener("resize",a.resize)},setDuration:function(t){return void 0===t&&(t=a.settings.transitionDuration),e(a.settings.parentElementType,e(a.el)).css({"-webkit-transition-duration":t+"s","-moz-transition-duration":t+"s","-o-transition-duration":t+"s","-ms-transition-duration":t+"s","transition-duration":t+"s"}),this},transform:function(t){const i=0-(t-1)*a.data.imageWidth;return e(a.settings.parentElementType,e(a.el)).css({"-webkit-transform":"translate("+i+"px, 0)","-moz-transform":"translate("+i+"px, 0)","-o-transform":"translate("+i+"px, 0)","-ms-transform":"translate("+i+"px, 0)",transform:"translate("+i+"px, 0)"}),this},reset:function(e){return a.setDuration(0),a.transform(e),this},move:function(){return a.setDuration(a.settings.transitionDuration),a.transform(a.data.activeIndex),this},rotate:function(t){if(!e(a.el).hasClass("busy"))return e(a.el).addClass("busy"),a.data.activeIndex==a.data.itemCount&&1==t?(a.reset(1),a.data.activeIndex=2,setTimeout(a.move,10)):1==a.data.activeIndex&&-1==t?(a.reset(a.data.itemCount),a.data.activeIndex=a.data.itemCount-1,setTimeout(a.move,10)):(a.data.activeIndex+=t,setTimeout(a.move,10)),setTimeout(function(){e(a.el).removeClass("busy")},1e3*a.settings.transitionDuration),this},toggleTimer:function(e){return e?(clearInterval(a.data.autoScrollTimer),a.data.autoScrollTimer=setInterval(function(){a.data.autoScrollPause||a.rotate(1)},a.settings.autoScrollInterval)):clearInterval(a.data.autoScrollTimer),this},resize:function(){return a.data.imageWidth=e(a.el).outerWidth(),e(a.settings.childElementType,e(a.el)).width(a.data.imageWidth),e(a.settings.parentElementType,e(a.el)).width(a.data.imageWidth*e(a.settings.childElementType,e(a.el)).length),a.reset(a.data.activeIndex),this}};return this.jqRotator=a,a.init(),this})},e.fn.jqRotator.defaults={parentElementType:"dl",childElementType:"dd",autoScroll:!0,transitionDuration:.4,autoScrollInterval:5e3,autoScrollStartDelay:2e3}}(jQuery),function(e){e.fn.jqCollapsable=function(){function t(e){for(var t=document.cookie.split(";"),a=0;a').insertAfter(e("> p.hdr, > p.title",this)),e(this).attr("id")&&t("jqCollapseState").indexOf(e(this).attr("id"))>-1&&(e(this).addClass("active"),e(".carouselH > .clip > *",this).each(function(){e(this).get(0).carouselH.resize()})),e("a.toggle",this).off("click").on("click",function(){var a=e(this).parent();if(a.toggleClass("active"),a.attr("id")){var i=t("jqCollapseState"),n=a.attr("id");a.hasClass("active")?-1==i.indexOf(n)&&i.push(n):i.indexOf(n)>-1&&(i=i.filter(function(e){return e!=n})),document.cookie="jqCollapseState="+(i.length?i:"")+";expires="+new Date("1/1/2199").toUTCString()+"; path=/"}a.hasClass("active")&&(animScrollTo(a.attr("id")),e(".carouselH > .clip > *",a).each(function(){e(this).get(0).carouselH.resize()}))})})}}(jQuery),function(e){e.fn.jqCatchEnter=function(t){t&&e.extend({target:null,parent:null},t),this.each(function(){e(this).off("keypress").on("keypress",function(a){null!=a.target&&"TEXTAREA"!=a.target.tagName&&a.keyCode==KEY.RETURN&&(a.preventDefault(),null!=t.parent?e(t.target,e(t.parent)).get(0).click():e(t.target).get(0).click())})})}}(jQuery),function(e){e.fn.jqShowMore=function(t){t=e.extend({},e.fn.jqShowMore.defaults,t||{}),this.each(function(){var t=e(this);if("1"!=t.data("initcomplete")){e("ul",t).each(function(){e("li",this).length>11&&(e("li:gt(10)",this).addClass("overflow"),e(this).after(''+i18n("showMore")+""))}),e("a.more",t).on("click",function(){"1"==e(this).attr("data-mode")?(e(this).prev("ul").addClass("showAll"),e(this).attr("data-mode","0").html(i18n("showLess"))):(e(this).prev("ul").removeClass("showAll"),e(this).attr("data-mode","1").html(i18n("showMore")),animScrollTo(e(this).parent().attr("id")))}),t.data("initcomplete","1")}})},e.fn.jqShowMore.defaults={maxItems:10}}(jQuery),function($){$.fn.jqFileUpload=function(e){if(this.length){var t={accept:"",maxFiles:1,maxFileSize:null,allowPreview:!1,checkQuality:!1,minImageDPI:null,minImageWidth:null,minImageHeight:null,onUpload:null,uploadHandler:("undefined"!=typeof FolderRoot?FolderRoot:"/")+"Handlers/FileUpload.ashx",reportError:$.fn.jqFileUpload.error};return this.each(function(){var a={settings:$.extend({},t,e),clone:$(this).clone()};null!=$(this).attr("accept")&&(a.settings.accept=$(this).attr("accept").toLowerCase()),null!=$(this).data("maxfiles")&&(a.settings.maxFiles=$(this).data("maxfiles")),null!=$(this).data("maxfilesize")&&(a.settings.maxFileSize=$(this).data("maxfilesize")),null!=$(this).data("lang")&&(a.settings.lang=$(this).data("lang")),null!=$(this).data("allowpreview")&&(a.settings.allowPreview=$(this).data("allowpreview")),null!=$(this).data("checkquality")&&(a.settings.checkQuality=$(this).data("checkquality")),null!=$(this).data("minimagedpi")&&(a.settings.minImageDPI=$(this).data("minimagedpi")),null!=$(this).data("minimagewidth")&&(a.settings.minImageWidth=$(this).data("minimagewidth")),null!=$(this).data("minimageheight")&&(a.settings.minImageHeight=$(this).data("minimageheight")),null!=$(this).data("callback")&&(a.settings.onUpload=$(this).data("callback")),null!=$(this).data("before")&&(a.settings.beforeSend=$(this).data("before")),a.wrapperId=($(this).attr("id")||"jqFileUpload"+window.FileUploads)+"_Wrap",$(this).wrap(''),a.wrapper=$("#"+a.wrapperId),a.fileListId=($(this).attr("id")||"jqFileUpload"+window.FileUploads)+"_Files",a.wrapper.append(''),a.fileList=$("#"+a.fileListId),$(this).on("change",$.fn.jqFileUpload.fileSelected),$(this).on("mousedown",function(e){$(".error",$(this).parents(".jqFileUploadWrap")).slideUp(100,function(e){$(this).remove()})}),$(this).hover(function(){a.wrapper.addClass("hover")},function(){a.wrapper.removeClass("hover")}),$(this).data("jqFileUpload",a),a.removeAllFiles=$.fn.jqFileUpload.removeAllFiles})}},$.extend($.fn.jqFileUpload,{fileSize:function(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(0)+" KB"},error:function(e,t){e.data("jqFileUpload").fileList.before(''+t+"
")},fileSelected:function(e){var FileUpload=$(this).data("jqFileUpload"),fileName=$(this).val()||"",fileExtension=(fileName.match(/(\.[^\.]+)$/gi)?fileName.match(/(\.[^\.]+)$/gi)[0]:"").toLowerCase(),fileQualityIssue=!1;FileUpload.wrapper.removeClass("hover");var file=this.files[0],input=$(this);try{if(""==fileName||""==fileExtension)throw"NoFile";if(""!=FileUpload.settings.accept&&-1==FileUpload.settings.accept.indexOf(fileExtension))throw(void 0!==i18n?i18n("invalidFileType"):"Sorry but $extension files are not permitted. Please review the upload requirements and try again.").replace(/\$extension/gi,fileExtension);if(file&&FileUpload.settings.maxFileSize>0&&file.size>1024*FileUpload.settings.maxFileSize*1024)throw(void 0!==i18n?i18n("fileTooLarge"):"Sorry but the file you chose is too large ($size). Please review the upload requirements and try again.").replace(/\$size/gi,$.fn.jqFileUpload.fileSize(file.size));var thisFile=$(this).val();$('input:file[id!="'+$(this).attr("id")+'"]',FileUpload.wrapper).each(function(e){if($(this).val()==thisFile)throw(void 0!==i18n?i18n("duplicateFile"):"You have already selected the file '$file'.").replace(/\$file/gi,thisFile.match(/[^\/\\]+$/gi)[0])})}catch(e){return void("NoFile"!=e&&(FileUpload.settings.reportError(input,e),$("input:file",FileUpload.wrapper).last().remove(),$.fn.jqFileUpload.addFileInput(FileUpload)))}var label=$(''),progressBar=$(''),removeLink=$(''+(void 0!==i18n?i18n("removeFile"):"x")+""),title=$(''+fileName.match(/[^\/\\]+$/gi)[0]+"
");FileUpload.fileList.append(label.append(progressBar,removeLink," ",title)),$("a",FileUpload.fileList).off("click").on("click",$.fn.jqFileUpload.removeFile);var data=new FormData;data.append("fileUpload[]",file),input.data("xhr",$.ajax({url:FileUpload.settings.uploadHandler,type:"POST",cache:!1,data:data,processData:!1,contentType:!1,headers:{csrf:CSRFToken},beforeSend:function(o){label.addClass("uploading"),FileUpload.settings.beforeSend&&eval(`${FileUpload.settings.beforeSend}()`)},success:function(o){if(null!=o.error)return FileUpload.settings.reportError(input,o.error.message),$("input:file",FileUpload.wrapper).last().remove(),void $.fn.jqFileUpload.addFileInput(FileUpload);input.data("files",o.data.files),input.prop("disabled",!0);var tempFileName=input.data("files")[0].tempFileName;".jpg,.jpeg,.png".indexOf(fileExtension)>-1&&(1==FileUpload.settings.allowPreview&&FileUpload.fileList.append(label.append($('
'))),1==FileUpload.settings.checkQuality&&(input.data("files")[0].imageResolutionH=100&&label.removeClass("uploading")}},!1),e}}))},addFileInput:function(e){var t=$("input:file",e.wrapper).length;if(t0?"_"+n:""));e.fileList.before(s),s.on("change",$.fn.jqFileUpload.fileSelected),s.on("mousedown",function(e){$(".error",$(this).parents(".jqFileUploadWrap")).slideUp(100,function(e){$(this).remove()})}),s.hover(function(){e.wrapper.addClass("hover")},function(){e.wrapper.removeClass("hover")}),s.data("jqFileUpload",e)}else e.wrapper.addClass("max"),e.wrapper.last().prop("disabled",!0)},removeFile:function(e){var t=$("#"+$(this).attr("data-inputid")),a=t.data("xhr"),i=t.data("jqFileUpload");null!=(a=t.data("xhr"))&&(a.abort(),t.data("xhr",null)),$(this).parent().remove(),t.remove(),0==$("input:file:not(:disabled)",i.wrapper).length&&$.fn.jqFileUpload.addFileInput(i),$("input:file:not(:disabled)",i.wrapper).length>0&&i.wrapper.removeClass("max")},removeAllFiles:function(e){this.wrapper.removeClass("max"),$("input:file",this.wrapper).remove(),$(".fileList > div",this.wrapper).remove(),$.fn.jqFileUpload.addFileInput(this)}}),$(function(){$("input:file.jqFileUpload").jqFileUpload()})}(jQuery),function(e){e.fn.jqHtmlInsert=function(t){if(this.length){var a={path:"Lib/Documents/"};return this.each(function(){var i=e.extend({},a,t);null!=e(this).data("path")&&(i.path=e(this).data("path")),e(this).load(FolderRoot+i.path+e(this).data("filename"))})}},e(function(){e(".jqHtmlInsert").jqHtmlInsert()})}(jQuery);var pdValidate=function(){var e=[],t=0,a=1,i=2,n=3,s={requiredPattern:"^.+$",templates:{summary:''+i18n("validationSummaryTitle")+"
",itemError:'
',itemOk:'
'}};return document.addEventListener("DOMContentLoaded",function(){e.length=0,document.querySelectorAll("*[data-pdvgroup]").forEach(function(t){t.addEventListener("change",pdValidate.validateField),t.addEventListener("blur",pdValidate.validateField),t.addEventListener("focus",pdValidate.resetField),t.addEventListener("keydown",pdValidate.resetField);var a=document.createElement("div");a.classList.add("pdvContainer"),function(e,t){var a=e.parentElement.querySelector('label[for="'+e.id+'"]'),i=e.parentElement.querySelector(".chrLimit");t=t||document.createElement("div"),e.parentNode.appendChild(t),t.appendChild(e),"checkbox"==e.type&&a?t.appendChild(a):i&&t.appendChild(i)}(t,a),e.push(t)}),document.querySelectorAll("*[data-pdvtrigger]").forEach(function(e){e.clickHandler=void 0!==e.eventListenerList&&e.eventListenerList.click?e.eventListenerList.click[0]:null,null!=e.clickHandler&&e.removeEventListener("click",e.clickHandler),e.addEventListener("click",pdValidate.validateForm)})}),{validate:function(e){var r=void 0===e.dataset.pdvrequired||"1"==e.dataset.pdvrequired,o=t;"checkbox"==e.type?o=e.checked?t:n:(o=!r||new RegExp(s.requiredPattern).test(e.value.replace(/ /g,""))?t:a)==t&&""!=e.value&&e.dataset.pdvpattern&&!new RegExp(e.dataset.pdvpattern).test(e.value)&&(o=i),o==t?(e.classList.remove("err"),e.classList.add("ok")):(e.classList.add("err"),e.classList.remove("ok"));var l=e.parentElement.querySelector(".icon")||document.createElement("DIV");return l.className="icon "+(o==t?"ok":"err"),l.innerHTML=o==t?s.templates.itemOk:s.templates.itemError,(r||o!=t)&&e.parentElement.appendChild(l),o},validateField:function(e){return pdValidate.validate(this)},resetField:function(e){return(a=(t=this).parentElement.querySelector(".icon"))&&t.parentElement.removeChild(a),t.classList.remove("ok"),void t.classList.remove("err");var t,a},validateForm:function(a){for(var r=[],o=this.dataset.pdvtrigger,l=0,d=0;d0){if(a.preventDefault(),a.cancelBubble=!0,a.stopPropagation&&a.stopPropagation(),this.dataset.pdvsummarybefore){var u;if((u=document.createElement("DIV")).setAttribute("id","pdvSum"+o),u.classList.add("pdvSummary"),u.innerHTML=s.templates.summary,"simple"==this.dataset.pdvsummary){var p=document.createElement("P");p.classList.add("msg"),p.innerHTML=i18n("validationSummaryMessage"),u.appendChild(p)}else if(r.length){var h=document.createElement("UL");h.classList.add("msg");for(d=0;d',t,a,n||"noscroll")}function modalAlert(e,t,a,i,n){modalShow(''+e+"
"+(void 0!==t?"
"+t+"
":"")+'
OK ',a||0,i||0,n),document.querySelector(".modalAlert .close").addEventListener("click",modalHide)}function modalShow(e,t,a,i,n){void 0===n&&(n=!0),document.body.classList.contains("modalActive")||(document.body.dataset.scrollrestore=document.documentElement.scrollTop,document.body.classList.add("modalActive"),n||document.body.classList.add("modalNoOvlClose"),document.forms[0].style.top=0-document.body.dataset.scrollrestore+"px"),window.modal.style.width=t&&"auto"!=t?t+"px":"auto",window.modal.style.height=a&&"auto"!=a?a+"px":"auto",window.modalContent.innerHTML=e,window.modalOvl.className=null!=i?i:"",window.modal.className=null!=i?i:"",window.modalResize()}function modalHide(){document.body.classList.contains("modalActive")&&(window.modalOvl.className="hid",window.modal.className="hid",window.addEventListener("resize",window.modalResizeEvent),window.modalContent.innerHTML="",setTimeout(function(){document.body.classList.remove("modalActive"),document.body.classList.remove("modalNoOvlClose"),document.forms[0].style.top=0,document.body.dataset.scrollrestore>0&&(window.parent?window.parent:window).scrollTo(0,parseInt(document.body.dataset.scrollrestore))}))}function modalKeypress(e){27===e.keyCode&&document.body.classList.contains("modalActive")&&modalHide()}function qsInit(){var e=getCookie("SearchHistory");if(e.length){qsHistoryEnabled=!0;for(var t=0;t'+e[t]+"")}$("#txtSearch").keydown(qsKeyDown).keyup(qsKeyUp).focus(qsSuggestShow).blur(qsSuggestHide),qsHistoryEnabled&&($("#txtSearch").focus(qsHistoryShow).blur(qsHistoryHide),$("#qsHistory li a").click(function(){$("#txtSearch").val($(this).html()),qsGo()}))}function qsGo(){location.href=HTTPHost+"/product-list"+($("#txtSearch").val()?"?Text="+$("#txtSearch").val().replace(/[\<\%\&\@\#\=\+\>]*/g,"").replace(/\s+/g," ").replace(/^\s+/,"").replace(/\s+$/,""):"")}function qsKeyDown(e){switch(window.event?window.event.keyCode:e?e.which:0){case KEY.RETURN:return $("#qsHistory li a.hl").length?$("#txtSearch").val($("#qsHistory li a.hl").first().html()):$("#qsSuggest li a.hl").length&&$("#txtSearch").val($("#qsSuggest li a.hl").first().html()),qsGo(),!1;case KEY.TAB:case KEY.SHIFTTAB:return $("#qsHistory li a.hl").length?($("#txtSearch").val($("#qsHistory li a.hl").first().html()),qsHistoryHide()):$("#qsSuggest li a.hl").length&&($("#txtSearch").val($("#qsSuggest li a.hl").first().html()),qsSuggestHide()),!0;case KEY.UP:return $("#qsHistory").is(":visible")?qsHistoryMove(-1):$("#qsSuggest").is(":visible")&&qsSuggestMove(-1),!1;case KEY.DOWN:return $("#qsHistory").is(":visible")?qsHistoryMove(1):$("#qsSuggest").is(":visible")&&qsSuggestMove(1),!1;default:return $("#qsHistory li a.hl").length&&$("#qsHistory li a.hl").first().removeClass("hl"),!0}}function qsKeyUp(e){switch(window.event?window.event.keyCode:e?e.which:0){case KEY.ESC:return qsHistoryHide(),qsSuggestHide(),!1;case KEY.UP:case KEY.DOWN:return!1;default:return qsHistoryEnabled&&($("#txtSearch").val()?qsHistoryHide():qsHistoryShow()),$("#txtSearch").val()?$.ajax({url:FolderRoot+"Handlers/Search/AutoSuggest.ashx",data:{q:$("#txtSearch").val()},cache:!0,dataType:"json"}).done(function(e){switch(parseInt(e.Error.Code)){case-1:if($("#qsSuggest ul li").remove(),e.Suggestions.length>0){for(var t=0;t'+e.Suggestions[t].Text+"");$("#qsSuggest li a").click(function(){$("#txtSearch").val($(this).html()),qsGo()}),qsSuggestShow()}else qsSuggestHide();break;default:qsSuggestHide()}}).fail(function(){qsSuggestHide()}):qsSuggestHide(),!0}}function qsSuggestShow(){$("#txtSearch").val()?$("#qsSuggest").fadeIn("fast"):qsSuggestHide()}function qsSuggestHide(){$("#qsSuggest li a.hl").removeClass("hl"),$("#qsSuggest").fadeOut("fast")}function qsSuggestMove(e){if($("#qsSuggest li a.hl").length){var t=$("#qsSuggest li a").index($("#qsSuggest li a.hl").first().removeClass("hl"))+e;t>$("#qsSuggest li a").length-1?t=0:t<0&&(t=$("#qsSuggest li a").length-1),$("#qsSuggest li a").eq(t).addClass("hl")}else $("#qsSuggest li a:first").addClass("hl")}function qsHistoryShow(){qsHistoryEnabled?$("#txtSearch").val()?qsHistoryHide():$("#qsHistory").fadeIn("fast"):qsHistoryHide()}function qsHistoryHide(){$("#qsHistory li a.hl").removeClass("hl"),$("#qsHistory").fadeOut("fast")}function qsHistoryMove(e){if($("#qsHistory li a.hl").length){var t=$("#qsHistory li a").index($("#qsHistory li a.hl").first().removeClass("hl"))+e;t>$("#qsHistory li a").length-1?t=0:t<0&&(t=$("#qsHistory li a").length-1),$("#qsHistory li a").eq(t).addClass("hl")}else $("#qsHistory li a:first").addClass("hl")}function qsHistoryClear(){document.cookie="SearchHistory=;path=/;session=0;expires=Thu, 01 Jan 1970 00:00:01 GMT;",qsHistoryEnabled=!1,qsHistoryHide()}function bskSumUpd(e,t){$("#hdrBsk .a").html(e),$("#hdrBsk .b").html(t)}function miniBskInit(){$("#hdrBsk").hoverIntent(function(){isDesktop&&miniBskShow()},function(){null==miniBskTimer&&(miniBskTimer=setTimeout(miniBskHide,3e3))})}function miniBskShow(e){$("#miniBsk").length&&(miniBskHideCancel(),miniBskLoaded?($("#hdrBsk, #miniBsk div.sumBg").css({width:$("#hdrBsk .bskSum").outerWidth()+34+"px"}),$("#miniBsk").fadeIn("fast"),$("#hdrBsk .loading").animate({opacity:"0",filter:"alpha(opacity=0)"},"fast",function(){$(this).hide()})):($("#hdrBsk .loading").css({opacity:"0",filter:"alpha(opacity=0)"}).show().animate({opacity:"0.75",filter:"alpha(opacity=75)"},"fast"),$.ajax({url:FolderRoot+"shopping-basket-mini",timeout:1e4,cache:!1,dataType:"html"}).done(function(t){miniBskLoaded=!0;try{if($("#miniBsk div.ph").html($("#bsktMini",$(t)).html()),$("#miniBsk div.ph .itemCount").length){var a=parseInt($("#miniBsk div.ph .itemCount").html());$("#hdrBsk .a").html(a>99?"99+":a),$("#hdrBsk .b").html($("#miniBsk div.ph .subTotal").html())}else $("#hdrBsk .a").html("0"),$("#hdrBsk .b").html(asCurrency(0));$("#miniBsk input[type='button']").click(miniBskUpdate),$("#hdrBsk, #miniBsk div.sumBg").css({width:$("#hdrBsk .bskSum").outerWidth()+34+"px"}),$("#miniBsk").fadeIn("fast"),e&&animScrollTo("miniBsk"),$("#hdrBsk .loading").animate({opacity:"0",filter:"alpha(opacity=0)"},"fast",function(){$(this).hide()})}catch(e){miniBskHide()}}).fail(miniBskHide)))}function miniBskHide(){$("#miniBsk").fadeOut("fast"),$("#hdrBsk .loading").animate({opacity:"0",filter:"alpha(opacity=0)"},"fast",function(){$(this).hide()})}function miniBskHideCancel(){clearTimeout(miniBskTimer),miniBskTimer=null}function miniBskUpdate(e){var t=$(e.target?e.target:e.srcElement),a=t.siblings("input.qty");t.hasClass("del")&&a.val("0");var i=new FormData;i.append("rowCount",$("#miniBsk table.bsk tr").length);for(var n=1;n<=$("#miniBsk table.bsk tr").length;n++)t=$("#miniBsk table.bsk tr").eq(n-1).find("input.upd"),i.append("productId_"+n,t.attr("data-product-id")),i.append("groupId_"+n,t.attr("data-group-id")),i.append("quantity_"+n,t.siblings("input.qty").val());$.ajax({url:FolderRoot+"Handlers/Basket/Update.ashx",type:"POST",data:i,processData:!1,contentType:!1,cache:!1,dataType:"json"}).done(function(e){null==e.Errors?(miniBskLoaded=!1,miniBskShow()):alert(i18n("problemTryingUpdateBasket"))}).fail(function(e){alert(i18n("problemTryingUpdateBasket"))})}function miniBskHideCheck(e){$("#hdrBsk").is(e.target)||0!=$("#hdrBsk").has(e.target).length||(miniBskHideCancel(),$("#miniBsk").fadeOut("fast"))}function mmInit(){isDesktop?($("#hdrNav a[data-child], #hdrNav li.back a").off("click"),$("#hdrNav .hdrNavChild").each(function(){var e=$('#hdrNav .hdrNavChild a[data-child="'+$(this).data("parent")+'"]');e.length&&$(this).removeClass("hdrNavChild").addClass("hdrNavChildSub").appendTo(e.parent())}),$("#hdrNavMain a").off("mouseenter mouseleave").on("mouseenter",function(e){$(this).parent().addClass("mmHover");var t=$(this).data("child");t&&($('#hdrNav .hdrNavChild[data-parent="'+t+'"]').addClass("mmActive"),clearTimeout(mmTimeout),$("html").addClass("mmActive"))}).on("mouseleave",function(e){var t=$(this).data("child"),a=$(("undefined"!=typeof event?event.toElement:null)||e.relatedTarget);t&&(a.data("parent")==t||a.parents('.hdrNavChild[data-parent="'+t+'"]').length)||($(this).parent().removeClass("mmHover"),t&&($('#hdrNav .hdrNavChild[data-parent="'+t+'"]').removeClass("mmActive"),mmTimeout=setTimeout(function(){$("html").removeClass("mmActive")},10)))}),$("#hdrNav .hdrNavChild").off("mouseleave").on("mouseleave",function(e){var t=$(this).data("parent");$(("undefined"!=typeof event?event.toElement:null)||e.relatedTarget).data("child")!=t&&($('#hdrNavMain a[data-child="'+t+'"]').parent().removeClass("mmHover"),$(this).removeClass("mmActive"),mmTimeout=setTimeout(function(){$("html").removeClass("mmActive")},10))})):($("#hdrNavMain a[data-child], #hdrNav .hdrNavChild").off("mouseenter mouseleave"),$("html, #hdrNav .hdrNavChild").removeClass("mmActive"),$("#hdrNavMain a").removeClass("mmHover"),$("#hdrNav .hdrNavChildSub").each(function(){var e=$(this).parents(".hdrNavChild");e.length&&e.after($(this).removeClass("hdrNavChildSub").addClass("hdrNavChild"))}),$("#hdrNav a[data-child], #hdrNav li.back a").not(".hideChildBB").off("click").on("click",function(e){var t=$(this).data("child");if($(this).parent().hasClass("back")){t=$(this).parents(".hdrNavChild").removeClass("bbOpen bbActive");$('#hdrNav a[data-child="'+t.data("parent")+'"]').parents("ul:not(.hdrNavChild), .hdrNavChild").removeClass("bbAside")}else $('#hdrNav a[data-child="'+t+'"]').parents("ul:not(.hdrNavChild), .hdrNavChild").hasClass("bbAside")||($('#hdrNav a[data-child="'+t+'"]').parents("ul:not(.hdrNavChild), .hdrNavChild").addClass("bbAside"),$('#hdrNav .hdrNavChild[data-parent="'+t+'"]').addClass("bbActive"),setTimeout(function(){$('#hdrNav .hdrNavChild[data-parent="'+t+'"]').addClass("bbOpen")},400));e.preventDefault()}))}function mlKeyPress(e){var t;return window.event?t=window.event.keyCode:e&&(t=e.which),13!=t||(mlGo(),!1)}function mlGo(){!async function(){$("#mailingList .frm").addClass("plsWait"),0!=await googleReCaptcha("MailingList")&&$.ajax({url:FolderRoot+"Handlers/MailingList/Join.ashx",type:"POST",data:{Email:$("#txtMLEmail").val(),OtpML:$("#otpML").val(),RegCode:$("#regCode").val()},cache:!1,dataType:"json"}).done(function(e){$("#mailingList .frm").removeClass("plsWait"),location.href=SSLHost+"/mailing-list"}).fail(function(e,t){$("#mailingList .frm").removeClass("plsWait"),location.href=SSLHost+"/mailing-list"})}()}!function(e,t){"object"==typeof exports&&exports&&"string"!=typeof exports.nodeName?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):(e.Mustache={},t(e.Mustache))}(this,function(e){var t=Object.prototype.toString,a=Array.isArray||function(e){return"[object Array]"===t.call(e)};function i(e){return"function"==typeof e}function n(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function s(e,t){return null!=e&&"object"==typeof e&&t in e}var r=RegExp.prototype.test;var o=/\S/;function l(e){return!function(e,t){return r.call(e,t)}(o,e)}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};var c=/\s*/,u=/\s+/,p=/\s*=/,h=/\s*\}/,m=/#|\^|\/|>|\{|&|=|!/;function f(e){this.string=e,this.tail=e,this.pos=0}function v(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function g(){this.cache={}}f.prototype.eos=function(){return""===this.tail},f.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var a=t[0];return this.tail=this.tail.substring(a.length),this.pos+=a.length,a},f.prototype.scanUntil=function(e){var t,a=this.tail.search(e);switch(a){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,a),this.tail=this.tail.substring(a)}return this.pos+=t.length,t},v.prototype.push=function(e){return new v(e,this)},v.prototype.lookup=function(e){var t,a,n,r=this.cache;if(r.hasOwnProperty(e))t=r[e];else{for(var o,l,d,c=this,u=!1;c;){if(e.indexOf(".")>0)for(o=c.view,l=e.split("."),d=0;null!=o&&d0?n[n.length-1][4]:a;break;default:i.push(t)}return a}(function(e){for(var t,a,i=[],n=0,s=e.length;n"===r?o=this.renderPartial(s,t,a,n):"&"===r?o=this.unescapedValue(s,t):"name"===r?o=this.escapedValue(s,t):"text"===r&&(o=this.rawValue(s)),void 0!==o&&(l+=o);return l.replace(/(^\s*)|(\s*$)$/,"")},g.prototype.renderSection=function(e,t,n,s){var r=this,o="",l=t.lookup(e[1]);if(l){if(a(l))for(var d=0,c=l.length;d"'`=\/]/g,function(e){return d[e]})},e.Scanner=f,e.Context=v,e.Writer=g,e}),document.addEventListener("DOMContentLoaded",function(){window.modal=document.getElementById("modal"),window.modalOvl=document.getElementById("modalOvl"),window.modalContent=document.getElementById("modalContent"),window.modalClose=document.getElementById("modalClose"),window.modalResize=function(){window.modal.style.transform="translate(-50%, -"+Math.floor(window.modal.offsetHeight/2)+"px)"},window.modal&&(window.modalOvl.addEventListener("click",modalHide),window.modalClose.addEventListener("click",modalHide),window.addEventListener("keydown",modalKeypress),window.addEventListener("resize",window.modalResize))}),Element.prototype._addEventListener=Element.prototype.addEventListener,Element.prototype.addEventListener=function(e,t,a){"click"==e&&this.eventListenerList&&this.eventListenerList.click&&this.eventListenerList.click[0].toString().indexOf("pdvtrigger")>-1?this.clickHandler=t:this._addEventListener(e,t,a),this.eventListenerList||(this.eventListenerList={}),this.eventListenerList[e]||(this.eventListenerList[e]=[]),this.eventListenerList[e].push(t)};var oById=function(e){return document.getElementById(e)},oQ=oQuery=function(e,t){return(t||document).querySelector(e,t)},oQA=oQueryAll=function(e,t){return(t||document).querySelectorAll(e,t)};function jqDefer(e){window.jQuery?e():setTimeout(function(){jqDefer(e)},50)}function pageInit(){deferredCssCount=$(".deferredCss").length,$(".deferredCss").each(function(){var e=$($(this).text()).get(0).href,t=$(this).remove().text();$.get(e,function(){deferredCssLoadedCount++,$("body").append(t)})}),$("#bodyOverlay").click(function(){$("html").removeClass("bbActive"),void 0!==$("body").attr("data-scrollTop")&&(window.scrollTo(0,$("body").attr("data-scrollTop")),$("body").removeAttr("data-scrollTop"))}),$("#hdrMain .bbtn a").click(function(){$("html").hasClass("bbActive")?$("#bodyOverlay").click():(void 0===$("body").attr("data-scrollTop")&&$("body").attr("data-scrollTop",$(window).scrollTop()),$("html").addClass("bbActive"))}),$("#ftrMain ul.cont li.c p").click(function(){window.matchMedia&&window.matchMedia("(max-width: 499px)").matches&&$(this).toggleClass("active").next("menu").slideToggle(300,function(){"none"==$(this).css("display")&&$(this).removeAttr("style")})}),$(".tabs").each(function(){window.location.hash?showTab(null,window.location.hash):showTab(null,"tabnotselected")}),$(".fs.collapsable").jqCollapsable(),oQueryAll("dl.collapsable").forEach(function(e){e.addEventListener("click",function(e){"DT"==e.target.tagName&&(e.target.classList.contains("active")?e.target.classList.remove("active"):e.target.classList.add("active"))})});var e=oQuery("h3.scrollAnchor");e&&e.addEventListener("click",function(e){"A"==e.target.tagName&&(e.preventDefault(),animScrollTo(e.target.dataset.tag))}),$(".jqRotator").jqRotator(),benefitsBarRotate(),isTouchDevice()&&$("body").addClass("touch"),minHeightMain()}function floatLabelValidate(e){e.value?(e.classList.add("hasVal"),oQuery("#"+e.id+"Error").innerHTML=""):(e.classList.remove("hasVal"),oQuery("#"+e.id+"Error").innerHTML=e.dataset.error)}function floatLabelInit(){oQueryAll(".floatLabel input").forEach(function(e){e.addEventListener("blur",function(e){floatLabelValidate(this)})}),window.addEventListener("pageshow",function(e){oQueryAll(".floatLabel input").forEach(function(e){e.value&&e.classList.add("hasVal")})})}function formInit(){$('form input[type="radio"], form input[type="checkbox"]').each(function(){$(this).click(function(e){$(this).blur().focus()})}),$("#pcaSearch").off("keyup keydown focus blur").on("keyup keydown focus",pcaFind).on("blur",pcaBlur),$(".pca .showAddr").off("click").on("click",pcaShowAddr),floatLabelInit()}function minHeightMain(){$("#m").css({"min-height":window.innerHeight-$("#h").outerHeight(!0)-$("#bc").outerHeight(!1)-32-$("#f").outerHeight(!0)+("home"==pageName?16:0)-(isDesktop?0:$("#ftrPD").outerHeight(!1))})}function isDesktopCheck(){if(isDesktop=!1,window.matchMedia)for(var e=0;e0&&$("#"+e).is(":visible")&&$("html, body").animate({scrollTop:$("#"+e).offset().top-("fixed"==$("#hdr").css("position")?$("#hdr").outerHeight()+$("#hdrSrch").outerHeight():0)-(isDesktop?16:8)},t||200)}function isInViewport(e){var t=e.getBoundingClientRect();return t.bottom>=0&&t.right>=0&&t.top<=(window.innerHeight||document.documentElement.clientHeight)&&t.left<=(window.innerWidth||document.documentElement.clientWidth)}function lazyLoader(){if(lazyloadImages=oQueryAll("img[data-lazy-src], source[data-lazy-src]"),null==webPSupported){var e=document.createElement("canvas");webPSupported=!(!e.getContext||!e.getContext("2d"))&&0==e.toDataURL("image/webp").indexOf("data:image/webp")}if("IntersectionObserver"in window)null==imageObserver&&(imageObserver=new IntersectionObserver(function(e){e.forEach(function(e){if(e.isIntersecting){var t=e.target;t.dataset.loadTimeout=setTimeout(function(){t["SOURCE"==t.tagName?"srcset":"src"]=webPSupported?t.dataset.lazySrc.replace(/\.(jpg|png)/,".webp"):t.dataset.lazySrc,t.setAttribute("data-lazy-loaded",1),imageObserver.unobserve(t)},200)}else void 0!==e.target.dataset.loadTimeout&&clearTimeout(e.target.dataset.loadTimeout)})})),lazyloadImages&&lazyloadImages.length&&lazyloadImages.forEach(function(e){imageObserver.observe(e)});else{function t(){null!=lazyloadThrottleTimeout&&clearTimeout(lazyloadThrottleTimeout),lazyloadThrottleTimeout=setTimeout(function(){for(var e=0;e0?["th","st","nd","rd"][e>3&&e<21||e%10>3?0:e%10]:"")}function charLimiter(e,t){$(e).val().length>t&&$(e).val($(e).val().substring(0,t))}function loadingLayerShow(e){void 0!==e?$("#loadLayer").addClass(e):$("#loadLayer").attr("class","loadLayer"),window.loadLayerTimeout=setTimeout(function(){$(".loadLayer").fadeIn(100)},150)}function loadingLayerHide(){clearTimeout(window.loadLayerTimeout),""==$("#loadLayer").get(0).className.replace(/loadLayer/,"")&&$(".loadLayer").fadeOut(100)}function showTab(e,t){null!=e&&(t=e.currentTarget.location.hash),""!=t?(t=t.replace("#",""),$(".tabs a").removeClass("active"),$(".tabSection").hide(),0==$("#tab"+t).length&&$(".tabs a").length&&(t=$(".tabs a:first").attr("href").replace("#","")),$("#tab"+t).length&&$("#tabSect"+t).length&&($("#tab"+t).addClass("active"),$("#tabSect"+t).show())):$(".tabs a").length&&($(".tabs a").first().addClass("active").siblings("a").removeClass("active"),$(".tabSection").first().show().siblings(".tabSection").hide())}function pcaCapture_Find(e,t,a){var i=$("#pcaResults dl dd.highlight").first(),n=function(e,t){if("keydown"==e.type){var a=-1;return i.length&&(a=i.removeClass("highlight").index()),(a+=t)<0?a=0:a>$("#pcaResults dl dd").length-1&&(a=$("#pcaResults dl dd").length-1),i=$("#pcaResults dl dd").eq(a).addClass("highlight"),$("#pcaResults dl").scrollTop($("#pcaResults dl").scrollTop()+(i.position().top-$("#pcaResults dl").position().top)-$("#pcaResults dl").height()/2+i.height()/2),e.preventDefault(),!1}};switch(e.keyCode){case KEY.ESC:if("keyup"==e.type)return $("#pcaResults").hide(),e.preventDefault(),!1;break;case KEY.UP:return n(e,-1);case KEY.DOWN:return n(e,1);case KEY.PAGEUP:return n(e,-10);case KEY.PAGEDOWN:return n(e,10);case KEY.RETURN:return"keyup"==e.type&&i.length&&$("a",i).click(),e.preventDefault(),!1}"keyup"!=e.type&&"click"!=e.type&&"focus"!=e.type||(pcaInProgress&&pcaInProgress.abort(),pcaInProgress=$.getJSON("https://services.postcodeanywhere.co.uk/Capture/Interactive/Find/v1.00/json3.ws",{Key:LoqateKey,Text:t,Container:a,Countries:LoqateCountries,Limit:10,Language:"en-gb"},function(e){if(1==e.Items.length&&void 0!==e.Items[0].Error)$("#pcaResults").hide();else{var t=$("#pcaResults dl");if($("dd",t).remove(),e.Items.length>0){for(var a=0;a").append($("").attr("tabindex","-1").attr("data-type",e.Items[a].Type).attr("data-id",e.Items[a].Id).attr("href","javascript:;").attr("title",e.Items[a].Text+" "+e.Items[a].Description).html(""+e.Items[a].Text+" "+e.Items[a].Description)));$("#pcaResults").show(),$("#pcaResults dl dd a").on("click",function(e){switch($(this).attr("data-type")){case"Address":pcaCapture_Retrieve($(this).attr("data-id"));break;default:pcaCapture_Find(e,$("#pcaSearch").val(),$(this).attr("data-id"))}})}else $("#pcaResults").hide()}}))}function pcaCapture_Retrieve(e){pcaInProgress&&pcaInProgress.abort(),pcaInProgress=$.getJSON("https://services.postcodeanywhere.co.uk/Capture/Interactive/Retrieve/v1.00/json3.ws",{Key:LoqateKey,Id:e},function(e){if(1==e.Items.length&&void 0!==e.Items[0].Error);else if(e.Items.length>0){$('.addr input[data-field="company"]').val(e.Items[0].Company);var t="";""!=e.Items[0].SubBuilding&&(t+=e.Items[0].SubBuilding+", "),""!=e.Items[0].BuildingName&&(t+=e.Items[0].BuildingName+", "),""!=e.Items[0].BuildingNumber&&(t+=e.Items[0].BuildingNumber+", "),""!=e.Items[0].SecondaryStreet&&(t+=e.Items[0].SecondaryStreet+", "),""!=t&&(t=t.replace(/[ ,]+$/,"")),$('.addr input[data-field="house"]').val(t),$('.addr input[data-field="street"]').val(e.Items[0].Street),$('.addr input[data-field="area"]').val(e.Items[0].District),$('.addr input[data-field="town"]').val(e.Items[0].City),$('.addr input[data-field="county"]').val(e.Items[0].Province),$('.addr input[data-field="postcode"]').val(e.Items[0].PostalCode),$('.addr input[data-field="country"], .addr select[data-field="country"]').val(e.Items[0].CountryName),$(".addr").show(),$(".showAddr").hide(),$("#pcaResults").hide()}else alert(i18n("unableLoadThisAddress"))})}function pcaFind(e){return pcaCapture_Find(e,$("#pcaSearch").val(),"")}function pcaBlur(e){$.contains($("#pcaSearch").parent().get(0),$(e.relatedTarget||document.activeElement).get(0))||$("#pcaResults").hide()}function pcaShowAddr(e){$(this).hide().parent().parent().siblings(".addr").show()}function renderTemplate(e,t,a){$.get(FolderRoot+"Tpl/Mst/"+e+".mst?"+ResourceVersion,function(e){e=e.replace("/",FolderRoot).replace("https://www.giftstore.co.uk",HTTPHost).replace("https://www.giftstore.co.uk",SSLHost).replace("https://cdn.giftstore.co.uk",CDNHost);var i=Mustache.render(e,"object"!=typeof t?JSON.parse(t):t);"function"==typeof a&&a(i)})}function messageBox(e,t,a,i){renderTemplate(e,t,function(e){$("").attr("id","alerts").addClass("mBox").html(e).addClass(i).insertBefore($(a)),setTimeout(function(){animScrollTo("alerts")},10)})}function alertBox(e,t,a){messageBox("Alert",e,t,a)}function confirmBox(e,t,a){messageBox("Confirmation",e,t,a)}function messageBoxHide(){$("#alerts").slideUp(100,function(){$(this).remove()})}function localStorageGet(e){return localStorage.getItem(e)}function localStorageSet(e,t){localStorage.setItem(e,t)}function localStorageRemove(e){localStorage.removeItem(e)}function reportJSError(e,t){var a={error:e.stack||e.message,message:t||null};$.ajax({url:FolderRoot+"Handlers/JSError.ashx",data:a,type:"POST",cache:!1})}function doXhr(e,t,a,i){return i=!1!==i,new Promise(function(i,n){var s=new XMLHttpRequest;s.open(e,t),s.setRequestHeader("Content-type","application/json; charset=utf-8"),s.onload=function(){if(this.status>=200&&this.status<300)i(!s.response||s.response);else{var e;try{e=JSON.parse(s.responseText).message+" - "+JSON.parse(s.responseText).exceptionMessage}catch(e){}n({status:this.status,statusText:e,filename:t,stack:this.status+" status error reported from XMLHttpRequest function: "+e})}},s.onerror=function(){var e;try{e=JSON.parse(s.responseText).message+" - "+JSON.parse(s.responseText).exceptionMessage}catch(e){}n({status:this.status,statusText:e,filename:t,stack:"Error reported from XMLHttpRequest function: "+e})},s.send(JSON.stringify(a))}).catch(function(e){if(reportJSError(e,"at doXhr ("+t+", "+(a?JSON.stringify(a):"no data")+")"),!i)throw e})}function redirectUrl(e,t){var a;return doXhr("POST",SSLHost+"/api/page/pathfrompagename",{pageName:e}).then(function(e){if(e.error)throw!0;if(null==(e?JSON.parse(e):{}).path)throw!0;a=JSON.parse(e).path}).catch(function(){a=e}),FolderRoot+a+(void 0!==t?t:"")}function benefitsBarRotate(){window.matchMedia&&window.matchMedia("(max-width: 829px)").matches&&($("#hdrBenBar .cont").hasClass("jqRotator")||$("#hdrBenBar .cont").jqRotator({autoScroll:!0,parentElementType:"ul",childElementType:"li"}))}function waitForCookieScript(){window.waitForCookieScriptCounter=(window.waitForCookieScriptCounter||0)+1,$("#cookiescript_manage_wrap:visible").length?(window.waitForCookieScriptCounter=0,$("#cookiescript_manage_wrap").click()):window.waitForCookieScriptCounter<50&&setTimeout(waitForCookieScript,100)}function showCookieScript(){CookieScript&&(CookieScript.instance.show(),waitForCookieScript())}function googleReCaptcha(e){return new Promise(function(t){grecaptcha.ready(function(){grecaptcha.execute(GCAPTCHASITEKEY,{action:e}).then(function(a){$.ajax({url:FolderRoot+"api/captcha/googlerecaptcha",type:"POST",data:{token:a,action:e},cache:!1,success:function(e){t(!e.ThresholdMet||e.ThresholdMet)},error:function(e){t(!0)}})})})})}HTMLElement.prototype.oQ=HTMLElement.prototype.oQuery=function(e){return oQuery(e,this)},HTMLElement.prototype.oQA=HTMLElement.prototype.oQueryAll=function(e){return oQueryAll(e,this)},Array.prototype.distinct=function(){return this.filter((e,t,a)=>a.indexOf(e)===t)},HTMLElement.prototype.catchEnter=function(e){this.addEventListener("keypress",function(t){null!=t.target&&"TEXTAREA"!=t.target.tagName&&t.keyCode==KEY.RETURN&&(t.preventDefault(),e.click())})},document.addEventListener("DOMContentLoaded",function(){isDesktopCheck(),jqDefer(function(){pageInit(),formInit(),mmInit(),qsInit(),miniBskInit(),lazyLoader()})}),"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),window.addEventListener("resize",function(){isDesktopCheck(),jqDefer(function(){mmInit(),minHeightMain(),$(".fs.collapsable").jqCollapsable(),window.benfBarTimer&&(clearTimeout(window.benfBarTimer),window.benfBarTimer=null),window.benfBarTimer=setTimeout(benefitsBarRotate,100)})}),document.addEventListener("mousedown",miniBskHideCheck),window.addEventListener("hashchange",showTab);