(function(window,doc){function prefixStyle(style){if(vendor==="")return style;style=style.charAt(0).toUpperCase()+style.substr(1);return vendor+style}var m=Math;var dummyStyle=doc.createElement("div").style;var vendor=function(){var vendors="t,webkitT,MozT,msT,OT".split(",");var t;var i=0;for(var l=vendors.length;i<l;i++){t=vendors[i]+"ransform";if(t in dummyStyle)return vendors[i].substr(0,vendors[i].length-1)}return false}();var cssVendor=vendor?"-"+vendor.toLowerCase()+"-":"";var transform=prefixStyle("transform");
var transitionProperty=prefixStyle("transitionProperty");var transitionDuration=prefixStyle("transitionDuration");var transformOrigin=prefixStyle("transformOrigin");var transitionTimingFunction=prefixStyle("transitionTimingFunction");var transitionDelay=prefixStyle("transitionDelay");var isAndroid=/android/gi.test(navigator.appVersion);var isIDevice=/iphone|ipad/gi.test(navigator.appVersion);var isTouchPad=/hp-tablet/gi.test(navigator.appVersion);var has3d=prefixStyle("perspective")in dummyStyle;
var hasTouch="ontouchstart"in window&&!isTouchPad;var hasTransform=vendor!==false;var hasTransitionEnd=prefixStyle("transition")in dummyStyle;var RESIZE_EV="onorientationchange"in window?"orientationchange":"resize";var START_EV=hasTouch?"touchstart":"mousedown";var MOVE_EV=hasTouch?"touchmove":"mousemove";var END_EV=hasTouch?"touchend":"mouseup";var CANCEL_EV=hasTouch?"touchcancel":"mouseup";var TRNEND_EV=function(){if(vendor===false)return false;var transitionEnd={"":"transitionend","webkit":"webkitTransitionEnd",
"Moz":"transitionend","O":"otransitionend","ms":"MSTransitionEnd"};return transitionEnd[vendor]}();var nextFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){return setTimeout(callback,1)}}();var cancelFrame=function(){return window.cancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||
window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout}();var translateZ=has3d?" translateZ(0)":"";var iScroll=function(el,options){var that=this;var i;that.wrapper=typeof el=="object"?el:doc.getElementById(el);that.wrapper.style.overflow="hidden";that.options={scroller:that.wrapper.children[0],hScroll:true,vScroll:true,x:0,y:0,bounce:true,bounceLock:false,momentum:true,lockDirection:true,useTransform:true,useTransition:false,topOffset:0,checkDOMChanges:false,handleClick:true,
hScrollbar:true,vScrollbar:true,fixedScrollbar:isAndroid,hideScrollbar:isIDevice,fadeScrollbar:isIDevice&&has3d,scrollbarClass:"",zoom:false,zoomMin:1,zoomMax:4,doubleTapZoom:2,wheelAction:"scroll",snap:false,snapThreshold:1,onRefresh:null,onBeforeScrollStart:function(e){e.preventDefault()},onScrollStart:null,onBeforeScrollMove:null,onScrollMove:null,onBeforeScrollEnd:null,onScrollEnd:null,onTouchEnd:null,onDestroy:null,onZoomStart:null,onZoom:null,onZoomEnd:null};for(i in options)that.options[i]=
options[i];that.scroller=that.options.scroller;that.x=that.options.x;that.y=that.options.y;that.options.useTransform=hasTransform&&that.options.useTransform;that.options.hScrollbar=that.options.hScroll&&that.options.hScrollbar;that.options.vScrollbar=that.options.vScroll&&that.options.vScrollbar;that.options.zoom=that.options.useTransform&&that.options.zoom;that.options.useTransition=hasTransitionEnd&&that.options.useTransition;if(that.options.zoom&&isAndroid)translateZ="";that.scroller.style[transitionProperty]=
that.options.useTransform?cssVendor+"transform":"top left";that.scroller.style[transitionDuration]="0";that.scroller.style[transformOrigin]="0 0";if(that.options.useTransition)that.scroller.style[transitionTimingFunction]="cubic-bezier(0.33,0.66,0.66,1)";if(that.options.useTransform)that.scroller.style[transform]="translate("+that.x+"px,"+that.y+"px)"+translateZ;else that.scroller.style.cssText+=";position:absolute;top:"+that.y+"px;left:"+that.x+"px";if(that.options.useTransition)that.options.fixedScrollbar=
true;that.refresh();that._bind(RESIZE_EV,window);that._bind(START_EV);if(!hasTouch)if(that.options.wheelAction!="none"){that._bind("DOMMouseScroll");that._bind("mousewheel")}if(that.options.checkDOMChanges)that.checkDOMTime=setInterval(function(){that._checkDOMChanges()},500)};iScroll.prototype={enabled:true,x:0,y:0,steps:[],scale:1,currPageX:0,currPageY:0,pagesX:[],pagesY:[],aniTime:null,wheelZoomCount:0,handleEvent:function(e){var that=this;switch(e.type){case START_EV:if(!hasTouch&&e.button!==
0)return;that._start(e);break;case MOVE_EV:that._move(e);break;case END_EV:case CANCEL_EV:that._end(e);break;case RESIZE_EV:that._resize();break;case "DOMMouseScroll":case "mousewheel":that._wheel(e);break;case TRNEND_EV:that._transitionEnd(e);break}},_checkDOMChanges:function(){if(this.moved||this.zoomed||this.animating||this.scrollerW==this.scroller.offsetWidth*this.scale&&this.scrollerH==this.scroller.offsetHeight*this.scale)return;this.refresh()},_scrollbar:function(dir){var that=this;var bar;
if(!that[dir+"Scrollbar"]){if(that[dir+"ScrollbarWrapper"]){if(hasTransform)that[dir+"ScrollbarIndicator"].style[transform]="";that[dir+"ScrollbarWrapper"].parentNode.removeChild(that[dir+"ScrollbarWrapper"]);that[dir+"ScrollbarWrapper"]=null;that[dir+"ScrollbarIndicator"]=null}return}if(!that[dir+"ScrollbarWrapper"]){bar=doc.createElement("div");if(that.options.scrollbarClass)bar.className=that.options.scrollbarClass+dir.toUpperCase();else bar.style.cssText="position:absolute;z-index:100;"+(dir==
"h"?"height:7px;bottom:1px;left:2px;right:"+(that.vScrollbar?"7":"2")+"px":"width:7px;bottom:"+(that.hScrollbar?"7":"2")+"px;top:2px;right:1px");bar.style.cssText+=";pointer-events:none;"+cssVendor+"transition-property:opacity;"+cssVendor+"transition-duration:"+(that.options.fadeScrollbar?"350ms":"0")+";overflow:hidden;opacity:"+(that.options.hideScrollbar?"0":"1");that.wrapper.appendChild(bar);that[dir+"ScrollbarWrapper"]=bar;bar=doc.createElement("div");if(!that.options.scrollbarClass)bar.style.cssText=
"position:absolute;z-index:100;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);"+cssVendor+"background-clip:padding-box;"+cssVendor+"box-sizing:border-box;"+(dir=="h"?"height:100%":"width:100%")+";"+cssVendor+"border-radius:3px;border-radius:3px";bar.style.cssText+=";pointer-events:none;"+cssVendor+"transition-property:"+cssVendor+"transform;"+cssVendor+"transition-timing-function:cubic-bezier(0.33,0.66,0.66,1);"+cssVendor+"transition-duration:0;"+cssVendor+"transform: translate(0,0)"+
translateZ;if(that.options.useTransition)bar.style.cssText+=";"+cssVendor+"transition-timing-function:cubic-bezier(0.33,0.66,0.66,1)";that[dir+"ScrollbarWrapper"].appendChild(bar);that[dir+"ScrollbarIndicator"]=bar}if(dir=="h"){that.hScrollbarSize=that.hScrollbarWrapper.clientWidth;that.hScrollbarIndicatorSize=m.max(m.round(that.hScrollbarSize*that.hScrollbarSize/that.scrollerW),8);that.hScrollbarIndicator.style.width=that.hScrollbarIndicatorSize+"px";that.hScrollbarMaxScroll=that.hScrollbarSize-
that.hScrollbarIndicatorSize;that.hScrollbarProp=that.hScrollbarMaxScroll/that.maxScrollX}else{that.vScrollbarSize=that.vScrollbarWrapper.clientHeight;that.vScrollbarIndicatorSize=m.max(m.round(that.vScrollbarSize*that.vScrollbarSize/that.scrollerH),8);that.vScrollbarIndicator.style.height=that.vScrollbarIndicatorSize+"px";that.vScrollbarMaxScroll=that.vScrollbarSize-that.vScrollbarIndicatorSize;that.vScrollbarProp=that.vScrollbarMaxScroll/that.maxScrollY}that._scrollbarPos(dir,true)},_resize:function(){var that=
this;setTimeout(function(){that.refresh()},isAndroid?200:0)},_pos:function(x,y){if(this.zoomed)return;x=this.hScroll?x:0;y=this.vScroll?y:0;if(this.options.useTransform)this.scroller.style[transform]="translate("+x+"px,"+y+"px) scale("+this.scale+")"+translateZ;else{x=m.round(x);y=m.round(y);this.scroller.style.left=x+"px";this.scroller.style.top=y+"px"}this.x=x;this.y=y;this._scrollbarPos("h");this._scrollbarPos("v")},_scrollbarPos:function(dir,hidden){var that=this;var pos=dir=="h"?that.x:that.y;
var size;if(!that[dir+"Scrollbar"])return;pos=that[dir+"ScrollbarProp"]*pos;if(pos<0){if(!that.options.fixedScrollbar){size=that[dir+"ScrollbarIndicatorSize"]+m.round(pos*3);if(size<8)size=8;that[dir+"ScrollbarIndicator"].style[dir=="h"?"width":"height"]=size+"px"}pos=0}else if(pos>that[dir+"ScrollbarMaxScroll"])if(!that.options.fixedScrollbar){size=that[dir+"ScrollbarIndicatorSize"]-m.round((pos-that[dir+"ScrollbarMaxScroll"])*3);if(size<8)size=8;that[dir+"ScrollbarIndicator"].style[dir=="h"?"width":
"height"]=size+"px";pos=that[dir+"ScrollbarMaxScroll"]+(that[dir+"ScrollbarIndicatorSize"]-size)}else pos=that[dir+"ScrollbarMaxScroll"];that[dir+"ScrollbarWrapper"].style[transitionDelay]="0";that[dir+"ScrollbarWrapper"].style.opacity=hidden&&that.options.hideScrollbar?"0":"1";that[dir+"ScrollbarIndicator"].style[transform]="translate("+(dir=="h"?pos+"px,0)":"0,"+pos+"px)")+translateZ},_start:function(e){var that=this;var point=hasTouch?e.touches[0]:e;var matrix;var x;var y;var c1;var c2;if(!that.enabled)return;
if(that.options.onBeforeScrollStart)that.options.onBeforeScrollStart.call(that,e);if(that.options.useTransition||that.options.zoom)that._transitionTime(0);that.moved=false;that.animating=false;that.zoomed=false;that.distX=0;that.distY=0;that.absDistX=0;that.absDistY=0;that.dirX=0;that.dirY=0;if(that.options.zoom&&hasTouch&&e.touches.length>1){c1=m.abs(e.touches[0].pageX-e.touches[1].pageX);c2=m.abs(e.touches[0].pageY-e.touches[1].pageY);that.touchesDistStart=m.sqrt(c1*c1+c2*c2);that.originX=m.abs(e.touches[0].pageX+
e.touches[1].pageX-that.wrapperOffsetLeft*2)/2-that.x;that.originY=m.abs(e.touches[0].pageY+e.touches[1].pageY-that.wrapperOffsetTop*2)/2-that.y;if(that.options.onZoomStart)that.options.onZoomStart.call(that,e)}if(that.options.momentum){if(that.options.useTransform){matrix=getComputedStyle(that.scroller,null)[transform].replace(/[^0-9\-.,]/g,"").split(",");x=+(matrix[12]||matrix[4]);y=+(matrix[13]||matrix[5])}else{x=+getComputedStyle(that.scroller,null).left.replace(/[^0-9-]/g,"");y=+getComputedStyle(that.scroller,
null).top.replace(/[^0-9-]/g,"")}if(x!=that.x||y!=that.y){if(that.options.useTransition)that._unbind(TRNEND_EV);else cancelFrame(that.aniTime);that.steps=[];that._pos(x,y);if(that.options.onScrollEnd)that.options.onScrollEnd.call(that)}}that.absStartX=that.x;that.absStartY=that.y;that.startX=that.x;that.startY=that.y;that.pointX=point.pageX;that.pointY=point.pageY;that.startTime=e.timeStamp||Date.now();if(that.options.onScrollStart)that.options.onScrollStart.call(that,e);that._bind(MOVE_EV,window);
that._bind(END_EV,window);that._bind(CANCEL_EV,window)},_move:function(e){var that=this;var point=hasTouch?e.touches[0]:e;var deltaX=point.pageX-that.pointX;var deltaY=point.pageY-that.pointY;var newX=that.x+deltaX;var newY=that.y+deltaY;var c1;var c2;var scale;var timestamp=e.timeStamp||Date.now();if(that.options.onBeforeScrollMove)that.options.onBeforeScrollMove.call(that,e);if(that.options.zoom&&hasTouch&&e.touches.length>1){c1=m.abs(e.touches[0].pageX-e.touches[1].pageX);c2=m.abs(e.touches[0].pageY-
e.touches[1].pageY);that.touchesDist=m.sqrt(c1*c1+c2*c2);that.zoomed=true;scale=1/that.touchesDistStart*that.touchesDist*this.scale;if(scale<that.options.zoomMin)scale=.5*that.options.zoomMin*Math.pow(2,scale/that.options.zoomMin);else if(scale>that.options.zoomMax)scale=2*that.options.zoomMax*Math.pow(.5,that.options.zoomMax/scale);that.lastScale=scale/this.scale;newX=this.originX-this.originX*that.lastScale+this.x;newY=this.originY-this.originY*that.lastScale+this.y;this.scroller.style[transform]=
"translate("+newX+"px,"+newY+"px) scale("+scale+")"+translateZ;if(that.options.onZoom)that.options.onZoom.call(that,e);return}that.pointX=point.pageX;that.pointY=point.pageY;if(newX>0||newX<that.maxScrollX)newX=that.options.bounce?that.x+deltaX/2:newX>=0||that.maxScrollX>=0?0:that.maxScrollX;if(newY>that.minScrollY||newY<that.maxScrollY)newY=that.options.bounce?that.y+deltaY/2:newY>=that.minScrollY||that.maxScrollY>=0?that.minScrollY:that.maxScrollY;that.distX+=deltaX;that.distY+=deltaY;that.absDistX=
m.abs(that.distX);that.absDistY=m.abs(that.distY);if(that.absDistX<6&&that.absDistY<6)return;if(that.options.lockDirection)if(that.absDistX>that.absDistY+5){newY=that.y;deltaY=0}else if(that.absDistY>that.absDistX+5){newX=that.x;deltaX=0}that.moved=true;that._pos(newX,newY);that.dirX=deltaX>0?-1:deltaX<0?1:0;that.dirY=deltaY>0?-1:deltaY<0?1:0;if(timestamp-that.startTime>300){that.startTime=timestamp;that.startX=that.x;that.startY=that.y}if(that.options.onScrollMove)that.options.onScrollMove.call(that,
e)},_end:function(e){if(hasTouch&&e.touches.length!==0)return;var that=this;var point=hasTouch?e.changedTouches[0]:e;var target;var ev;var momentumX={dist:0,time:0};var momentumY={dist:0,time:0};var duration=(e.timeStamp||Date.now())-that.startTime;var newPosX=that.x;var newPosY=that.y;var distX;var distY;var newDuration;var snap;var scale;that._unbind(MOVE_EV,window);that._unbind(END_EV,window);that._unbind(CANCEL_EV,window);if(that.options.onBeforeScrollEnd)that.options.onBeforeScrollEnd.call(that,
e);if(that.zoomed){scale=that.scale*that.lastScale;scale=Math.max(that.options.zoomMin,scale);scale=Math.min(that.options.zoomMax,scale);that.lastScale=scale/that.scale;that.scale=scale;that.x=that.originX-that.originX*that.lastScale+that.x;that.y=that.originY-that.originY*that.lastScale+that.y;that.scroller.style[transitionDuration]="200ms";that.scroller.style[transform]="translate("+that.x+"px,"+that.y+"px) scale("+that.scale+")"+translateZ;that.zoomed=false;that.refresh();if(that.options.onZoomEnd)that.options.onZoomEnd.call(that,
e);return}if(!that.moved){if(hasTouch)if(that.doubleTapTimer&&that.options.zoom){clearTimeout(that.doubleTapTimer);that.doubleTapTimer=null;if(that.options.onZoomStart)that.options.onZoomStart.call(that,e);that.zoom(that.pointX,that.pointY,that.scale==1?that.options.doubleTapZoom:1);if(that.options.onZoomEnd)setTimeout(function(){that.options.onZoomEnd.call(that,e)},200)}else if(this.options.handleClick)that.doubleTapTimer=setTimeout(function(){that.doubleTapTimer=null;for(target=point.target;target.nodeType!=
1;)target=target.parentNode;if(target.tagName!="SELECT"&&target.tagName!="INPUT"&&target.tagName!="TEXTAREA"){ev=doc.createEvent("MouseEvents");ev.initMouseEvent("click",true,true,e.view,1,point.screenX,point.screenY,point.clientX,point.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,0,null);ev._fake=true;target.dispatchEvent(ev)}},that.options.zoom?250:0);that._resetPos(400);if(that.options.onTouchEnd)that.options.onTouchEnd.call(that,e);return}if(duration<300&&that.options.momentum){momentumX=newPosX?
that._momentum(newPosX-that.startX,duration,-that.x,that.scrollerW-that.wrapperW+that.x,that.options.bounce?that.wrapperW:0):momentumX;momentumY=newPosY?that._momentum(newPosY-that.startY,duration,-that.y,that.maxScrollY<0?that.scrollerH-that.wrapperH+that.y-that.minScrollY:0,that.options.bounce?that.wrapperH:0):momentumY;newPosX=that.x+momentumX.dist;newPosY=that.y+momentumY.dist;if(that.x>0&&newPosX>0||that.x<that.maxScrollX&&newPosX<that.maxScrollX)momentumX={dist:0,time:0};if(that.y>that.minScrollY&&
newPosY>that.minScrollY||that.y<that.maxScrollY&&newPosY<that.maxScrollY)momentumY={dist:0,time:0}}if(momentumX.dist||momentumY.dist){newDuration=m.max(m.max(momentumX.time,momentumY.time),10);if(that.options.snap){distX=newPosX-that.absStartX;distY=newPosY-that.absStartY;if(m.abs(distX)<that.options.snapThreshold&&m.abs(distY)<that.options.snapThreshold)that.scrollTo(that.absStartX,that.absStartY,200);else{snap=that._snap(newPosX,newPosY);newPosX=snap.x;newPosY=snap.y;newDuration=m.max(snap.time,
newDuration)}}that.scrollTo(m.round(newPosX),m.round(newPosY),newDuration);if(that.options.onTouchEnd)that.options.onTouchEnd.call(that,e);return}if(that.options.snap){distX=newPosX-that.absStartX;distY=newPosY-that.absStartY;if(m.abs(distX)<that.options.snapThreshold&&m.abs(distY)<that.options.snapThreshold)that.scrollTo(that.absStartX,that.absStartY,200);else{snap=that._snap(that.x,that.y);if(snap.x!=that.x||snap.y!=that.y)that.scrollTo(snap.x,snap.y,snap.time)}if(that.options.onTouchEnd)that.options.onTouchEnd.call(that,
e);return}that._resetPos(200);if(that.options.onTouchEnd)that.options.onTouchEnd.call(that,e)},_resetPos:function(time){var that=this;var resetX=that.x>=0?0:that.x<that.maxScrollX?that.maxScrollX:that.x;var resetY=that.y>=that.minScrollY||that.maxScrollY>0?that.minScrollY:that.y<that.maxScrollY?that.maxScrollY:that.y;if(resetX==that.x&&resetY==that.y){if(that.moved){that.moved=false;if(that.options.onScrollEnd)that.options.onScrollEnd.call(that)}if(that.hScrollbar&&that.options.hideScrollbar){if(vendor==
"webkit")that.hScrollbarWrapper.style[transitionDelay]="300ms";that.hScrollbarWrapper.style.opacity="0"}if(that.vScrollbar&&that.options.hideScrollbar){if(vendor=="webkit")that.vScrollbarWrapper.style[transitionDelay]="300ms";that.vScrollbarWrapper.style.opacity="0"}return}that.scrollTo(resetX,resetY,time||0)},_wheel:function(e){var that=this;var wheelDeltaX;var wheelDeltaY;var deltaX;var deltaY;var deltaScale;if("wheelDeltaX"in e){wheelDeltaX=e.wheelDeltaX/12;wheelDeltaY=e.wheelDeltaY/12}else if("wheelDelta"in
e)wheelDeltaX=wheelDeltaY=e.wheelDelta/12;else if("detail"in e)wheelDeltaX=wheelDeltaY=-e.detail*3;else return;if(that.options.wheelAction=="zoom"){deltaScale=that.scale*Math.pow(2,1/3*(wheelDeltaY?wheelDeltaY/Math.abs(wheelDeltaY):0));if(deltaScale<that.options.zoomMin)deltaScale=that.options.zoomMin;if(deltaScale>that.options.zoomMax)deltaScale=that.options.zoomMax;if(deltaScale!=that.scale){if(!that.wheelZoomCount&&that.options.onZoomStart)that.options.onZoomStart.call(that,e);that.wheelZoomCount++;
that.zoom(e.pageX,e.pageY,deltaScale,400);setTimeout(function(){that.wheelZoomCount--;if(!that.wheelZoomCount&&that.options.onZoomEnd)that.options.onZoomEnd.call(that,e)},400)}return}deltaX=that.x+wheelDeltaX;deltaY=that.y+wheelDeltaY;if(deltaX>0)deltaX=0;else if(deltaX<that.maxScrollX)deltaX=that.maxScrollX;if(deltaY>that.minScrollY)deltaY=that.minScrollY;else if(deltaY<that.maxScrollY)deltaY=that.maxScrollY;if(that.maxScrollY<0)that.scrollTo(deltaX,deltaY,0)},_transitionEnd:function(e){var that=
this;if(e.target!=that.scroller)return;that._unbind(TRNEND_EV);that._startAni()},_startAni:function(){var that=this;var startX=that.x;var startY=that.y;var startTime=Date.now();var step;var easeOut;var animate;if(that.animating)return;if(!that.steps.length){that._resetPos(400);return}step=that.steps.shift();if(step.x==startX&&step.y==startY)step.time=0;that.animating=true;that.moved=true;if(that.options.useTransition){that._transitionTime(step.time);that._pos(step.x,step.y);that.animating=false;if(step.time)that._bind(TRNEND_EV);
else that._resetPos(0);return}animate=function(){var now=Date.now();var newX;var newY;if(now>=startTime+step.time){that._pos(step.x,step.y);that.animating=false;if(that.options.onAnimationEnd)that.options.onAnimationEnd.call(that);that._startAni();return}now=(now-startTime)/step.time-1;easeOut=m.sqrt(1-now*now);newX=(step.x-startX)*easeOut+startX;newY=(step.y-startY)*easeOut+startY;that._pos(newX,newY);if(that.animating)that.aniTime=nextFrame(animate)};animate()},_transitionTime:function(time){time+=
"ms";this.scroller.style[transitionDuration]=time;if(this.hScrollbar)this.hScrollbarIndicator.style[transitionDuration]=time;if(this.vScrollbar)this.vScrollbarIndicator.style[transitionDuration]=time},_momentum:function(dist,time,maxDistUpper,maxDistLower,size){var deceleration=6E-4;var speed=m.abs(dist)/time;var newDist=speed*speed/(2*deceleration);var newTime=0;var outsideDist=0;if(dist>0&&newDist>maxDistUpper){outsideDist=size/(6/(newDist/speed*deceleration));maxDistUpper=maxDistUpper+outsideDist;
speed=speed*maxDistUpper/newDist;newDist=maxDistUpper}else if(dist<0&&newDist>maxDistLower){outsideDist=size/(6/(newDist/speed*deceleration));maxDistLower=maxDistLower+outsideDist;speed=speed*maxDistLower/newDist;newDist=maxDistLower}newDist=newDist*(dist<0?-1:1);newTime=speed/deceleration;return{dist:newDist,time:m.round(newTime)}},_offset:function(el){var left=-el.offsetLeft;for(var top=-el.offsetTop;el=el.offsetParent;){left-=el.offsetLeft;top-=el.offsetTop}if(el!=this.wrapper){left*=this.scale;
top*=this.scale}return{left:left,top:top}},_snap:function(x,y){var that=this;var i;var l;var page;var time;var sizeX;var sizeY;page=that.pagesX.length-1;for(i=0,l=that.pagesX.length;i<l;i++)if(x>=that.pagesX[i]){page=i;break}if(page==that.currPageX&&page>0&&that.dirX<0)page--;x=that.pagesX[page];sizeX=m.abs(x-that.pagesX[that.currPageX]);sizeX=sizeX?m.abs(that.x-x)/sizeX*500:0;that.currPageX=page;page=that.pagesY.length-1;for(i=0;i<page;i++)if(y>=that.pagesY[i]){page=i;break}if(page==that.currPageY&&
page>0&&that.dirY<0)page--;y=that.pagesY[page];sizeY=m.abs(y-that.pagesY[that.currPageY]);sizeY=sizeY?m.abs(that.y-y)/sizeY*500:0;that.currPageY=page;time=m.round(m.max(sizeX,sizeY))||200;return{x:x,y:y,time:time}},_bind:function(type,el,bubble){(el||this.scroller).addEventListener(type,this,!!bubble)},_unbind:function(type,el,bubble){(el||this.scroller).removeEventListener(type,this,!!bubble)},destroy:function(){var that=this;that.scroller.style[transform]="";that.hScrollbar=false;that.vScrollbar=
false;that._scrollbar("h");that._scrollbar("v");that._unbind(RESIZE_EV,window);that._unbind(START_EV);that._unbind(MOVE_EV,window);that._unbind(END_EV,window);that._unbind(CANCEL_EV,window);if(!that.options.hasTouch){that._unbind("DOMMouseScroll");that._unbind("mousewheel")}if(that.options.useTransition)that._unbind(TRNEND_EV);if(that.options.checkDOMChanges)clearInterval(that.checkDOMTime);if(that.options.onDestroy)that.options.onDestroy.call(that)},refresh:function(){var that=this;var offset;var i;
var l;var els;var pos=0;var page=0;if(that.scale<that.options.zoomMin)that.scale=that.options.zoomMin;that.wrapperW=that.wrapper.clientWidth||1;that.wrapperH=that.wrapper.clientHeight||1;that.minScrollY=-that.options.topOffset||0;that.scrollerW=m.round(that.scroller.offsetWidth*that.scale);that.scrollerH=m.round((that.scroller.offsetHeight+that.minScrollY)*that.scale);that.maxScrollX=that.wrapperW-that.scrollerW;that.maxScrollY=that.wrapperH-that.scrollerH+that.minScrollY;that.dirX=0;that.dirY=0;
if(that.options.onRefresh)that.options.onRefresh.call(that);that.hScroll=that.options.hScroll&&that.maxScrollX<0;that.vScroll=that.options.vScroll&&(!that.options.bounceLock&&!that.hScroll||that.scrollerH>that.wrapperH);that.hScrollbar=that.hScroll&&that.options.hScrollbar;that.vScrollbar=that.vScroll&&that.options.vScrollbar&&that.scrollerH>that.wrapperH;offset=that._offset(that.wrapper);that.wrapperOffsetLeft=-offset.left;that.wrapperOffsetTop=-offset.top;if(typeof that.options.snap=="string"){that.pagesX=
[];that.pagesY=[];els=that.scroller.querySelectorAll(that.options.snap);for(i=0,l=els.length;i<l;i++){pos=that._offset(els[i]);pos.left+=that.wrapperOffsetLeft;pos.top+=that.wrapperOffsetTop;that.pagesX[i]=pos.left<that.maxScrollX?that.maxScrollX:pos.left*that.scale;that.pagesY[i]=pos.top<that.maxScrollY?that.maxScrollY:pos.top*that.scale}}else if(that.options.snap){for(that.pagesX=[];pos>=that.maxScrollX;){that.pagesX[page]=pos;pos=pos-that.wrapperW;page++}if(that.maxScrollX%that.wrapperW)that.pagesX[that.pagesX.length]=
that.maxScrollX-that.pagesX[that.pagesX.length-1]+that.pagesX[that.pagesX.length-1];pos=0;page=0;for(that.pagesY=[];pos>=that.maxScrollY;){that.pagesY[page]=pos;pos=pos-that.wrapperH;page++}if(that.maxScrollY%that.wrapperH)that.pagesY[that.pagesY.length]=that.maxScrollY-that.pagesY[that.pagesY.length-1]+that.pagesY[that.pagesY.length-1]}that._scrollbar("h");that._scrollbar("v");if(!that.zoomed){that.scroller.style[transitionDuration]="0";that._resetPos(400)}},scrollTo:function(x,y,time,relative){var that=
this;var step=x;var i;var l;that.stop();if(!step.length)step=[{x:x,y:y,time:time,relative:relative}];for(i=0,l=step.length;i<l;i++){if(step[i].relative){step[i].x=that.x-step[i].x;step[i].y=that.y-step[i].y}that.steps.push({x:step[i].x,y:step[i].y,time:step[i].time||0})}that._startAni()},scrollToElement:function(el,time){var that=this;var pos;el=el.nodeType?el:that.scroller.querySelector(el);if(!el)return;pos=that._offset(el);pos.left+=that.wrapperOffsetLeft;pos.top+=that.wrapperOffsetTop;pos.left=
pos.left>0?0:pos.left<that.maxScrollX?that.maxScrollX:pos.left;pos.top=pos.top>that.minScrollY?that.minScrollY:pos.top<that.maxScrollY?that.maxScrollY:pos.top;time=time===undefined?m.max(m.abs(pos.left)*2,m.abs(pos.top)*2):time;that.scrollTo(pos.left,pos.top,time)},scrollToPage:function(pageX,pageY,time){var that=this;var x;var y;time=time===undefined?400:time;if(that.options.onScrollStart)that.options.onScrollStart.call(that);if(that.options.snap){pageX=pageX=="next"?that.currPageX+1:pageX=="prev"?
that.currPageX-1:pageX;pageY=pageY=="next"?that.currPageY+1:pageY=="prev"?that.currPageY-1:pageY;pageX=pageX<0?0:pageX>that.pagesX.length-1?that.pagesX.length-1:pageX;pageY=pageY<0?0:pageY>that.pagesY.length-1?that.pagesY.length-1:pageY;that.currPageX=pageX;that.currPageY=pageY;x=that.pagesX[pageX];y=that.pagesY[pageY]}else{x=-that.wrapperW*pageX;y=-that.wrapperH*pageY;if(x<that.maxScrollX)x=that.maxScrollX;if(y<that.maxScrollY)y=that.maxScrollY}that.scrollTo(x,y,time)},disable:function(){this.stop();
this._resetPos(0);this.enabled=false;this._unbind(MOVE_EV,window);this._unbind(END_EV,window);this._unbind(CANCEL_EV,window)},enable:function(){this.enabled=true},stop:function(){if(this.options.useTransition)this._unbind(TRNEND_EV);else cancelFrame(this.aniTime);this.steps=[];this.moved=false;this.animating=false},zoom:function(x,y,scale,time){var that=this;var relScale=scale/that.scale;if(!that.options.useTransform)return;that.zoomed=true;time=time===undefined?200:time;x=x-that.wrapperOffsetLeft-
that.x;y=y-that.wrapperOffsetTop-that.y;that.x=x-x*relScale+that.x;that.y=y-y*relScale+that.y;that.scale=scale;that.refresh();that.x=that.x>0?0:that.x<that.maxScrollX?that.maxScrollX:that.x;that.y=that.y>that.minScrollY?that.minScrollY:that.y<that.maxScrollY?that.maxScrollY:that.y;that.scroller.style[transitionDuration]=time+"ms";that.scroller.style[transform]="translate("+that.x+"px,"+that.y+"px) scale("+scale+")"+translateZ;that.zoomed=false},isReady:function(){return!this.moved&&!this.zoomed&&
!this.animating}};dummyStyle=null;if(typeof exports!=="undefined")exports.iScroll=iScroll;else window.iScroll=iScroll})(window,document);
/*
 FastClick: polyfill to remove click delays on browsers with touch UIs.

 @version 1.0.0
 @codingstandard ftlabs-jsv2
 @copyright The Financial Times Limited [All Rights Reserved]
 @license MIT License (see LICENSE.txt)
*/
function FastClick(layer){function bind(method,context){return function(){return method.apply(context,arguments)}}var oldOnClick;this.trackingClick=false;this.trackingClickStart=0;this.targetElement=null;this.touchStartX=0;this.touchStartY=0;this.lastTouchIdentifier=0;this.touchBoundary=10;this.layer=layer;if(FastClick.notNeeded(layer))return;if(deviceIsAndroid){layer.addEventListener("mouseover",bind(this.onMouse,this),true);layer.addEventListener("mousedown",bind(this.onMouse,this),true);layer.addEventListener("mouseup",
bind(this.onMouse,this),true)}layer.addEventListener("click",bind(this.onClick,this),true);layer.addEventListener("touchstart",bind(this.onTouchStart,this),false);layer.addEventListener("touchmove",bind(this.onTouchMove,this),false);layer.addEventListener("touchend",bind(this.onTouchEnd,this),false);layer.addEventListener("touchcancel",bind(this.onTouchCancel,this),false);if(!Event.prototype.stopImmediatePropagation){layer.removeEventListener=function(type,callback,capture){var rmv=Node.prototype.removeEventListener;
if(type==="click")rmv.call(layer,type,callback.hijacked||callback,capture);else rmv.call(layer,type,callback,capture)};layer.addEventListener=function(type,callback,capture){var adv=Node.prototype.addEventListener;if(type==="click")adv.call(layer,type,callback.hijacked||(callback.hijacked=function(event){if(!event.propagationStopped)callback(event)}),capture);else adv.call(layer,type,callback,capture)}}if(typeof layer.onclick==="function"){oldOnClick=layer.onclick;layer.addEventListener("click",function(event){oldOnClick(event)},
false);layer.onclick=null}}var deviceIsAndroid=navigator.userAgent.indexOf("Android")>0;var deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent);var deviceIsIOS4=deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent);var deviceIsIOSWithBadTarget=deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);
FastClick.prototype.needsClick=function(target){switch(target.nodeName.toLowerCase()){case "button":case "select":case "textarea":if(target.disabled)return true;break;case "input":if(deviceIsIOS&&target.type==="file"||target.disabled)return true;break;case "label":case "video":return true}return/\bneedsclick\b/.test(target.className)};
FastClick.prototype.needsFocus=function(target){switch(target.nodeName.toLowerCase()){case "textarea":return true;case "select":return!deviceIsAndroid;case "input":switch(target.type){case "button":case "checkbox":case "file":case "image":case "radio":case "submit":return false}return!target.disabled&&!target.readOnly;default:return/\bneedsfocus\b/.test(target.className)}};
FastClick.prototype.sendClick=function(targetElement,event){var clickEvent;var touch;if(document.activeElement&&document.activeElement!==targetElement)document.activeElement.blur();touch=event.changedTouches[0];clickEvent=document.createEvent("MouseEvents");clickEvent.initMouseEvent(this.determineEventType(targetElement),true,true,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,false,false,false,false,0,null);clickEvent.forwardedTouchEvent=true;targetElement.dispatchEvent(clickEvent)};
FastClick.prototype.determineEventType=function(targetElement){if(deviceIsAndroid&&targetElement.tagName.toLowerCase()==="select")return"mousedown";return"click"};FastClick.prototype.focus=function(targetElement){var length;if(deviceIsIOS&&targetElement.setSelectionRange&&targetElement.type.indexOf("date")!==0&&targetElement.type!=="time"){length=targetElement.value.length;targetElement.setSelectionRange(length,length)}else targetElement.focus()};
FastClick.prototype.updateScrollParent=function(targetElement){var scrollParent;var parentElement;scrollParent=targetElement.fastClickScrollParent;if(!scrollParent||!scrollParent.contains(targetElement)){parentElement=targetElement;do{if(parentElement.scrollHeight>parentElement.offsetHeight){scrollParent=parentElement;targetElement.fastClickScrollParent=parentElement;break}parentElement=parentElement.parentElement}while(parentElement)}if(scrollParent)scrollParent.fastClickLastScrollTop=scrollParent.scrollTop};
FastClick.prototype.getTargetElementFromEventTarget=function(eventTarget){if(eventTarget.nodeType===Node.TEXT_NODE)return eventTarget.parentNode;return eventTarget};
FastClick.prototype.onTouchStart=function(event){var targetElement;var touch;var selection;if(event.targetTouches.length>1)return true;targetElement=this.getTargetElementFromEventTarget(event.target);touch=event.targetTouches[0];if(deviceIsIOS){selection=window.getSelection();if(selection.rangeCount&&!selection.isCollapsed)return true;if(!deviceIsIOS4){if(touch.identifier===this.lastTouchIdentifier){event.preventDefault();return false}this.lastTouchIdentifier=touch.identifier;this.updateScrollParent(targetElement)}}this.trackingClick=
true;this.trackingClickStart=event.timeStamp;this.targetElement=targetElement;this.touchStartX=touch.pageX;this.touchStartY=touch.pageY;if(event.timeStamp-this.lastClickTime<200)event.preventDefault();return true};FastClick.prototype.touchHasMoved=function(event){var touch=event.changedTouches[0];var boundary=this.touchBoundary;if(Math.abs(touch.pageX-this.touchStartX)>boundary||Math.abs(touch.pageY-this.touchStartY)>boundary)return true;return false};
FastClick.prototype.onTouchMove=function(event){if(!this.trackingClick)return true;if(this.targetElement!==this.getTargetElementFromEventTarget(event.target)||this.touchHasMoved(event)){this.trackingClick=false;this.targetElement=null}return true};FastClick.prototype.findControl=function(labelElement){if(labelElement.control!==undefined)return labelElement.control;if(labelElement.htmlFor)return document.getElementById(labelElement.htmlFor);return labelElement.querySelector("button, input:not([type\x3dhidden]), keygen, meter, output, progress, select, textarea")};
FastClick.prototype.onTouchEnd=function(event){var forElement;var trackingClickStart;var targetTagName;var scrollParent;var touch;var targetElement=this.targetElement;if(!this.trackingClick)return true;if(event.timeStamp-this.lastClickTime<200){this.cancelNextClick=true;return true}this.cancelNextClick=false;this.lastClickTime=event.timeStamp;trackingClickStart=this.trackingClickStart;this.trackingClick=false;this.trackingClickStart=0;if(deviceIsIOSWithBadTarget){touch=event.changedTouches[0];targetElement=
document.elementFromPoint(touch.pageX-window.pageXOffset,touch.pageY-window.pageYOffset)||targetElement;targetElement.fastClickScrollParent=this.targetElement.fastClickScrollParent}targetTagName=targetElement.tagName.toLowerCase();if(targetTagName==="label"){forElement=this.findControl(targetElement);if(forElement){this.focus(targetElement);if(deviceIsAndroid)return false;targetElement=forElement}}else if(this.needsFocus(targetElement)){if(event.timeStamp-trackingClickStart>100||deviceIsIOS&&window.top!==
window&&targetTagName==="input"){this.targetElement=null;return false}this.focus(targetElement);this.sendClick(targetElement,event);if(!deviceIsIOS4||targetTagName!=="select"){this.targetElement=null;event.preventDefault()}return false}if(deviceIsIOS&&!deviceIsIOS4){scrollParent=targetElement.fastClickScrollParent;if(scrollParent&&scrollParent.fastClickLastScrollTop!==scrollParent.scrollTop)return true}if(!this.needsClick(targetElement)){event.preventDefault();this.sendClick(targetElement,event)}return false};
FastClick.prototype.onTouchCancel=function(){this.trackingClick=false;this.targetElement=null};FastClick.prototype.onMouse=function(event){if(!this.targetElement)return true;if(event.forwardedTouchEvent)return true;if(!event.cancelable)return true;if(!this.needsClick(this.targetElement)||this.cancelNextClick){if(event.stopImmediatePropagation)event.stopImmediatePropagation();else event.propagationStopped=true;event.stopPropagation();event.preventDefault();return false}return true};
FastClick.prototype.onClick=function(event){var permitted;if(this.trackingClick){this.targetElement=null;this.trackingClick=false;return true}if(event.target.type==="submit"&&event.detail===0)return true;permitted=this.onMouse(event);if(!permitted)this.targetElement=null;return permitted};
FastClick.prototype.destroy=function(){var layer=this.layer;if(deviceIsAndroid){layer.removeEventListener("mouseover",this.onMouse,true);layer.removeEventListener("mousedown",this.onMouse,true);layer.removeEventListener("mouseup",this.onMouse,true)}layer.removeEventListener("click",this.onClick,true);layer.removeEventListener("touchstart",this.onTouchStart,false);layer.removeEventListener("touchmove",this.onTouchMove,false);layer.removeEventListener("touchend",this.onTouchEnd,false);layer.removeEventListener("touchcancel",
this.onTouchCancel,false)};
FastClick.notNeeded=function(layer){var metaViewport;var chromeVersion;if(typeof window.ontouchstart==="undefined")return true;chromeVersion=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1];if(chromeVersion)if(deviceIsAndroid){metaViewport=document.querySelector("meta[name\x3dviewport]");if(metaViewport){if(metaViewport.content.indexOf("user-scalable\x3dno")!==-1)return true;if(chromeVersion>31&&window.innerWidth<=window.screen.width)return true}}else return true;if(layer.style.msTouchAction===
"none")return true;return false};FastClick.attach=function(layer){return new FastClick(layer)};window.FastClick=FastClick;
(function(){var root=this;var previousUnderscore=root._;var ArrayProto=Array.prototype;var ObjProto=Object.prototype;var FuncProto=Function.prototype;var push=ArrayProto.push;var slice=ArrayProto.slice;var concat=ArrayProto.concat;var toString=ObjProto.toString;var hasOwnProperty=ObjProto.hasOwnProperty;var nativeIsArray=Array.isArray;var nativeKeys=Object.keys;var nativeBind=FuncProto.bind;var _=function(obj){if(obj instanceof _)return obj;if(!(this instanceof _))return new _(obj);this._wrapped=
obj};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=_;exports._=_}else root._=_;_.VERSION="1.7.0";var createCallback=function(func,context,argCount){if(context===void 0)return func;switch(argCount==null?3:argCount){case 1:return function(value){return func.call(context,value)};case 2:return function(value,other){return func.call(context,value,other)};case 3:return function(value,index,collection){return func.call(context,value,index,collection)};
case 4:return function(accumulator,value,index,collection){return func.call(context,accumulator,value,index,collection)}}return function(){return func.apply(context,arguments)}};_.iteratee=function(value,context,argCount){if(value==null)return _.identity;if(_.isFunction(value))return createCallback(value,context,argCount);if(_.isObject(value))return _.matches(value);return _.property(value)};_.each=_.forEach=function(obj,iteratee,context){if(obj==null)return obj;iteratee=createCallback(iteratee,context);
var i;var length=obj.length;if(length===+length)for(i=0;i<length;i++)iteratee(obj[i],i,obj);else{var keys=_.keys(obj);for(i=0,length=keys.length;i<length;i++)iteratee(obj[keys[i]],keys[i],obj)}return obj};_.map=_.collect=function(obj,iteratee,context){if(obj==null)return[];iteratee=_.iteratee(iteratee,context);var keys=obj.length!==+obj.length&&_.keys(obj);var length=(keys||obj).length;var results=Array(length);var currentKey;for(var index=0;index<length;index++){currentKey=keys?keys[index]:index;
results[index]=iteratee(obj[currentKey],currentKey,obj)}return results};var reduceError="Reduce of empty array with no initial value";_.reduce=_.foldl=_.inject=function(obj,iteratee,memo,context){if(obj==null)obj=[];iteratee=createCallback(iteratee,context,4);var keys=obj.length!==+obj.length&&_.keys(obj);var length=(keys||obj).length;var index=0;var currentKey;if(arguments.length<3){if(!length)throw new TypeError(reduceError);memo=obj[keys?keys[index++]:index++]}for(;index<length;index++){currentKey=
keys?keys[index]:index;memo=iteratee(memo,obj[currentKey],currentKey,obj)}return memo};_.reduceRight=_.foldr=function(obj,iteratee,memo,context){if(obj==null)obj=[];iteratee=createCallback(iteratee,context,4);var keys=obj.length!==+obj.length&&_.keys(obj);var index=(keys||obj).length;var currentKey;if(arguments.length<3){if(!index)throw new TypeError(reduceError);memo=obj[keys?keys[--index]:--index]}for(;index--;){currentKey=keys?keys[index]:index;memo=iteratee(memo,obj[currentKey],currentKey,obj)}return memo};
_.find=_.detect=function(obj,predicate,context){var result;predicate=_.iteratee(predicate,context);_.some(obj,function(value,index,list){if(predicate(value,index,list)){result=value;return true}});return result};_.filter=_.select=function(obj,predicate,context){var results=[];if(obj==null)return results;predicate=_.iteratee(predicate,context);_.each(obj,function(value,index,list){if(predicate(value,index,list))results.push(value)});return results};_.reject=function(obj,predicate,context){return _.filter(obj,
_.negate(_.iteratee(predicate)),context)};_.every=_.all=function(obj,predicate,context){if(obj==null)return true;predicate=_.iteratee(predicate,context);var keys=obj.length!==+obj.length&&_.keys(obj);var length=(keys||obj).length;var index;var currentKey;for(index=0;index<length;index++){currentKey=keys?keys[index]:index;if(!predicate(obj[currentKey],currentKey,obj))return false}return true};_.some=_.any=function(obj,predicate,context){if(obj==null)return false;predicate=_.iteratee(predicate,context);
var keys=obj.length!==+obj.length&&_.keys(obj);var length=(keys||obj).length;var index;var currentKey;for(index=0;index<length;index++){currentKey=keys?keys[index]:index;if(predicate(obj[currentKey],currentKey,obj))return true}return false};_.contains=_.include=function(obj,target){if(obj==null)return false;if(obj.length!==+obj.length)obj=_.values(obj);return _.indexOf(obj,target)>=0};_.invoke=function(obj,method){var args=slice.call(arguments,2);var isFunc=_.isFunction(method);return _.map(obj,function(value){return(isFunc?
method:value[method]).apply(value,args)})};_.pluck=function(obj,key){return _.map(obj,_.property(key))};_.where=function(obj,attrs){return _.filter(obj,_.matches(attrs))};_.findWhere=function(obj,attrs){return _.find(obj,_.matches(attrs))};_.max=function(obj,iteratee,context){var result=-Infinity;var lastComputed=-Infinity;var value$$0;var computed;if(iteratee==null&&obj!=null){obj=obj.length===+obj.length?obj:_.values(obj);var i=0;for(var length=obj.length;i<length;i++){value$$0=obj[i];if(value$$0>
result)result=value$$0}}else{iteratee=_.iteratee(iteratee,context);_.each(obj,function(value,index,list){computed=iteratee(value,index,list);if(computed>lastComputed||computed===-Infinity&&result===-Infinity){result=value;lastComputed=computed}})}return result};_.min=function(obj,iteratee,context){var result=Infinity;var lastComputed=Infinity;var value$$0;var computed;if(iteratee==null&&obj!=null){obj=obj.length===+obj.length?obj:_.values(obj);var i=0;for(var length=obj.length;i<length;i++){value$$0=
obj[i];if(value$$0<result)result=value$$0}}else{iteratee=_.iteratee(iteratee,context);_.each(obj,function(value,index,list){computed=iteratee(value,index,list);if(computed<lastComputed||computed===Infinity&&result===Infinity){result=value;lastComputed=computed}})}return result};_.shuffle=function(obj){var set=obj&&obj.length===+obj.length?obj:_.values(obj);var length=set.length;var shuffled=Array(length);var index=0;for(var rand;index<length;index++){rand=_.random(0,index);if(rand!==index)shuffled[index]=
shuffled[rand];shuffled[rand]=set[index]}return shuffled};_.sample=function(obj,n,guard){if(n==null||guard){if(obj.length!==+obj.length)obj=_.values(obj);return obj[_.random(obj.length-1)]}return _.shuffle(obj).slice(0,Math.max(0,n))};_.sortBy=function(obj,iteratee,context){iteratee=_.iteratee(iteratee,context);return _.pluck(_.map(obj,function(value,index,list){return{value:value,index:index,criteria:iteratee(value,index,list)}}).sort(function(left,right){var a=left.criteria;var b=right.criteria;
if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)return-1}return left.index-right.index}),"value")};var group=function(behavior){return function(obj,iteratee,context){var result={};iteratee=_.iteratee(iteratee,context);_.each(obj,function(value,index){var key=iteratee(value,index,obj);behavior(result,value,key)});return result}};_.groupBy=group(function(result,value,key){if(_.has(result,key))result[key].push(value);else result[key]=[value]});_.indexBy=group(function(result,value,key){result[key]=
value});_.countBy=group(function(result,value,key){if(_.has(result,key))result[key]++;else result[key]=1});_.sortedIndex=function(array,obj,iteratee,context){iteratee=_.iteratee(iteratee,context,1);var value=iteratee(obj);var low=0;for(var high=array.length;low<high;){var mid=low+high>>>1;if(iteratee(array[mid])<value)low=mid+1;else high=mid}return low};_.toArray=function(obj){if(!obj)return[];if(_.isArray(obj))return slice.call(obj);if(obj.length===+obj.length)return _.map(obj,_.identity);return _.values(obj)};
_.size=function(obj){if(obj==null)return 0;return obj.length===+obj.length?obj.length:_.keys(obj).length};_.partition=function(obj$$0,predicate,context){predicate=_.iteratee(predicate,context);var pass=[];var fail=[];_.each(obj$$0,function(value,key,obj){(predicate(value,key,obj)?pass:fail).push(value)});return[pass,fail]};_.first=_.head=_.take=function(array,n,guard){if(array==null)return void 0;if(n==null||guard)return array[0];if(n<0)return[];return slice.call(array,0,n)};_.initial=function(array,
n,guard){return slice.call(array,0,Math.max(0,array.length-(n==null||guard?1:n)))};_.last=function(array,n,guard){if(array==null)return void 0;if(n==null||guard)return array[array.length-1];return slice.call(array,Math.max(array.length-n,0))};_.rest=_.tail=_.drop=function(array,n,guard){return slice.call(array,n==null||guard?1:n)};_.compact=function(array){return _.filter(array,_.identity)};var flatten=function(input,shallow,strict,output){if(shallow&&_.every(input,_.isArray))return concat.apply(output,
input);var i=0;for(var length=input.length;i<length;i++){var value=input[i];if(!_.isArray(value)&&!_.isArguments(value)){if(!strict)output.push(value)}else if(shallow)push.apply(output,value);else flatten(value,shallow,strict,output)}return output};_.flatten=function(array,shallow){return flatten(array,shallow,false,[])};_.without=function(array){return _.difference(array,slice.call(arguments,1))};_.uniq=_.unique=function(array,isSorted,iteratee,context){if(array==null)return[];if(!_.isBoolean(isSorted)){context=
iteratee;iteratee=isSorted;isSorted=false}if(iteratee!=null)iteratee=_.iteratee(iteratee,context);var result=[];var seen=[];var i=0;for(var length=array.length;i<length;i++){var value=array[i];if(isSorted){if(!i||seen!==value)result.push(value);seen=value}else if(iteratee){var computed=iteratee(value,i,array);if(_.indexOf(seen,computed)<0){seen.push(computed);result.push(value)}}else if(_.indexOf(result,value)<0)result.push(value)}return result};_.union=function(){return _.uniq(flatten(arguments,
true,true,[]))};_.intersection=function(array){if(array==null)return[];var result=[];var argsLength=arguments.length;var i=0;for(var length=array.length;i<length;i++){var item=array[i];if(_.contains(result,item))continue;for(var j=1;j<argsLength;j++)if(!_.contains(arguments[j],item))break;if(j===argsLength)result.push(item)}return result};_.difference=function(array){var rest=flatten(slice.call(arguments,1),true,true,[]);return _.filter(array,function(value){return!_.contains(rest,value)})};_.zip=
function(array){if(array==null)return[];var length=_.max(arguments,"length").length;var results=Array(length);for(var i=0;i<length;i++)results[i]=_.pluck(arguments,i);return results};_.object=function(list,values){if(list==null)return{};var result={};var i=0;for(var length=list.length;i<length;i++)if(values)result[list[i]]=values[i];else result[list[i][0]]=list[i][1];return result};_.indexOf=function(array,item,isSorted){if(array==null)return-1;var i=0;var length=array.length;if(isSorted)if(typeof isSorted==
"number")i=isSorted<0?Math.max(0,length+isSorted):isSorted;else{i=_.sortedIndex(array,item);return array[i]===item?i:-1}for(;i<length;i++)if(array[i]===item)return i;return-1};_.lastIndexOf=function(array,item,from){if(array==null)return-1;var idx=array.length;if(typeof from=="number")idx=from<0?idx+from+1:Math.min(idx,from+1);for(;--idx>=0;)if(array[idx]===item)return idx;return-1};_.range=function(start,stop,step){if(arguments.length<=1){stop=start||0;start=0}step=step||1;var length=Math.max(Math.ceil((stop-
start)/step),0);var range=Array(length);for(var idx=0;idx<length;idx++,start+=step)range[idx]=start;return range};var Ctor=function(){};_.bind=function(func,context){var args;var bound;if(nativeBind&&func.bind===nativeBind)return nativeBind.apply(func,slice.call(arguments,1));if(!_.isFunction(func))throw new TypeError("Bind must be called on a function");args=slice.call(arguments,2);bound=function(){if(!(this instanceof bound))return func.apply(context,args.concat(slice.call(arguments)));Ctor.prototype=
func.prototype;var self=new Ctor;Ctor.prototype=null;var result=func.apply(self,args.concat(slice.call(arguments)));if(_.isObject(result))return result;return self};return bound};_.partial=function(func){var boundArgs=slice.call(arguments,1);return function(){var position=0;var args=boundArgs.slice();var i=0;for(var length=args.length;i<length;i++)if(args[i]===_)args[i]=arguments[position++];for(;position<arguments.length;)args.push(arguments[position++]);return func.apply(this,args)}};_.bindAll=
function(obj){var i;var length=arguments.length;var key;if(length<=1)throw new Error("bindAll must be passed function names");for(i=1;i<length;i++){key=arguments[i];obj[key]=_.bind(obj[key],obj)}return obj};_.memoize=function(func,hasher){var memoize=function(key){var cache=memoize.cache;var address=hasher?hasher.apply(this,arguments):key;if(!_.has(cache,address))cache[address]=func.apply(this,arguments);return cache[address]};memoize.cache={};return memoize};_.delay=function(func,wait){var args=
slice.call(arguments,2);return setTimeout(function(){return func.apply(null,args)},wait)};_.defer=function(func){return _.delay.apply(_,[func,1].concat(slice.call(arguments,1)))};_.throttle=function(func,wait,options){var context;var args;var result;var timeout=null;var previous=0;if(!options)options={};var later=function(){previous=options.leading===false?0:_.now();timeout=null;result=func.apply(context,args);if(!timeout)context=args=null};return function(){var now=_.now();if(!previous&&options.leading===
false)previous=now;var remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0||remaining>wait){clearTimeout(timeout);timeout=null;previous=now;result=func.apply(context,args);if(!timeout)context=args=null}else if(!timeout&&options.trailing!==false)timeout=setTimeout(later,remaining);return result}};_.debounce=function(func,wait,immediate){var timeout;var args;var context;var timestamp;var result;var later=function(){var last=_.now()-timestamp;if(last<wait&&last>0)timeout=setTimeout(later,
wait-last);else{timeout=null;if(!immediate){result=func.apply(context,args);if(!timeout)context=args=null}}};return function(){context=this;args=arguments;timestamp=_.now();var callNow=immediate&&!timeout;if(!timeout)timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);context=args=null}return result}};_.wrap=function(func,wrapper){return _.partial(wrapper,func)};_.negate=function(predicate){return function(){return!predicate.apply(this,arguments)}};_.compose=function(){var args=
arguments;var start=args.length-1;return function(){var i=start;for(var result=args[start].apply(this,arguments);i--;)result=args[i].call(this,result);return result}};_.after=function(times,func){return function(){if(--times<1)return func.apply(this,arguments)}};_.before=function(times,func){var memo;return function(){if(--times>0)memo=func.apply(this,arguments);else func=null;return memo}};_.once=_.partial(_.before,2);_.keys=function(obj){if(!_.isObject(obj))return[];if(nativeKeys)return nativeKeys(obj);
var keys=[];for(var key in obj)if(_.has(obj,key))keys.push(key);return keys};_.values=function(obj){var keys=_.keys(obj);var length=keys.length;var values=Array(length);for(var i=0;i<length;i++)values[i]=obj[keys[i]];return values};_.pairs=function(obj){var keys=_.keys(obj);var length=keys.length;var pairs=Array(length);for(var i=0;i<length;i++)pairs[i]=[keys[i],obj[keys[i]]];return pairs};_.invert=function(obj){var result={};var keys=_.keys(obj);var i=0;for(var length=keys.length;i<length;i++)result[obj[keys[i]]]=
keys[i];return result};_.functions=_.methods=function(obj){var names=[];for(var key in obj)if(_.isFunction(obj[key]))names.push(key);return names.sort()};_.extend=function(obj){if(!_.isObject(obj))return obj;var source;var prop;var i=1;for(var length=arguments.length;i<length;i++){source=arguments[i];for(prop in source)if(hasOwnProperty.call(source,prop))obj[prop]=source[prop]}return obj};_.pick=function(obj,iteratee,context){var result={};var key;if(obj==null)return result;if(_.isFunction(iteratee)){iteratee=
createCallback(iteratee,context);for(key in obj){var value=obj[key];if(iteratee(value,key,obj))result[key]=value}}else{var keys=concat.apply([],slice.call(arguments,1));obj=new Object(obj);var i=0;for(var length=keys.length;i<length;i++){key=keys[i];if(key in obj)result[key]=obj[key]}}return result};_.omit=function(obj,iteratee,context){if(_.isFunction(iteratee))iteratee=_.negate(iteratee);else{var keys=_.map(concat.apply([],slice.call(arguments,1)),String);iteratee=function(value,key){return!_.contains(keys,
key)}}return _.pick(obj,iteratee,context)};_.defaults=function(obj){if(!_.isObject(obj))return obj;var i=1;for(var length=arguments.length;i<length;i++){var source=arguments[i];for(var prop in source)if(obj[prop]===void 0)obj[prop]=source[prop]}return obj};_.clone=function(obj){if(!_.isObject(obj))return obj;return _.isArray(obj)?obj.slice():_.extend({},obj)};_.tap=function(obj,interceptor){interceptor(obj);return obj};var eq=function(a,b,aStack,bStack){if(a===b)return a!==0||1/a===1/b;if(a==null||
b==null)return a===b;if(a instanceof _)a=a._wrapped;if(b instanceof _)b=b._wrapped;var className=toString.call(a);if(className!==toString.call(b))return false;switch(className){case "[object RegExp]":case "[object String]":return""+a===""+b;case "[object Number]":if(+a!==+a)return+b!==+b;return+a===0?1/+a===1/b:+a===+b;case "[object Date]":case "[object Boolean]":return+a===+b}if(typeof a!="object"||typeof b!="object")return false;for(var length=aStack.length;length--;)if(aStack[length]===a)return bStack[length]===
b;var aCtor=a.constructor;var bCtor=b.constructor;if(aCtor!==bCtor&&"constructor"in a&&"constructor"in b&&!(_.isFunction(aCtor)&&aCtor instanceof aCtor&&_.isFunction(bCtor)&&bCtor instanceof bCtor))return false;aStack.push(a);bStack.push(b);var size;var result;if(className==="[object Array]"){size=a.length;result=size===b.length;if(result)for(;size--;)if(!(result=eq(a[size],b[size],aStack,bStack)))break}else{var keys=_.keys(a);var key;size=keys.length;result=_.keys(b).length===size;if(result)for(;size--;){key=
keys[size];if(!(result=_.has(b,key)&&eq(a[key],b[key],aStack,bStack)))break}}aStack.pop();bStack.pop();return result};_.isEqual=function(a,b){return eq(a,b,[],[])};_.isEmpty=function(obj){if(obj==null)return true;if(_.isArray(obj)||_.isString(obj)||_.isArguments(obj))return obj.length===0;for(var key in obj)if(_.has(obj,key))return false;return true};_.isElement=function(obj){return!!(obj&&obj.nodeType===1)};_.isArray=nativeIsArray||function(obj){return toString.call(obj)==="[object Array]"};_.isObject=
function(obj){var type=typeof obj;return type==="function"||type==="object"&&!!obj};_.each(["Arguments","Function","String","Number","Date","RegExp"],function(name){_["is"+name]=function(obj){return toString.call(obj)==="[object "+name+"]"}});if(!_.isArguments(arguments))_.isArguments=function(obj){return _.has(obj,"callee")};if(typeof/./!=="function")_.isFunction=function(obj){return typeof obj=="function"||false};_.isFinite=function(obj){return isFinite(obj)&&!isNaN(parseFloat(obj))};_.isNaN=function(obj){return _.isNumber(obj)&&
obj!==+obj};_.isBoolean=function(obj){return obj===true||obj===false||toString.call(obj)==="[object Boolean]"};_.isNull=function(obj){return obj===null};_.isUndefined=function(obj){return obj===void 0};_.has=function(obj,key){return obj!=null&&hasOwnProperty.call(obj,key)};_.noConflict=function(){root._=previousUnderscore;return this};_.identity=function(value){return value};_.constant=function(value){return function(){return value}};_.noop=function(){};_.property=function(key){return function(obj){return obj[key]}};
_.matches=function(attrs){var pairs=_.pairs(attrs);var length=pairs.length;return function(obj){if(obj==null)return!length;obj=new Object(obj);for(var i=0;i<length;i++){var pair=pairs[i];var key=pair[0];if(pair[1]!==obj[key]||!(key in obj))return false}return true}};_.times=function(n,iteratee,context){var accum=Array(Math.max(0,n));iteratee=createCallback(iteratee,context,1);for(var i=0;i<n;i++)accum[i]=iteratee(i);return accum};_.random=function(min,max){if(max==null){max=min;min=0}return min+Math.floor(Math.random()*
(max-min+1))};_.now=Date.now||function(){return(new Date).getTime()};var escapeMap={"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#x27;","`":"\x26#x60;"};var unescapeMap=_.invert(escapeMap);var createEscaper=function(map){var escaper=function(match){return map[match]};var source="(?:"+_.keys(map).join("|")+")";var testRegexp=RegExp(source);var replaceRegexp=RegExp(source,"g");return function(string){string=string==null?"":""+string;return testRegexp.test(string)?string.replace(replaceRegexp,
escaper):string}};_.escape=createEscaper(escapeMap);_.unescape=createEscaper(unescapeMap);_.result=function(object,property){if(object==null)return void 0;var value=object[property];return _.isFunction(value)?object[property]():value};var idCounter=0;_.uniqueId=function(prefix){var id=++idCounter+"";return prefix?prefix+id:id};var noMatch=/(.)^/;var escapes={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"};var escaper=/\\|'|\r|\n|\u2028|\u2029/g;var escapeChar=function(match){return"\\"+
escapes[match]};_.template=function(text,settings,oldSettings){if(!settings&&oldSettings)settings=oldSettings;settings=_.defaults({},settings,_.templateSettings);var matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join("|")+"|$","g");var index=0;var source="__p+\x3d'";text.replace(matcher,function(match,escape,interpolate,evaluate,offset){source+=text.slice(index,offset).replace(escaper,escapeChar);index=offset+match.length;
if(escape)source+="'+\n((__t\x3d("+escape+"))\x3d\x3dnull?'':_.escape(__t))+\n'";else if(interpolate)source+="'+\n((__t\x3d("+interpolate+"))\x3d\x3dnull?'':__t)+\n'";else if(evaluate)source+="';\n"+evaluate+"\n__p+\x3d'";return match});source+="';\n";if(!settings.variable)source="with(obj||{}){\n"+source+"}\n";source="var __t,__p\x3d'',__j\x3dArray.prototype.join,"+"print\x3dfunction(){__p+\x3d__j.call(arguments,'');};\n"+source+"return __p;\n";try{var render=new Function(settings.variable||"obj",
"_",source)}catch(e){e.source=source;throw e;}var template=function(data){return render.call(this,data,_)};var argument=settings.variable||"obj";template.source="function("+argument+"){\n"+source+"}";return template};_.chain=function(obj){var instance=_(obj);instance._chain=true;return instance};var result=function(obj){return this._chain?_(obj).chain():obj};_.mixin=function(obj){_.each(_.functions(obj),function(name){var func=_[name]=obj[name];_.prototype[name]=function(){var args=[this._wrapped];
push.apply(args,arguments);return result.call(this,func.apply(_,args))}})};_.mixin(_);_.each(["pop","push","reverse","shift","sort","splice","unshift"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){var obj=this._wrapped;method.apply(obj,arguments);if((name==="shift"||name==="splice")&&obj.length===0)delete obj[0];return result.call(this,obj)}});_.each(["concat","join","slice"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){return result.call(this,
method.apply(this._wrapped,arguments))}});_.prototype.value=function(){return this._wrapped};if(typeof define==="function"&&define.amd)define("underscore",[],function(){return _})}).call(this);
(function($){var Slick=window.Slick||{};Slick=function(){function Slick(element,settings){var _=this;var responsiveSettings;var breakpoint;_.defaults={accessibility:true,appendArrows:$(element),arrows:true,asNavFor:null,prevArrow:'\x3cbutton type\x3d"button" data-role\x3d"none" class\x3d"slick-prev"\x3ePrevious\x3c/button\x3e',nextArrow:'\x3cbutton type\x3d"button" data-role\x3d"none" class\x3d"slick-next"\x3eNext\x3c/button\x3e',autoplay:false,autoplaySpeed:3E3,centerMode:false,centerPadding:"50px",
cssEase:"ease",customPaging:function(slider,i){return'\x3cbutton type\x3d"button" data-role\x3d"none"\x3e'+(i+1)+"\x3c/button\x3e"},dots:false,dotsClass:"slick-dots",draggable:true,easing:"linear",fade:false,focusOnSelect:false,infinite:true,lazyLoad:"ondemand",onBeforeChange:null,onAfterChange:null,onInit:null,onReInit:null,pauseOnHover:true,pauseOnDotsHover:false,responsive:null,rtl:false,slide:"div",slidesToShow:1,slidesToScroll:1,speed:300,swipe:true,touchMove:true,touchThreshold:5,useCSS:true,
vertical:false};_.initials={animating:false,dragging:false,autoPlayTimer:null,currentSlide:0,currentLeft:null,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:false,slideOffset:0,swipeLeft:null,$list:null,touchObject:{},transformsEnabled:false};$.extend(_,_.initials);_.activeBreakpoint=null;_.animType=null;_.animProp=null;_.breakpoints=[];_.breakpointSettings=[];_.cssTransitions=
false;_.paused=false;_.positionProp=null;_.$slider=$(element);_.$slidesCache=null;_.transformType=null;_.transitionType=null;_.windowWidth=0;_.windowTimer=null;_.options=$.extend({},_.defaults,settings);_.originalSettings=_.options;responsiveSettings=_.options.responsive||null;if(responsiveSettings&&responsiveSettings.length>-1){for(breakpoint in responsiveSettings)if(responsiveSettings.hasOwnProperty(breakpoint)){_.breakpoints.push(responsiveSettings[breakpoint].breakpoint);_.breakpointSettings[responsiveSettings[breakpoint].breakpoint]=
responsiveSettings[breakpoint].settings}_.breakpoints.sort(function(a,b){return b-a})}_.autoPlay=$.proxy(_.autoPlay,_);_.autoPlayClear=$.proxy(_.autoPlayClear,_);_.changeSlide=$.proxy(_.changeSlide,_);_.selectHandler=$.proxy(_.selectHandler,_);_.setPosition=$.proxy(_.setPosition,_);_.swipeHandler=$.proxy(_.swipeHandler,_);_.dragHandler=$.proxy(_.dragHandler,_);_.keyHandler=$.proxy(_.keyHandler,_);_.autoPlayIterator=$.proxy(_.autoPlayIterator,_);_.instanceUid=instanceUid++;_.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/;
_.init()}var instanceUid=0;return Slick}();Slick.prototype.addSlide=function(markup,index,addBefore){var _=this;if(typeof index==="boolean"){addBefore=index;index=null}else if(index<0||index>=_.slideCount)return false;_.unload();if(typeof index==="number")if(index===0&&_.$slides.length===0)$(markup).appendTo(_.$slideTrack);else if(addBefore)$(markup).insertBefore(_.$slides.eq(index));else $(markup).insertAfter(_.$slides.eq(index));else if(addBefore===true)$(markup).prependTo(_.$slideTrack);else $(markup).appendTo(_.$slideTrack);
_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slides.each(function(index,element){$(element).attr("index",index)});_.$slidesCache=_.$slides;_.reinit()};Slick.prototype.animateSlide=function(targetLeft,callback){var animProps={};var _=this;if(_.options.rtl===true&&_.options.vertical===false)targetLeft=-targetLeft;if(_.transformsEnabled===false)if(_.options.vertical===false)_.$slideTrack.animate({left:targetLeft},
_.options.speed,_.options.easing,callback);else _.$slideTrack.animate({top:targetLeft},_.options.speed,_.options.easing,callback);else if(_.cssTransitions===false)$({animStart:_.currentLeft}).animate({animStart:targetLeft},{duration:_.options.speed,easing:_.options.easing,step:function(now){if(_.options.vertical===false){animProps[_.animType]="translate("+now+"px, 0px)";_.$slideTrack.css(animProps)}else{animProps[_.animType]="translate(0px,"+now+"px)";_.$slideTrack.css(animProps)}},complete:function(){if(callback)callback.call()}});
else{_.applyTransition();if(_.options.vertical===false)animProps[_.animType]="translate3d("+targetLeft+"px, 0px, 0px)";else animProps[_.animType]="translate3d(0px,"+targetLeft+"px, 0px)";_.$slideTrack.css(animProps);if(callback)setTimeout(function(){_.disableTransition();callback.call()},_.options.speed)}};Slick.prototype.applyTransition=function(slide){var _=this;var transition={};if(_.options.fade===false)transition[_.transitionType]=_.transformType+" "+_.options.speed+"ms "+_.options.cssEase;else transition[_.transitionType]=
"opacity "+_.options.speed+"ms "+_.options.cssEase;if(_.options.fade===false)_.$slideTrack.css(transition);else _.$slides.eq(slide).css(transition)};Slick.prototype.autoPlay=function(){var _=this;if(_.autoPlayTimer)clearInterval(_.autoPlayTimer);if(_.slideCount>_.options.slidesToShow&&_.paused!==true)_.autoPlayTimer=setInterval(_.autoPlayIterator,_.options.autoplaySpeed)};Slick.prototype.autoPlayClear=function(){var _=this;if(_.autoPlayTimer)clearInterval(_.autoPlayTimer)};Slick.prototype.autoPlayIterator=
function(){var _=this;var asNavFor=_.options.asNavFor!=null?$(_.options.asNavFor).getSlick():null;if(_.options.infinite===false)if(_.direction===1){if(_.currentSlide+1===_.slideCount-1)_.direction=0;_.slideHandler(_.currentSlide+_.options.slidesToScroll);if(asNavFor!=null)asNavFor.slideHandler(asNavFor.currentSlide+asNavFor.options.slidesToScroll)}else{if(_.currentSlide-1===0)_.direction=1;_.slideHandler(_.currentSlide-_.options.slidesToScroll);if(asNavFor!=null)asNavFor.slideHandler(asNavFor.currentSlide-
asNavFor.options.slidesToScroll)}else{_.slideHandler(_.currentSlide+_.options.slidesToScroll);if(asNavFor!=null)asNavFor.slideHandler(asNavFor.currentSlide+asNavFor.options.slidesToScroll)}};Slick.prototype.buildArrows=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow=$(_.options.prevArrow);_.$nextArrow=$(_.options.nextArrow);if(_.htmlExpr.test(_.options.prevArrow))_.$prevArrow.appendTo(_.options.appendArrows);if(_.htmlExpr.test(_.options.nextArrow))_.$nextArrow.appendTo(_.options.appendArrows);
if(_.options.infinite!==true)_.$prevArrow.addClass("slick-disabled")}};Slick.prototype.buildDots=function(){var _=this;var i;var dotString;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow){dotString='\x3cul class\x3d"'+_.options.dotsClass+'"\x3e';for(i=0;i<=_.getDotCount();i+=1)dotString+="\x3cli\x3e"+_.options.customPaging.call(this,_,i)+"\x3c/li\x3e";dotString+="\x3c/ul\x3e";_.$dots=$(dotString).appendTo(_.$slider);_.$dots.find("li").first().addClass("slick-active")}};Slick.prototype.buildOut=
function(){var _=this;_.$slides=_.$slider.children(_.options.slide+":not(.slick-cloned)").addClass("slick-slide");_.slideCount=_.$slides.length;_.$slides.each(function(index,element){$(element).attr("index",index)});_.$slidesCache=_.$slides;_.$slider.addClass("slick-slider");_.$slideTrack=_.slideCount===0?$('\x3cdiv class\x3d"slick-track"/\x3e').appendTo(_.$slider):_.$slides.wrapAll('\x3cdiv class\x3d"slick-track"/\x3e').parent();_.$list=_.$slideTrack.wrap('\x3cdiv class\x3d"slick-list"/\x3e').parent();
_.$slideTrack.css("opacity",0);if(_.options.centerMode===true){_.options.slidesToScroll=1;if(_.options.slidesToShow%2===0)_.options.slidesToShow=3}$("img[data-lazy]",_.$slider).not("[src]").addClass("slick-loading");_.setupInfinite();_.buildArrows();_.buildDots();_.updateDots();if(_.options.accessibility===true)_.$list.prop("tabIndex",0);_.setSlideClasses(typeof this.currentSlide==="number"?this.currentSlide:0);if(_.options.draggable===true)_.$list.addClass("draggable")};Slick.prototype.checkResponsive=
function(){var _=this;var breakpoint;var targetBreakpoint;if(_.originalSettings.responsive&&_.originalSettings.responsive.length>-1&&_.originalSettings.responsive!==null){targetBreakpoint=null;for(breakpoint in _.breakpoints)if(_.breakpoints.hasOwnProperty(breakpoint))if($(window).width()<_.breakpoints[breakpoint])targetBreakpoint=_.breakpoints[breakpoint];if(targetBreakpoint!==null)if(_.activeBreakpoint!==null){if(targetBreakpoint!==_.activeBreakpoint){_.activeBreakpoint=targetBreakpoint;_.options=
$.extend({},_.options,_.breakpointSettings[targetBreakpoint]);_.refresh()}}else{_.activeBreakpoint=targetBreakpoint;_.options=$.extend({},_.options,_.breakpointSettings[targetBreakpoint]);_.refresh()}else if(_.activeBreakpoint!==null){_.activeBreakpoint=null;_.options=$.extend({},_.options,_.originalSettings);_.refresh()}}};Slick.prototype.changeSlide=function(event){var _=this;var $target=$(event.target);var asNavFor=_.options.asNavFor!=null?$(_.options.asNavFor).getSlick():null;$target.is("a")&&
event.preventDefault();switch(event.data.message){case "previous":if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide-_.options.slidesToScroll);if(asNavFor!=null)asNavFor.slideHandler(asNavFor.currentSlide-asNavFor.options.slidesToScroll)}break;case "next":if(_.slideCount>_.options.slidesToShow){_.slideHandler(_.currentSlide+_.options.slidesToScroll);if(asNavFor!=null)asNavFor.slideHandler(asNavFor.currentSlide+asNavFor.options.slidesToScroll)}break;case "index":var index=$(event.target).parent().index()*
_.options.slidesToScroll;_.slideHandler(index);if(asNavFor!=null)asNavFor.slideHandler(index);break;default:return false}};Slick.prototype.destroy=function(){var _=this;_.autoPlayClear();_.touchObject={};$(".slick-cloned",_.$slider).remove();if(_.$dots)_.$dots.remove();if(_.$prevArrow){_.$prevArrow.remove();_.$nextArrow.remove()}if(_.$slides.parent().hasClass("slick-track"))_.$slides.unwrap().unwrap();_.$slides.removeClass("slick-slide slick-active slick-visible").removeAttr("style");_.$slider.removeClass("slick-slider");
_.$slider.removeClass("slick-initialized");_.$list.off(".slick");$(window).off(".slick-"+_.instanceUid);$(document).off(".slick-"+_.instanceUid)};Slick.prototype.disableTransition=function(slide){var _=this;var transition={};transition[_.transitionType]="";if(_.options.fade===false)_.$slideTrack.css(transition);else _.$slides.eq(slide).css(transition)};Slick.prototype.fadeSlide=function(slideIndex,callback){var _=this;if(_.cssTransitions===false){_.$slides.eq(slideIndex).css({zIndex:1E3});_.$slides.eq(slideIndex).animate({opacity:1},
_.options.speed,_.options.easing,callback)}else{_.applyTransition(slideIndex);_.$slides.eq(slideIndex).css({opacity:1,zIndex:1E3});if(callback)setTimeout(function(){_.disableTransition(slideIndex);callback.call()},_.options.speed)}};Slick.prototype.filterSlides=function(filter){var _=this;if(filter!==null){_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.filter(filter).appendTo(_.$slideTrack);_.reinit()}};Slick.prototype.getCurrent=function(){var _=this;return _.currentSlide};
Slick.prototype.getDotCount=function(){var _=this;var breaker=0;var dotCounter=0;var dotCount=0;var dotLimit;for(dotLimit=_.options.infinite===true?_.slideCount+_.options.slidesToShow-_.options.slidesToScroll:_.slideCount;breaker<dotLimit;){dotCount++;dotCounter+=_.options.slidesToScroll;breaker=dotCounter+_.options.slidesToShow}return dotCount};Slick.prototype.getLeft=function(slideIndex){var _=this;var targetLeft;var verticalHeight;var verticalOffset=0;_.slideOffset=0;verticalHeight=_.$slides.first().outerHeight();
if(_.options.infinite===true){if(_.slideCount>_.options.slidesToShow){_.slideOffset=_.slideWidth*_.options.slidesToShow*-1;verticalOffset=verticalHeight*_.options.slidesToShow*-1}if(_.slideCount%_.options.slidesToScroll!==0)if(slideIndex+_.options.slidesToScroll>_.slideCount&&_.slideCount>_.options.slidesToShow){_.slideOffset=_.slideCount%_.options.slidesToShow*_.slideWidth*-1;verticalOffset=_.slideCount%_.options.slidesToShow*verticalHeight*-1}}else if(_.slideCount%_.options.slidesToShow!==0)if(slideIndex+
_.options.slidesToScroll>_.slideCount&&_.slideCount>_.options.slidesToShow){_.slideOffset=_.options.slidesToShow*_.slideWidth-_.slideCount%_.options.slidesToShow*_.slideWidth;verticalOffset=_.slideCount%_.options.slidesToShow*verticalHeight}if(_.options.centerMode===true&&_.options.infinite===true)_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2)-_.slideWidth;else if(_.options.centerMode===true)_.slideOffset+=_.slideWidth*Math.floor(_.options.slidesToShow/2);if(_.options.vertical===
false)targetLeft=slideIndex*_.slideWidth*-1+_.slideOffset;else targetLeft=slideIndex*verticalHeight*-1+verticalOffset;return targetLeft};Slick.prototype.init=function(){var _=this;if(!$(_.$slider).hasClass("slick-initialized")){_.buildOut();_.setProps();_.startLoad();_.loadSlider();_.initializeEvents();_.checkResponsive();$(_.$slider).addClass("slick-initialized")}if(_.options.onInit!==null)_.options.onInit.call(this,_)};Slick.prototype.initArrowEvents=function(){var _=this;if(_.options.arrows===
true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.on("click.slick",{message:"previous"},_.changeSlide);_.$nextArrow.on("click.slick",{message:"next"},_.changeSlide)}};Slick.prototype.initDotEvents=function(){var _=this;if(_.options.dots===true&&_.slideCount>_.options.slidesToShow)$("li",_.$dots).on("click.slick",{message:"index"},_.changeSlide);if(_.options.dots===true&&_.options.pauseOnDotsHover===true&&_.options.autoplay===true)$("li",_.$dots).on("mouseenter.slick",_.autoPlayClear).on("mouseleave.slick",
_.autoPlay)};Slick.prototype.initializeEvents=function(){var _=this;_.initArrowEvents();_.initDotEvents();_.$list.on("touchstart.slick mousedown.slick",{action:"start"},_.swipeHandler);_.$list.on("touchmove.slick mousemove.slick",{action:"move"},_.swipeHandler);_.$list.on("touchend.slick mouseup.slick",{action:"end"},_.swipeHandler);_.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},_.swipeHandler);if(_.options.pauseOnHover===true&&_.options.autoplay===true){_.$list.on("mouseenter.slick",
_.autoPlayClear);_.$list.on("mouseleave.slick",_.autoPlay)}if(_.options.accessibility===true)_.$list.on("keydown.slick",_.keyHandler);if(_.options.focusOnSelect===true)$(_.options.slide,_.$slideTrack).on("click.slick",_.selectHandler);$(window).on("orientationchange.slick.slick-"+_.instanceUid,function(){_.checkResponsive();_.setPosition()});$(window).on("resize.slick.slick-"+_.instanceUid,function(){if($(window).width()!==_.windowWidth){clearTimeout(_.windowDelay);_.windowDelay=window.setTimeout(function(){_.windowWidth=
$(window).width();_.checkResponsive();_.setPosition()},50)}});$(window).on("load.slick.slick-"+_.instanceUid,_.setPosition);$(document).on("ready.slick.slick-"+_.instanceUid,_.setPosition)};Slick.prototype.initUI=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.show();_.$nextArrow.show()}if(_.options.dots===true&&_.slideCount>_.options.slidesToShow)_.$dots.show();if(_.options.autoplay===true)_.autoPlay()};Slick.prototype.keyHandler=function(event){var _=
this;if(event.keyCode===37)_.changeSlide({data:{message:"previous"}});else if(event.keyCode===39)_.changeSlide({data:{message:"next"}})};Slick.prototype.lazyLoad=function(){function loadImages(imagesScope){$("img[data-lazy]",imagesScope).each(function(){var image=$(this);var imageSource=$(this).attr("data-lazy")+"?"+(new Date).getTime();image.load(function(){image.animate({opacity:1},200)}).css({opacity:0}).attr("src",imageSource).removeAttr("data-lazy").removeClass("slick-loading")})}var _=this;
var loadRange;var cloneRange;var rangeStart;var rangeEnd;if(_.options.centerMode===true||_.options.fade===true){rangeStart=_.options.slidesToShow+_.currentSlide-1;rangeEnd=rangeStart+_.options.slidesToShow+2}else{rangeStart=_.options.infinite?_.options.slidesToShow+_.currentSlide:_.currentSlide;rangeEnd=rangeStart+_.options.slidesToShow}loadRange=_.$slider.find(".slick-slide").slice(rangeStart,rangeEnd);loadImages(loadRange);if(_.slideCount==1){cloneRange=_.$slider.find(".slick-slide");loadImages(cloneRange)}else if(_.currentSlide>=
_.slideCount-_.options.slidesToShow){cloneRange=_.$slider.find(".slick-cloned").slice(0,_.options.slidesToShow);loadImages(cloneRange)}else if(_.currentSlide===0){cloneRange=_.$slider.find(".slick-cloned").slice(_.options.slidesToShow*-1);loadImages(cloneRange)}};Slick.prototype.loadSlider=function(){var _=this;_.setPosition();_.$slideTrack.css({opacity:1});_.$slider.removeClass("slick-loading");_.initUI();if(_.options.lazyLoad==="progressive")_.progressiveLazyLoad()};Slick.prototype.postSlide=function(index){var _=
this;if(_.options.onAfterChange!==null)_.options.onAfterChange.call(this,_,index);_.animating=false;_.setPosition();_.swipeLeft=null;if(_.options.autoplay===true&&_.paused===false)_.autoPlay()};Slick.prototype.progressiveLazyLoad=function(){var _=this;var imgCount;var targetImage;imgCount=$("img[data-lazy]").length;if(imgCount>0){targetImage=$("img[data-lazy]",_.$slider).first();targetImage.attr("src",targetImage.attr("data-lazy")).removeClass("slick-loading").load(function(){targetImage.removeAttr("data-lazy");
_.progressiveLazyLoad()})}};Slick.prototype.refresh=function(){var _=this;var currentSlide=_.currentSlide;_.destroy();$.extend(_,_.initials);_.currentSlide=currentSlide;_.init()};Slick.prototype.reinit=function(){var _=this;_.$slides=_.$slideTrack.children(_.options.slide).addClass("slick-slide");_.slideCount=_.$slides.length;if(_.currentSlide>=_.slideCount&&_.currentSlide!==0)_.currentSlide=_.currentSlide-_.options.slidesToScroll;_.setProps();_.setupInfinite();_.buildArrows();_.updateArrows();_.initArrowEvents();
_.buildDots();_.updateDots();_.initDotEvents();if(_.options.focusOnSelect===true)$(_.options.slide,_.$slideTrack).on("click.slick",_.selectHandler);_.setSlideClasses(0);_.setPosition();if(_.options.onReInit!==null)_.options.onReInit.call(this,_)};Slick.prototype.removeSlide=function(index,removeBefore){var _=this;if(typeof index==="boolean"){removeBefore=index;index=removeBefore===true?0:_.slideCount-1}else index=removeBefore===true?--index:index;if(_.slideCount<1||index<0||index>_.slideCount-1)return false;
_.unload();_.$slideTrack.children(this.options.slide).eq(index).remove();_.$slides=_.$slideTrack.children(this.options.slide);_.$slideTrack.children(this.options.slide).detach();_.$slideTrack.append(_.$slides);_.$slidesCache=_.$slides;_.reinit()};Slick.prototype.setCSS=function(position){var _=this;var positionProps={};var x;var y;if(_.options.rtl===true)position=-position;x=_.positionProp=="left"?position+"px":"0px";y=_.positionProp=="top"?position+"px":"0px";positionProps[_.positionProp]=position;
if(_.transformsEnabled===false)_.$slideTrack.css(positionProps);else{positionProps={};if(_.cssTransitions===false){positionProps[_.animType]="translate("+x+", "+y+")";_.$slideTrack.css(positionProps)}else{positionProps[_.animType]="translate3d("+x+", "+y+", 0px)";_.$slideTrack.css(positionProps)}}};Slick.prototype.setDimensions=function(){var _=this;if(_.options.vertical===false){if(_.options.centerMode===true)_.$list.css({padding:"0px "+_.options.centerPadding})}else{_.$list.height(_.$slides.first().outerHeight(true)*
_.options.slidesToShow);if(_.options.centerMode===true)_.$list.css({padding:_.options.centerPadding+" 0px"})}_.listWidth=_.$list.width();_.listHeight=_.$list.height();if(_.options.vertical===false){_.slideWidth=Math.ceil(_.listWidth/_.options.slidesToShow);_.$slideTrack.width(Math.ceil(_.slideWidth*_.$slideTrack.children(".slick-slide").length))}else{_.slideWidth=Math.ceil(_.listWidth);_.$slideTrack.height(Math.ceil(_.$slides.first().outerHeight(true)*_.$slideTrack.children(".slick-slide").length))}var offset=
_.$slides.first().outerWidth(true)-_.$slides.first().width();_.$slideTrack.children(".slick-slide").width(_.slideWidth-offset)};Slick.prototype.setFade=function(){var _=this;var targetLeft;_.$slides.each(function(index,element){targetLeft=_.slideWidth*index*-1;$(element).css({position:"relative",left:targetLeft,top:0,zIndex:800,opacity:0})});_.$slides.eq(_.currentSlide).css({zIndex:900,opacity:1})};Slick.prototype.setPosition=function(){var _=this;_.setDimensions();if(_.options.fade===false)_.setCSS(_.getLeft(_.currentSlide));
else _.setFade()};Slick.prototype.setProps=function(){var _=this;_.positionProp=_.options.vertical===true?"top":"left";if(_.positionProp==="top")_.$slider.addClass("slick-vertical");else _.$slider.removeClass("slick-vertical");if(document.body.style.WebkitTransition!==undefined||document.body.style.MozTransition!==undefined||document.body.style.msTransition!==undefined)if(_.options.useCSS===true)_.cssTransitions=true;if(document.body.style.MozTransform!==undefined){_.animType="MozTransform";_.transformType=
"-moz-transform";_.transitionType="MozTransition"}if(document.body.style.webkitTransform!==undefined){_.animType="webkitTransform";_.transformType="-webkit-transform";_.transitionType="webkitTransition"}if(document.body.style.msTransform!==undefined){_.animType="msTransform";_.transformType="-ms-transform";_.transitionType="msTransition"}if(document.body.style.transform!==undefined){_.animType="transform";_.transformType="transform";_.transitionType="transition"}_.transformsEnabled=_.animType!==null};
Slick.prototype.setSlideClasses=function(index){var _=this;var centerOffset;var allSlides;var indexOffset;var remainder;_.$slider.find(".slick-slide").removeClass("slick-active").removeClass("slick-center");allSlides=_.$slider.find(".slick-slide");if(_.options.centerMode===true){centerOffset=Math.floor(_.options.slidesToShow/2);if(_.options.infinite===true){if(index>=centerOffset&&index<=_.slideCount-1-centerOffset)_.$slides.slice(index-centerOffset,index+centerOffset+1).addClass("slick-active");
else{indexOffset=_.options.slidesToShow+index;allSlides.slice(indexOffset-centerOffset+1,indexOffset+centerOffset+2).addClass("slick-active")}if(index===0)allSlides.eq(allSlides.length-1-_.options.slidesToShow).addClass("slick-center");else if(index===_.slideCount-1)allSlides.eq(_.options.slidesToShow).addClass("slick-center")}_.$slides.eq(index).addClass("slick-center")}else if(index>=0&&index<=_.slideCount-_.options.slidesToShow)_.$slides.slice(index,index+_.options.slidesToShow).addClass("slick-active");
else if(allSlides.length<=_.options.slidesToShow)allSlides.addClass("slick-active");else{remainder=_.slideCount%_.options.slidesToShow;indexOffset=_.options.infinite===true?_.options.slidesToShow+index:index;if(_.options.slidesToShow==_.options.slidesToScroll&&_.slideCount-index<_.options.slidesToShow)allSlides.slice(indexOffset-(_.options.slidesToShow-remainder),indexOffset+remainder).addClass("slick-active");else allSlides.slice(indexOffset,indexOffset+_.options.slidesToShow).addClass("slick-active")}if(_.options.lazyLoad===
"ondemand")_.lazyLoad()};Slick.prototype.setupInfinite=function(){var _=this;var i;var slideIndex;var infiniteCount;if(_.options.fade===true||_.options.vertical===true)_.options.centerMode=false;if(_.options.infinite===true&&_.options.fade===false){slideIndex=null;if(_.slideCount>_.options.slidesToShow){if(_.options.centerMode===true)infiniteCount=_.options.slidesToShow+1;else infiniteCount=_.options.slidesToShow;for(i=_.slideCount;i>_.slideCount-infiniteCount;i-=1){slideIndex=i-1;$(_.$slides[slideIndex]).clone(true).attr("id",
"").prependTo(_.$slideTrack).addClass("slick-cloned")}for(i=0;i<infiniteCount;i+=1){slideIndex=i;$(_.$slides[slideIndex]).clone(true).attr("id","").appendTo(_.$slideTrack).addClass("slick-cloned")}_.$slideTrack.find(".slick-cloned").find("[id]").each(function(){$(this).attr("id","")})}}};Slick.prototype.selectHandler=function(event){var _=this;var asNavFor=_.options.asNavFor!=null?$(_.options.asNavFor).getSlick():null;var index=parseInt($(event.target).parent().attr("index"));if(!index)index=0;if(_.slideCount<=
_.options.slidesToShow)return;_.slideHandler(index);if(asNavFor!=null){if(asNavFor.slideCount<=asNavFor.options.slidesToShow)return;asNavFor.slideHandler(index)}};Slick.prototype.slideHandler=function(index){var targetSlide;var animSlide;var slideLeft;var unevenOffset;var targetLeft=null;var _=this;if(_.animating===true)return false;targetSlide=index;targetLeft=_.getLeft(targetSlide);slideLeft=_.getLeft(_.currentSlide);unevenOffset=_.slideCount%_.options.slidesToScroll!==0?_.options.slidesToScroll:
0;_.currentLeft=_.swipeLeft===null?slideLeft:_.swipeLeft;if(_.options.infinite===false&&_.options.centerMode===false&&(index<0||index>_.slideCount-_.options.slidesToShow+unevenOffset)){if(_.options.fade===false){targetSlide=_.currentSlide;_.animateSlide(slideLeft,function(){_.postSlide(targetSlide)})}return false}else if(_.options.infinite===false&&_.options.centerMode===true&&(index<0||index>_.slideCount-_.options.slidesToScroll)){if(_.options.fade===false){targetSlide=_.currentSlide;_.animateSlide(slideLeft,
function(){_.postSlide(targetSlide)})}return false}if(_.options.autoplay===true)clearInterval(_.autoPlayTimer);if(targetSlide<0)if(_.slideCount%_.options.slidesToScroll!==0)animSlide=_.slideCount-_.slideCount%_.options.slidesToScroll;else animSlide=_.slideCount-_.options.slidesToScroll;else if(targetSlide>_.slideCount-1)animSlide=0;else animSlide=targetSlide;_.animating=true;if(_.options.onBeforeChange!==null&&index!==_.currentSlide)_.options.onBeforeChange.call(this,_,_.currentSlide,animSlide);_.currentSlide=
animSlide;_.setSlideClasses(_.currentSlide);_.updateDots();_.updateArrows();if(_.options.fade===true){_.fadeSlide(animSlide,function(){_.postSlide(animSlide)});return false}_.animateSlide(targetLeft,function(){_.postSlide(animSlide)})};Slick.prototype.startLoad=function(){var _=this;if(_.options.arrows===true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.hide();_.$nextArrow.hide()}if(_.options.dots===true&&_.slideCount>_.options.slidesToShow)_.$dots.hide();_.$slider.addClass("slick-loading")};
Slick.prototype.swipeDirection=function(){var xDist;var yDist;var r;var swipeAngle;var _=this;xDist=_.touchObject.startX-_.touchObject.curX;yDist=_.touchObject.startY-_.touchObject.curY;r=Math.atan2(yDist,xDist);swipeAngle=Math.round(r*180/Math.PI);if(swipeAngle<0)swipeAngle=360-Math.abs(swipeAngle);if(swipeAngle<=45&&swipeAngle>=0)return"left";if(swipeAngle<=360&&swipeAngle>=315)return"left";if(swipeAngle>=135&&swipeAngle<=225)return"right";return"vertical"};Slick.prototype.swipeEnd=function(event$$0){var _=
this;var asNavFor=_.options.asNavFor!=null?$(_.options.asNavFor).getSlick():null;_.dragging=false;if(_.touchObject.curX===undefined)return false;if(_.touchObject.swipeLength>=_.touchObject.minSwipe){$(event$$0.target).on("click.slick",function(event){event.stopImmediatePropagation();event.stopPropagation();event.preventDefault();$(event.target).off("click.slick")});switch(_.swipeDirection()){case "left":_.slideHandler(_.currentSlide+_.options.slidesToScroll);if(asNavFor!=null)asNavFor.slideHandler(asNavFor.currentSlide+
asNavFor.options.slidesToScroll);_.touchObject={};break;case "right":_.slideHandler(_.currentSlide-_.options.slidesToScroll);if(asNavFor!=null)asNavFor.slideHandler(asNavFor.currentSlide-asNavFor.options.slidesToScroll);_.touchObject={};break}}else if(_.touchObject.startX!==_.touchObject.curX){_.slideHandler(_.currentSlide);if(asNavFor!=null)asNavFor.slideHandler(asNavFor.currentSlide);_.touchObject={}}};Slick.prototype.swipeHandler=function(event){var _=this;if(_.options.swipe===false||"ontouchend"in
document&&_.options.swipe===false)return;else if(_.options.draggable===false||_.options.draggable===false&&!event.originalEvent.touches)return;_.touchObject.fingerCount=event.originalEvent&&event.originalEvent.touches!==undefined?event.originalEvent.touches.length:1;_.touchObject.minSwipe=_.listWidth/_.options.touchThreshold;switch(event.data.action){case "start":_.swipeStart(event);break;case "move":_.swipeMove(event);break;case "end":_.swipeEnd(event);break}};Slick.prototype.swipeMove=function(event){var _=
this;var curLeft;var swipeDirection;var positionOffset;var touches;touches=event.originalEvent!==undefined?event.originalEvent.touches:null;curLeft=_.getLeft(_.currentSlide);if(!_.dragging||touches&&touches.length!==1)return false;_.touchObject.curX=touches!==undefined?touches[0].pageX:event.clientX;_.touchObject.curY=touches!==undefined?touches[0].pageY:event.clientY;_.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(_.touchObject.curX-_.touchObject.startX,2)));swipeDirection=_.swipeDirection();
if(swipeDirection==="vertical")return;if(event.originalEvent!==undefined&&_.touchObject.swipeLength>4)event.preventDefault();positionOffset=_.touchObject.curX>_.touchObject.startX?1:-1;if(_.options.vertical===false)_.swipeLeft=curLeft+_.touchObject.swipeLength*positionOffset;else _.swipeLeft=curLeft+_.touchObject.swipeLength*(_.$list.height()/_.listWidth)*positionOffset;if(_.options.fade===true||_.options.touchMove===false)return false;if(_.animating===true){_.swipeLeft=null;return false}_.setCSS(_.swipeLeft)};
Slick.prototype.swipeStart=function(event){var _=this;var touches;if(_.touchObject.fingerCount!==1||_.slideCount<=_.options.slidesToShow){_.touchObject={};return false}if(event.originalEvent!==undefined&&event.originalEvent.touches!==undefined)touches=event.originalEvent.touches[0];_.touchObject.startX=_.touchObject.curX=touches!==undefined?touches.pageX:event.clientX;_.touchObject.startY=_.touchObject.curY=touches!==undefined?touches.pageY:event.clientY;_.dragging=true};Slick.prototype.unfilterSlides=
function(){var _=this;if(_.$slidesCache!==null){_.unload();_.$slideTrack.children(this.options.slide).detach();_.$slidesCache.appendTo(_.$slideTrack);_.reinit()}};Slick.prototype.unload=function(){var _=this;$(".slick-cloned",_.$slider).remove();if(_.$dots)_.$dots.remove();if(_.$prevArrow){_.$prevArrow.remove();_.$nextArrow.remove()}_.$slides.removeClass("slick-slide slick-active slick-visible").removeAttr("style")};Slick.prototype.updateArrows=function(){var _=this;if(_.options.arrows===true&&_.options.infinite!==
true&&_.slideCount>_.options.slidesToShow){_.$prevArrow.removeClass("slick-disabled");_.$nextArrow.removeClass("slick-disabled");if(_.currentSlide===0){_.$prevArrow.addClass("slick-disabled");_.$nextArrow.removeClass("slick-disabled")}else if(_.currentSlide>=_.slideCount-_.options.slidesToShow){_.$nextArrow.addClass("slick-disabled");_.$prevArrow.removeClass("slick-disabled")}}};Slick.prototype.updateDots=function(){var _=this;if(_.$dots!==null){_.$dots.find("li").removeClass("slick-active");_.$dots.find("li").eq(Math.floor(_.currentSlide/
_.options.slidesToScroll)).addClass("slick-active")}};$.fn.slick=function(options){var _=this;return _.each(function(index,element){element.slick=new Slick(element,options)})};$.fn.slickAdd=function(slide,slideIndex,addBefore){var _=this;return _.each(function(index,element){element.slick.addSlide(slide,slideIndex,addBefore)})};$.fn.slickCurrentSlide=function(){var _=this;return _.get(0).slick.getCurrent()};$.fn.slickFilter=function(filter){var _=this;return _.each(function(index,element){element.slick.filterSlides(filter)})};
$.fn.slickGoTo=function(slide){var _=this;return _.each(function(index,element){var asNavFor=element.slick.options.asNavFor!=null?$(element.slick.options.asNavFor):null;if(asNavFor!=null)asNavFor.slickGoTo(slide);element.slick.slideHandler(slide)})};$.fn.slickNext=function(){var _=this;return _.each(function(index,element){element.slick.changeSlide({data:{message:"next"}})})};$.fn.slickPause=function(){var _=this;return _.each(function(index,element){element.slick.autoPlayClear();element.slick.paused=
true})};$.fn.slickPlay=function(){var _=this;return _.each(function(index,element){element.slick.paused=false;element.slick.autoPlay()})};$.fn.slickPrev=function(){var _=this;return _.each(function(index,element){element.slick.changeSlide({data:{message:"previous"}})})};$.fn.slickRemove=function(slideIndex,removeBefore){var _=this;return _.each(function(index,element){element.slick.removeSlide(slideIndex,removeBefore)})};$.fn.slickGetOption=function(option){var _=this;return _.get(0).slick.options[option]};
$.fn.slickSetOption=function(option,value,refresh){var _=this;return _.each(function(index,element){element.slick.options[option]=value;if(refresh===true){element.slick.unload();element.slick.reinit()}})};$.fn.slickUnfilter=function(){var _=this;return _.each(function(index,element){element.slick.unfilterSlides()})};$.fn.unslick=function(){var _=this;return _.each(function(index,element){if(element.slick)element.slick.destroy()})};$.fn.getSlick=function(){var s=null;var _=this;_.each(function(index,
element){s=element.slick});return s}})(jQuery);
(function(e){e.easing["jswing"]=e.easing["swing"];e.extend(e.easing,{def:"easeOutQuad",swing:function(t,n,r,i,s){return e.easing[e.easing.def](t,n,r,i,s)},easeInQuad:function(e,t,n,r,i){return r*(t/=i)*t+n},easeOutQuad:function(e,t,n,r,i){return-r*(t/=i)*(t-2)+n},easeInOutQuad:function(e,t,n,r,i){if((t/=i/2)<1)return r/2*t*t+n;return-r/2*(--t*(t-2)-1)+n},easeInCubic:function(e,t,n,r,i){return r*(t/=i)*t*t+n},easeOutCubic:function(e,t,n,r,i){return r*((t=t/i-1)*t*t+1)+n},easeInOutCubic:function(e,
t,n,r,i){if((t/=i/2)<1)return r/2*t*t*t+n;return r/2*((t-=2)*t*t+2)+n},easeInQuart:function(e,t,n,r,i){return r*(t/=i)*t*t*t+n},easeOutQuart:function(e,t,n,r,i){return-r*((t=t/i-1)*t*t*t-1)+n},easeInOutQuart:function(e,t,n,r,i){if((t/=i/2)<1)return r/2*t*t*t*t+n;return-r/2*((t-=2)*t*t*t-2)+n},easeInQuint:function(e,t,n,r,i){return r*(t/=i)*t*t*t*t+n},easeOutQuint:function(e,t,n,r,i){return r*((t=t/i-1)*t*t*t*t+1)+n},easeInOutQuint:function(e,t,n,r,i){if((t/=i/2)<1)return r/2*t*t*t*t*t+n;return r/
2*((t-=2)*t*t*t*t+2)+n},easeInSine:function(e,t,n,r,i){return-r*Math.cos(t/i*(Math.PI/2))+r+n},easeOutSine:function(e,t,n,r,i){return r*Math.sin(t/i*(Math.PI/2))+n},easeInOutSine:function(e,t,n,r,i){return-r/2*(Math.cos(Math.PI*t/i)-1)+n},easeInExpo:function(e,t,n,r,i){return t==0?n:r*Math.pow(2,10*(t/i-1))+n},easeOutExpo:function(e,t,n,r,i){return t==i?n+r:r*(-Math.pow(2,-10*t/i)+1)+n},easeInOutExpo:function(e,t,n,r,i){if(t==0)return n;if(t==i)return n+r;if((t/=i/2)<1)return r/2*Math.pow(2,10*(t-
1))+n;return r/2*(-Math.pow(2,-10*--t)+2)+n},easeInCirc:function(e,t,n,r,i){return-r*(Math.sqrt(1-(t/=i)*t)-1)+n},easeOutCirc:function(e,t,n,r,i){return r*Math.sqrt(1-(t=t/i-1)*t)+n},easeInOutCirc:function(e,t,n,r,i){if((t/=i/2)<1)return-r/2*(Math.sqrt(1-t*t)-1)+n;return r/2*(Math.sqrt(1-(t-=2)*t)+1)+n},easeInElastic:function(e,t,n,r,i){var s=1.70158;var o=0;var u=r;if(t==0)return n;if((t/=i)==1)return n+r;if(!o)o=i*.3;if(u<Math.abs(r)){u=r;s=o/4}else s=o/(2*Math.PI)*Math.asin(r/u);return-(u*Math.pow(2,
10*(t-=1))*Math.sin((t*i-s)*2*Math.PI/o))+n},easeOutElastic:function(e,t,n,r,i){var s=1.70158;var o=0;var u=r;if(t==0)return n;if((t/=i)==1)return n+r;if(!o)o=i*.3;if(u<Math.abs(r)){u=r;s=o/4}else s=o/(2*Math.PI)*Math.asin(r/u);return u*Math.pow(2,-10*t)*Math.sin((t*i-s)*2*Math.PI/o)+r+n},easeInOutElastic:function(e,t,n,r,i){var s=1.70158;var o=0;var u=r;if(t==0)return n;if((t/=i/2)==2)return n+r;if(!o)o=i*.3*1.5;if(u<Math.abs(r)){u=r;s=o/4}else s=o/(2*Math.PI)*Math.asin(r/u);if(t<1)return-.5*u*Math.pow(2,
10*(t-=1))*Math.sin((t*i-s)*2*Math.PI/o)+n;return u*Math.pow(2,-10*(t-=1))*Math.sin((t*i-s)*2*Math.PI/o)*.5+r+n},easeInBack:function(e,t,n,r,i,s){if(s==undefined)s=1.70158;return r*(t/=i)*t*((s+1)*t-s)+n},easeOutBack:function(e,t,n,r,i,s){if(s==undefined)s=1.70158;return r*((t=t/i-1)*t*((s+1)*t+s)+1)+n},easeInOutBack:function(e,t,n,r,i,s){if(s==undefined)s=1.70158;if((t/=i/2)<1)return r/2*t*t*(((s*=1.525)+1)*t-s)+n;return r/2*((t-=2)*t*(((s*=1.525)+1)*t+s)+2)+n},easeInBounce:function(t,n,r,i,s){return i-
e.easing.easeOutBounce(t,s-n,0,i,s)+r},easeOutBounce:function(e,t,n,r,i){if((t/=i)<1/2.75)return r*7.5625*t*t+n;else if(t<2/2.75)return r*(7.5625*(t-=1.5/2.75)*t+.75)+n;else if(t<2.5/2.75)return r*(7.5625*(t-=2.25/2.75)*t+.9375)+n;else return r*(7.5625*(t-=2.625/2.75)*t+.984375)+n},easeInOutBounce:function(t,n,r,i,s){if(n<s/2)return e.easing.easeInBounce(t,n*2,0,i,s)*.5+r;return e.easing.easeOutBounce(t,n*2-s,0,i,s)*.5+i*.5+r}});e.fn.animatescroll=function(t){var n=e.extend({},e.fn.animatescroll.defaults,
t);if(typeof n.onScrollStart=="function")n.onScrollStart.call(this);if(n.element=="html,body"){var r=this.offset().top;e(n.element).stop().animate({scrollTop:r-n.padding},n.scrollSpeed,n.easing)}else e(n.element).stop().animate({scrollTop:this.offset().top-this.parent().offset().top+this.parent().scrollTop()-n.padding},n.scrollSpeed,n.easing);setTimeout(function(){if(typeof n.onScrollEnd=="function")n.onScrollEnd.call(this)},n.scrollSpeed)};e.fn.animatescroll.defaults={easing:"swing",scrollSpeed:800,
padding:0,element:"html,body"}})(jQuery);
(function(window,document,$){function args(elem){var newAttrs={};var rinlinejQuery=/^jQuery\d+$/;$.each(elem.attributes,function(i,attr){if(attr.specified&&!rinlinejQuery.test(attr.name))newAttrs[attr.name]=attr.value});return newAttrs}function clearPlaceholder(event,value){var input=this;var $input=$(input);if(input.value==$input.attr("placeholder")&&$input.hasClass("placeholder"))if($input.data("placeholder-password")){$input=$input.hide().next().show().attr("id",$input.removeAttr("id").data("placeholder-id"));
if(event===true)return $input[0].value=value;$input.focus()}else{input.value="";$input.removeClass("placeholder");input==safeActiveElement()&&input.select()}}function setPlaceholder(){var $replacement;var input=this;var $input=$(input);var id=this.id;if(input.value==""){if(input.type=="password"){if(!$input.data("placeholder-textinput")){try{$replacement=$input.clone().attr({"type":"text"})}catch(e){$replacement=$("\x3cinput\x3e").attr($.extend(args(this),{"type":"text"}))}$replacement.removeAttr("name").data({"placeholder-password":$input,
"placeholder-id":id}).bind("focus.placeholder",clearPlaceholder);$input.data({"placeholder-textinput":$replacement,"placeholder-id":id}).before($replacement)}$input=$input.removeAttr("id").hide().prev().attr("id",id).show()}$input.addClass("placeholder");$input[0].value=$input.attr("placeholder")}else $input.removeClass("placeholder")}function safeActiveElement(){try{return document.activeElement}catch(exception){}}var isOperaMini=Object.prototype.toString.call(window.operamini)=="[object OperaMini]";
var isInputSupported="placeholder"in document.createElement("input")&&!isOperaMini;var isTextareaSupported="placeholder"in document.createElement("textarea")&&!isOperaMini;var prototype=$.fn;var valHooks=$.valHooks;var propHooks=$.propHooks;var hooks;var placeholder;if(isInputSupported&&isTextareaSupported){placeholder=prototype.placeholder=function(){return this};placeholder.input=placeholder.textarea=true}else{placeholder=prototype.placeholder=function(){var $this=this;$this.filter((isInputSupported?
"textarea":":input")+"[placeholder]").not(".placeholder").bind({"focus.placeholder":clearPlaceholder,"blur.placeholder":setPlaceholder}).data("placeholder-enabled",true).trigger("blur.placeholder");return $this};placeholder.input=isInputSupported;placeholder.textarea=isTextareaSupported;hooks={"get":function(element){var $element=$(element);var $passwordInput=$element.data("placeholder-password");if($passwordInput)return $passwordInput[0].value;return $element.data("placeholder-enabled")&&$element.hasClass("placeholder")?
"":element.value},"set":function(element,value){var $element=$(element);var $passwordInput=$element.data("placeholder-password");if($passwordInput)return $passwordInput[0].value=value;if(!$element.data("placeholder-enabled"))return element.value=value;if(value==""){element.value=value;if(element!=safeActiveElement())setPlaceholder.call(element)}else if($element.hasClass("placeholder"))clearPlaceholder.call(element,true,value)||(element.value=value);else element.value=value;return $element}};if(!isInputSupported){valHooks.input=
hooks;propHooks.value=hooks}if(!isTextareaSupported){valHooks.textarea=hooks;propHooks.value=hooks}$(function(){$(document).delegate("form","submit.placeholder",function(){var $inputs=$(".placeholder",this).each(clearPlaceholder);setTimeout(function(){$inputs.each(setPlaceholder)},10)})});$(window).bind("beforeunload.placeholder",function(){$(".placeholder").each(function(){this.value=""})})}})(this,document,jQuery);
jQuery(function(){function isValidEmailAddress(email){var validEmail=false;if(email){email=email.trim().toLowerCase();var pattern=/^[\w-']+(\.[\w-']+)*@([a-zA-Z0-9]+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*?\.[a-zA-Z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$/;validEmail=pattern.exec(email)}return validEmail}function sendFormToSubscribe(form){if(!form.hasClass("hasBeenSent"))if(typeof fitbitViewer!=typeof undef){var fieldEmail=$("#subscribeEmailId").val();if(fieldEmail==fitbitViewer&&fitbitViewer!=""&&fieldEmail!=
"")sendSubscribeForCurrentUser(fitbitViewer,form);else sendSubscribeForNewUser(form)}else sendSubscribeForNewUser(form)}function sendSubscribeForNewUser(form){$.getJSON(form.attr("action")+"?callback\x3d?",form.serialize(),function(data){var $message=data.Message;var $status=data.Status===200?"success":"error";if(typeof cmForm!=typeof undef&&typeof cmForm[$status+"Message"]!=typeof undef)$message=cmForm[$status+"Message"];if($status=="success"){form.addClass("hasBeenSent");$("#subscribeEmailId").attr("disabled",
"disabled");$("#homepage-subscribe-field-button").hide()}if(form.parent().find(".message").length)form.parent().find(".message").removeClass("success error").addClass($status).empty().append($message);else alert($message)})}function sendSubscribeForCurrentUser(email,form){$.ajax({type:"POST",url:"/ajaxapi",data:$.param({request:JSON.stringify({"template":"/mgmt/ajaxTemplate.jsp","serviceCalls":[{"name":"notificationSetting","method":"subscribeToProductUpdates","args":{"email":email}}]})})}).done(function(data){var $message=
"";if(typeof cmForm!=typeof undef&&typeof cmForm.successMessage!=typeof undef)$message=cmForm.successMessage;form.addClass("hasBeenSent");$("#subscribeEmailId").attr("disabled","disabled");$("#homepage-subscribe-field-button").hide();if(form.parent().find(".message").length)form.parent().find(".message").removeClass("success error").addClass("success").empty().append($message);else alert($message)})}function sendSubscribeForNewDevices(form){$.getJSON(form.attr("action")+"?callback\x3d?",form.serialize(),
function(data){$(".feedback-area form, .feedback-area .product-message").fadeOut(function(){$(".feedback-area .thanks-message").fadeIn()})})}function sendSubscribeForNewDevicesStore(form){$.getJSON(form.attr("action")+"?callback\x3d?",form.serialize(),function(data){})}if(typeof String.prototype.trim!=="function")String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};$("#homepage-subscribe-field-button").click(function(e){var form=$("#cmForm");sendFormToSubscribe(form)});$("#cmForm").submit(function(e){e.preventDefault();
var form=$(this);sendFormToSubscribe(form)});$(".feedback-area form").submit(function(e){e.preventDefault();var _email=$(".feedback-area form input[type\x3d'email']").val();if(isValidEmailAddress(_email))sendSubscribeForNewDevices($(this));else{var _e_message=$(".feedback-area").attr("error_message");$(".feedback-area form div .subscription-error-message").remove();$(".feedback-area form div").prepend("\x3cspan class\x3d'subscription-error-message'\x3e"+_e_message+"\x3c/span\x3e")}});$(".feedback-area .arrow").click(function(){$(".feedback-area form").find(":submit").click()})});
$(document).ready(function(){FastClick.attach(document.body);var slider=$("#slider");if(typeof String.prototype.trim!=="function")String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")};if(slider.length){slider.slick({arrows:false,dots:true,infinite:true,autoplay:true,autoplaySpeed:5E3});var slick=slider.getSlick();slick.$list.on("touchmove.slick mousemove.slick",function(){if(slick.dragging)slider.slickPause()});slider.find(".slick-dots li button").on("click",function(){slider.slickPause()})}$("input, textarea").placeholder()});
function PointerEventsPolyfill(options){this.options={selector:"*",mouseEvents:["click","dblclick","mousedown","mouseup"],usePolyfillIf:function(){if(navigator.appName=="Microsoft Internet Explorer"){var agent=navigator.userAgent;if(agent.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/)!=null){var version=parseFloat(RegExp.$1);if(version<11)return true}}return false}};if(options){var obj=this;$.each(options,function(k,v){obj.options[k]=v})}if(this.options.usePolyfillIf())this.register_mouse_events()}
PointerEventsPolyfill.initialize=function(options){if(PointerEventsPolyfill.singleton==null)PointerEventsPolyfill.singleton=new PointerEventsPolyfill(options);return PointerEventsPolyfill.singleton};
PointerEventsPolyfill.prototype.register_mouse_events=function(){$(document).on(this.options.mouseEvents.join(" "),this.options.selector,function(e){if($(this).css("pointer-events")=="none"){var origDisplayAttribute=$(this).css("display");$(this).css("display","none");var underneathElem=document.elementFromPoint(e.clientX,e.clientY);if(origDisplayAttribute)$(this).css("display",origDisplayAttribute);else $(this).css("display","");e.target=underneathElem;$(underneathElem).trigger(e);return false}return true})};
var detectIE=function(){var ua=window.navigator.userAgent;var msie=ua.indexOf("MSIE ");var trident=ua.indexOf("Trident/");if(msie>0)return parseInt(ua.substring(msie+5,ua.indexOf(".",msie)),10);if(trident>0){var rv=ua.indexOf("rv:");return parseInt(ua.substring(rv+3,ua.indexOf(".",rv)),10)}return false};var chunk=function(data,number){return _.chain(data).groupBy(function(element,index){return Math.floor(index/number)}).toArray().value()};
var isMobile=function(){return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i.test(navigator.userAgent||navigator.vendor||window.opera)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test((navigator.userAgent||
navigator.vendor||window.opera).substr(0,4))};var setClassesForProduct=function(windowWidth){var storeProducts=$("#product").find(".store-product");if(windowWidth>1150)_.each(storeProducts,function(e,i){$(e).addClass(_.include([2,5],i)?"popup-detail-left":"popup-detail-right")});else _.each(storeProducts,function(e,i){$(e).addClass(i%2==0?"popup-detail-right":"popup-detail-left")})};
var setStorePopupPosition=function(windowWidth,storeProduct,storePopup,pos,posHeader,index,height){var top;var left;if(storeProduct.closest(".aprl-section").length)return;if(windowWidth>1150){if(storeProduct.hasClass("charge")||storeProduct.hasClass("chargehr")||storeProduct.hasClass("surge"))top=posHeader.top-3;else top=posHeader.top+22;if(storeProduct.hasClass("popup-detail-left"))storePopup.css({"left":-358,"margin-left":2.5,"top":top});else if(_.include([0,3,6],index))storePopup.css({left:-20,
top:top});else if(navigator.userAgent.search("Safari")>=0&&navigator.userAgent.search("Chrome")<0)storePopup.css({left:-21,top:top});else storePopup.css({left:-20,top:top})}else if(windowWidth>767){top=storeProduct.hasClass("charge")||storeProduct.hasClass("chargehr")?posHeader.top-13:posHeader.top+22;left=storeProduct.hasClass("popup-detail-left")?-358:-20.5;storePopup.css({left:left,top:top})}else{top=storeProduct.hasClass("charge")||storeProduct.hasClass("chargehr")?posHeader.top-43:posHeader.top+
37;if(storeProduct.hasClass("popup-detail-left"))storePopup.css({"left":-151.5,"top":top});else storePopup.css({left:-2.5,top:top})}};var calculateMaxValue=function(storeProducts,klass){return _.max(_.map(storeProducts.find(klass),function(el){return $(el).height()}),function(h){return h})};
var calculateHeight=function(windowWidth,storeProduct,klass,detailHeight,diffHeightValue,plusValDetailHeight,plusValHeaderHeight){var maxHeaderHeight;var maxFooterHeight;if(klass==".aria"){maxHeaderHeight=storeProduct.find(".store-product-header").height();maxFooterHeight=storeProduct.find(".store-product-footer").height()}else{var storeProducts=$(klass);maxHeaderHeight=calculateMaxValue(storeProducts,".store-product-header");maxFooterHeight=calculateMaxValue(storeProducts,".store-product-footer");
storeProduct.find(".store-product-header").height(maxHeaderHeight)}if(detailHeight>maxHeaderHeight+maxFooterHeight-diffHeightValue){if(windowWidth>767)if(storeProduct.hasClass("popup-detail-right"))storeProduct.find(".jump-store-popup-back").css({bottom:19});else storeProduct.find(".jump-store-popup-back").css({bottom:19});return detailHeight+plusValDetailHeight}else return maxHeaderHeight+plusValHeaderHeight};
var setHeaderHeight=function(storeProduct,windowWidth){if(storeProduct.closest(".aprl-section").length)return storeProduct.find(".store-product-header").eq(0).outerHeight(true)+37;var detailHeight=storeProduct.find(".detail").height();if(windowWidth>1150)if(storeProduct.hasClass("desktop-new"))return calculateHeight(windowWidth,storeProduct,".desktop-new",detailHeight,63,380,470);else if(storeProduct.hasClass("aria"))return calculateHeight(windowWidth,storeProduct,".aria",detailHeight,74,378,438);
else return calculateHeight(windowWidth,storeProduct,".desktop-old",detailHeight,63,379,469);else if(windowWidth>767)if(storeProduct.hasClass("tablet-first"))return calculateHeight(windowWidth,storeProduct,".tablet-first",detailHeight,85,441,541);else{if($("body").is(".locale-en_US, .locale-en_CA, .locale-en_GB, .locale-en_NZ, .locale-fr_FR, .locale-es_ES"))if(storeProduct.is(".surge, .flex"))return calculateHeight(windowWidth,storeProduct,".surge, .flex",detailHeight,85,406,506);else if(storeProduct.is(".one, .zip"))return calculateHeight(windowWidth,
storeProduct,".one, .zip",detailHeight,85,364,504);if(storeProduct.hasClass("aria"))return calculateHeight(windowWidth,storeProduct,".aria",detailHeight,106,361,436);else if(storeProduct.is(".surge, .zip"))return calculateHeight(windowWidth,storeProduct,".surge, .zip",detailHeight,85,406,506);else return calculateHeight(windowWidth,storeProduct,".one, .flex",detailHeight,85,364,464)}else{storeProduct.css({top:0});if($("body").is(".locale-en_US, .locale-en_CA, .locale-en_GB, .locale-en_NZ, .locale-fr_FR, .locale-es_ES"))if(storeProduct.is(".surge, .flex"))return calculateHeight(windowWidth,
storeProduct,".surge, .flex",detailHeight,-2,236,429);else if(storeProduct.is(".one, .zip"))return calculateHeight(windowWidth,storeProduct,".one, .zip",detailHeight,40,235,407);if(storeProduct.hasClass("tablet-first"))return calculateHeight(windowWidth,storeProduct,".tablet-first",detailHeight,-2,230,426);else if(storeProduct.hasClass("aria"))return calculateHeight(windowWidth,storeProduct,".aria",detailHeight,106,234,354);else if(storeProduct.is(".surge, .zip"))return calculateHeight(windowWidth,
storeProduct,".surge, .zip",detailHeight,-2,236,429);else return calculateHeight(windowWidth,storeProduct,".one, .flex",detailHeight,40,235,387)}};
var setParametersForStorePopupContent=function(self,visiblePopup,windowWidth,ieVersion,visibleBack,visibleSizingChart,visibleNotifyMe){var thatProduct=self.parents(".store-product");var storePopup=thatProduct.find(".store-popup");var storePopupFront=storePopup.find(".store-popup-front");var storePopupBack=storePopup.find(".store-popup-back");var pos=thatProduct.position();var posHeader=thatProduct.find(".store-product-header").position();var index=_.indexOf($("#product").find(".store-product").toArray(),
thatProduct[0]);thatProduct.find(".badge").hide();$(".show-more").removeAttr("style");if(windowWidth<1151)thatProduct.find(".show-more").hide();if(visiblePopup.length)visiblePopup.hideStorePopup(windowWidth);if(visibleSizingChart)if(visibleBack)storePopup.find(".sizing-chart").show();else if(ieVersion)setTimeout(function(){storePopup.find(".sizing-chart").show()},100);else storePopup.find(".sizing-chart").show();if(visibleNotifyMe)if(visibleBack)storePopup.find(".preorder").show();else if(ieVersion)setTimeout(function(){storePopup.find(".preorder").show()},
100);else storePopup.find(".preorder").show();if(visibleBack){storePopup.addClass("flipped");if(ieVersion)storePopupFront.hide()}else{storePopup.find(".form-header.post").addClass("from-front");if(ieVersion)storePopupFront.show()}var height;var cloneThatProduct=thatProduct.clone(true);var width=storePopup.width();cloneThatProduct.css({position:"static"});cloneThatProduct.find(".store-popup").remove();storePopupFront.append(cloneThatProduct);storePopup.css({display:"block",opacity:0});height=setHeaderHeight(cloneThatProduct,
windowWidth);storePopup.find(".jump-store-popup-back").show();storePopup.find(".close-store-popup").show();storePopupFront.css({"-webkit-transform":""});storePopupBack.css({"-webkit-transform":""});setStorePopupPosition(windowWidth,thatProduct,storePopup,pos,posHeader,index,height);if(!storePopup.closest(".aprl-section").length)if(ieVersion){storePopupBack.css({height:height,transform:"rotateY(180deg)",width:width});storePopupFront.css({height:height,transform:"rotate(0deg)",width:width})}else{storePopupBack.css({"-webkit-backface-visibility":"hidden",
"backface-visibility":"hidden","transform":"rotateY(180deg)"});storePopupFront.css({"-webkit-backface-visibility":"hidden","backface-visibility":"hidden","transform":"rotateY(0deg)"});if(windowWidth>767){storePopupBack.css({height:height});storePopupFront.css({height:height})}else{storePopupFront.css({height:height});storePopup.find(".preorder").css({height:height})}if(visibleBack){storePopupBack.css({"-webkit-transform":"rotateY(180deg)"});storePopupFront.css({"-webkit-transform":"rotateY(0deg)"})}}else{storePopupBack.css({height:height+
30});storePopupFront.css({height:height+30})}storePopup.css({opacity:1})};
var setMenuSticky=function(windowWidth,menuOffset){var scrollTop=$(window).scrollTop();if(windowWidth>767)if($(".aprl-section").length&&scrollTop+60>=$(".aprl-section").offset().top)$("#to-apparel").closest("li").addClass("active").siblings().removeClass("active");else if(scrollTop+60>=$("#accessories").offset().top){$("#to-accessories").closest("li").addClass("active").siblings().removeClass("active");$("#switch-categories").addClass("fixed")}else if(scrollTop>=menuOffset){$("#switch-categories").addClass("fixed");
$("#wrapper-slider").css({"padding-bottom":60});$("#to-product").closest("li").addClass("active").siblings().removeClass("active")}else{$("#switch-categories").removeClass("fixed");$("#wrapper-slider").css({"padding-bottom":0});$("#to-product").closest("li").removeClass("active")}};
var countFilterItems=function(accessories,windowWidth){_.each(accessories.filter(".active"),function(el,idx){if(windowWidth>1199)$(el).css({"margin-left":idx%4==0?0:65});else if(windowWidth>767)$(el).css({"margin-left":idx%3==0?0:59});else $(el).css({"margin-left":idx%2==0?0:19})})};var sendSubscribeForNewDevicesStore=function(form){$.getJSON(form.attr("action")+"?callback\x3d?",form.serialize(),function(data){})};
var jumpStorePopupFront=function(storePopup){storePopup.removeClass("flipped");if(storePopup.closest(".aprl-section").length)return false;setTimeout(function(){storePopup.find(".store-popup-back").hide();storePopup.find(".store-popup-front").show()},100)};
var closeStorePopup=function(storePopup,windowWidth){var storeProduct=storePopup.find(".store-product");var preorderPopup=storePopup.find(".preorder");if(!storeProduct.closest(".aprl-section").length)storePopup.find(".store-popup-back").hide();storeProduct.removeAttr("style");storePopup.hideStorePopup(windowWidth);$(".badge").show();preorderPopup.find(".post").hide();preorderPopup.find(".pre").show();preorderPopup.find(".email-preorder").val("");if(windowWidth<1151)$(".show-more").show();$(".from-front").removeClass("from-front");
$("#popup-overlay").remove()};var isValidEmailAddress=function(email){var validEmail=false;if(email){email=email.trim().toLowerCase();var pattern=/^[\w-']+(\.[\w-']+)*@([a-zA-Z0-9]+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*?\.[a-zA-Z]{2,6}|(\d{1,3}\.){3}\d{1,3})(:\d{4})?$/;validEmail=pattern.exec(email)}return validEmail};
var setMarginsForDescription=function(windowWidth,chunks){var defaultMarginTopValue=windowWidth>767?10:12;_.each(chunks,function(chunk){var chunkHeights=_.map(chunk,function(el){if(windowWidth>767)return $(el).find(".store-product-header h3").height();else{var icons=$(el).find(".store-product-header .icons");if(icons.length)return $(el).find(".store-product-header h3").height()+icons.height();else return $(el).find(".store-product-header h3").height()}});var maxChunkHeight=_.max(chunkHeights,function(h){return h});
var heightDiffs=_.map(chunkHeights,function(h){return maxChunkHeight-h});_.each(chunk,function(el,idx){$(el).find(".store-product-header p").css({"margin-top":heightDiffs[idx]+defaultMarginTopValue})})})};var setAllMarginsForDescription=function(windowWidth){setMarginsForDescription(windowWidth,chunk($("#product").find(".store-product"),windowWidth>1199?3:2));setMarginsForDescription(windowWidth,chunk($("#accessories").find(".store-product"),windowWidth>1199?4:windowWidth>767?3:2))};
$.fn.hideStorePopup=function(windowWidth){var self=$(this);if(!self.closest(".aprl-section").length)self.find(".store-popup-back").hide();self.hide();self.find(".store-popup-front").show();self.find(".store-product").remove();self.removeClass("flipped");if(windowWidth>1150)self.parents(".store-product").find(".show-more").hide();else;};$.fn.switchClass=function(c){var $self=$(this);$self.addClass(c).siblings().removeClass(c);return $self};
var doc=$(document);var windowWidth=window.innerWidth>0?window.innerWidth:screen.width;$(window).resize(function(){windowWidth=window.innerWidth>0?window.innerWidth:screen.width;if(windowWidth>767)$(".store-product-price").css({"display":"inline","float":"right"});else $(".store-product-price").css({"display":"block","float":"none"});countFilterItems($("#accessories").find(".store-products-wrapper \x3e .store-product"),windowWidth)});
doc.ready(function(){function findAcessoriesInStock(){var $this=$(this);var $product=$this.closest(".store-product");var id=$product.find(".store-product-colors \x3e .active").find(".store-product-models \x3e .active").attr("data-id");var skuObj;if($this.closest("#accessories").length&&typeof accessoriesInStock!=="undefined")skuObj=accessoriesInStock;if($this.closest("#apparel").length&&typeof apparelInStock!=="undefined")skuObj=apparelInStock;if(!$.isPlainObject(skuObj))return;if(skuObj.hasOwnProperty(id)){$product.find(".sp-product-stock-message").remove();
if(skuObj[id].hasOwnProperty("stockMessage")){var text=skuObj[id].stockMessage;if(typeof text==="string"&&text.length){var $message=$("\x3cspan\x3e",{"class":"sp-product-stock-message","text":text});$product.find(".store-product-footer").append($message)}}}}var footerButton=$(".footer-button");var addToCart=$(".add-to-cart");var notifyMe=$(".notify-me");var categories=$("#switch-categories").find("a");var filter=$("#accessories").find(".product-section-header .filter");var ieVersion=detectIE();var mobile=
isMobile();var menuOffset=$("#switch-categories").offset().top;setAllMarginsForDescription(windowWidth);countFilterItems($("#accessories").find(".store-products-wrapper \x3e .store-product"),windowWidth);$("#to-product").click(function(){$("#product").animatescroll({padding:60,scrollSpeed:1500})});$("#to-accessories").click(function(){$("#accessories").animatescroll({padding:60,scrollSpeed:1500})});$(".to-product").click(function(){$("#product").animatescroll({padding:60,scrollSpeed:1500})});$(".to-accessories").click(function(){$("#accessories").animatescroll({padding:60,
scrollSpeed:1500})});$("#to-apparel").click(function(){$(".aprl-section").animatescroll({padding:60,scrollSpeed:1500})});$(".to-apparel").click(function(){$(".aprl-section").animatescroll({padding:60,scrollSpeed:1500})});setMenuSticky(windowWidth,menuOffset);$(window).bind("scroll",function(e){setMenuSticky(windowWidth,menuOffset)});setClassesForProduct(windowWidth);addToCart.click(function(){var productId=$(this).parents(".store-product").find("ul.store-product-colors \x3e li.active").find("ul.store-product-models \x3e li.active").attr("data-id");
var path="/cart";var bodyClass=$("body").attr("class");var useCart=bodyClass.indexOf("en_US")>-1||bodyClass.indexOf("en_CA")>-1;if(!useCart)path="/order";location.href=path+"?productId\x3d"+productId});footerButton.mousedown(function(){$(this).addClass("visited")});footerButton.mouseup(function(){$(this).removeClass("visited")});footerButton.mouseleave(function(){$(this).removeClass("visited")});categories.click(function(){$(this).closest("li").addClass("active").siblings().removeClass("active")});
doc.click(function(e$$0){var target=$(e$$0.target);if(!target.is(".store-popup, .overlay-image, .see-sizing-chart, .notify-me")&&!target.parents().is(".store-popup, .overlay-image, .see-sizing-chart, .notify-me, .aprl-section .store-product-images")){var preorderPopup=$(".preorder");var visiblePopup=$(".store-popup:visible");if(visiblePopup.length)visiblePopup.hideStorePopup(windowWidth);preorderPopup.find(".post").hide();preorderPopup.find(".pre").show();preorderPopup.find(".email-preorder").val("");
$(".badge").show();if(windowWidth<1151)$(".show-more").show();$(".from-front").removeClass("from-front");$("#popup-overlay").remove()}if(!target.is(".color-select")&&!target.parents().is(".color-select")&&(!target.is(".filter")&&!target.parents().is(".filter"))&&isMobile()){var storeProductColors=$(".store-product-colors-mobile");_.each(storeProductColors,function(e){var el=$(e);var storeProductColorsItems=$(e).find("\x3e li");if(!(storeProductColorsItems.length==1&&storeProductColorsItems[0].className==
"active")){storeProductColorsItems.find("div.color-select").removeAttr("style");el.css({"z-index":0});storeProductColorsItems.removeAttr("style");el.removeClass("active-store-product-colors")}});filter.removeClass("active");$("#accessories").find("\x3e div:eq(1)").removeAttr("style")}});if(windowWidth>1150){$("div.color-select i").hover(function(){var left;var self=$(this);var color=self.css("background-color");var colorName=self.find(".store-product-color-name");left=(-colorName.outerWidth()+self.width())/
2;self.css({"z-index":10});colorName.css({left:left,color:color}).addClass("active")},function(){var self=$(this);var colorName=self.find(".store-product-color-name");self.removeAttr("style");colorName.removeClass("active")});filter.hover(function(){filter.addClass("active")},function(){filter.removeClass("active")});$(".overlay-image").hover(function(){if(!$(this).parents(".store-popup").length){var storeProduct=$(this).parents(".store-product");storeProduct.find(".badge").css({"opacity":".4"});
storeProduct.find(".store-product-images \x3e div.active").find("img").css({"opacity":".4"});storeProduct.find(".store-product-images \x3e div.show-more").css({"display":"table"})}},function(){if(!$(this).parents(".store-popup").length){var storeProduct=$(this).parents(".store-product");storeProduct.find(".badge").css({"opacity":""});storeProduct.find(".store-product-images \x3e div.active").find("img").css({"opacity":""});storeProduct.find(".store-product-images \x3e div.show-more").css({"display":""})}})}else filter.click(function(){if(filter.hasClass("active")){filter.removeClass("active");
$("#accessories").find("\x3e div:eq(1)").removeAttr("style")}else{var storeProductColors=$(".store-product-colors");_.each(storeProductColors,function(e){var el=$(e);var storeProductColorsItems=$(e).find("\x3e li");if(!(storeProductColorsItems.length==1&&storeProductColorsItems[0].className=="active")){storeProductColorsItems.find("div.color-select").removeAttr("style");el.css({"z-index":0});storeProductColorsItems.removeAttr("style");el.removeClass("active-store-product-colors")}});$("#accessories").find("\x3e div:eq(1)").css({"margin-top":2});
filter.addClass("active")}});$("ul.store-product-colors-mobile div.color-select").click(function(){var self=$(this);var showMore=self.parents(".store-product").find(".show-more");var storeProductColors=self.parents(".store-product-colors-mobile");var visiblePopup=$(".store-popup:visible");if(visiblePopup.length&&!self.parents(".store-popup").length)visiblePopup.hideStorePopup(windowWidth);filter.removeClass("active");if(storeProductColors.hasClass("active-store-product-colors")){var color=self.parent();
showMore.css({"z-index":7});self.removeAttr("style");storeProductColors.css({"z-index":0});storeProductColors.find("\x3e li").removeAttr("style");storeProductColors.removeClass("active-store-product-colors")}else{$("#accessories").find("\x3e div:eq(1)").removeAttr("style");showMore.css({"z-index":13});_.each($(".active-store-product-colors"),function(e){var el=$(e);el.find("div.color-select").removeAttr("style");el.find("\x3e li").removeAttr("style");el.css({"z-index":0});el.removeClass("active-store-product-colors")});
storeProductColors.css({"background-color":"white","border":"2px solid #939c9e","border-radius":8,"z-index":13});storeProductColors.find("\x3e li").css({border:"none",display:"block"});storeProductColors.addClass("active-store-product-colors")}});$(".close-store-popup").click(function(){var storePopup=$(this).parents(".store-popup");closeStorePopup(storePopup,windowWidth)});$(".form-header.post").click(function(){var self=$(this);var storePopup=self.parents(".store-popup");if(self.hasClass("from-front"))jumpStorePopupFront(storePopup);
else closeStorePopup(storePopup,windowWidth)});if(ieVersion&&ieVersion<9)countFilterItems($("#accessories").find(".store-products-wrapper \x3e .store-product"),windowWidth);$(".filter-menu ul li").click(function(){var filterValue=$(this).data("filter");var accessories=$("#accessories").find(".store-products-wrapper \x3e .store-product");filter.removeClass("active");$(this).addClass("active").siblings().removeClass("active");filter.find(".filter-menu \x3e div").eq(0).text($(this).text());$(".store-filter-product-type").html($(this).data("deviceName"));
if(filterValue=="all")if(ieVersion&&ieVersion<9){accessories.addClass("active");accessories.removeClass("hidden");countFilterItems(accessories.filter(".active"),windowWidth)}else{accessories.removeAttr("style");accessories.addClass("active");accessories.removeClass("hidden")}else{_.each(accessories,function(e,idx){var el=$(e);if(el.data("filter").split(",").indexOf(filterValue)!==-1||el.data("filter")=="all"){el.addClass("active");el.removeClass("hidden")}else{el.removeClass("active");el.addClass("hidden")}});
countFilterItems(accessories,windowWidth)}});$(".jump-store-popup-front").click(function(){var storePopup=$(this).parents(".store-popup");jumpStorePopupFront(storePopup)});notifyMe.click(function(){var self=$(this);var visiblePopup=$(".store-popup:visible");var storePopup=$(this).parents(".store-popup");$(".show-more").removeAttr("style");if(!$("#popup-overlay").length)$("#container").before($('\x3cdiv id\x3d"popup-overlay"\x3e\x3c/div\x3e'));if(storePopup.length){storePopup.addClass("flipped");if(ieVersion)setTimeout(function(){storePopup.find(".preorder").show();
storePopup.find(".store-popup-front").hide()},200);else{storePopup.find(".preorder").show();storePopup.find(".store-popup-back").css({"-webkit-transform":"rotateY(180deg)"});storePopup.find(".store-popup-front").css({"-webkit-transform":"rotateY(0deg)"})}}else setParametersForStorePopupContent(self,visiblePopup,windowWidth,ieVersion,true,false,true)});$(".see-sizing-chart").click(function(){var self=$(this);var visiblePopup=$(".store-popup:visible");var storePopup=$(this).parents(".store-popup");
$(".show-more").removeAttr("style");if(!$("#popup-overlay").length)$("#container").before($('\x3cdiv id\x3d"popup-overlay"\x3e\x3c/div\x3e'));if(self.closest(".aprl-section").length){var $popup=self.closest(".store-product").find(".store-popup");if(storePopup.length)storePopup.addClass("flipped");else{setParametersForStorePopupContent(self,visiblePopup,windowWidth,false,true,true,false);$popup.addClass("flipped flipped-transition-off");window.setTimeout(function(){$popup.removeClass("flipped-transition-off")},
0)}return}if(storePopup.length){storePopup.addClass("flipped");if(ieVersion)setTimeout(function(){storePopup.find(".sizing-chart").show();storePopup.find(".store-popup-front").hide()},200);else{storePopup.find(".sizing-chart").show();storePopup.find(".store-popup-back").css({"-webkit-transform":"rotateY(180deg)"});storePopup.find(".store-popup-front").css({"-webkit-transform":"rotateY(0deg)"})}}else setParametersForStorePopupContent(self,visiblePopup,windowWidth,ieVersion,true,true,false)});(function findAccessoriesInStockOnLoad(){$("#accessories .store-product, #apparel .store-product").each(function(){findAcessoriesInStock.apply(this)})})();
$(".store-product-colors \x3e li, .store-product-colors-mobile \x3e li").click(function(){var self=$(this);var klass=self.attr("class");if(!self.hasClass("active")){var storeProduct;if(self.parents(".store-popup").length)storeProduct=self.parents(".store-popup").parents(".store-product");else storeProduct=self.parents(".store-product");var storeProductColors=storeProduct.find(".store-product-colors");var storeProductColorsMobile=storeProduct.find(".store-product-colors-mobile");var storeProductImages=
storeProduct.find(".store-product-images");storeProductColors.find("\x3e li").removeClass("active");storeProductColorsMobile.find("\x3e li").removeClass("active");storeProductImages.find("\x3e div").removeClass("active");storeProductColorsMobile.find("\x3e li."+klass).addClass("active");storeProductColors.find("\x3e li."+klass).addClass("active");storeProductImages.find("\x3e div."+klass).addClass("active");findAcessoriesInStock.call(self)}});$(".store-product-models \x3e li").click(function(){var el=
$(this);var idx=el.index();el.parents(".store-product-colors").find(".store-product-models").each(function(){$(this).find("li").eq(idx).switchClass("active")});findAcessoriesInStock.call(el)});$(".overlay-image").click(function(){var self=$(this);var visiblePopup=$(".store-popup:visible");if(!self.parents(".store-popup").length){if(!$("#popup-overlay").length)$("#container").before($('\x3cdiv id\x3d"popup-overlay"\x3e\x3c/div\x3e'));setParametersForStorePopupContent(self,visiblePopup,windowWidth,
ieVersion,false,false,false)}});$("#store-logo").click(function(){$("header").animatescroll({scrollSpeed:1500})});$(".preorder-form").on("submit",function(e){var $this=$(this);var $preorderPopup=$(this).parents(".preorder");var $email=$this.find('[type\x3d"email"]');var $errorContainer=$this.find(".subscription-error-message");var errorText=$this.data("error");if(isValidEmailAddress($email.val())){sendSubscribeForNewDevicesStore($this);$errorContainer.hide();$preorderPopup.find(".pre").hide();$preorderPopup.find(".preorder-header.post").show();
$preorderPopup.find(".form-header.post").css({display:"table"})}else $errorContainer.text(errorText).show();e.preventDefault()});$(".red-arrow").on("click",function(){var $preorderForm=$(this).parents("form");$preorderForm.trigger("submit")})});
$(function(){function setApparelPopupHeight(){var $popup=$(".store-popup:visible");if($popup.length){var storePopupFront=$popup.find(".store-popup-front");var storePopupBack=$popup.find(".store-popup-back");var _height=$popup.closest(".store-product").find(".store-product-header").eq(0).outerHeight(true)+30-($(window).width()<768?0:30);storePopupBack.css({height:_height});storePopupFront.css({height:_height})}}function recalcApparelPopup(){var $popup=$(".aprl-section .store-popup:visible");if($popup.length){var $product=
$popup.closest(".store-product");var $img=$product.find(".store-product-images img").eq(0);setApparelPopupHeight();setApparelPopupDirection.apply($product)}}function setApparelEqualHeight(){var width=$(window).width();var $product=$(".aprl-section .store-products-wrapper \x3e .store-product");var productsInRow=0;var rowArray=[[]];var heightArray=[[]];if(width>1199)productsInRow=4;else if(width<=1199&&width>767)productsInRow=3;else if(width<767)productsInRow=2;$product.each(function(i){var $this=$(this);
if(i%productsInRow==0&&i!==0){rowArray.push([]);heightArray.push([])}rowArray[rowArray.length-1].push($(this));heightArray[heightArray.length-1]=function(){var $description=$this.find(".product-main-description");var $newHeader=$description.find("h3");var $newText=$description.find("p");var currentHeader=heightArray[heightArray.length-1][0];var currentText=heightArray[heightArray.length-1][1];$($newHeader,$newText).attr("style","");if(typeof currentHeader==="undefined"||currentHeader<$newHeader.height())currentHeader=
$newHeader.height();if(typeof currentText==="undefined"||currentText<$newText.height())currentText=$newText.height();return[currentHeader,currentText]}()});_.each(rowArray,function(item,k){_.each(item,function(i){$(i).find(".product-main-description").find("h3").height(heightArray[k][0]).end().find("p").height(heightArray[k][1])})})}function setApparelPopupDirection(){var $this=$(this);var width=$(window).width();var index=$(this).index();++index;if(width>1199&&index%4===0||width<=1199&&width>767&&
index%3===0||width<=767&&index%2===0){$(this).addClass("product-last");$this.find(".store-popup .product-detail-image").prependTo($this.find(".store-popup .product-detail-image").parent())}else{$(this).removeClass("product-last");$this.find(".store-popup .product-detail-image").appendTo($this.find(".store-popup .product-detail-image").parent())}}var isAndroidBrowser=window.navigator&&window.navigator.userAgent.indexOf("534.30")>0&&window.navigator.userAgent.toLowerCase().match(/android/);if(isAndroidBrowser)$("body").addClass("old-android-browser");
$(".aprl-section").on("click",".store-product-images",function(e){var self=$(this);var $img=self.find("img");var $product=self.closest(".store-product");var visiblePopup=$(".store-popup:visible");if(!$img.parents(".store-popup").length){if(!$("#popup-overlay").length)$("#container").before($('\x3cdiv id\x3d"popup-overlay"\x3e\x3c/div\x3e'));setParametersForStorePopupContent($img,visiblePopup,$(window).width(),false,false,false,false);setApparelPopupDirection.apply($product);$product.addClass("flipped-transition-off");
window.setTimeout(function(){$product.removeClass("flipped-transition-off")},0)}});$(".aprl-section").on("click",".see-sizing-chart",function(e){var $product=$(this).closest(".store-product");setApparelPopupDirection.apply($(this).closest(".store-product"));$product.addClass("flipped-transition-off");window.setTimeout(function(){$product.removeClass("flipped-transition-off")},0)});setApparelEqualHeight();var _resizeTimeout=null;$(window).on("resize orientationchange",function(){window.clearTimeout(_resizeTimeout);
_resizeTimeout=window.setTimeout(function(){setApparelEqualHeight();recalcApparelPopup()},100)})});
(function($){function selectProductColors(){var $this=$(this);var $product=$this.closest(".sp-col");var color=$this.data("color");var colorName=$this.find(".sp-product-color-label").eq(0).text();var $mobileSizes=$product.find(".sp-products-colors-mobile").eq(0).find(".active .sp-product-sizes");$product.find('.sp-product-images [data-color\x3d"'+color+'"]').addClass("active").siblings().removeClass("active").end().end().find(".sp-product-color-mobile-active").attr("data-color",color).find(".sp-product-color-label").text(colorName).end();
$product.find(".sp-product-color-mobile-active").each(function(){$(this).find(".sp-product-sizes").replaceWith($mobileSizes.clone())})}function openStorePopup(type){var $this=$(this);var $popup=$("\x3cdiv\x3e",{"class":"sp-store-popup"});var $overlay=$("\x3cdiv\x3e",{"class":"page-overlay"});var $front=$("\x3cdiv\x3e",{"class":"sp-store-popup-front"});var $back=$("\x3cdiv\x3e",{"class":"sp-store-popup-back"});closeStorePopup();$popup.prepend($front.html($this[0].outerHTML));$popup.append($back);$popup.find(".sp-product-last").removeClass("sp-product-last");
$("body").prepend($overlay);$this.append($popup);if($(window).width()<=767)$back.css("min-height","475px");else $back.css("min-height",$front.outerHeight())}function changePopupBackContent(type){var $popup=$(".sp-store-popup");var $product=$popup.closest(".sp-product");var $back=$popup.find(".sp-store-popup-back");type=type||"sizing";if(type==="sizing")$back.removeClass("sp-product-notify-me-overlay").html($product.find(".sp-product-sizing-chart").html());else $back.addClass("sp-product-notify-me-overlay").html($product.find(".sp-product-notify-me").html())}
function closeStorePopup(){$(".page-overlay").remove();$(".sp-store-popup").remove()}function disableMobileColorSelector(){$(".sp-products-colors-mobile").each(function(){var $this=$(this);if($this.children("li").length<=2)$this.addClass("sp-colors-disabled")})}function isColorInViewport(){var $this=$(this);var rect=$this[0].getBoundingClientRect();var thisHeight=$this.outerHeight(true);var $windowHeight=$(window).height();return rect.bottom+thisHeight>$windowHeight?true:false}function findProductInStock(){if(!$.isPlainObject(productsInStock))return;
var $this=$(this);var $productColors=$this.find(".sp-product-colors").eq(0);var $productSizes=$this.find(".active .sp-product-sizes");var productId;if($productSizes.length)productId=$productSizes.find(".active").data("id");else productId=$productColors.find(".active").data("id");$this.find(".sp-product-stock-message").remove();if(productsInStock.hasOwnProperty(productId))if(productsInStock[productId].hasOwnProperty("stockMessage")){var text=productsInStock[productId].stockMessage;if(typeof text===
"string"&&text.length){var $message=$("\x3cspan\x3e",{"class":"sp-product-stock-message","text":text});$this.find(".sp-btn-add-to-cart").after($message)}}}function findProductInStockOnLoad(){$(".sp-section .sp-product").each(function(){findProductInStock.apply(this)})}function loadLayoutImages(){var $images=$(".js-load-img");$images.each(function(i,e){var $this=$(e);var type=isMobileView()?"mobile":isTabletView()?"tablet":"default";e.src=$this.data(type)||$this.data("default")})}setProductsColEqualHeight=
function(container){var currentTallestHeader=0;var currentTallestDescription=0;var currentRowStart=0;var topPosition=0;var rowDivs=[];var $col=container;$($col).each(function(){var $this=$(this);var $product=$this.find("\x3e .sp-product");var $header=$product.find(".sp-product-main-text .sp-product-slogan");var $description=$product.find(".sp-product-description");$this=$(this);$product.removeClass("sp-product-last");$($header,$description).height("auto");topPostion=$this.position().top;if(currentRowStart!=
topPostion){for(currentDiv=0;currentDiv<rowDivs.length;currentDiv++){rowDivs[currentDiv].find(".sp-product-main-text .sp-product-slogan").height(currentTallestHeader).end().find(".sp-product-description").height(currentTallestDescription);if(rowDivs.length-1==currentDiv)rowDivs[currentDiv].addClass("sp-product-last")}rowDivs.length=0;currentRowStart=topPostion;currentTallestHeader=$product.find(".sp-product-main-text .sp-product-slogan").height();currentTallestDescription=$product.find(".sp-product-description").height();
rowDivs.push($product)}else{rowDivs.push($product);currentTallestHeader=currentTallestHeader<$header.height()?$header.height():currentTallestHeader;currentTallestDescription=currentTallestDescription<$description.height()?$description.height():currentTallestDescription}for(currentDiv=0;currentDiv<rowDivs.length;currentDiv++)rowDivs[currentDiv].find(".sp-product-main-text .sp-product-slogan").height(currentTallestHeader).end().find(".sp-product-description").height(currentTallestDescription)})};$.fn.placeholderFix=
function(options){var opts=$.extend({},$.fn.placeholderFix.defaults,options);return this.each(function(){var $el=$(this);var msg=$el.attr("placeholder");var origColor=$el.css("color");if(!("placeholder"in document.createElement("input"))){if($el.val()==="")$el.val(msg).css("color",opts.color);$el.focus(function(){if($el.val()===msg)$el.val("").css("color",origColor)}).blur(function(){if($el.val()==="")$el.val(msg).css("color",opts.color)})}})};$.fn.placeholderFix.defaults={"color":"#777777"};$(function(){disableMobileColorSelector();
setProductsColEqualHeight(".sp-section .sp-col");$(window).resize(function(){setProductsColEqualHeight(".sp-section .sp-col")});window.setTimeout(function(){findProductInStockOnLoad()},800);$(".sp-product").on("mouseenter",".sp-product-color i",function(e){var $this=$(this);var $popup=$this.find(".sp-product-color-name");$popup.css("margin-left",(-$popup.outerWidth()+$this.width())/2);$this.addClass("hover")}).on("mouseleave",".sp-product-color i",function(e){var $this=$(this);$this.removeClass("hover")}).on("click",
".sp-product-colors \x3e li",function(e){var $this=$(this);var color=$this.data("color");var $colors=$this.closest(".sp-col").find('[data-color\x3d"'+color+'"]');var $mobileContainer=$this.closest(".sp-products-colors-mobile");if($mobileContainer.hasClass("sp-colors-disabled"))return;if($mobileContainer.length){if($mobileContainer.hasClass("active"))$mobileContainer.removeClass("active");else{$(".sp-products-colors-mobile").removeClass("active");$mobileContainer.addClass("active");var $mobileColors=
$this.closest(".sp-product-colors").find("\x3e li");var colorHeight=$this.outerHeight();if(isColorInViewport.apply($this.closest(".sp-product-colors"))){$this.closest(".sp-product-colors").addClass("inverted");$mobileColors.filter(".sp-product-color-mobile-active").next().css("margin-top",-($mobileColors.length*colorHeight))}else{$this.closest(".sp-product-colors").removeClass("inverted");$mobileColors.filter(".sp-product-color-mobile-active").next().css("margin-top",0)}}if($this.closest(".sp-product-color-mobile-active").length)return}selectProductColors.apply($colors);
$colors.not(".sp-product-color-mobile-active").addClass("active").siblings().removeClass("active");findProductInStock.apply($this.closest(".sp-col"))}).on("click",".sp-product-sizes li",function(e){var $this=$(this);var size=$this.data("size");var $sizes=$this.closest(".sp-col").find('[data-size\x3d"'+size+'"]');$sizes.addClass("active").siblings().removeClass("active");findProductInStock.apply($this.closest(".sp-col"));if($(this).attr("data-id")=="405003"){$(".add-btn").hide();$(".notify1").show()}else if($(this).attr("data-id")==
"405006"){$(".add-btn").hide();$(".notify1").show()}else if($(this).attr("data-id")=="405001"){$(".add-btn").show();$(".notify1").hide()}else if($(this).attr("data-id")=="405002"){$(".add-btn").show();$(".notify1").hide()}else if($(this).attr("data-id")=="405004"){$(".add-btn").show();$(".notify1").hide()}else if($(this).attr("data-id")=="405005"){$(".add-btn").show();$(".notify1").hide()}e.stopImmediatePropagation()}).on("click",".sp-product-images",function(e){var $this=$(this);var $product=$(this).closest(".sp-product");
if(!$this.closest(".sp-store-popup").length)openStorePopup.apply($product);e.preventDefault()}).on("click",".sp-product-sizing-link",function(e){var $this=$(this);var $product=$(this).closest(".sp-col").find(".sp-product").eq(0);if(!$this.closest(".sp-store-popup").length){openStorePopup.apply($product);$product.addClass("sp-popup-transition-off");window.setTimeout(function(){$product.removeClass("sp-popup-transition-off")},0)}changePopupBackContent("sizing");$product.find(".sp-store-popup").addClass("flipped");
e.preventDefault()}).on("click",".sp-btn-notify-me",function(e){var $this=$(this);var $product=$(this).closest(".sp-col").find(".sp-product").eq(0);if(!$this.closest(".sp-store-popup").length){openStorePopup.apply($product);$product.find(".sp-store-popup-back").addClass("sp-popup-notify-from-page");$product.addClass("sp-popup-transition-off");window.setTimeout(function(){$product.removeClass("sp-popup-transition-off")},0)}changePopupBackContent("notifyme");$product.find(".sp-store-popup").addClass("flipped");
$(".sp-store-popup-back .sp-product-notify-me-email").placeholderFix({"color":"#939c9e"});e.preventDefault()}).on("click",".sp-product-close-btn",function(e){closeStorePopup();e.preventDefault()}).on("click",".sp-product-notify-me-keep-link",function(e){var $this=$(this);var $back=$this.closest(".sp-store-popup-back");if($back.hasClass("sp-popup-notify-from-page"))closeStorePopup();else $back.find(".sp-product-back-btn").trigger("click");e.preventDefault()}).on("click",".sp-product-back-btn",function(e){var $this=
$(this);var $product=$this.closest(".sp-store-popup");$product.removeClass("flipped");window.setTimeout(function(){$product.find(".sp-store-popup-back").removeClass("sp-product-notify-me-overlay sp-popup-notify-from-page")},600);e.preventDefault()});$(document).on("click",".sp-product-notify-me-form-submit",function(e){}).on("submit",".sp-product-notify-me-form",function(e){var $this=$(this);var $form=$this.closest("form");var $email=$form.find(".sp-product-notify-me-email").val();var $errorContainer=
$form.find(".sp-product-notify-me-error");var errorText=$form.data("error");e.preventDefault();if(isValidEmailAddress($email)){$.getJSON($form.attr("action")+"?callback\x3d?",$form.serialize(),function(data){var _b=$this.closest(".sp-store-popup-back");_b.addClass("sp-product-notify-me-sended")});return false}else $errorContainer.text(errorText).show()}).on("click",".sp-btn-add-to-cart",function(e){var $this=$(this);var productId;var $product=$this.closest(".sp-product");var $productColors=$product.find(".sp-product-colors").eq(0);
var $productSizes=$productColors.find(".active .sp-product-sizes");var bodyClass=$("body").attr("class");var useCart=bodyClass.indexOf("en_US")!==-1||bodyClass.indexOf("en_CA")!==-1;var path=useCart?"/cart":"/order";if($productSizes.length)productId=$productSizes.find(".active").data("id");else productId=$productColors.find(".active").data("id");window.location.href=path+"?productId\x3d"+productId;e.preventDefault()});$("html").on("click",function(e){if(!$(e.target).closest(".sp-product").length)closeStorePopup();
if(!$(e.target).closest(".sp-products-colors-mobile").length)$(".sp-products-colors-mobile").removeClass("active")})});if(navigator.appVersion.indexOf("Win")!=-1&&navigator.userAgent.indexOf("Safari")!=-1&&navigator.userAgent.indexOf("Chrome")==-1)$("#accessories \x3e div \x3e div .store-product .store-product-images, #accessories \x3e div \x3e div .store-product .store-product-header, #accessories \x3e div \x3e div .store-product .store-product-footer, .aprl-section .store-product-header, .aprl-section .store-product-footer").css("width",
186);var windowResizeHandlers=[];var $win=$(window);isMobileView=function(){var winWidth=$win.width();if(winWidth<=767)return true;return false};isTabletView=function(){var winWidth=$win.width();if(winWidth>767&&winWidth<=1199)return true;return false};loadLayoutImages();var loadLayoutImagesTimeout=null;windowResizeHandlers.push(function(){window.clearTimeout(loadLayoutImagesTimeout);loadLayoutImagesTimeout=window.setTimeout(function(){loadLayoutImages()},1E3)})})(jQuery);
function checkHash(){window.setTimeout(doHashCheck,10)}var doHashCheck=function(global){return function(){var fnName=window.location.hash.replace(/^#/,"");if(typeof global[fnName]=="function")global[fnName]()}}(this);function chargeHrBlackXl(){$(".add-btn").hide();$(".notify1").show();$("#black-xl").click();$(".notify1 \x3e a").click();$(document).scrollTop($(".sp-section").offset().top)}
function chargeHrPlumSm(){$(".chargehr-buttons").hide();$(".notify2").show();$(".color-plum").click();$("#plum-sm").click();$(".notify2 \x3e a").click();$(document).scrollTop($(".sp-section").offset().top)}function chargeHrPlumMd(){$(".chargehr-buttons").hide();$(".notify2").show();$(".color-plum").click();$("#plum-md").click();$(".notify2 \x3e a").click();$(document).scrollTop($(".sp-section").offset().top)}
function chargeHrPlumXl(){$(".chargehr-buttons").hide();$(".notify2").show();$(".color-plum").click();$("#plum-xl").click();$(".notify2 \x3e a").click();$(document).scrollTop($(".sp-section").offset().top)}
$(document).ready(function(){checkHash();$(document).on("click",".color-check",function(e){if($(this).hasClass("unavailable")){$(".chargehr-buttons").hide();$(".notify2").show()}else{$(".chargehr-buttons").show();$(".notify2").hide();if($(".stock-check.active").hasClass("unavailable")){$(".add-btn").hide();$(".notify1").show()}else{$(".add-btn").show();$(".notify1").hide()}}});$(document).on("click",".sp-product-color-mobile-active",function(e){if($(".color-check.active").hasClass("unavailable")){$(".chargehr-buttons").hide();
$(".notify2").show()}else{$(".chargehr-buttons").show();$(".notify2").hide();if($(".stock-check.active").hasClass("unavailable")){$(".add-btn").hide();$(".notify1").show()}else{$(".add-btn").show();$(".notify1").hide()}}});$(document).on("click",".sp-product-color-mobile-active \x3e .sp-product-sizes \x3e li",function(e){if($(this).attr("data-id")=="405006"){$(".add-btn").hide();$(".notify1").show()}else{$(".add-btn").show();$(".notify1").hide()}});$(document).on("click",".notify1 \x3e a",function(e){var $blackForm=
$(".sp-product-notify-me-content").find("#chargehr-bxl-form");$plumLargeForm=$(".sp-product-notify-me-content").find("#chargehr-pxl-form");$plumSmallForm=$(".sp-product-notify-me-content").find("#chargehr-psm-form");$(".chr-black-image").show();$(".chr-plum-image").hide();$(".black-popup-header").show();$(".plum-popup-header").hide();$blackForm.show();$plumSmallForm.hide();$plumLargeForm.hide()});$(document).on("click",".notify2 \x3e a",function(e){var $blackForm=$(".sp-product-notify-me-content").find("#chargehr-bxl-form");
$plumLargeForm=$(".sp-product-notify-me-content").find("#chargehr-pxl-form");$plumSmallForm=$(".sp-product-notify-me-content").find("#chargehr-psm-form");$(".chr-plum-image").show();$(".chr-black-image").hide();$(".black-popup-header").hide();$(".plum-popup-header").show();if($(".sp-product-sizes \x3e .active").hasClass("plum-a")){$plumLargeForm.hide();$blackForm.hide();$plumSmallForm.show()}else if($(".sp-product-sizes \x3e .active").hasClass("plum-b")){$plumLargeForm.show();$blackForm.hide();$plumSmallForm.hide()}else{$("#default-notify-form").show();
$plumLargeForm.hide();$plumSmallForm.hide();$plumLargeForm.hide()}})});
window.matchMedia||(window.matchMedia=function(){var a=window.styleMedia||window.media;if(!a){var b=document.createElement("style");var c=document.getElementsByTagName("script")[0];var d=null;b.type="text/css",b.id="matchmediajs-test",c.parentNode.insertBefore(b,c),d="getComputedStyle"in window&&window.getComputedStyle(b,null)||b.currentStyle,a={matchMedium:function(a){var c="@media "+a+"{ #matchmediajs-test { width: 1px; } }";return b.styleSheet?b.styleSheet.cssText=c:b.textContent=c,"1px"===d.width}}}return function(b){return{matches:a.matchMedium(b||
"all"),media:b||"all"}}}()),function(a$$1,b$$1,c$$0){function d$$0(a){var b;var c;var d;var e;var g;var h=a||{};b=h.elements||f.getAllElements();var i=0;for(var j=b.length;j>i;i++)if(c=b[i],d=c.parentNode,e=void 0,g=void 0,"IMG"===c.nodeName.toUpperCase()&&(c[f.ns]||(c[f.ns]={}),h.reevaluate||!c[f.ns].evaluated)){if(d&&"PICTURE"===d.nodeName.toUpperCase()){if(f.removeVideoShim(d),e=f.getMatch(c,d),e===!1)continue}else e=void 0;(d&&"PICTURE"===d.nodeName.toUpperCase()||c.srcset&&!f.srcsetSupported||
!f.sizesSupported&&c.srcset&&c.srcset.indexOf("w")>-1)&&f.dodgeSrcset(c),e?(g=f.processSourceSet(e),f.applyBestCandidate(g,c)):(g=f.processSourceSet(c),(void 0===c.srcset||c[f.ns].srcset)&&f.applyBestCandidate(g,c)),c[f.ns].evaluated=!0}}function e(){function c(){var b;a$$1._picturefillWorking||(a$$1._picturefillWorking=!0,a$$1.clearTimeout(b),b=a$$1.setTimeout(function(){d$$0({reevaluate:!0}),a$$1._picturefillWorking=!1},60))}d$$0();var e=setInterval(function(){return d$$0(),/^loaded|^i|^c/.test(b$$1.readyState)?
void clearInterval(e):void 0},250);a$$1.addEventListener?a$$1.addEventListener("resize",c,!1):a$$1.attachEvent&&a$$1.attachEvent("onresize",c)}if(a$$1.HTMLPictureElement)return void(a$$1.picturefill=function(){});b$$1.createElement("picture");var f=a$$1.picturefill||{};f.ns="picturefill",function(){f.srcsetSupported="srcset"in c$$0,f.sizesSupported="sizes"in c$$0}(),f.trim=function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")},f.endsWith=function(a,b){return a.endsWith?a.endsWith(b):-1!==
a.indexOf(b,a.length-b.length)},f.restrictsMixedContent=function(){return"https:"===a$$1.location.protocol},f.matchesMedia=function(b){return a$$1.matchMedia&&a$$1.matchMedia(b).matches},f.getDpr=function(){return a$$1.devicePixelRatio||1},f.getWidthFromLength=function(a){a=a&&a.indexOf("%")>-1==!1&&(parseFloat(a)>0||a.indexOf("calc(")>-1)?a:"100vw",a=a.replace("vw","%"),f.lengthEl||(f.lengthEl=b$$1.createElement("div"),f.lengthEl.style.cssText="border:0;display:block;font-size:1em;left:0;margin:0;padding:0;position:absolute;visibility:hidden"),
f.lengthEl.style.width=a,b$$1.body.appendChild(f.lengthEl),f.lengthEl.className="helper-from-picturefill-js",f.lengthEl.offsetWidth<=0&&(f.lengthEl.style.width=b$$1.documentElement.offsetWidth+"px");var c=f.lengthEl.offsetWidth;return b$$1.body.removeChild(f.lengthEl),c},f.detectTypeSupport=function(b,c){var e=new a$$1.Image;return e.onerror=function(){f.types[b]=!1,d$$0()},e.onload=function(){f.types[b]=1===e.width,d$$0()},e.src=c,"pending"},f.types=f.types||{},f.types["image/jpeg"]=!0,f.types["image/gif"]=
!0,f.types["image/png"]=!0,f.types["image/svg+xml"]=b$$1.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"),f.types["image/webp"]=f.detectTypeSupport("image/webp","data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA\x3d"),f.verifyTypeSupport=function(a){var b=a.getAttribute("type");if(null===b||""===b)return!0;var c=f.types[b];return"string"==typeof c&&"pending"!==c?(f.types[b]=f.detectTypeSupport(b,c),"pending"):"function"==typeof c?(c(),"pending"):
c},f.parseSize=function(a){var b=/(\([^)]+\))?\s*(.+)/g.exec(a);return{media:b&&b[1],length:b&&b[2]}},f.findWidthFromSourceSize=function(a){var b;var c=f.trim(a).split(/\s*,\s*/);var d=0;for(var e=c.length;e>d;d++){var g=c[d];var h=f.parseSize(g);var i=h.length;var j=h.media;if(i&&(!j||f.matchesMedia(j))){b=i;break}}return f.getWidthFromLength(b)},f.parseSrcset=function(a){for(var b=[];""!==a;){a=a.replace(/^\s+/g,"");var c;var d=a.search(/\s/g);var e=null;if(-1!==d){c=a.slice(0,d);var f=c.slice(-1);
if((","===f||""===c)&&(c=c.replace(/,+$/,""),e=""),a=a.slice(d+1),null===e){var g=a.indexOf(",");-1!==g?(e=a.slice(0,g),a=a.slice(g+1)):(e=a,a="")}}else c=a,a="";(c||e)&&b.push({url:c,descriptor:e})}return b},f.parseDescriptor=function(a,b){var c;var d=b||"100vw";var e=a&&a.replace(/(^\s+|\s+$)/g,"");var g=f.findWidthFromSourceSize(d);if(e){var h=e.split(" ");for(var i=h.length-1;i>=0;i--){var j=h[i];var k=j&&j.slice(j.length-1);if("h"!==k&&"w"!==k||f.sizesSupported){if("x"===k){var l=j&&parseFloat(j,
10);c=l&&!isNaN(l)?l:1}}else c=parseFloat(parseInt(j,10)/g)}}return c||1},f.getCandidatesFromSourceSet=function(a,b){var c=f.parseSrcset(a);var d=[];var e=0;for(var g=c.length;g>e;e++){var h=c[e];d.push({url:h.url,resolution:f.parseDescriptor(h.descriptor,b)})}return d},f.dodgeSrcset=function(a){a.srcset&&(a[f.ns].srcset=a.srcset,a.srcset="",a.setAttribute("data-pfsrcset",a[f.ns].srcset))},f.processSourceSet=function(a){var b=a.getAttribute("srcset");var c=a.getAttribute("sizes");var d=[];return"IMG"===
a.nodeName.toUpperCase()&&a[f.ns]&&a[f.ns].srcset&&(b=a[f.ns].srcset),b&&(d=f.getCandidatesFromSourceSet(b,c)),d},f.backfaceVisibilityFix=function(a){var b=a.style||{};var c="webkitBackfaceVisibility"in b;var d=b.zoom;c&&(b.zoom=".999",c=a.offsetWidth,b.zoom=d)},f.setInherentSize=function(a$$0,b$$0,c){var d;var e=void 0!==c?c:b$$0.complete;var g=!e&&b$$0.getAttribute&&null!==b$$0.getAttribute("width");var h=function(a,b){b.setAttribute&&b.setAttribute("width",b.naturalWidth/a)};e&&a$$0&&!g&&h(a$$0,
b$$0),e||(d=setTimeout(function(){f.setInherentSize(a$$0,b$$0,b$$0.complete)},250))},f.applyBestCandidate=function(a,b){var c;var d;var e;a.sort(f.ascendingSort),d=a.length,e=a[d-1];for(var g=0;d>g;g++)if(c=a[g],c.resolution>=f.getDpr()){e=c;break}e&&!f.endsWith(b.src,e.url)&&(f.restrictsMixedContent()&&"http:"===e.url.substr(0,"http:".length).toLowerCase()?void 0!==window.console&&console.warn("Blocked mixed content image "+e.url):(b.src=e.url,b.currentSrc=b.src,f.backfaceVisibilityFix(b),f.setInherentSize(e.resolution,
b)))},f.ascendingSort=function(a,b){return a.resolution-b.resolution},f.removeVideoShim=function(a){var b=a.getElementsByTagName("video");if(b.length){var c=b[0];for(var d=c.getElementsByTagName("source");d.length;)a.insertBefore(d[0],c);c.parentNode.removeChild(c)}},f.getAllElements=function(){var a=[];var c=b$$1.getElementsByTagName("img");var d=0;for(var e=c.length;e>d;d++){var g=c[d];("PICTURE"===g.parentNode.nodeName.toUpperCase()||null!==g.getAttribute("srcset")||g[f.ns]&&null!==g[f.ns].srcset)&&
a.push(g)}return a},f.getMatch=function(a,b){var c;var d=b.childNodes;var e=0;for(var g=d.length;g>e;e++){var h=d[e];if(1===h.nodeType){if(h===a)return c;if("SOURCE"===h.nodeName.toUpperCase()){null!==h.getAttribute("src")&&void 0!==typeof console&&console.warn("The `src` attribute is invalid on `picture` `source` element; instead, use `srcset`.");var i=h.getAttribute("media");if(h.getAttribute("srcset")&&(!i||f.matchesMedia(i))){var j=f.verifyTypeSupport(h);if(j===!0){c=h;break}if("pending"===j)return!1}}}}return c},
e(),d$$0._=f,"object"==typeof module&&"object"==typeof module.exports?module.exports=d$$0:"function"==typeof define&&define.amd&&define(function(){return d$$0}),"object"==typeof a$$1&&(a$$1.picturefill=d$$0)}(window,window.document,new window.Image);
