(function(){
var deals=[
['50% off the Y1 Scandi stick range','/search.aspx?q=y1+scandi'],
['At least 40% off all Kookaburra hockey sticks','/all-hockey-equipment/sticks/g508.aspx?rsb=%2C0%7C1%7C0%7CKookaburra&rsc=%2C0%2C'],
['At least 30% off all Adidas hockey sticks','/all-hockey-equipment/sticks/g508.aspx?rsb=%2C0%7C1%7C0%7CAdidas&rsc=%2C0%2C'],
['50% off Under Armour Mach 1 Club turf shoes, now $79.95','/product/under-armour-mach-1-club-turf-shoes-orangegreenyellow-26/hoshuamach1e26.aspx'],
['Up to 40% off footwear clearance','/hockey-outlet/footwear/g693.aspx'],
['50% off Gryphon goalkeeping gear','/all-hockey-equipment/goal-keeping/g488.aspx?rsb=%2C0%7C1%7C0%7CGryphon&rsc=%2C0%2C'],
['50% off the Ritual Recon sling bag, now $59.95','/product/ritual-recon-sling-bag-(24)/hobarire24.aspx'],
['Arctic Traction Grip, $2 each','/product/arctic-traction-grip/hogrartraction.aspx']
];
var SALE_URL='/page/black-friday-sale.aspx';
/* hides itself automatically from Tue 1 Dec (NZDT) */
if(new Date().getTime() >= new Date('2026-12-01T00:00:00+13:00').getTime()) return;
document.documentElement.classList.add('ce-bf-live');
/* header red-to-black wipe: CSS starts the menu bar red; adding ce-hdr-black sweeps it to black.
Homepage: synced with the banner. Other pages: plays on the first page of a visit, then stays black. */
var DE=document.documentElement,isHome=!!document.getElementById('proCarousel'),seen=false,hdrT;
try{seen=sessionStorage.getItem('ce-hdr-wiped')==='1';sessionStorage.setItem('ce-hdr-wiped','1')}catch(e){}
function hdrBlack(){DE.classList.add('ce-hdr-black')}
if((seen&&!isHome)||(window.matchMedia&&matchMedia('(prefers-reduced-motion: reduce)').matches)){DE.classList.add('ce-hdr-instant');hdrBlack()}
else hdrT=setTimeout(hdrBlack,isHome?3500:1200);
/* NOTE: no less-than characters in this script - the e-retailer editor strips them */
function el(tag,cls,text){var e=document.createElement(tag);if(cls)e.className=cls;if(text)e.textContent=text;return e}
function link(href,text,hidden){var a=el('a',null,text);a.href=href;if(hidden)a.tabIndex=-1;return a}
function sep(){return el('span','ce-bf-sep','●')}
function group(hidden){
var g=el('div','ce-bf-group');
if(hidden)g.setAttribute('aria-hidden','true');
var first=link(SALE_URL,'',hidden);
first.appendChild(el('span','ce-bf-hl','Black Friday'));
first.appendChild(document.createTextNode(' Up to 50% off · Ends Mon 30 Nov'));
g.appendChild(first);g.appendChild(sep());
deals.forEach(function(d){g.appendChild(link(d[1],d[0],hidden));g.appendChild(sep())});
return g;
}
/* Black Friday Sale logo on the right-hand end of the black menu bar, centred in the bar - desktop only, scales to the space after the menu, hides if it will not fit */
function addLogo(hdr){
var h1=hdr.querySelector('h1.logo')||hdr.querySelector('.logo.relative-logo');if(!h1||document.getElementById('ce-bf-logo'))return;
var a=el('a');a.id='ce-bf-logo';a.href=SALE_URL;a.title='Shop the Black Friday Sale';a.setAttribute('aria-label','Shop the Black Friday Sale');
var im=el('span');im.className='ce-bfl';var w1=el('b');w1.textContent='Black';var w2=el('i');w2.textContent='Friday';var w3=el('u');w3.textContent='sale';im.appendChild(w1);im.appendChild(w2);im.appendChild(w3);a.appendChild(im);
/* same fonts as the homepage banner, loaded on every page */
var lf=document.getElementById('ce-bfh-font');if(!lf){lf=el('link');lf.id='ce-bfh-font';lf.rel='stylesheet';lf.href='https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@800;900&family=Inter:wght@400;500;600;700&family=Kaushan+Script&display=swap';document.head.appendChild(lf)}
if(document.fonts&&document.fonts.ready)document.fonts.ready.then(function(){place()});
/* goes inside the black menu bar so it sits above the menu layer and can be hovered and clicked */
(document.getElementById('ctl00_HeaderMiddle_pnlContentContainerData')||h1.parentNode).appendChild(a);
var RATIO=690/160,GAP=24,EDGE=30,MAXH=68,MINH=30;
function place(){
var last=null;Array.prototype.forEach.call(hdr.querySelectorAll('ul.mainMenuTop > li'),function(li){if(li.offsetWidth)last=li});
if(768 > innerWidth||!last){a.style.display='none';return}
a.style.display='block';
var bar=document.getElementById('ctl00_HeaderMiddle_pnlContentContainerData')||h1;
var pr=(a.offsetParent||hdr).getBoundingClientRect(),hr=hdr.getBoundingClientRect(),br=bar.getBoundingClientRect(),mr=last.getBoundingClientRect();
var room=hr.right-EDGE-mr.right-GAP,h=Math.min(MAXH,br.height*0.8);
im.style.fontSize=h+'px';var w=im.offsetWidth;
if(w > room){h=h*room/w;im.style.fontSize=h+'px';w=im.offsetWidth}
if(MINH > h){a.style.display='none';return}
a.style.left=Math.round(hr.right-EDGE-w-pr.left)+'px';
/* centred top-to-bottom in the black menu bar */
a.style.top=Math.round(br.top-pr.top+(br.height-h)/2)+'px';
}
place();window.addEventListener('resize',place);window.addEventListener('load',place);
setTimeout(place,300);setTimeout(place,1500);
if(window.ResizeObserver)new ResizeObserver(place).observe(h1);
/* the site's own script moves the main logo by changing a style on the header, so follow it */
if(window.MutationObserver)new MutationObserver(place).observe(hdr,{attributes:true,attributeFilter:['style','class']});
}
/* Black Friday homepage hero: adds the red-to-black banner to the homepage carousel and shows it first.
It is added at the END of the slide list so the slider's own script keeps its slide numbering, then shown on load and slotted back in after the last slide. */
function addHero(){
var car=document.getElementById('proCarousel'),tpl=document.getElementById('ce-bfh-tpl');
if(!car||!tpl||!tpl.content||document.querySelector('.ce-bfh'))return;
var inner=car.querySelector('.carousel-inner');if(!inner)return;
var f=document.getElementById('ce-bfh-font');
if(!f){f=el('link');f.id='ce-bfh-font';f.rel='stylesheet';f.href='https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@800;900&family=Inter:wght@400;500;600;700&family=Kaushan+Script&display=swap';document.head.appendChild(f)}
var item=el('div','carousel-item');item.appendChild(tpl.content.cloneNode(true));
var cur=inner.querySelector('.carousel-item.active');if(cur)cur.classList.remove('active');
item.classList.add('active');inner.appendChild(item);
car.classList.add('ce-bfh-ready');
/* sale period: Black Friday is the only homepage banner - the other slides are taken out of the page here (nothing is deleted; they come back automatically after the sale) */
Array.prototype.slice.call(inner.children).forEach(function(c){if(c!==item&&c.classList.contains('carousel-item'))inner.removeChild(c)});
car.classList.add('ce-bfh-only');
car.addEventListener('slide.bs.carousel',function(e){e.preventDefault()});
var hero=item.querySelector('.ce-bfh'),t,ht,shownAt=Date.now(),userAt=0,HOLD=10000;
function myIdx(){var k=0,n=-1;Array.prototype.forEach.call(inner.children,function(c){if(c.classList.contains('carousel-item')){if(c===item)n=k;k++}});return n}
function inst(){return window.bootstrap&&window.bootstrap.Carousel&&window.bootstrap.Carousel.getInstance(car)}
function play(){var bx=hero.querySelectorAll('.bfx');Array.prototype.forEach.call(bx,function(b){b.classList.remove('run')});void hero.offsetWidth;Array.prototype.forEach.call(bx,function(b){b.classList.add('run')})}
/* the artwork is drawn at 1440x720 (desktop) and 390x780 (mobile) and scaled to the slider width */
var dEl=hero.querySelector('.ce-bfh-d'),mEl=hero.querySelector('.ce-bfh-m');
function fit(){var w=hero.clientWidth;if(!w)return;if(dEl)dEl.style.transform='scale('+(w/1440)+')';if(mEl)mEl.style.transform='scale('+(w/390)+')'}
fit();window.addEventListener('resize',fit);if(window.ResizeObserver)new ResizeObserver(fit).observe(hero);
/* wait (max 1.2s) for the Inter font so the text does not jump from Arial */
var started=false;function start(){if(started)return;started=true;shownAt=Date.now();play();clearTimeout(hdrT);hdrT=setTimeout(hdrBlack,2100)}
function fontThenStart(){if(document.fonts&&document.fonts.load){Promise.all([document.fonts.load('900 40px "Big Shoulders Display"'),document.fonts.load('600 20px Inter'),document.fonts.load('40px "Kaushan Script"')]).then(start,start)}else start()}
if(f.sheet)fontThenStart();else{f.addEventListener('load',fontThenStart);f.addEventListener('error',start)}
setTimeout(start,1200);
function user(){userAt=Date.now()}
car.addEventListener('pointerdown',user,true);car.addEventListener('keydown',user,true);
car.addEventListener('slide.bs.carousel',function(e){
var now=Date.now(),me=myIdx(),auto=now-userAt>1500;
/* keep this slide up for 10s unless the shopper clicks or swipes */
if(e.from===me&&auto&&HOLD > now-shownAt){
e.preventDefault();clearTimeout(ht);
ht=setTimeout(function(){var c=inst();if(c)c.next()},HOLD-(now-shownAt));
return;
}
/* when the slider loops from the last original slide back to the first, show this slide first */
if(auto&&e.from===me-1&&e.to===0){
e.preventDefault();setTimeout(function(){var c=inst();if(c)c.to(me)},0);
}
});
car.addEventListener('slid.bs.carousel',function(e){if(e.relatedTarget===item||e.to===myIdx()){shownAt=Date.now();play()}else{clearTimeout(ht)}});
}
function init(){
var hdr=document.getElementById('ctl00_divHeader');
if(!hdr||document.getElementById('ce-bf-bar')) return;
var bar=el('div');bar.id='ce-bf-bar';
bar.setAttribute('role','region');bar.setAttribute('aria-label','Black Friday deals');
var track=el('div','ce-bf-track');
track.appendChild(group(false));track.appendChild(group(true));
bar.appendChild(track);
hdr.insertBefore(bar,hdr.firstChild);hdr.classList.add('ce-bf-on');addLogo(hdr);addHero();
/* constant speed (~70px per second) whatever the text length */
track.style.setProperty('--ce-bf-dur',Math.round(track.scrollWidth/2/70)+'s');
/* push page content down by the bar height so nothing hides under the fixed header */
var main=document.querySelector('.maincontent');
function offset(){
if(!main) return;
main.style.marginTop='';
/* only needed when the header is fixed (desktop); on mobile it is sticky and already pushes content down */
if(getComputedStyle(hdr).position!=='fixed') return;
var base=parseFloat(getComputedStyle(main).marginTop)||0;
main.style.marginTop=(base+bar.offsetHeight)+'px';
}
offset();
var t;window.addEventListener('resize',function(){clearTimeout(t);t=setTimeout(offset,150)});
}
/* run straight away if the header and homepage slider are already on the page, so the slide is in before the slider script counts its slides */
if(document.readyState!=='loading'||(document.getElementById('ctl00_divHeader')&&document.getElementById('proCarousel'))) init(); else document.addEventListener('DOMContentLoaded',init);
})();
;(function(){
/* Black Friday promo page: live countdown, and keeps the jump-to bar under the fixed header */
function run(){
var c=document.getElementById('bfp-count');if(!c)return;
var de=document.documentElement;function sbw(){de.style.setProperty('--bfp-sbw',Math.max(0,innerWidth-de.clientWidth)+'px')}sbw();window.addEventListener('resize',sbw);
/* full-bleed to the real screen edges on any device */
var bp=document.querySelector('.bfp');function bleed(){if(!bp||!bp.parentElement)return;var pl=bp.parentElement.getBoundingClientRect().left;bp.style.left='0';bp.style.marginLeft=(-pl)+'px';bp.style.marginRight='0';bp.style.width=de.clientWidth+'px'}bleed();window.addEventListener('resize',bleed);window.addEventListener('load',bleed);if(window.ResizeObserver)new ResizeObserver(bleed).observe(de);
var st=new Date(c.getAttribute('data-start')).getTime(),en=new Date(c.getAttribute('data-end')).getTime();
var lab=c.querySelector('[data-l]'),u={};['d','h','m','s'].forEach(function(k){u[k]=c.querySelector('[data-u="'+k+'"]')});
function pad(n){return (10 > n?'0':'')+n}
function tick(){var now=Date.now(),pre=st > now,t=Math.max(0,(pre?st:en)-now),s=Math.floor(t/1000);
if(lab)lab.textContent=pre?'Sale starts in':(t?'Sale ends in':'Sale has ended');
if(u.d)u.d.textContent=Math.floor(s/86400);if(u.h)u.h.textContent=pad(Math.floor(s%86400/3600));if(u.m)u.m.textContent=pad(Math.floor(s%3600/60));if(u.s)u.s.textContent=pad(s%60);
if(!t&&!pre){c.classList.add('bfp-ended');return}
setTimeout(tick,1005-now%1000)}
tick();
var nav=document.querySelector('.bfp-nav'),hdr=document.getElementById('ctl00_divHeader');
function top(){if(!nav||!hdr)return;var p=getComputedStyle(hdr).position,b=(p=='fixed'||p=='sticky')?Math.max(0,Math.round(hdr.getBoundingClientRect().bottom)):0;nav.style.setProperty('--bfp-top',b+'px');Array.prototype.forEach.call(document.querySelectorAll('.bfp-cat,.bfp-more'),function(x){x.style.scrollMarginTop=(b+nav.offsetHeight+16)+'px'})}
top();window.addEventListener('resize',top);window.addEventListener('scroll',top,{passive:true});
}
if(document.readyState=='loading')document.addEventListener('DOMContentLoaded',run);else run();
})();