function forceReflow(s){$(s).each(function(s,h){h.offsetHeight})}!function(s,h,t,e,a){function p(){var s=this._cloneProps(new this.constructor(this.mode,this.startPosition,this.loop));return s.gotoAndStop(this.currentFrame),s.paused=this.paused,s.framerate=this.framerate,s}function i(s,h,e){var a=t.extend(s,t.MovieClip);return a.clone=p,a.nominalBounds=h,a.frameBounds=e,a}var _;s.webFontTxtInst={};var r=0,A=0,g=[],n=[];s.ssMetadata=[],s.updateListCache=function(s){for(var h=0;h0)for(var h=0;h0&&(stage.scaleX=stage.scaleY=stage.scaleX-.15),lastW=t,lastH=e,lastS=i},window.addEventListener("resize",Canvas.canvasResize[id]),Canvas.canvasResize[id](),createjs.Ticker.setFPS(24),createjs.Ticker.addEventListener("tick",stage)},canvasShow:function(s){var h=$(s).attr("data-anim")||$(s).attr("data-bg");$(s).find(".canv").remove(),$(s).append('
'),$("#"+h).appendTo($(s).find(".canv")),Canvas.canvasResize[h]()},canvasHide:function(s){var h=$(s).attr("data-anim")||$(s).attr("data-bg");$(s).find("canvas").appendTo("ul.cnv li[data-id=li"+h+"]")},init:function(){var s=$("body").append('').find("ul.cnv");$("*[data-anim],*[data-bg]").each(function(){var h=$(this).attr("data-anim")||$(this).attr("data-bg");0==$(s).find("li[data-id=li"+h+"]").length&&$(s).append('
  • ')}),$(s).children().each(function(){Canvas.canvasInit($(this).find("canvas").attr("id"))}),$("*[data-anim]").hoverIntent({over:function(){var s=this;$(s).hasClass(".trans")&&!$(s).hasClass(".inview")||(Canvas.canvasShow(s),$(s).find(".canv").animate({opacity:1},Canvas.canvasOpac))},out:function(){var s=this;$(s).find(".canv").animate({opacity:0},Canvas.canvasOpac,function(){Canvas.canvasHide(s)})},timeout:10})}},cbModule=function(){var s=function(){h()},h=function(){console.log("init RR pill");var s=$(".pill-accordion");s.length>0&&s.each(function(s,h){$(h).find(".label-wrap").each(function(s,a){$(a).find(".hex").on("click",function(){if($(a).hasClass("open"))$(a).removeClass("open").addClass("closed"),e(a);else{var s=$(h).find(".label-wrap.open");$(s).removeClass("open").addClass("closed"),e(s),$(a).removeClass("closed").addClass("open"),t(a)}})})})},t=function(s){var h=$(s).find(".hex");$(s).find(".desc");$(h).html("-")},e=function(s){var h=$(s).find(".hex");$(s).find(".desc");$(h).html("+")};return{init:s}}(),Home=function(){function s(){this._arr=[]}var h="",t="normal-trans expand-trans shrink-trans expand shrink normal-trans-ty expand-trans-ty shrink-trans-ty expand-ty shrink-ty",e=function(){if(console.log("INIT HOME 2"),$(".rotator ul li").length>1)_(),i();else if(1==$(".rotator ul li").length){var s=$(".rotator ul li[data-bg]");Canvas.canvasShow(s)}};s.prototype.set=function(s,h){this._arr[s]=h},s.prototype.get=function(s){return s===this._arr.length?this._arr[0]:-1===s?this._arr[this._arr.length-1]:this._arr[s]};var a=function(s,t){var e=s.get(t),a=s.get(t+1);e.addClass("expand-trans"+h),a.addClass("shrink"+h),forceReflow(a),a.addClass("normal-trans"+h)},p=function(s,t){var e=s.get(t),a=s.get(t-1);e.addClass("shrink-trans"+h),a.addClass("expand"+h),forceReflow(a),a.addClass("normal-trans"+h)},i=function(){var h,e=0,i=$(".rotator ul"),_=i.find("li"),r=_.length,A=new s;_.each(function(s,h){A.set(s,$(h).find("img"))}),i.slick({slide:"li",speed:500,fade:!0,cssEase:"linear",arrows:!0,dots:!1,autoplay:!0}).on("beforeChange",function(s,t,i,_){e=i,h=_,e===r-1&&0===_?a(A,e):0===e&&_===r-1?p(A,e):e<_?a(A,e):e>_&&p(A,e)}).on("afterChange",function(s,h,a){A.get(e).removeClass(t),A.get(e+1).removeClass(t),A.get(e-1).removeClass(t)}).on("swipe",function(){}),Canvas.canvasShow($(".rotator"))},_=function(){enquire.register("screen and (min-width: 1024px)",{match:function(){h="-ty"},unmatch:function(){h=""},setup:function(){},deferSetup:!0,destroy:function(){}})};return{init:e}}();$(document).ready(function(){$(".toggle-brands").click(function(){$(this).hasClass("state-closed")?$(".brands").css("max-height",31+$(".brands-list").height()+"px"):$(".brands").css("max-height","81px"),$(this).toggleClass("state-closed")})});var Product=function(){var s=function(){console.log("INIT PRODUCT PAGE"),h(),t()},h=function(){console.log("bind Lightbox"),$("a[data-lightbox]").each(function(s,h){var t=$(h).find("img").attr("src");$(h).attr("href",t)}),lightbox.option({resizeDuration:200,wrapAround:!0,showImageNumberLabel:!1,disableScrolling:!0})},t=function(){var s={normal:{converter:.5},forte:{converter:.25}};$(".how-count").each(function(){var h=$(this),t=$('input[name="kg"]',h),e=$('input[name="g"]',h),a=$(".dose",h),p=$(".result dfn",h),i=$(this).hasClass("forte"),_=i?s.forte:s.normal;$("input",h).focus(function(){$(".focus",h).removeClass("focus"),$(this).parent().addClass("focus"),a.text(""),p.text(" "),$(".error",h).hide(),$(".remember, .result",h).show()}).on("keypress",function(s){var h=s.charCode>=48&&s.charCode<=57;return h&&($(this).val().length?$(this).css("width","3rem"):$(this).css("width","2rem")),h}),$("button",h).click(function(){if($(".focus",h).removeClass("focus"),$(".remember, .result, .error",h).hide(),0===t.val().length)return t.focus(),!1;var s=parseInt(t.val()||0)+parseInt(e.val()||0)/(parseInt(e.val()||0)>10?100:10);if(s<5)$(".error.few",h).show();else if(s>40)$(".error.alot",h).show();else{$(".remember, .result",h).show(),$(".error",h).hide();var i=Math.round(s*_.converter*100)/100,r=s<5?0:s>=7.7&&s<10?"3-4":"3";i+="",a.addClass("focus").text(i.replace(".",",")+" ml"),p.text(r)}})})};return{init:s}}();