/*
 imagesLoaded PACKAGED v4.1.0
 JavaScript is all like "You images are done yet or what?"
 MIT License
*/
isdesktop="screen and (min-width: 1025px)";istablet="screen and (min-width: 741px) and (max-width: 1024px)";ismobile="screen and (max-width: 740px)";
enquire.register("screen and (min-width: 1025px)",{match:function(){$("body").addClass("desktop")},unmatch:function(){$("body").removeClass("desktop")}}).register("screen and (min-width: 741px) and (max-width: 1024px)",{match:function(){$("body").addClass("tablet")},unmatch:function(){$("body").removeClass("tablet")}}).register("screen and (max-width: 740px)",{match:function(){$("body").addClass("mobile")},unmatch:function(){$("body").removeClass("mobile")}});
$(window).on("resize",function(){"no-repeat"==$("body").css("background-repeat")==1&&$("body").addClass("thisistablet");$(".thisistablet").length&&$(".nav ul > li > a").click(function(a){$(this).hasClass("opennow")||($(this).addClass("opennow"),$(this).parent("li").hasClass("js-togglesubnav")&&a.preventDefault())})}).resize();
function deviceimages(){$(window).on("resize",function(){$("body").hasClass("mobile")||$("img[data-src]").each(function(){var a=$(this).data("src");$(this).prop("src",a)})}).resize()}deviceimages();function liftcurtain(){$(document).unbind("keydown");$("#curtain, #popup").remove()}
function dropcurtain(a){liftcurtain();$(document).on("keydown",function(a){27==a.keyCode&&liftcurtain()});$(document).scrollTop();$(document.body).prepend('<div id="curtain"></div><div id="popup" class="loading '+a+'" style="position:inherit;"></div>');$(document).on("click touchend","#curtain, #popup #close-popup",liftcurtain)}
function loadpopup(a,b,c,d){dropcurtain(a);"undefined"==typeof d&&(d="");c=c?c:{};c.requestsource="ajax";$.get(b,c,function(a){$("#popup").html(a).removeClass("loading");li_scrolltop=$(document).scrollTop();$(".generic-popup, .n-popupWrap").css("top",li_scrolltop+50+"px")}).done(d)}function istablet(){var a=$(window).width();return 740<=a&&1024>=a}function isdesktop(){return 1024<$(window).width()}function isdttab(){return 740<$(window).width()}function ismobile(){return 740>$(window).width()}
function istabmob(){return 1024>=$(window).width()}function setcookie(a,b,c){var d=new Date;d.setTime(d.getTime()+c);c="expires="+d.toUTCString();document.cookie=a+"="+b+"; "+c+"; path=/"}function deletecookie(a){document.cookie=a+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"}function getcookie(a){a+="=";for(var b=document.cookie.split(";"),c=0;c<b.length;c++){for(var d=b[c];" "==d.charAt(0);)d=d.substring(1);if(-1!=d.indexOf(a))return d.substring(a.length,d.length)}return""}
function popuphelpcvc(a){a.preventDefault();loadpopup("cvc-info","/cvc-info-popup")}$(document).on("click",".cvc-info-pop",popuphelpcvc);
$(document).ready(function(){$(document).on("click",".closepop, #curtain",function(){liftcurtain()});$("#mob-nav-toggler, #mob-nav-toggler-new").on("click",function(){$("body").toggleClass("j-mobmenu");$(".menuIcon").toggleClass("j-active");$("#mobmenu, .outer-wrapper").toggleClass("active")});$("#closeMobMenu").on("click",function(){$("#mobmenu, .outer-wrapper").removeClass("active");$(".menuIcon").removeClass("j-active");$("body").removeClass("j-mobmenu")});$(".main-nav h2").on("click",function(){$("body").hasClass("desktop")||
(console.log("detected"),$(this).siblings(".submenu-outer").slideToggle(),$(this).toggleClass("j-mobActive"))});$(document).on("click",".js-login",function(){$("#mobmenu, .outer-wrapper").removeClass("active");$(".menuIcon").removeClass("j-active");$("body").removeClass("j-mobmenu")});$(".footer-col h3").on("click",function(){$("body").hasClass("mobile")&&($(this).hasClass("js-active")?($(this).removeClass("js-active"),$(".footer-col h3").next("ul").slideUp()):($(".footer-col h3").not(this).next("ul").slideUp(),
$(".footer-col h3").removeClass("js-active"),$(this).addClass("js-active"),$(this).next("ul").slideDown()))});$(".cart-wrap").on("mouseenter",function(){$("#cart-details-wrap-hovered").show();$("#cart-details-wrap-hovered").on("mouseleave",function(){$(this).hide()})});$.fn.owlCarousel&&$(".promo-text-wrap.owl-carousel").owlCarousel({mouseDrag:!1,touchDrag:!1,freeDrag:!1,loop:!0,items:1,autoplay:!0,autoplayTimeout:2E3,nav:!1,animateIn:"fadeIn",animateOut:"fadeOut"});$(window).on("resize",function(){var a=
$(".promo-banner-slider");0>=a.length||enquire.register("screen and (max-width: 920px)",{match:function(){$.fn.owlCarousel&&a.owlCarousel({loop:!0,items:1,autoplay:!0,autoplayTimeout:2E3,nav:!1,responsiveClass:!0})},unmatch:function(){a.length&&"undefined"!=typeof a.data("owlCarousel")&&(a.data("owlCarousel").destroy(),a.trigger("destroy.owl.carousel").removeClass("owl-carousel owl-loaded"),a.find(".owl-stage-outer").children().unwrap())}})}).resize();$(".mobSearch").click(function(){$(this).toggleClass("j-mobSearchOpen");
$(".search-wrap.mobSearchTrig").toggle();$(".search-wrap.mobSearchTrig input").focus();$(".fixedSearchToggler").hasClass("j-mobSearchOpen")?$(".backToProdTop").css("top","110px"):$(".backToProdTop").css("top","50px")});istabmob&&$(".account-lists-toggler").click(function(){$(this).next("ul").toggleClass("js-active");$(this).next("ul").find("a").click(function(){$(".account-lists-toggler").next("ul").removeClass("js-active")})});$(".category-lists-toggler").click(function(){$(this).next(".category-lists").slideToggle();
$(this).next("ul").find("a").click(function(){$(".category-lists-toggler").next("ul").hide()})});$(".region-list li a").click(function(){$(".region-list li.active").removeClass("active");$(this).parent().addClass("active");var a=$(this).data("location");$(".location-list.js-selected").removeClass("js-selected");$('.location-list[data-location="'+a+'"]').addClass("js-selected")});istabmob&&$(".region-list-toggler").click(function(){$(this).next(".region-list").slideToggle();$(this).next("ul").find("a").click(function(){$(".region-list-toggler").next("ul").hide()})});
ismobile&&$(".location-list-toggler").click(function(){$(this).next(".location-list").slideToggle();$(this).next("ul").find("a").click(function(){$(".location-list-toggler").next("ul").hide()})});$.fn.owlCarousel&&$(".blog-slider").owlCarousel({loop:!0,items:4,nav:!0,navText:['<i class="ion-ios-arrow-left"></i>','<i class="ion-ios-arrow-right"> </i>'],responsive:{0:{items:1},740:{items:3},1024:{items:4}}});$(".deliv-opt").click(function(){if(!$(this).find(".deliv-label").hasClass("js-deliv-selected")){$(this).find(".deliv-label").addClass("js-deliv-selected");
$(".deliv-opt").not(this).find(".deliv-label").removeClass("js-deliv-selected");var a=$(this).find(".deliv-label").data("delivery");$(".deliv-opt-details").removeClass("hidden");$(".deliv-opt-details").addClass("hidden");$('.deliv-opt-details[data-delivery="'+a+'"]').removeClass("hidden")}});$(document).on("click",".j-choosecard",function(){$(".j-choosecard").removeClass("j-card-selected");$(this).addClass("j-card-selected");ls_id=$(this).data("id");$(".cc-wrap").removeClass("hidden");$(".cc-wrap").addClass("hidden");
$('.cc-wrap[data-id="'+ls_id+'"]').removeClass("hidden")});$("#use-this").click(function(){$("#use-this").is(":checked")?$(".billing-add").hide():$(".billing-add").show()});$(document).on("click",".js-togglegiftcards",function(a){a.preventDefault();$(".gc-amount-wrap li").each(function(){ls_inactiveimage=$("img",this).data("inactive");$("img",this).attr("src",ls_inactiveimage);$("img",this).removeClass("js-selected")});ls_activeimage=$("img",this).data("active");$("img",this).attr("src",ls_activeimage);
$("img",this).addClass("js-selected")});if(ismobile)$(document).on("click",".sizeguide-lists-toggler",function(){$(this).next(".sizeguide-lists").slideToggle("fast");$(this).next("ul").find("a").click(function(){$(".sizeguide-lists-toggler").next("ul").hide()})});$("html").on("click",function(){$(".js-typeahead").hide()});$(".mailerList li a").click(function(){var a=$(this).data("category");$(".mailerWrap").hide();$(".mailerList li").removeClass("active").filter($(this).parent()).addClass("active");
$(".mailerWrap").hide().removeClass("j-selectedMailer");$('.mailerWrap[data-category="'+a+'"]').show().addClass("j-selectedMailer")});ismobile&&$(".faq-lists-toggler").click(function(){$(this).next(".faq-lists").slideToggle();$(this).next("ul").find("a").click(function(){$(".faq-lists-toggler").next("ul").hide()})});ismobile&&$(".mailerListToggler").click(function(){$(this).next(".mailerList").slideToggle();$(this).next("ul").find("a").click(function(){$(".mailerListToggler").next("ul").hide()})});
$("#pageBrands .filter").click(function(){$("#pageBrands .filter").removeClass("j-currentBrand");$(this).addClass("j-currentBrand");ls_pageurl=$(this).data("url");History.pushState(null,document.title,ls_pageurl)});$(".filterListTrigger").click(function(){$(".filterListTrigger").not(this).removeClass("j-open");$(this).toggleClass("j-open");$(".filterListTrigger").not(this).next(".filterList").slideUp();$(this).next(".filterList").slideToggle()});$(".filterList li").click(function(){$(this).toggleClass("j-selected")})});
$(".filter-list-wrap-outer").css({position:"relative",top:"auto",height:"auto"});
function filterheight(){var a=$(".category-listing"),b=$(window).outerHeight()-200,c=$(".category-listing").outerHeight();b=b>c?c:b;$("footer").outerHeight();$("header").outerHeight();$(".category-banner").outerHeight();c=2*($(".category-item").outerHeight()+33);var d=$(".js-catlist").outerHeight();$("body").hasClass("desktop")&&a.length&&($(".category-listing").offset(),d>c&&($(this).scrollTop()>$(".category-listing").offset().top-55?($(".filter-list-wrap-outer").css({height:b-30+"px",overflow:"scroll"}),
$(".filter-list-wrap-outer").css({position:"fixed",top:"55px"})):$(".filter-list-wrap-outer").css({position:"relative",top:"auto",height:"auto"})))}$(window).scroll(function(){filterheight()});$(window).resize(function(){li_width=$(window).width();710>li_width?$.each($(".banner-small"),function(a,b){console.log(b);$(b).css("max-height","")}):$(".banner-small").css("max-height",$(this).data("height")+"px")});
!function(a,b){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",b):"object"==typeof module&&module.exports?module.exports=b():a.EvEmitter=b()}(this,function(){function a(){}var b=a.prototype;return b.on=function(a,b){if(a&&b){var c=this._events=this._events||{};c=c[a]=c[a]||[];return-1==c.indexOf(b)&&c.push(b),this}},b.once=function(a,b){if(a&&b){this.on(a,b);var c=this._onceEvents=this._onceEvents||{};return(c[a]=c[a]||[])[b]=!0,this}},b.off=function(a,b){var c=this._events&&
this._events[a];if(c&&c.length){var d=c.indexOf(b);return-1!=d&&c.splice(d,1),this}},b.emitEvent=function(a,b){var c=this._events&&this._events[a];if(c&&c.length){var d=0,g=c[d];b=b||[];for(var k=this._onceEvents&&this._onceEvents[a];g;){var l=k&&k[g];l&&(this.off(a,g),delete k[g]);g.apply(this,b);d+=l?0:1;g=c[d]}return this}},a});
(function(a,b){"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(c){return b(a,c)}):"object"==typeof module&&module.exports?module.exports=b(a,require("ev-emitter")):a.imagesLoaded=b(a,a.EvEmitter)})(window,function(a,b){function c(a,b){for(var f in b)a[f]=b[f];return a}function d(a){var b=[];if(Array.isArray(a))b=a;else if("number"==typeof a.length)for(var f=0;f<a.length;f++)b.push(a[f]);else b.push(a);return b}function e(a,b,m){return this instanceof e?("string"==typeof a&&
(a=document.querySelectorAll(a)),this.elements=d(a),this.options=c({},this.options),"function"==typeof b?m=b:c(this.options,b),m&&this.on("always",m),this.getImages(),k&&(this.jqDeferred=new k.Deferred),void setTimeout(function(){this.check()}.bind(this))):new e(a,b,m)}function h(a){this.img=a}function g(a,b){this.url=a;this.element=b;this.img=new Image}var k=a.jQuery,l=a.console;e.prototype=Object.create(b.prototype);e.prototype.options={};e.prototype.getImages=function(){this.images=[];this.elements.forEach(this.addElementImages,
this)};e.prototype.addElementImages=function(a){"IMG"==a.nodeName&&this.addImage(a);!0===this.options.background&&this.addElementBackgroundImages(a);var b=a.nodeType;if(b&&n[b]){var c=a.querySelectorAll("img");for(b=0;b<c.length;b++)this.addImage(c[b]);if("string"==typeof this.options.background)for(a=a.querySelectorAll(this.options.background),b=0;b<a.length;b++)this.addElementBackgroundImages(a[b])}};var n={1:!0,9:!0,11:!0};return e.prototype.addElementBackgroundImages=function(a){var b=getComputedStyle(a);
if(b)for(var c=/url\((['"])?(.*?)\1\)/gi,f=c.exec(b.backgroundImage);null!==f;)(f=f&&f[2])&&this.addBackground(f,a),f=c.exec(b.backgroundImage)},e.prototype.addImage=function(a){a=new h(a);this.images.push(a)},e.prototype.addBackground=function(a,b){var c=new g(a,b);this.images.push(c)},e.prototype.check=function(){function a(a,c,f){setTimeout(function(){b.progress(a,c,f)})}var b=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(b){b.once("progress",
a);b.check()}):void this.complete()},e.prototype.progress=function(a,b,c){this.progressedCount++;this.hasAnyBroken=this.hasAnyBroken||!a.isLoaded;this.emitEvent("progress",[this,a,b]);this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,a);this.progressedCount==this.images.length&&this.complete();this.options.debug&&l&&l.log("progress: "+c,a,b)},e.prototype.complete=function(){var a=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(a,[this]),this.emitEvent("always",
[this]),this.jqDeferred)this.jqDeferred[this.hasAnyBroken?"reject":"resolve"](this)},h.prototype=Object.create(b.prototype),h.prototype.check=function(){return this.getIsImageComplete()?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},h.prototype.getIsImageComplete=
function(){return this.img.complete&&void 0!==this.img.naturalWidth},h.prototype.confirm=function(a,b){this.isLoaded=a;this.emitEvent("progress",[this,this.img,b])},h.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},h.prototype.onload=function(){this.confirm(!0,"onload");this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror");this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this);this.proxyImage.removeEventListener("error",
this);this.img.removeEventListener("load",this);this.img.removeEventListener("error",this)},g.prototype=Object.create(h.prototype),g.prototype.check=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);this.img.src=this.url;this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},g.prototype.unbindEvents=function(){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this)},g.prototype.confirm=
function(a,b){this.isLoaded=a;this.emitEvent("progress",[this,this.element,b])},e.makeJQueryPlugin=function(b){(b=b||a.jQuery)&&(k=b,k.fn.imagesLoaded=function(a,b){return(new e(this,a,b)).jqDeferred.promise(k(this))})},e.makeJQueryPlugin(),e});window.onorientationchange=function(){switch(window.orientation){case 0:case 90:case -90:window.location.reload()}};
function gridHeight(){$("#pageTrends .gridContainer, #pageTrendsNew .gridContainer").imagesLoaded(function(){$("#pageTrends .gridContainer > div, #pageTrendsNew .gridContainer > div").removeAttr("style");var a=-1;$("#pageTrends .gridContainer > div, #pageTrendsNew .gridContainer > div").each(function(){a=a>$("#pageTrends .gridContainer > div, #pageTrendsNew .gridContainer > div").height()?a:$("#pageTrends .gridContainer > div, #pageTrendsNew .gridContainer > div").height()});$("#pageTrends .gridContainer > div, #pageTrendsNew .gridContainer > div").each(function(){$("#pageTrends .gridContainer > div, #pageTrendsNew .gridContainer > div").height(a)})})}
$(window).load(function(){gridHeight()});$(window).resize(function(){gridHeight()});$(document).ready(function(){$(window).on("scroll resize",function(){var a=$("header"),b=$(".navTop"),c=$(".navBot");$(window).scrollTop()>b.height()?a.addClass("headerIsFixed"):(a.removeClass("headerIsFixed"),c.show())});$(".fixedSearchToggler").on("click",function(){$(".navBot").toggle()});$(".selectButtonWrap a").on("click",function(){$(this).parent(".selectButtonWrap").find("a").removeClass("j-selected");$(this).addClass("j-selected")})});
$(function(){$('a[href*="#"]:not([href="#"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){var a=$(this.hash);a=a.length?a:$("[name="+this.hash.slice(1)+"]");if(a.length)return $("html, body").animate({scrollTop:a.offset().top-150},500),!1}})});
$(window).scroll(function(){var a=$("#page-product-B .left-col").height(),b=$("#page-product-B .rightInner").height();a+=b;$("body").hasClass("mobile")&&($(window).scrollTop()>a?$(".backToProdTop").removeClass("hidden"):$(".backToProdTop").addClass("hidden"))});$(document).on("click",".registerGcWrapToggler",function(){$(".registerGcWrap").slideToggle()});$(document).on("click",".promoFormToggler",function(){$(this).find("i").toggleClass("ion-ios-arrow-down ion-ios-arrow-up");$(".promoForm").slideToggle()});
$(document).on("click",".coPaymentTitle",function(){$(this).addClass("active");$(this).next(".paymentType").slideDown();$(".coPaymentTitle").not(this).removeClass("active");$(".coPaymentTitle").not(this).next(".paymentType").slideUp()});$(".pageLaybuy .question").on("click",function(a){$(".pageLaybuy .question").not(this).next(".answer").slideUp();$(".pageLaybuy .question").not(this).removeClass("j-qActive");$(this).toggleClass("j-qActive");$(this).next(".answer").slideToggle()});
$(document).on("click",".laybuyPopLink",function(){var a=$(this).data("value");po_data={};po_data.v=a;loadpopup("laybuyPopup","/laybuy-popup",po_data)});var li_storeuser=getcookie("ci_storeuserid"),li_idlemilliseconds=18E4,li_idletimer;function resettimer(a){testpageformob("resettimer");clearTimeout(li_idletimer);li_idletimer=setTimeout(function(){deletecookie();testpageformob("logout");window.location="https://www.numberoneshoes.co.nz/logout"},li_idlemilliseconds)}
$(function(){""!=li_storeuser?(testpageformob("has store"),ls_events="mousemove click mouseup mousedown keydown keypress keyup submit change mouseenter scroll resize dblclick",$(document.body).bind(ls_events,resettimer),resettimer()):testpageformob("no store")});
function testpageformob(a){var b=$(".js-testing");0<b.length&&(0>=b.find("span."+a).length?b.append('<span class="'+a+'">'+a+': (<span class="'+a+'count" data-count="1">1</span>)</span><br/>'):(lo_count=$("."+a+"count"),li_count=parseInt(lo_count.attr("data-count"))+1,lo_count.html(li_count).attr("data-count",li_count)))}$(document).on("ready",function(){new ClipboardJS(".copyCode")});
$(document).on("click",".closeTopBar",function(a){a.preventDefault();a.stopPropagation();$(".topBar").hide();$("section").css("margin-top","80px");$(".nav .submenu-outer").css("top","85px")});