var Inyo_Product,Inyo_ExpeditedCutoffTimer;(function(n){function o(){t=jQuery("#RealTimeInventoryUri_LinkUri").val();e=jQuery("#ShippingCalculatorUri_LinkUri").val();r=jQuery("#IsReviewHelpfulUri_LinkUri").val();u=jQuery("#IsDiyStoryHelpfulUri_LinkUri").val();h();s();c();l();v();y();p()}function s(){var t=jQuery(window).width(),n;t<1024&&(n=jQuery(".carousel-link-button"),n.removeAttr("data-toggle").removeAttr("data-target").removeAttr("href").removeAttr("data-uri"))}function h(){jQuery("#txtQuantity").on("change",function(){var n=jQuery(this).val(),t=jQuery("#AddToCart").attr("href");jQuery("#AddToCart").attr("href",a(t,"Qty",n))})}function c(){var n=function(n,t,r){r.status===200?i(n.InStock):i(!1)},r=function(){i(!1)};t&&jQuery.ajax({type:"POST",url:t,contentType:"application/json; charset=utf-8",dataType:"json",success:n,error:r})}function i(n){var t,i,r,u;n&&(jQuery("#Availability").css("display","none"),t=jQuery("#BackorderDate"),i=jQuery("#InStock"),t.text().trim().length?(t.remove(),i.find("link").attr("href","https://schema.org/InStock")):i.removeClass("hidden"),r=jQuery("#backorderDate-mobile"),u=jQuery("#inStock-mobile"),r.text().trim().length?(r.remove(),u.find("link").attr("href","https://schema.org/InStock")):u.removeClass("hidden"))}function l(){var i=jQuery("#ratings"),n,t;i.length>0&&(n=jQuery("#ratings .ratings-popover-content")[0].innerHTML,t=jQuery("#ratings .ratings-popover-count")[0].innerHTML,jQuery(".ratings-popover-button").popover({placement:"auto right",content:n,title:t,html:!0,trigger:"hover focus"}))}function a(n,t,i){var r=new RegExp("([?|&])"+t+"=.*?(&|$)","i"),u=n.indexOf("?")!==-1?"&":"?";return n.match(r)?n.replace(r,"$1"+t+"="+i+"$2"):n+u+t+"="+i}function f(n,t,i,r){var u=function(n){var t=jQuery(r).closest("p")[0];t.innerHTML=t.innerHTML+" "+n.Message},f=function(){alert("Error: Sorry for the inconvenience, but we are unable to complete your request.  Please try again.")};jQuery.ajax({type:"POST",url:n+"?isHelpful="+t+"&uniqueId="+i,contentType:"application/json; charset=utf-8",crossDomain:!0,success:u,error:f})}function v(){jQuery(".review-helpful-click").on("click",function(){var n=Number(jQuery(this).attr("data-id")),t=Number(jQuery(this).attr("data-helpful"));f(r,t,n,this)})}function y(){jQuery(".diy-helpful-click").on("click",function(){var n=Number(jQuery(this).attr("data-id")),t=Number(jQuery(this).attr("data-helpful"));f(u,t,n,this)})}function p(){var i=jQuery(window).width(),n,r,t;if(i<=1024){jQuery(".panel-collapse").removeClass("in");jQuery(".collapse-button").removeClass("collapsed");jQuery(".open-accordion").on("click",function(){jQuery(".panel-collapse").removeClass("in");var n=jQuery(this).attr("data-accordion");jQuery(n).addClass("in")});n=window.location.hash;n&&(r=jQuery(n),r.length&&(t=jQuery('a[href="'+n+'"]').attr("data-accordion"),jQuery(t).addClass("in"),jQuery(t).prev(".panel-heading").find("i.indicator").toggleClass("fa-plus-circle fa-minus-circle")))}else i>1024&&(jQuery(".collapse-button").removeAttr("data-toggle").removeAttr("data-parent"),jQuery(".collapse-button").removeAttr("href").removeAttr("role").removeAttr("aria-controls"))}var e,t,r,u;n.Initialize=o})(Inyo_Product||(Inyo_Product={})),function(n){function f(n){r=new o;i=new s(n);t=new e(r,i);t.init()}var t,i,r;n.initialize=f;var e=function(){function n(n,t){this.view=n;this.timer=t;this.view.hideCountdown()}return n.prototype.init=function(){this.timer.timerUpdatedEvent.attach(this,this.timerUpdatedEventHandler);this.timer.timeUpEvent.attach(this,this.timeUpEventHandler);this.view.showCountdown();this.timer.start()},n.prototype.timerUpdatedEventHandler=function(){var t=this.timer.days*24+this.timer.hours,i=this.timer.minutes,r=this.timer.seconds,n=this.timer.getNumberOfCalendarDatesUntilTarget();if(n>=1){this.view.hideCountdown();return}this.view.renderCountdownClock(t,i,r,n)},n.prototype.timeUpEventHandler=function(){this.view.hideCountdown();this.timer.stop()},n}(),o=function(){function n(){this.$timer=jQuery("#timer");this.$hours=jQuery("#Hour");this.$minutes=jQuery("#Minute");this.$seconds=jQuery("#Second");this.$date=jQuery("#Date")}return n.prototype.showCountdown=function(){this.$timer.show()},n.prototype.hideCountdown=function(){this.$timer.hide()},n.prototype.renderCountdownClock=function(n,t,i,r){this.hasLessThanMinuteLeft(n,t)?(this.renderSeconds(i),this.$seconds.show(),this.$minutes.hide(),this.$hours.hide()):(this.renderMinutes(t),this.renderHours(n),this.$hours.show(),this.$minutes.show(),this.$seconds.hide());r===0?this.$date.text("today"):r===1&&this.$date.text("tomorrow")},n.prototype.hasLessThanMinuteLeft=function(n,t){return n+t===0},n.prototype.renderHours=function(n){n>1?this.$hours.text(" "+n+" hrs"):n===1?this.$hours.text(" "+n+" hr"):n===0&&this.$hours.text("")},n.prototype.renderMinutes=function(n){n>1||n===0?this.$minutes.text(" "+n+" mins "):n===1&&this.$minutes.text(" "+n+" min ")},n.prototype.renderSeconds=function(n){this.$seconds.text(" "+n+" secs ")},n}(),s=function(){function n(n){this.MILLISECONDS_IN_A_DAY=864e5;this.MILLISECONDS_IN_AN_HOUR=36e5;this.MILLISECONDS_IN_A_MINUTE=6e4;this.MILLISECONDS_IN_A_SECOND=1e3;this.targetTimeInMs=n;this.timerUpdatedEvent=new u(this);this.timeUpEvent=new u(this);this.timeoutID=-1}return n.prototype.update=function(){var n=this.getTotalMillisecondsRemaining();this.days=Math.floor(n/this.MILLISECONDS_IN_A_DAY);this.hours=Math.floor(n%this.MILLISECONDS_IN_A_DAY/this.MILLISECONDS_IN_AN_HOUR);this.minutes=Math.floor(n%this.MILLISECONDS_IN_AN_HOUR/this.MILLISECONDS_IN_A_MINUTE);this.seconds=Math.floor(n%this.MILLISECONDS_IN_A_MINUTE/this.MILLISECONDS_IN_A_SECOND);this.milliseconds=n%this.MILLISECONDS_IN_A_SECOND},n.prototype.getTotalMillisecondsRemaining=function(){return this.targetTimeInMs-Date.now()},n.prototype.timeIsUp=function(){return this.getTotalMillisecondsRemaining()<=0},n.prototype.getNumberOfCalendarDatesUntilTarget=function(){var n=new Date(this.targetTimeInMs),t=new Date(Date.now());return n.setHours(0,0,0,0),t.setHours(0,0,0,0),(n.getTime()-t.getTime())/this.MILLISECONDS_IN_A_DAY},n.prototype.start=function(){if(this.timeIsUp()){this.timeUpEvent.notify(null);return}this.update();this.timerUpdatedEvent.notify(null);this.scheduleNextUpdate(this)},n.prototype.stop=function(){this.timeoutID!==-1&&(clearTimeout(this.timeoutID),this.timeoutID=-1)},n.prototype.scheduleNextUpdate=function(n){n.timeoutID=setTimeout(function(){n.timeIsUp()?n.timeUpEvent.notify(null):(n.update(),n.timerUpdatedEvent.notify(null),n.scheduleNextUpdate(n))},n.calculateNextUpdate())},n.prototype.calculateNextUpdate=function(){var n=new Date(Date.now());return this.getTotalMillisecondsRemaining()<this.MILLISECONDS_IN_A_MINUTE?this.MILLISECONDS_IN_A_SECOND+5-n.getMilliseconds():this.MILLISECONDS_IN_A_MINUTE+5-n.getTime()%this.MILLISECONDS_IN_A_MINUTE},n}(),u=function(){function n(n){this.sender=n;this.subscribers=[]}return n.prototype.attach=function(n,t){this.subscribers.push(new h(n,t))},n.prototype.notify=function(n){for(var i,t=0;t<this.subscribers.length;t++)i=this.subscribers[t],i.handler.apply(i.listener,n,this.sender)},n}(),h=function(){function n(n,t){this.listener=n;this.handler=t}return n}()}(Inyo_ExpeditedCutoffTimer||(Inyo_ExpeditedCutoffTimer={}))