Home Health News Patient Voices: Restless Leg Syndrome

Patient Voices: Restless Leg Syndrome

4
0


restless leg syndrome differently the results are the same: sleepless nights and restless days. What is it like to be diagnosed with R.L.S.? Six men and women speak about their experiences. (Join the discussion here.)” />

Patient Voices: Restless Leg Syndrome – The New York Times

Creepy-crawly, itchy, tingly, aching legs — while different people may describe restless leg syndrome differently the results are the same: sleepless nights and restless days. What is it like to be diagnosed with R.L.S.? Six men and women speak about their experiences.


















‘).append(tmp).html();
};

/**
* In the current simple implementation, an index i is a break
* opportunity in txt iff it is 0, txt.length, or the
* index of a non-whitespace char immediately preceded by a
* whitespace char. (Thus, it doesn’t honour ‘white-space’ or
* any Unicode line-breaking classes.)
*
* @precondition 0 = 0) {
oldLH = $this.css(‘line-height’);
}

// remove line height before measuring container size
$this.css(‘line-height’, ‘normal’);

var containerWidth = $this.width();
var containerHeight = $this.height();

// save settings
var oldWS = $this.css(‘white-space’);
var oldFloat = $this.css(‘float’);
var oldDisplay = $this.css(‘display’);
var oldPosition = $this.css(‘position’);

// temporary settings
$this.css({
‘white-space’: ‘nowrap’,
‘float’: ‘none’,
‘display’: ‘inline’,
‘position’: ‘static’
});

var nowrapWidth = $this.width();
var nowrapHeight = $this.height();

// An estimate of the average line width reduction due
// to trimming trailing space that we expect over all
// lines other than the last.

var spaceWidth = ((oldWS === ‘pre-wrap’) ? 0 : getSpaceWidth($this, nowrapHeight));

if (containerWidth > 0 && // prevent divide by zero
nowrapWidth > containerWidth && // text is more than 1 line
nowrapWidth 1) {

// clear whitespace match cache for each line
wsMatches = null;

var desiredWidth = Math.round((nowrapWidth + spaceWidth)
/ remLines
– spaceWidth);

// Guessed char index
var guessIndex = Math.round((remainingText.length + 1) / remLines) – 1;

var le = new NextWS_params();

// Find a breaking space somewhere before (or equal to) desired width,
// not necessarily the closest to the desired width.
findBreakOpportunity($this, remainingText, containerWidth, desiredWidth, -1, guessIndex, le);

// Find first breaking char after (or equal to) desired width.
var ge = new NextWS_params();
guessIndex = le.index;
findBreakOpportunity($this, remainingText, containerWidth, desiredWidth, +1, guessIndex, ge);

// Find first breaking char before (or equal to) desired width.
le.reset();
guessIndex = ge.index;
findBreakOpportunity($this, remainingText, containerWidth, desiredWidth, -1, guessIndex, le);

// Find closest string to desired length
var splitIndex;
if (le.index === 0) {
splitIndex = ge.index;
} else if ((containerWidth ‘;
}
remainingText = remainingText.substr(splitIndex);

// update counters
remLines–;
$this.html(remainingText);
nowrapWidth = $this.width();
}

if (shouldJustify) {
$this.html(newText + justify($this, remainingText, containerWidth));
} else {
$this.html(newText + remainingText);
}
}

// restore settings
$this.css({
‘position’: oldPosition,
‘display’: oldDisplay,
‘float’: oldFloat,
‘white-space’: oldWS,
‘line-height’: oldLH
});
});
};

return function(selectors) {
if ($.isArray(selectors)) selectors = selectors.join(‘, ‘);
function applyBalanceText() {
$(selectors)
.each(function() {
// look for html nodes in this element
var el = $(this), updated, related;
if (el.hasClass(‘interactive-leadin’)) {
// save dateline and related link
updated = el.find(‘time.dateline’);
related = el.find(‘a.related-link’);
el.data(‘updated’, updated.get(0))
.data(‘related’, related.get(0))
.data(‘filter’, $.trim((updated.text() + “http://www.nytimes.com/” + related.text()).replace(/[ nt]+/g, “http://www.nytimes.com/”)));
} else if (el.hasClass(‘g-intro’)) {
// special treatment for stacks
updated = el.find(‘.g-updated’);
related = el.find(‘.g-related-link’);
el.data(‘updated’, updated.get(0))
.data(‘related’, related.get(0))
.data(‘filter’, $.trim((updated.text() + (related.get(0) ? “http://www.nytimes.com/” + related.text() : “http://www.nytimes.com/”)).replace(/[ nt]+/g, “http://www.nytimes.com/”)));
console.log(el.data(‘filter’), related.get(0));
}
})
.balanceText()
.each(function() {
var el = $(this), filter, summary, nobr;
if (el.hasClass(‘interactive-leadin’)) {
el.find(‘.dateline,.related-link’).remove();
filter = el.data(‘filter’);
summary = el.html().replace(/[ nt]+/g, “http://www.nytimes.com/”).replace(filter, “http://www.nytimes.com/”);
el.html(‘‘+summary+’‘);
nobr = $(‘‘)
.css(‘white-space’, ‘nowrap’)
.appendTo(el);
nobr.append(el.data(‘updated’));
nobr.append(“http://www.nytimes.com/”);
nobr.append(el.data(‘related’));
} else if (el.hasClass(‘g-intro’)) {
// special treatment for stacks
el.find(‘.g-updated,.g-related-link’).remove();
filter = el.data(‘filter’);
summary = el.html().replace(/[ nt]+/g, “http://www.nytimes.com/”).replace(filter, “http://www.nytimes.com/”);
el.html(‘‘+summary+’‘);
nobr = $(‘‘)
.css(‘white-space’, ‘nowrap’)
.appendTo(el);
nobr.append(el.data(‘updated’));
if (el.data(‘related’)) {
nobr.append(“http://www.nytimes.com/”);
nobr.append(el.data(‘related’));
}
}

});
}
// Apply on DOM ready
$(window).ready(applyBalanceText);
// Reapply on resize
$(window).smartresize(applyBalanceText);
};

});

define(‘jquery’,[“jquery/nyt”], function ($) { return $ });
/**
* @preserve LaziestLoader – v0.7.2 – 2015-11-17
* A responsive lazy loader for jQuery.
* http://sjwilliams.github.io/laziestloader/
* Copyright (c) 2015 Josh Williams; Licensed MIT
*/

(function(factory) {
if (typeof define === ‘function’ && define.amd) {
define(‘laziestloader’,[‘jquery’], factory);
} else {
factory(jQuery);
}
}(function($) {

var laziestLoader = function(options, callback) {

var $w = $(window),
$elements = this,
$loaded = $(), // elements with the correct source set
retina = window.devicePixelRatio > 1,
didScroll = false;

options = $.extend(true, {
threshold: 0,
sizePattern: /{{SIZE}}/ig,
getSource: getSource,
event: ‘scroll’,
scrollThrottle: 250, // time in ms to throttle scroll. Increase for better performance.
sizeOffsetPercent: 0, // prefer smaller images
setSourceMode: true // plugin sets source attribute of the element. Set to false if you would like to, instead, use the callback to completely manage the element on trigger.
}, options);


var useNativeScroll = (typeof options.event === ‘string’) && (options.event.indexOf(‘scroll’) === 0);

/**
* Generate source path of image to load. Take into account
* type of data supplied and whether or not a retina
* image is available.
*
* Basic option: data attributes specifing a single image to load,
* regardless of viewport.
* Eg:
*
*
*
*
* Range of sizes: specify a string path with a {{size}} that
* will be replaced by an integer from a list of available sizes.
* Eg:
*
*
*
*
*
* Range of sizes, with slugs: specify a string path with a {{size}} that
* will be replaced by a slug representing an image size.
* Eg:
*
*
*
* @param {jQuery object} $el
* @return {String}
*/

function getSource($el) {
var source, slug;
var data = $el.data();
if (data.pattern && data.widths && $.isArray(data.widths)) {
source = retina ? data.patternRetina : data.pattern;
source = source “http://www.nytimes.com/” data.pattern;

// width or slug version?
if (typeof data.widths[0] === ‘object’) {
slug = (function() {
var widths = $.map(data.widths, function(val) {
return val.size;
});

var bestFitWidth = bestFit($el.width(), widths);

// match best width back to its corresponding slug
for (var i = data.widths.length – 1; i >= 0; i–) {
if (data.widths[i].size === bestFitWidth) {
return data.widths[i].slug;
}
}
})();

source = source.replace(options.sizePattern, slug);
} else {
source = source.replace(options.sizePattern, bestFit($el.width(), data.widths));
}
} else {
source = retina ? data.srcRetina : data.src;
source = source “http://www.nytimes.com/” data.src;
}

return source;
}

/**
* Reflect loaded state in class names
* and fire event.
*
* @param {jQuery Object} $el
*/
function onLoad($el) {
$el.addClass(‘ll-loaded’).removeClass(‘ll-notloaded’);
$el.trigger(‘loaded’);

if (typeof callback === ‘function’) {
callback.call($el);
}
}

/**
* Attach event handler that sets correct
* media source for the elements’ width, or
* allows callback to manipulate element
* exclusively.
*/

function bindLoader() {
$elements.one(‘laziestloader’, function() {
var $el = $(this);
var source;

// set height?
if ($el.data().ratio) {
setHeight.call(this);
}

// set content. default: set element source
if (options.setSourceMode) {
source = options.getSource($el);
if (source && this.getAttribute(‘src’) !== source) {
this.setAttribute(‘src’, source);
}
}

// applied immediately to reflect that media has started but,
// perhaps, hasn’t finished downloading.
$el.addClass(‘ll-loadstarted’);

// Determine when to fire `loaded` event. Wait until
// media is truly loaded if possible, otherwise immediately.
if (options.setSourceMode && (this.nodeName === ‘IMG”http://www.nytimes.com/”| this.nodeName === ‘VIDEO”http://www.nytimes.com/”| this.nodeName === ‘AUDIO’) ) {
if (this.nodeName === ‘IMG’) {
this.onload = function() {
onLoad($el);
};
} else {
this.onloadstart = function() {
onLoad($el);
};
}
} else {
onLoad($el);
}
});
}

/**
* Remove even handler from elements
*/

function unbindLoader() {
$elements.off(‘laziestloader’);
}

/**
* Find the best sized image, opting for larger over smaller
*
* @param {Number} targetWidth element width
* @param {Array} widths array of numbers
* @return {Number}
*/

var bestFit = laziestLoader.bestFit = function(targetWidth, widths) {
var selectedWidth = widths[widths.length – 1],
i = widths.length,
offset = targetWidth * (options.sizeOffsetPercent / 100);

// sort smallest to largest
widths.sort(function(a, b) {
return a – b;
});

while (i–) {
if ((targetWidth – offset) 0 &&
rect.right + threshold > 0 &&
rect.left 0&&0===b.container.parents(“.”+b.params.slideActiveClass).length)return;var s={left:window.pageXOffset,top:window.pageYOffset},r=window.innerWidth,i=window.innerHeight,n=b.container.offset();b.rtl&&(n.left=n.left-b.container[0].scrollLeft);for(var o=[[n.left,n.top],[n.left+b.width,n.top],[n.left,n.top+b.height],[n.left+b.width,n.top+b.height]],l=0;l=s.left&&p[0]=s.top&&p[1]Math.abs(s.pixelY)))return;a=s.pixelX*t}else{if(!(Math.abs(s.pixelY)>Math.abs(s.pixelX)))return;a=s.pixelY}else a=Math.abs(s.pixelX)>Math.abs(s.pixelY)?-s.pixelX*t:-s.pixelY;if(0!==a){if(b.params.mousewheelInvert&&(a=-a),b.params.freeMode){var r=b.getWrapperTranslate()+a*b.params.mousewheelSensitivity,i=b.isBeginning,n=b.isEnd;if(r>=b.minTranslate()&&(r=b.minTranslate()),r60)if(a=0?parseInt(r,10)*t*n+”%”:r*t*n+”px”,i=i.indexOf(“%”)>=0?parseInt(i,10)*t+”%”:i*t+”px”,a.transform(“translate3d(“+r+”, “+i+”,0px)”)}function g(e){return 0!==e.indexOf(“on”)&&(e=e[0]!==e[0].toUpperCase()?”on”+e[0].toUpperCase()+e.substring(1):”on”+e),e}if(!(this instanceof t))return new t(a,s);var h={direction:”horizontal”,touchEventsTarget:”container”,initialSlide:0,speed:300,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,iOSEdgeSwipeDetection:!1,iOSEdgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:”slide”,coverflow:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0},flip:{slideShadows:!0,limitRotation:!0},cube:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94},fade:{crossFade:!1},parallax:!1,zoom:!1,zoomMax:3,zoomMin:1,zoomToggle:!0,scrollbar:null,scrollbarHide:!0,scrollbarDraggable:!1,scrollbarSnapOnRelease:!1,keyboardControl:!1,mousewheelControl:!1,mousewheelReleaseOnEdges:!1,mousewheelInvert:!1,mousewheelForceToAxis:!1,mousewheelSensitivity:1,mousewheelEventsTarged:”container”,hashnav:!1,hashnavWatchState:!1,history:!1,replaceState:!1,breakpoints:void 0,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:”column”,slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,onlyExternal:!1,threshold:0,touchMoveStopPropagation:!0,touchReleaseOnEdges:!1,uniqueNavElements:!0,pagination:null,paginationElement:”span”,paginationClickable:!1,paginationHide:!1,paginationBulletRender:null,paginationProgressRender:null,paginationFractionRender:null,paginationCustomRender:null,paginationType:”bullets”,resistance:!0,resistanceRatio:.85,nextButton:null,prevButton:null,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,lazyLoading:!1,lazyLoadingInPrevNext:!1,lazyLoadingInPrevNextAmount:1,lazyLoadingOnTransitionStart:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,control:void 0,controlInverse:!1,controlBy:”slide”,normalizeSlideIndex:!0,allowSwipeToPrev:!0,allowSwipeToNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:”swiper-no-swiping”,passiveListeners:!0,containerModifierClass:”swiper-container-“,slideClass:”swiper-slide”,slideActiveClass:”swiper-slide-active”,slideDuplicateActiveClass:”swiper-slide-duplicate-active”,slideVisibleClass:”swiper-slide-visible”,slideDuplicateClass:”swiper-slide-duplicate”,slideNextClass:”swiper-slide-next”,slideDuplicateNextClass:”swiper-slide-duplicate-next”,slidePrevClass:”swiper-slide-prev”,slideDuplicatePrevClass:”swiper-slide-duplicate-prev”,wrapperClass:”swiper-wrapper”,bulletClass:”swiper-pagination-bullet”,bulletActiveClass:”swiper-pagination-bullet-active”,buttonDisabledClass:”swiper-button-disabled”,paginationCurrentClass:”swiper-pagination-current”,paginationTotalClass:”swiper-pagination-total”,paginationHiddenClass:”swiper-pagination-hidden”,paginationProgressbarClass:”swiper-pagination-progressbar”,paginationClickableClass:”swiper-pagination-clickable”,paginationModifierClass:”swiper-pagination-“,lazyLoadingClass:”swiper-lazy”,lazyStatusLoadingClass:”swiper-lazy-loading”,lazyStatusLoadedClass:”swiper-lazy-loaded”,lazyPreloaderClass:”swiper-lazy-preloader”,notificationClass:”swiper-notification”,preloaderClass:”preloader”,zoomContainerClass:”swiper-zoom-container”,observer:!1,observeParents:!1,a11y:!1,prevSlideMessage:”Previous slide”,nextSlideMessage:”Next slide”,firstSlideMessage:”This is the first slide”,lastSlideMessage:”This is the last slide”,paginationBulletMessage:”Go to slide {{index}}”,runCallbacksOnInit:!0},f=s&&s.virtualTranslate;s=s”http://www.nytimes.com/”{};var v={};for(var w in s)if(“object”!=typeof s[w]”http://www.nytimes.com/”null===s[w]”http://www.nytimes.com/”(s[w].nodeType”http://www.nytimes.com/”s[w]===window”http://www.nytimes.com/”s[w]===document”http://www.nytimes.com/””undefined”!=typeof Dom7&&s[w]instanceof Dom7″http://www.nytimes.com/””undefined”!=typeof jQuery&&s[w]instanceof jQuery))v[w]=s[w];else{v[w]={};for(var y in s[w])v[w][y]=s[w][y]}for(var x in h)if(“undefined”==typeof s[x])s[x]=h[x];else if(“object”==typeof s[x])for(var T in h[x])”undefined”==typeof s[x][T]&&(s[x][T]=h[x][T]);var b=this;if(b.params=s,b.originalParams=v,b.classNames=[],”undefined”!=typeof e&&”undefined”!=typeof Dom7&&(e=Dom7),(“undefined”!=typeof e”http://www.nytimes.com/”(e=”undefined”==typeof Dom7?window.Dom7″http://www.nytimes.com/”window.Zepto”http://www.nytimes.com/”window.jQuery:Dom7))&&(b.$=e,b.currentBreakpoint=void 0,b.getActiveBreakpoint=function(){if(!b.params.breakpoints)return!1;var e,a=!1,t=[];for(e in b.params.breakpoints)b.params.breakpoints.hasOwnProperty(e)&&t.push(e);t.sort(function(e,a){return parseInt(e,10)>parseInt(a,10)});for(var s=0;s=window.innerWidth&&!a&&(a=e);return a”http://www.nytimes.com/””max”},b.setBreakpoint=function(){var e=b.getActiveBreakpoint();if(e&&b.currentBreakpoint!==e){var a=e in b.params.breakpoints?b.params.breakpoints[e]:b.originalParams,t=b.params.loop&&a.slidesPerView!==b.params.slidesPerView;for(var s in a)b.params[s]=a[s];b.currentBreakpoint=e,t&&b.destroyLoop&&b.reLoop(!0)}},b.params.breakpoints&&b.setBreakpoint(),b.container=e(a),0!==b.container.length)){if(b.container.length>1){var C=[];return b.container.each(function(){C.push(new t(this,s))}),C}b.container[0].swiper=b,b.container.data(“swiper”,b),b.classNames.push(b.params.containerModifierClass+b.params.direction),b.params.freeMode&&b.classNames.push(b.params.containerModifierClass+”free-mode”),b.support.flexbox”http://www.nytimes.com/”(b.classNames.push(b.params.containerModifierClass+”no-flexbox”),b.params.slidesPerColumn=1),b.params.autoHeight&&b.classNames.push(b.params.containerModifierClass+”autoheight”),(b.params.parallax”http://www.nytimes.com/”b.params.watchSlidesVisibility)&&(b.params.watchSlidesProgress=!0),b.params.touchReleaseOnEdges&&(b.params.resistanceRatio=0),[“cube”,”coverflow”,”flip”].indexOf(b.params.effect)>=0&&(b.support.transforms3d?(b.params.watchSlidesProgress=!0,b.classNames.push(b.params.containerModifierClass+”3d”)):b.params.effect=”slide”),”slide”!==b.params.effect&&b.classNames.push(b.params.containerModifierClass+b.params.effect),”cube”===b.params.effect&&(b.params.resistanceRatio=0,b.params.slidesPerView=1,b.params.slidesPerColumn=1,b.params.slidesPerGroup=1,b.params.centeredSlides=!1,b.params.spaceBetween=0,b.params.virtualTranslate=!0,b.params.setWrapperSize=!1),”fade”!==b.params.effect&&”flip”!==b.params.effect”http://www.nytimes.com/”(b.params.slidesPerView=1,b.params.slidesPerColumn=1,b.params.slidesPerGroup=1,b.params.watchSlidesProgress=!0,b.params.spaceBetween=0,b.params.setWrapperSize=!1,”undefined”==typeof f&&(b.params.virtualTranslate=!0)),b.params.grabCursor&&b.support.touch&&(b.params.grabCursor=!1),b.wrapper=b.container.children(“.”+b.params.wrapperClass),b.params.pagination&&(b.paginationContainer=e(b.params.pagination),b.params.uniqueNavElements&&”string”==typeof b.params.pagination&&b.paginationContainer.length>1&&1===b.container.find(b.params.pagination).length&&(b.paginationContainer=b.container.find(b.params.pagination)),”bullets”===b.params.paginationType&&b.params.paginationClickable?b.paginationContainer.addClass(b.params.paginationModifierClass+”clickable”):b.params.paginationClickable=!1,b.paginationContainer.addClass(b.params.paginationModifierClass+b.params.paginationType)),(b.params.nextButton”http://www.nytimes.com/”b.params.prevButton)&&(b.params.nextButton&&(b.nextButton=e(b.params.nextButton),b.params.uniqueNavElements&&”string”==typeof b.params.nextButton&&b.nextButton.length>1&&1===b.container.find(b.params.nextButton).length&&(b.nextButton=b.container.find(b.params.nextButton))),b.params.prevButton&&(b.prevButton=e(b.params.prevButton),b.params.uniqueNavElements&&”string”==typeof b.params.prevButton&&b.prevButton.length>1&&1===b.container.find(b.params.prevButton).length&&(b.prevButton=b.container.find(b.params.prevButton)))),b.isHorizontal=function(){return”horizontal”===b.params.direction},b.rtl=b.isHorizontal()&&(“rtl”===b.container[0].dir.toLowerCase()”http://www.nytimes.com/””rtl”===b.container.css(“direction”)),b.rtl&&b.classNames.push(b.params.containerModifierClass+”rtl”),b.rtl&&(b.wrongRTL=”-webkit-box”===b.wrapper.css(“display”)),b.params.slidesPerColumn>1&&b.classNames.push(b.params.containerModifierClass+”multirow”),b.device.android&&b.classNames.push(b.params.containerModifierClass+”android”),b.container.addClass(b.classNames.join(“http://www.nytimes.com/”)),b.translate=0,b.progress=0,b.velocity=0,b.lockSwipeToNext=function(){b.params.allowSwipeToNext=!1,b.params.allowSwipeToPrev===!1&&b.params.grabCursor&&b.unsetGrabCursor()},b.lockSwipeToPrev=function(){b.params.allowSwipeToPrev=!1,b.params.allowSwipeToNext===!1&&b.params.grabCursor&&b.unsetGrabCursor()},b.lockSwipes=function(){b.params.allowSwipeToNext=b.params.allowSwipeToPrev=!1,b.params.grabCursor&&b.unsetGrabCursor()},b.unlockSwipeToNext=function(){b.params.allowSwipeToNext=!0,b.params.allowSwipeToPrev===!0&&b.params.grabCursor&&b.setGrabCursor()},b.unlockSwipeToPrev=function(){b.params.allowSwipeToPrev=!0,b.params.allowSwipeToNext===!0&&b.params.grabCursor&&b.setGrabCursor()},b.unlockSwipes=function(){b.params.allowSwipeToNext=b.params.allowSwipeToPrev=!0,b.params.grabCursor&&b.setGrabCursor()},b.setGrabCursor=function(e){b.container[0].style.cursor=”move”,b.container[0].style.cursor=e?”-webkit-grabbing”:”-webkit-grab”,b.container[0].style.cursor=e?”-moz-grabbin”:”-moz-grab”,b.container[0].style.cursor=e?”grabbing”:”grab”},b.unsetGrabCursor=function(){b.container[0].style.cursor=”http://www.nytimes.com/”},b.params.grabCursor&&b.setGrabCursor(),b.imagesToLoad=[],b.imagesLoaded=0,b.loadImage=function(e,a,t,s,r,i){function n(){i&&i()}var o;e.complete&&r?n():a?(o=new window.Image,o.onload=n,o.onerror=n,s&&(o.sizes=s),t&&(o.srcset=t),a&&(o.src=a)):n()},b.preloadImages=function(){function e(){“undefined”!=typeof b&&null!==b&&(void 0!==b.imagesLoaded&&b.imagesLoaded++,b.imagesLoaded===b.imagesToLoad.length&&(b.params.updateOnImagesReady&&b.update(),b.emit(“onImagesReady”,b)))}b.imagesToLoad=b.container.find(“img”);for(var a=0;a1)for(i=0;ib.slides.length)break;e.push(b.slides.eq(t)[0])}else e.push(b.slides.eq(b.activeIndex)[0]);for(i=0;ia?s:a}a&&b.wrapper.css(“height”,a+”px”)},b.updateContainerSize=function(){var e,a;e=”undefined”!=typeof b.params.width?b.params.width:b.container[0].clientWidth,a=”undefined”!=typeof b.params.height?b.params.height:b.container[0].clientHeight,0===e&&b.isHorizontal()”http://www.nytimes.com/”0===a&&!b.isHorizontal()”http://www.nytimes.com/”(e=e-parseInt(b.container.css(“padding-left”),10)-parseInt(b.container.css(“padding-right”),10),a=a-parseInt(b.container.css(“padding-top”),10)-parseInt(b.container.css(“padding-bottom”),10),b.width=e,b.height=a,b.size=b.isHorizontal()?b.width:b.height)},b.updateSlidesSize=function(){b.slides=b.wrapper.children(“.”+b.params.slideClass),b.snapGrid=[],b.slidesGrid=[],b.slidesSizesGrid=[];var e,a=b.params.spaceBetween,t=-b.params.slidesOffsetBefore,s=0,i=0;if(“undefined”!=typeof b.size){“string”==typeof a&&a.indexOf(“%”)>=0&&(a=parseFloat(a.replace(“%”,”http://www.nytimes.com/”))/100*b.size),b.virtualSize=-a,b.rtl?b.slides.css({marginLeft:”http://www.nytimes.com/”,marginTop:”http://www.nytimes.com/”}):b.slides.css({marginRight:”http://www.nytimes.com/”,marginBottom:”http://www.nytimes.com/”});var n;b.params.slidesPerColumn>1&&(n=Math.floor(b.slides.length/b.params.slidesPerColumn)===b.slides.length/b.params.slidesPerColumn?b.slides.length:Math.ceil(b.slides.length/b.params.slidesPerColumn)*b.params.slidesPerColumn,”auto”!==b.params.slidesPerView&&”row”===b.params.slidesPerColumnFill&&(n=Math.max(n,b.params.slidesPerView*b.params.slidesPerColumn)));var o,l=b.params.slidesPerColumn,p=n/l,d=p-(b.params.slidesPerColumn*p-b.slides.length);for(e=0;e1){var m,c,g;”column”===b.params.slidesPerColumnFill?(c=Math.floor(e/l),g=e-c*l,(c>d”http://www.nytimes.com/”c===d&&g===l-1)&&++g>=l&&(g=0,c++),m=c+g*n/l,u.css({“-webkit-box-ordinal-group”:m,”-moz-box-ordinal-group”:m,”-ms-flex-order”:m,”-webkit-order”:m,order:m})):(g=Math.floor(e/p),c=e-g*p),u.css(“margin-“+(b.isHorizontal()?”top”:”left”),0!==g&&b.params.spaceBetween&&b.params.spaceBetween+”px”).attr(“data-swiper-column”,c).attr(“data-swiper-row”,g)}”none”!==u.css(“display”)&&(“auto”===b.params.slidesPerView?(o=b.isHorizontal()?u.outerWidth(!0):u.outerHeight(!0),b.params.roundLengths&&(o=r(o))):(o=(b.size-(b.params.slidesPerView-1)*a)/b.params.slidesPerView,b.params.roundLengths&&(o=r(o)),b.isHorizontal()?b.slides[e].style.width=o+”px”:b.slides[e].style.height=o+”px”),b.slides[e].swiperSlideSize=o,b.slidesSizesGrid.push(o),b.params.centeredSlides?(t=t+o/2+s/2+a,0===e&&(t=t-b.size/2-a),Math.abs(t)<.001 h="http://www.nytimes.com/">1&&(b.virtualSize=(o+b.params.spaceBetween)*n,b.virtualSize=Math.ceil(b.virtualSize/b.params.slidesPerColumn)-b.params.spaceBetween,b.isHorizontal()?b.wrapper.css({width:b.virtualSize+b.params.spaceBetween+”px”}):b.wrapper.css({height:b.virtualSize+b.params.spaceBetween+”px”}),b.params.centeredSlides)){for(h=[],e=0;e1&&b.snapGrid.push(b.virtualSize-b.size)}0===b.snapGrid.length&&(b.snapGrid=[0]),0!==b.params.spaceBetween&&(b.isHorizontal()?b.rtl?b.slides.css({marginLeft:a+”px”}):b.slides.css({marginRight:a+”px”}):b.slides.css({marginBottom:a+”px”})),b.params.watchSlidesProgress&&b.updateSlidesOffset()}},b.updateSlidesOffset=function(){for(var e=0;e=0&&i0&&n=b.size;o&&b.slides.eq(t).addClass(b.params.slideVisibleClass)}s.progress=b.rtl?-r:r}}},b.updateProgress=function(e){“undefined”==typeof e&&(e=b.translate”http://www.nytimes.com/”0);var a=b.maxTranslate()-b.minTranslate(),t=b.isBeginning,s=b.isEnd;0===a?(b.progress=0,b.isBeginning=b.isEnd=!0):(b.progress=(e-b.minTranslate())/a,b.isBeginning=b.progress=1),b.isBeginning&&!t&&b.emit(“onReachBeginning”,b),b.isEnd&&!s&&b.emit(“onReachEnd”,b),b.params.watchSlidesProgress&&b.updateSlidesProgress(e),b.emit(“onProgress”,b,b.progress)},b.updateActiveIndex=function(){var e,a,t,s=b.rtl?b.translate:-b.translate;for(a=0;a=b.slidesGrid[a]&&s=b.slidesGrid[a]&&s=b.slidesGrid[a]&&(e=a);b.params.normalizeSlideIndex&&(e=b.snapGrid.length&&(t=b.snapGrid.length-1),e!==b.activeIndex&&(b.snapIndex=t,b.previousIndex=b.activeIndex,b.activeIndex=e,b.updateClasses(),b.updateRealIndex())},b.updateRealIndex=function(){b.realIndex=b.slides.eq(b.activeIndex).attr(“data-swiper-slide-index”)”http://www.nytimes.com/”b.activeIndex},b.updateClasses=function(){b.slides.removeClass(b.params.slideActiveClass+”http://www.nytimes.com/”+b.params.slideNextClass+”http://www.nytimes.com/”+b.params.slidePrevClass+”http://www.nytimes.com/”+b.params.slideDuplicateActiveClass+”http://www.nytimes.com/”+b.params.slideDuplicateNextClass+”http://www.nytimes.com/”+b.params.slideDuplicatePrevClass);var a=b.slides.eq(b.activeIndex);a.addClass(b.params.slideActiveClass),s.loop&&(a.hasClass(b.params.slideDuplicateClass)?b.wrapper.children(“.”+b.params.slideClass+”:not(.”+b.params.slideDuplicateClass+’)[data-swiper-slide-index=”http://www.nytimes.com/”+b.realIndex+”http://www.nytimes.com/”]’).addClass(b.params.slideDuplicateActiveClass):b.wrapper.children(“.”+b.params.slideClass+”.”+b.params.slideDuplicateClass+'[data-swiper-slide-index=”http://www.nytimes.com/”+b.realIndex+”http://www.nytimes.com/”]’).addClass(b.params.slideDuplicateActiveClass));var t=a.next(“.”+b.params.slideClass).addClass(b.params.slideNextClass);b.params.loop&&0===t.length&&(t=b.slides.eq(0),t.addClass(b.params.slideNextClass));var r=a.prev(“.”+b.params.slideClass).addClass(b.params.slidePrevClass);if(b.params.loop&&0===r.length&&(r=b.slides.eq(-1),r.addClass(b.params.slidePrevClass)),s.loop&&(t.hasClass(b.params.slideDuplicateClass)?b.wrapper.children(“.”+b.params.slideClass+”:not(.”+b.params.slideDuplicateClass+’)[data-swiper-slide-index=”http://www.nytimes.com/”+t.attr(“data-swiper-slide-index”)+”http://www.nytimes.com/”]’).addClass(b.params.slideDuplicateNextClass):b.wrapper.children(“.”+b.params.slideClass+”.”+b.params.slideDuplicateClass+'[data-swiper-slide-index=”http://www.nytimes.com/”+t.attr(“data-swiper-slide-index”)+”http://www.nytimes.com/”]’).addClass(b.params.slideDuplicateNextClass),r.hasClass(b.params.slideDuplicateClass)?b.wrapper.children(“.”+b.params.slideClass+”:not(.”+b.params.slideDuplicateClass+’)[data-swiper-slide-index=”http://www.nytimes.com/”+r.attr(“data-swiper-slide-index”)+”http://www.nytimes.com/”]’).addClass(b.params.slideDuplicatePrevClass):b.wrapper.children(“.”+b.params.slideClass+”.”+b.params.slideDuplicateClass+'[data-swiper-slide-index=”http://www.nytimes.com/”+r.attr(“data-swiper-slide-index”)+”http://www.nytimes.com/”]’).addClass(b.params.slideDuplicatePrevClass)),b.paginationContainer&&b.paginationContainer.length>0){var i,n=b.params.loop?Math.ceil((b.slides.length-2*b.loopedSlides)/b.params.slidesPerGroup):b.snapGrid.length;if(b.params.loop?(i=Math.ceil((b.activeIndex-b.loopedSlides)/b.params.slidesPerGroup),i>b.slides.length-1-2*b.loopedSlides&&(i-=b.slides.length-2*b.loopedSlides),i>n-1&&(i-=n),i0&&(b.bullets.removeClass(b.params.bulletActiveClass),b.paginationContainer.length>1?b.bullets.each(function(){e(this).index()===i&&e(this).addClass(b.params.bulletActiveClass)}):b.bullets.eq(i).addClass(b.params.bulletActiveClass)),”fraction”===b.params.paginationType&&(b.paginationContainer.find(“.”+b.params.paginationCurrentClass).text(i+1),b.paginationContainer.find(“.”+b.params.paginationTotalClass).text(n)),”progress”===b.params.paginationType){var o=(i+1)/n,l=o,p=1;b.isHorizontal()”http://www.nytimes.com/”(p=o,l=1),b.paginationContainer.find(“.”+b.params.paginationProgressbarClass).transform(“translate3d(0,0,0) scaleX(“+l+”) scaleY(“+p+”)”).transition(b.params.speed)}”custom”===b.params.paginationType&&b.params.paginationCustomRender&&(b.paginationContainer.html(b.params.paginationCustomRender(b,i+1,n)),b.emit(“onPaginationRendered”,b,b.paginationContainer[0]))}b.params.loop”http://www.nytimes.com/”(b.params.prevButton&&b.prevButton&&b.prevButton.length>0&&(b.isBeginning?(b.prevButton.addClass(b.params.buttonDisabledClass),b.params.a11y&&b.a11y&&b.a11y.disable(b.prevButton)):(b.prevButton.removeClass(b.params.buttonDisabledClass),b.params.a11y&&b.a11y&&b.a11y.enable(b.prevButton))),b.params.nextButton&&b.nextButton&&b.nextButton.length>0&&(b.isEnd?(b.nextButton.addClass(b.params.buttonDisabledClass),b.params.a11y&&b.a11y&&b.a11y.disable(b.nextButton)):(b.nextButton.removeClass(b.params.buttonDisabledClass),b.params.a11y&&b.a11y&&b.a11y.enable(b.nextButton))))},b.updatePagination=function(){if(b.params.pagination&&b.paginationContainer&&b.paginationContainer.length>0){var e=”http://www.nytimes.com/”;if(“bullets”===b.params.paginationType){for(var a=b.params.loop?Math.ceil((b.slides.length-2*b.loopedSlides)/b.params.slidesPerGroup):b.snapGrid.length,t=0;t
‘+b.params.paginationElement+”>”;b.paginationContainer.html(e),b.bullets=b.paginationContainer.find(“.”+b.params.bulletClass),b.params.paginationClickable&&b.params.a11y&&b.a11y&&b.a11y.initPagination()}”fraction”===b.params.paginationType&&(e=b.params.paginationFractionRender?b.params.paginationFractionRender(b,b.params.paginationCurrentClass,b.params.paginationTotalClass):’ / ‘,b.paginationContainer.html(e)),”progress”===b.params.paginationType&&(e=b.params.paginationProgressRender?b.params.paginationProgressRender(b,b.params.paginationProgressbarClass):”http://www.nytimes.com/”,b.paginationContainer.html(e)),”custom”!==b.params.paginationType&&b.emit(“onPaginationRendered”,b,b.paginationContainer[0])}},b.update=function(e){function a(){b.rtl?-b.translate:b.translate;s=Math.min(Math.max(b.translate,b.maxTranslate()),b.minTranslate()),b.setWrapperTranslate(s),b.updateActiveIndex(),b.updateClasses()}if(b.updateContainerSize(),b.updateSlidesSize(),b.updateProgress(),b.updatePagination(),b.updateClasses(),b.params.scrollbar&&b.scrollbar&&b.scrollbar.set(),e){var t,s;b.controller&&b.controller.spline&&(b.controller.spline=void 0),b.params.freeMode?(a(),b.params.autoHeight&&b.updateAutoHeight()):(t=(“auto”===b.params.slidesPerView”http://www.nytimes.com/”b.params.slidesPerView>1)&&b.isEnd&&!b.params.centeredSlides?b.slideTo(b.slides.length-1,0,!1,!0):b.slideTo(b.activeIndex,0,!1,!0),t”http://www.nytimes.com/”a())}else b.params.autoHeight&&b.updateAutoHeight()},b.onResize=function(e){b.params.breakpoints&&b.setBreakpoint();var a=b.params.allowSwipeToPrev,t=b.params.allowSwipeToNext;b.params.allowSwipeToPrev=b.params.allowSwipeToNext=!0,b.updateContainerSize(),b.updateSlidesSize(),(“auto”===b.params.slidesPerView”http://www.nytimes.com/”b.params.freeMode”http://www.nytimes.com/”e)&&b.updatePagination(),b.params.scrollbar&&b.scrollbar&&b.scrollbar.set(),b.controller&&b.controller.spline&&(b.controller.spline=void 0);var s=!1;if(b.params.freeMode){var r=Math.min(Math.max(b.translate,b.maxTranslate()),b.minTranslate());b.setWrapperTranslate(r),b.updateActiveIndex(),b.updateClasses(),b.params.autoHeight&&b.updateAutoHeight()}else b.updateClasses(),s=(“auto”===b.params.slidesPerView”http://www.nytimes.com/”b.params.slidesPerView>1)&&b.isEnd&&!b.params.centeredSlides?b.slideTo(b.slides.length-1,0,!1,!0):b.slideTo(b.activeIndex,0,!1,!0);b.params.lazyLoading&&!s&&b.lazy&&b.lazy.load(),b.params.allowSwipeToPrev=a,b.params.allowSwipeToNext=t},b.touchEventsDesktop={start:”mousedown”,move:”mousemove”,end:”mouseup”},window.navigator.pointerEnabled?b.touchEventsDesktop={start:”pointerdown”,move:”pointermove”,end:”pointerup”}:window.navigator.msPointerEnabled&&(b.touchEventsDesktop={start:”MSPointerDown”,move:”MSPointerMove”,end:”MSPointerUp”}),b.touchEvents={start:b.support.touch”http://www.nytimes.com/”!b.params.simulateTouch?”touchstart”:b.touchEventsDesktop.start,move:b.support.touch”http://www.nytimes.com/”!b.params.simulateTouch?”touchmove”:b.touchEventsDesktop.move,end:b.support.touch”http://www.nytimes.com/”!b.params.simulateTouch?”touchend”:b.touchEventsDesktop.end},(window.navigator.pointerEnabled”http://www.nytimes.com/”window.navigator.msPointerEnabled)&&(“container”===b.params.touchEventsTarget?b.container:b.wrapper).addClass(“swiper-wp8-“+b.params.direction),b.initEvents=function(e){var a=e?”off”:”on”,t=e?”removeEventListener”:”addEventListener”,r=”container”===b.params.touchEventsTarget?b.container[0]:b.wrapper[0],i=b.support.touch?r:document,n=!!b.params.nested;if(b.browser.ie)r[t](b.touchEvents.start,b.onTouchStart,!1),i[t](b.touchEvents.move,b.onTouchMove,n),i[t](b.touchEvents.end,b.onTouchEnd,!1);else{if(b.support.touch){var o=!(“touchstart”!==b.touchEvents.start”http://www.nytimes.com/”!b.support.passiveListener”http://www.nytimes.com/”!b.params.passiveListeners)&&{passive:!0,capture:!1};r[t](b.touchEvents.start,b.onTouchStart,o),r[t](b.touchEvents.move,b.onTouchMove,n),r[t](b.touchEvents.end,b.onTouchEnd,o)}(s.simulateTouch&&!b.device.ios&&!b.device.android”http://www.nytimes.com/”s.simulateTouch&&!b.support.touch&&b.device.ios)&&(r[t](“mousedown”,b.onTouchStart,!1),document[t](“mousemove”,b.onTouchMove,n),document[t](“mouseup”,b.onTouchEnd,!1))}window[t](“resize”,b.onResize),b.params.nextButton&&b.nextButton&&b.nextButton.length>0&&(b.nextButton[a](“click”,b.onClickNext),b.params.a11y&&b.a11y&&b.nextButton[a](“keydown”,b.a11y.onEnterKey)),b.params.prevButton&&b.prevButton&&b.prevButton.length>0&&(b.prevButton[a](“click”,b.onClickPrev),b.params.a11y&&b.a11y&&b.prevButton[a](“keydown”,b.a11y.onEnterKey)),b.params.pagination&&b.params.paginationClickable&&(b.paginationContainer[a](“click”,”.”+b.params.bulletClass,b.onClickIndex),b.params.a11y&&b.a11y&&b.paginationContainer[a](“keydown”,”.”+b.params.bulletClass,b.a11y.onEnterKey)),(b.params.preventClicks”http://www.nytimes.com/”b.params.preventClicksPropagation)&&r[t](“click”,b.preventClicks,!0)},b.attachEvents=function(){b.initEvents()},b.detachEvents=function(){b.initEvents(!0)},b.allowClick=!0,b.preventClicks=function(e){b.allowClick”http://www.nytimes.com/”(b.params.preventClicks&&e.preventDefault(),b.params.preventClicksPropagation&&b.animating&&(e.stopPropagation(),e.stopImmediatePropagation()));
},b.onClickNext=function(e){e.preventDefault(),b.isEnd&&!b.params.loop”http://www.nytimes.com/”b.slideNext()},b.onClickPrev=function(e){e.preventDefault(),b.isBeginning&&!b.params.loop”http://www.nytimes.com/”b.slidePrev()},b.onClickIndex=function(a){a.preventDefault();var t=e(this).index()*b.params.slidesPerGroup;b.params.loop&&(t+=b.loopedSlides),b.slideTo(t)},b.updateClickedSlide=function(a){var t=o(a,”.”+b.params.slideClass),s=!1;if(t)for(var r=0;rb.slides.length-b.loopedSlides+b.params.slidesPerView/2?(b.fixLoop(),n=b.wrapper.children(“.”+b.params.slideClass+'[data-swiper-slide-index=”http://www.nytimes.com/”+i+”http://www.nytimes.com/”]:not(.’+b.params.slideDuplicateClass+”)”).eq(0).index(),setTimeout(function(){b.slideTo(n)},0)):b.slideTo(n):n>b.slides.length-b.params.slidesPerView?(b.fixLoop(),n=b.wrapper.children(“.”+b.params.slideClass+'[data-swiper-slide-index=”http://www.nytimes.com/”+i+”http://www.nytimes.com/”]:not(.’+b.params.slideDuplicateClass+”)”).eq(0).index(),setTimeout(function(){b.slideTo(n)},0)):b.slideTo(n)}else b.slideTo(n)}};var S,z,M,P,E,I,k,D,L,B,H=”input, select, textarea, button, video”,G=Date.now(),X=[];b.animating=!1,b.touches={startX:0,startY:0,currentX:0,currentY:0,diff:0};var Y,A;b.onTouchStart=function(a){if(a.originalEvent&&(a=a.originalEvent),Y=”touchstart”===a.type,Y”http://www.nytimes.com/”!(“which”in a)”http://www.nytimes.com/”3!==a.which){if(b.params.noSwiping&&o(a,”.”+b.params.noSwipingClass))return void(b.allowClick=!0);if(!b.params.swipeHandler”http://www.nytimes.com/”o(a,b.params.swipeHandler)){var t=b.touches.currentX=”touchstart”===a.type?a.targetTouches[0].pageX:a.pageX,s=b.touches.currentY=”touchstart”===a.type?a.targetTouches[0].pageY:a.pageY;if(!(b.device.ios&&b.params.iOSEdgeSwipeDetection&&t0&&(D=!1),”touchstart”!==a.type){var r=!0;e(a.target).is(H)&&(r=!1),document.activeElement&&e(document.activeElement).is(H)&&document.activeElement.blur(),r&&a.preventDefault()}b.emit(“onTouchStart”,b,a)}}}},b.onTouchMove=function(a){if(a.originalEvent&&(a=a.originalEvent),!Y”http://www.nytimes.com/””mousemove”!==a.type){if(a.preventedByNestedSwiper)return b.touches.startX=”touchmove”===a.type?a.targetTouches[0].pageX:a.pageX,void(b.touches.startY=”touchmove”===a.type?a.targetTouches[0].pageY:a.pageY);if(b.params.onlyExternal)return b.allowClick=!1,void(S&&(b.touches.startX=b.touches.currentX=”touchmove”===a.type?a.targetTouches[0].pageX:a.pageX,b.touches.startY=b.touches.currentY=”touchmove”===a.type?a.targetTouches[0].pageY:a.pageY,P=Date.now()));if(Y&&b.params.touchReleaseOnEdges&&!b.params.loop)if(b.isHorizontal()){if(b.touches.currentXb.touches.startX&&b.translate>=b.minTranslate())return}else if(b.touches.currentYb.touches.startY&&b.translate>=b.minTranslate())return;if(Y&&document.activeElement&&a.target===document.activeElement&&e(a.target).is(H))return z=!0,void(b.allowClick=!1);if(M&&b.emit(“onTouchMove”,b,a),!(a.targetTouches&&a.targetTouches.length>1)){if(b.touches.currentX=”touchmove”===a.type?a.targetTouches[0].pageX:a.pageX,b.touches.currentY=”touchmove”===a.type?a.targetTouches[0].pageY:a.pageY,”undefined”==typeof E){var t;b.isHorizontal()&&b.touches.currentY===b.touches.startY”http://www.nytimes.com/”!b.isHorizontal()&&b.touches.currentX!==b.touches.startX?E=!1:(t=180*Math.atan2(Math.abs(b.touches.currentY-b.touches.startY),Math.abs(b.touches.currentX-b.touches.startX))/Math.PI,E=b.isHorizontal()?t>b.params.touchAngle:90-t>b.params.touchAngle)}if(E&&b.emit(“onTouchMoveOpposite”,b,a),”undefined”==typeof A&&b.browser.ieTouch&&(b.touches.currentX===b.touches.startX&&b.touches.currentY===b.touches.startY”http://www.nytimes.com/”(A=!0)),S){if(E)return void(S=!1);if(A”http://www.nytimes.com/”!b.browser.ieTouch){b.allowClick=!1,b.emit(“onSliderMove”,b,a),a.preventDefault(),b.params.touchMoveStopPropagation&&!b.params.nested&&a.stopPropagation(),z”http://www.nytimes.com/”(s.loop&&b.fixLoop(),k=b.getWrapperTranslate(),b.setWrapperTransition(0),b.animating&&b.wrapper.trigger(“webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd”),b.params.autoplay&&b.autoplaying&&(b.params.autoplayDisableOnInteraction?b.stopAutoplay():b.pauseAutoplay()),B=!1,!b.params.grabCursor”http://www.nytimes.com/”b.params.allowSwipeToNext!==!0&&b.params.allowSwipeToPrev!==!0″http://www.nytimes.com/”b.setGrabCursor(!0)),z=!0;var r=b.touches.diff=b.isHorizontal()?b.touches.currentX-b.touches.startX:b.touches.currentY-b.touches.startY;r*=b.params.touchRatio,b.rtl&&(r=-r),b.swipeDirection=r>0?”prev”:”next”,I=r+k;var i=!0;if(r>0&&I>b.minTranslate()?(i=!1,b.params.resistance&&(I=b.minTranslate()-1+Math.pow(-b.minTranslate()+k+r,b.params.resistanceRatio))):rk&&(I=k),b.params.threshold>0){if(!(Math.abs(r)>b.params.threshold”http://www.nytimes.com/”D))return void(I=k);if(!D)return D=!0,b.touches.startX=b.touches.currentX,b.touches.startY=b.touches.currentY,I=k,void(b.touches.diff=b.isHorizontal()?b.touches.currentX-b.touches.startX:b.touches.currentY-b.touches.startY)}b.params.followFinger&&((b.params.freeMode”http://www.nytimes.com/”b.params.watchSlidesProgress)&&b.updateActiveIndex(),b.params.freeMode&&(0===X.length&&X.push({position:b.touches[b.isHorizontal()?”startX”:”startY”],time:P}),X.push({position:b.touches[b.isHorizontal()?”currentX”:”currentY”],time:(new window.Date).getTime()})),b.updateProgress(I),b.setWrapperTranslate(I))}}}}},b.onTouchEnd=function(a){if(a.originalEvent&&(a=a.originalEvent),M&&b.emit(“onTouchEnd”,b,a),M=!1,S){b.params.grabCursor&&z&&S&&(b.params.allowSwipeToNext===!0″http://www.nytimes.com/”b.params.allowSwipeToPrev===!0)&&b.setGrabCursor(!1);var t=Date.now(),s=t-P;if(b.allowClick&&(b.updateClickedSlide(a),b.emit(“onTap”,b,a),s300&&(L&&clearTimeout(L),L=setTimeout(function(){b&&(b.params.paginationHide&&b.paginationContainer.length>0&&!e(a.target).hasClass(b.params.bulletClass)&&b.paginationContainer.toggleClass(b.params.paginationHiddenClass),b.emit(“onClick”,b,a))},300)),s-b.maxTranslate())return void(b.slides.length1){var i=X.pop(),n=X.pop(),o=i.position-n.position,l=i.time-n.time;b.velocity=o/l,b.velocity=b.velocity/2,Math.abs(b.velocity)150″http://www.nytimes.com/”(new window.Date).getTime()-i.time>300)&&(b.velocity=0)}else b.velocity=0;b.velocity=b.velocity*b.params.freeModeMomentumVelocityRatio,X.length=0;var p=1e3*b.params.freeModeMomentumRatio,d=b.velocity*p,u=b.translate+d;b.rtl&&(u=-u);var m,c=!1,g=20*Math.abs(b.velocity)*b.params.freeModeMomentumBounceRatio;if(ub.minTranslate())b.params.freeModeMomentumBounce?(u-b.minTranslate()>g&&(u=b.minTranslate()+g),m=b.minTranslate(),c=!0,B=!0):u=b.minTranslate();else if(b.params.freeModeSticky){var h,f=0;for(f=0;f-u){h=f;break}u=Math.abs(b.snapGrid[h]-u)=b.params.longSwipesMs)&&(b.updateProgress(),b.updateActiveIndex()))}var v,w=0,y=b.slidesSizesGrid[0];for(v=0;v=b.slidesGrid[v]&&r=b.slidesGrid[v]&&(w=v,y=b.slidesGrid[b.slidesGrid.length-1]-b.slidesGrid[b.slidesGrid.length-2]);var x=(r-b.slidesGrid[w])/y;if(s>b.params.longSwipesMs){if(!b.params.longSwipes)return void b.slideTo(b.activeIndex);”next”===b.swipeDirection&&(x>=b.params.longSwipesRatio?b.slideTo(w+b.params.slidesPerGroup):b.slideTo(w)),”prev”===b.swipeDirection&&(x>1-b.params.longSwipesRatio?b.slideTo(w+b.params.slidesPerGroup):b.slideTo(w))}else{if(!b.params.shortSwipes)return void b.slideTo(b.activeIndex);”next”===b.swipeDirection&&b.slideTo(w+b.params.slidesPerGroup),”prev”===b.swipeDirection&&b.slideTo(w)}}},b._slideTo=function(e,a){return b.slideTo(e,a,!0,!0)},b.slideTo=function(e,a,t,s){“undefined”==typeof t&&(t=!0),”undefined”==typeof e&&(e=0),e=b.snapGrid.length&&(b.snapIndex=b.snapGrid.length-1);var r=-b.snapGrid[b.snapIndex];if(b.params.autoplay&&b.autoplaying&&(s”http://www.nytimes.com/”!b.params.autoplayDisableOnInteraction?b.pauseAutoplay(a):b.stopAutoplay()),b.updateProgress(r),b.params.normalizeSlideIndex)for(var i=0;i=Math.floor(100*b.slidesGrid[i])&&(e=i);return!(!b.params.allowSwipeToNext&&rb.translate&&r>b.maxTranslate()&&(b.activeIndex”http://www.nytimes.com/”0)!==e)&&(“undefined”==typeof a&&(a=b.params.speed),b.previousIndex=b.activeIndex”http://www.nytimes.com/”0,b.activeIndex=e,b.updateRealIndex(),b.rtl&&-r===b.translate”http://www.nytimes.com/”!b.rtl&&r===b.translate?(b.params.autoHeight&&b.updateAutoHeight(),b.updateClasses(),”slide”!==b.params.effect&&b.setWrapperTranslate(r),!1):(b.updateClasses(),b.onTransitionStart(t),0===a”http://www.nytimes.com/”b.browser.lteIE9?(b.setWrapperTranslate(r),b.setWrapperTransition(0),b.onTransitionEnd(t)):(b.setWrapperTranslate(r),b.setWrapperTransition(a),b.animating”http://www.nytimes.com/”(b.animating=!0,b.wrapper.transitionEnd(function(){b&&b.onTransitionEnd(t)}))),!0)))},b.onTransitionStart=function(e){“undefined”==typeof e&&(e=!0),b.params.autoHeight&&b.updateAutoHeight(),b.lazy&&b.lazy.onTransitionStart(),e&&(b.emit(“onTransitionStart”,b),b.activeIndex!==b.previousIndex&&(b.emit(“onSlideChangeStart”,b),b.activeIndex>b.previousIndex?b.emit(“onSlideNextStart”,b):b.emit(“onSlidePrevStart”,b)))},b.onTransitionEnd=function(e){b.animating=!1,b.setWrapperTransition(0),”undefined”==typeof e&&(e=!0),b.lazy&&b.lazy.onTransitionEnd(),e&&(b.emit(“onTransitionEnd”,b),b.activeIndex!==b.previousIndex&&(b.emit(“onSlideChangeEnd”,b),b.activeIndex>b.previousIndex?b.emit(“onSlideNextEnd”,b):b.emit(“onSlidePrevEnd”,b))),b.params.history&&b.history&&b.history.setHistory(b.params.history,b.activeIndex),b.params.hashnav&&b.hashnav&&b.hashnav.setHash()},b.slideNext=function(e,a,t){if(b.params.loop){if(b.animating)return!1;b.fixLoop();b.container[0].clientLeft;return b.slideTo(b.activeIndex+b.params.slidesPerGroup,a,e,t)}return b.slideTo(b.activeIndex+b.params.slidesPerGroup,a,e,t)},b._slideNext=function(e){return b.slideNext(!0,e,!0)},b.slidePrev=function(e,a,t){if(b.params.loop){if(b.animating)return!1;b.fixLoop();b.container[0].clientLeft;return b.slideTo(b.activeIndex-1,a,e,t)}return b.slideTo(b.activeIndex-1,a,e,t)},b._slidePrev=function(e){return b.slidePrev(!0,e,!0)},b.slideReset=function(e,a,t){return b.slideTo(b.activeIndex,a,e)},b.disableTouchControl=function(){return b.params.onlyExternal=!0,!0},b.enableTouchControl=function(){return b.params.onlyExternal=!1,!0},b.setWrapperTransition=function(e,a){b.wrapper.transition(e),”slide”!==b.params.effect&&b.effects[b.params.effect]&&b.effects[b.params.effect].setTransition(e),b.params.parallax&&b.parallax&&b.parallax.setTransition(e),b.params.scrollbar&&b.scrollbar&&b.scrollbar.setTransition(e),b.params.control&&b.controller&&b.controller.setTransition(e,a),b.emit(“onSetTransition”,b,e)},b.setWrapperTranslate=function(e,a,t){var s=0,i=0,n=0;b.isHorizontal()?s=b.rtl?-e:e:i=e,b.params.roundLengths&&(s=r(s),i=r(i)),b.params.virtualTranslate”http://www.nytimes.com/”(b.support.transforms3d?b.wrapper.transform(“translate3d(“+s+”px, “+i+”px, “+n+”px)”):b.wrapper.transform(“translate(“+s+”px, “+i+”px)”)),b.translate=b.isHorizontal()?s:i;var o,l=b.maxTranslate()-b.minTranslate();o=0===l?0:(e-b.minTranslate())/l,o!==b.progress&&b.updateProgress(e),a&&b.updateActiveIndex(),”slide”!==b.params.effect&&b.effects[b.params.effect]&&b.effects[b.params.effect].setTranslate(b.translate),b.params.parallax&&b.parallax&&b.parallax.setTranslate(b.translate),b.params.scrollbar&&b.scrollbar&&b.scrollbar.setTranslate(b.translate),b.params.control&&b.controller&&b.controller.setTranslate(b.translate,t),b.emit(“onSetTranslate”,b,b.translate)},b.getTranslate=function(e,a){var t,s,r,i;return”undefined”==typeof a&&(a=”x”),b.params.virtualTranslate?b.rtl?-b.translate:b.translate:(r=window.getComputedStyle(e,null),window.WebKitCSSMatrix?(s=r.transform”http://www.nytimes.com/”r.webkitTransform,s.split(“,”).length>6&&(s=s.split(“, “).map(function(e){return e.replace(“,”,”.”)}).join(“, “)),i=new window.WebKitCSSMatrix(“none”===s?”http://www.nytimes.com/”:s)):(i=r.MozTransform”http://www.nytimes.com/”r.OTransform”http://www.nytimes.com/”r.MsTransform”http://www.nytimes.com/”r.msTransform”http://www.nytimes.com/”r.transform”http://www.nytimes.com/”r.getPropertyValue(“transform”).replace(“translate(“,”matrix(1, 0, 0, 1,”),t=i.toString().split(“,”)),”x”===a&&(s=window.WebKitCSSMatrix?i.m41:16===t.length?parseFloat(t[12]):parseFloat(t[4])),”y”===a&&(s=window.WebKitCSSMatrix?i.m42:16===t.length?parseFloat(t[13]):parseFloat(t[5])),b.rtl&&s&&(s=-s),s”http://www.nytimes.com/”0)},b.getWrapperTranslate=function(e){return”undefined”==typeof e&&(e=b.isHorizontal()?”x”:”y”),b.getTranslate(b.wrapper[0],e)},b.observers=[],b.initObservers=function(){if(b.params.observeParents)for(var e=b.container.parents(),a=0;aa.length&&(b.loopedSlides=a.length);var t,s=[],r=[];for(a.each(function(t,i){var n=e(this);t=a.length-b.loopedSlides&&s.push(i),n.attr(“data-swiper-slide-index”,t)}),t=0;t=0;t–)b.wrapper.prepend(e(s[t].cloneNode(!0)).addClass(b.params.slideDuplicateClass))},b.destroyLoop=function(){b.wrapper.children(“.”+b.params.slideClass+”.”+b.params.slideDuplicateClass).remove(),b.slides.removeAttr(“data-swiper-slide-index”)},b.reLoop=function(e){var a=b.activeIndex-b.loopedSlides;b.destroyLoop(),b.createLoop(),b.updateSlidesSize(),e&&b.slideTo(a+b.loopedSlides,0,!1)},b.fixLoop=function(){var e;b.activeIndex=2*b.loopedSlides”http://www.nytimes.com/”b.activeIndex>b.slides.length-2*b.params.slidesPerView)&&(e=-b.slides.length+b.activeIndex+b.loopedSlides,e+=b.loopedSlides,b.slideTo(e,0,!1,!0))},b.appendSlide=function(e){if(b.params.loop&&b.destroyLoop(),”object”==typeof e&&e.length)for(var a=0;a

‘),t.append(d)),0===u.length&&(u=e(“http://www.nytimes.com/”),t.append(u)),d.length&&(d[0].style.opacity=Math.max(-s,0)),u.length&&(u[0].style.opacity=Math.max(s,0))}t.transform(“translate3d(“+l+”px, “+p+”px, 0px) rotateX(“+o+”deg) rotateY(“+n+”deg)”)}},setTransition:function(a){if(b.slides.transition(a).find(“.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left”).transition(a),b.params.virtualTranslate&&0!==a){var t=!1;b.slides.eq(b.activeIndex).transitionEnd(function(){if(!t&&b&&e(this).hasClass(b.params.slideActiveClass)){t=!0,b.animating=!1;for(var a=[“webkitTransitionEnd”,”transitionend”,”oTransitionEnd”,”MSTransitionEnd”,”msTransitionEnd”],s=0;s

‘),b.wrapper.append(a)),a.css({height:b.width+”px”})):(a=b.container.find(“.swiper-cube-shadow”),0===a.length&&(a=e(“http://www.nytimes.com/”),b.container.append(a))));for(var s=0;s-1&&(t=90*s+90*o,b.rtl&&(t=90*-s-90*o)),r.transform(u),b.params.cube.slideShadows){var m=b.isHorizontal()?r.find(“.swiper-slide-shadow-left”):r.find(“.swiper-slide-shadow-top”),c=b.isHorizontal()?r.find(“.swiper-slide-shadow-right”):r.find(“.swiper-slide-shadow-bottom”);0===m.length&&(m=e(“http://www.nytimes.com/”),r.append(m)),0===c.length&&(c=e(“http://www.nytimes.com/”),r.append(c)),m.length&&(m[0].style.opacity=Math.max(-o,0)),c.length&&(c[0].style.opacity=Math.max(o,0))}}if(b.wrapper.css({“-webkit-transform-origin”:”50% 50% -“+b.size/2+”px”,”-moz-transform-origin”:”50% 50% -“+b.size/2+”px”,”-ms-transform-origin”:”50% 50% -“+b.size/2+”px”,”transform-origin”:”50% 50% -“+b.size/2+”px”}),b.params.cube.shadow)if(b.isHorizontal())a.transform(“translate3d(0px, “+(b.width/2+b.params.cube.shadowOffset)+”px, “+-b.width/2+”px) rotateX(90deg) rotateZ(0deg) scale(“+b.params.cube.shadowScale+”)”);else{var g=Math.abs(t)-90*Math.floor(Math.abs(t)/90),h=1.5-(Math.sin(2*g*Math.PI/360)/2+Math.cos(2*g*Math.PI/360)/2),f=b.params.cube.shadowScale,v=b.params.cube.shadowScale/h,w=b.params.cube.shadowOffset;a.transform(“scale3d(“+f+”, 1, “+v+”) translate3d(0px, “+(b.height/2+w)+”px, “+-b.height/2/v+”px) rotateX(-90deg)”)}var y=b.isSafari”http://www.nytimes.com/”b.isUiWebView?-b.size/2:0;b.wrapper.transform(“translate3d(0px,0,”+y+”px) rotateX(“+(b.isHorizontal()?0:t)+”deg) rotateY(“+(b.isHorizontal()?-t:0)+”deg)”)},setTransition:function(e){b.slides.transition(e).find(“.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left”).transition(e),b.params.cube.shadow&&!b.isHorizontal()&&b.container.find(“.swiper-cube-shadow”).transition(e)}},coverflow:{setTranslate:function(){for(var a=b.translate,t=b.isHorizontal()?-a+b.width/2:-a+b.height/2,s=b.isHorizontal()?b.params.coverflow.rotate:-b.params.coverflow.rotate,r=b.params.coverflow.depth,i=0,n=b.slides.length;i‘),o.append(v)),0===w.length&&(w=e(“http://www.nytimes.com/”),o.append(w)),v.length&&(v[0].style.opacity=d>0?d:0),w.length&&(w[0].style.opacity=-d>0?-d:0)}}if(b.browser.ie){var y=b.wrapper[0].style;y.perspectiveOrigin=t+”px 50%”}},setTransition:function(e){b.slides.transition(e).find(“.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left”).transition(e)}}},b.lazy={initialImageLoaded:!1,loadImageInSlide:function(a,t){if(“undefined”!=typeof a&&(“undefined”==typeof t&&(t=!0),0!==b.slides.length)){var s=b.slides.eq(a),r=s.find(“.”+b.params.lazyLoadingClass+”:not(.”+b.params.lazyStatusLoadedClass+”):not(.”+b.params.lazyStatusLoadingClass+”)”);!s.hasClass(b.params.lazyLoadingClass)”http://www.nytimes.com/”s.hasClass(b.params.lazyStatusLoadedClass)”http://www.nytimes.com/”s.hasClass(b.params.lazyStatusLoadingClass)”http://www.nytimes.com/”(r=r.add(s[0])),0!==r.length&&r.each(function(){var a=e(this);a.addClass(b.params.lazyStatusLoadingClass);var r=a.attr(“data-background”),i=a.attr(“data-src”),n=a.attr(“data-srcset”),o=a.attr(“data-sizes”);b.loadImage(a[0],i”http://www.nytimes.com/”r,n,o,!1,function(){if(r?(a.css(“background-image”,’url(“http://www.nytimes.com/”+r+”http://www.nytimes.com/”)’),a.removeAttr(“data-background”)):(n&&(a.attr(“srcset”,n),a.removeAttr(“data-srcset”)),o&&(a.attr(“sizes”,o),a.removeAttr(“data-sizes”)),i&&(a.attr(“src”,i),a.removeAttr(“data-src”))),a.addClass(b.params.lazyStatusLoadedClass).removeClass(b.params.lazyStatusLoadingClass),s.find(“.”+b.params.lazyPreloaderClass+”, .”+b.params.preloaderClass).remove(),b.params.loop&&t){var e=s.attr(“data-swiper-slide-index”);if(s.hasClass(b.params.slideDuplicateClass)){var l=b.wrapper.children(‘[data-swiper-slide-index=”http://www.nytimes.com/”+e+”http://www.nytimes.com/”]:not(.’+b.params.slideDuplicateClass+”)”);b.lazy.loadImageInSlide(l.index(),!1)}else{var p=b.wrapper.children(“.”+b.params.slideDuplicateClass+'[data-swiper-slide-index=”http://www.nytimes.com/”+e+”http://www.nytimes.com/”]’);b.lazy.loadImageInSlide(p.index(),!1)}}b.emit(“onLazyImageReady”,b,s[0],a[0])}),b.emit(“onLazyImageLoad”,b,s[0],a[0])})}},load:function(){var a,t=b.params.slidesPerView;if(“auto”===t&&(t=0),b.lazy.initialImageLoaded”http://www.nytimes.com/”(b.lazy.initialImageLoaded=!0),b.params.watchSlidesVisibility)b.wrapper.children(“.”+b.params.slideVisibleClass).each(function(){b.lazy.loadImageInSlide(e(this).index())});else if(t>1)for(a=b.activeIndex;a1″http://www.nytimes.com/”b.params.lazyLoadingInPrevNextAmount&&b.params.lazyLoadingInPrevNextAmount>1){var s=b.params.lazyLoadingInPrevNextAmount,r=t,i=Math.min(b.activeIndex+r+Math.max(s,r),b.slides.length),n=Math.max(b.activeIndex-Math.max(r,s),0);for(a=b.activeIndex+t;a0&&b.lazy.loadImageInSlide(o.index());var l=b.wrapper.children(“.”+b.params.slidePrevClass);l.length>0&&b.lazy.loadImageInSlide(l.index())}},onTransitionStart:function(){b.params.lazyLoading&&(b.params.lazyLoadingOnTransitionStart”http://www.nytimes.com/”!b.params.lazyLoadingOnTransitionStart&&!b.lazy.initialImageLoaded)&&b.lazy.load()},onTransitionEnd:function(){b.params.lazyLoading&&!b.params.lazyLoadingOnTransitionStart&&b.lazy.load()}},b.scrollbar={isTouched:!1,setDragPosition:function(e){var a=b.scrollbar,t=b.isHorizontal()?”touchstart”===e.type”http://www.nytimes.com/””touchmove”===e.type?e.targetTouches[0].pageX:e.pageX”http://www.nytimes.com/”e.clientX:”touchstart”===e.type”http://www.nytimes.com/””touchmove”===e.type?e.targetTouches[0].pageY:e.pageY”http://www.nytimes.com/”e.clientY,s=t-a.track.offset()[b.isHorizontal()?”left”:”top”]-a.dragSize/2,r=-b.minTranslate()*a.moveDivider,i=-b.maxTranslate()*a.moveDivider;si&&(s=i),s=-s/a.moveDivider,b.updateProgress(s),b.setWrapperTranslate(s,!0)},dragStart:function(e){var a=b.scrollbar;a.isTouched=!0,e.preventDefault(),e.stopPropagation(),a.setDragPosition(e),clearTimeout(a.dragTimeout),a.track.transition(0),b.params.scrollbarHide&&a.track.css(“opacity”,1),b.wrapper.transition(100),a.drag.transition(100),b.emit(“onScrollbarDragStart”,b)},dragMove:function(e){var a=b.scrollbar;a.isTouched&&(e.preventDefault?e.preventDefault():e.returnValue=!1,a.setDragPosition(e),b.wrapper.transition(0),a.track.transition(0),a.drag.transition(0),b.emit(“onScrollbarDragMove”,b))},dragEnd:function(e){var a=b.scrollbar;a.isTouched&&(a.isTouched=!1,b.params.scrollbarHide&&(clearTimeout(a.dragTimeout),a.dragTimeout=setTimeout(function(){a.track.css(“opacity”,0),a.track.transition(400)},1e3)),b.emit(“onScrollbarDragEnd”,b),b.params.scrollbarSnapOnRelease&&b.slideReset())},draggableEvents:function(){return b.params.simulateTouch!==!1″http://www.nytimes.com/”b.support.touch?b.touchEvents:b.touchEventsDesktop}(),enableDraggable:function(){var a=b.scrollbar,t=b.support.touch?a.track:document;e(a.track).on(a.draggableEvents.start,a.dragStart),e(t).on(a.draggableEvents.move,a.dragMove),e(t).on(a.draggableEvents.end,a.dragEnd)},disableDraggable:function(){var a=b.scrollbar,t=b.support.touch?a.track:document;e(a.track).off(b.draggableEvents.start,a.dragStart),e(t).off(b.draggableEvents.move,a.dragMove),e(t).off(b.draggableEvents.end,a.dragEnd)},set:function(){if(b.params.scrollbar){var a=b.scrollbar;a.track=e(b.params.scrollbar),b.params.uniqueNavElements&&”string”==typeof b.params.scrollbar&&a.track.length>1&&1===b.container.find(b.params.scrollbar).length&&(a.track=b.container.find(b.params.scrollbar)),a.drag=a.track.find(“.swiper-scrollbar-drag”),0===a.drag.length&&(a.drag=e(“http://www.nytimes.com/”),a.track.append(a.drag)),a.drag[0].style.width=”http://www.nytimes.com/”,a.drag[0].style.height=”http://www.nytimes.com/”,a.trackSize=b.isHorizontal()?a.track[0].offsetWidth:a.track[0].offsetHeight,a.divider=b.size/b.virtualSize,a.moveDivider=a.divider*(a.trackSize/b.size),a.dragSize=a.trackSize*a.divider,b.isHorizontal()?a.drag[0].style.width=a.dragSize+”px”:a.drag[0].style.height=a.dragSize+”px”,a.divider>=1?a.track[0].style.display=”none”:a.track[0].style.display=”http://www.nytimes.com/”,b.params.scrollbarHide&&(a.track[0].style.opacity=0)}},setTranslate:function(){if(b.params.scrollbar){var e,a=b.scrollbar,t=(b.translate”http://www.nytimes.com/”0,a.dragSize);e=(a.trackSize-a.dragSize)*b.progress,b.rtl&&b.isHorizontal()?(e=-e,e>0?(t=a.dragSize-e,e=0):-e+a.dragSize>a.trackSize&&(t=a.trackSize+e)):ea.trackSize&&(t=a.trackSize-e),b.isHorizontal()?(b.support.transforms3d?a.drag.transform(“translate3d(“+e+”px, 0, 0)”):a.drag.transform(“translateX(“+e+”px)”),a.drag[0].style.width=t+”px”):(b.support.transforms3d?a.drag.transform(“translate3d(0px, “+e+”px, 0)”):a.drag.transform(“translateY(“+e+”px)”),a.drag[0].style.height=t+”px”),b.params.scrollbarHide&&(clearTimeout(a.timeout),a.track[0].style.opacity=1,a.timeout=setTimeout(function(){a.track[0].style.opacity=0,a.track.transition(400)},1e3))}},setTransition:function(e){b.params.scrollbar&&b.scrollbar.drag.transition(e)}},b.controller={LinearSpline:function(e,a){this.x=e,this.y=a,this.lastIndex=e.length-1;var t,s;this.x.length;this.interpolate=function(e){return e?(s=r(this.x,e),t=s-1,(e-this.x[t])*(this.y[s]-this.y[t])/(this.x[s]-this.x[t])+this.y[t]):0};var r=function(){var e,a,t;return function(s,r){for(a=-1,e=s.length;e-a>1;)s[t=e+a>>1]-1?”DOMMouseScroll”:d()?”wheel”:”mousewheel”),b.disableMousewheelControl=function(){if(!b.mousewheel.event)return!1;var a=b.container;return”container”!==b.params.mousewheelEventsTarged&&(a=e(b.params.mousewheelEventsTarged)),a.off(b.mousewheel.event,u),!0},b.enableMousewheelControl=function(){if(!b.mousewheel.event)return!1;var a=b.container;return”container”!==b.params.mousewheelEventsTarged&&(a=e(b.params.mousewheelEventsTarged)),a.on(b.mousewheel.event,u),!0},b.parallax={setTranslate:function(){b.container.children(“[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]”).each(function(){c(this,b.progress)}),b.slides.each(function(){var a=e(this);a.find(“[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]”).each(function(){var e=Math.min(Math.max(a[0].progress,-1),1);c(this,e)})})},setTransition:function(a){“undefined”==typeof a&&(a=b.params.speed),b.container.find(“[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]”).each(function(){var t=e(this),s=parseInt(t.attr(“data-swiper-parallax-duration”),10)”http://www.nytimes.com/”a;0===a&&(s=0),t.transition(s)})}},b.zoom={scale:1,currentScale:1,isScaling:!1,gesture:{slide:void 0,slideWidth:void 0,slideHeight:void 0,image:void 0,imageWrap:void 0,zoomMax:b.params.zoomMax},image:{isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},velocity:{x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0},getDistanceBetweenTouches:function(e){if(e.targetTouches.lengtha.gesture.zoomMax&&(a.scale=a.gesture.zoomMax-1+Math.pow(a.scale-a.gesture.zoomMax+1,.5)),a.scalea.image.touchesStart.x)return void(a.image.isTouched=!1);if(!b.isHorizontal()&&Math.floor(a.image.minY)===Math.floor(a.image.startY)&&a.image.touchesCurrent.ya.image.touchesStart.y)return void(a.image.isTouched=!1)}e.preventDefault(),e.stopPropagation(),a.image.isMoved=!0,a.image.currentX=a.image.touchesCurrent.x-a.image.touchesStart.x+a.image.startX,a.image.currentY=a.image.touchesCurrent.y-a.image.touchesStart.y+a.image.startY,a.image.currentXa.image.maxX&&(a.image.currentX=a.image.maxX-1+Math.pow(a.image.currentX-a.image.maxX+1,.8)),a.image.currentYa.image.maxY&&(a.image.currentY=a.image.maxY-1+Math.pow(a.image.currentY-a.image.maxY+1,.8)),a.velocity.prevPositionX”http://www.nytimes.com/”(a.velocity.prevPositionX=a.image.touchesCurrent.x),a.velocity.prevPositionY”http://www.nytimes.com/”(a.velocity.prevPositionY=a.image.touchesCurrent.y),a.velocity.prevTime”http://www.nytimes.com/”(a.velocity.prevTime=Date.now()),a.velocity.x=(a.image.touchesCurrent.x-a.velocity.prevPositionX)/(Date.now()-a.velocity.prevTime)/2,a.velocity.y=(a.image.touchesCurrent.y-a.velocity.prevPositionY)/(Date.now()-a.velocity.prevTime)/2,Math.abs(a.image.touchesCurrent.x-a.velocity.prevPositionX)w&&(d=w),uy&&(u=y)):(d=0,u=0),s.gesture.imageWrap.transition(300).transform(“translate3d(“+d+”px, “+u+”px,0)”),s.gesture.image.transition(300).transform(“translate3d(0,0,0) scale(“+s.scale+”)”))}},attachEvents:function(a){var t=a?”off”:”on”;if(b.params.zoom){var s=(b.slides,!(“touchstart”!==b.touchEvents.start”http://www.nytimes.com/”!b.support.passiveListener”http://www.nytimes.com/”!b.params.passiveListeners)&&{passive:!0,capture:!1});b.support.gestures?(b.slides[t](“gesturestart”,b.zoom.onGestureStart,s),b.slides[t](“gesturechange”,b.zoom.onGestureChange,s),b.slides[t](“gestureend”,b.zoom.onGestureEnd,s)):”touchstart”===b.touchEvents.start&&(b.slides[t](b.touchEvents.start,b.zoom.onGestureStart,s),b.slides[t](b.touchEvents.move,b.zoom.onGestureChange,s),b.slides[t](b.touchEvents.end,b.zoom.onGestureEnd,s)),b[t](“touchStart”,b.zoom.onTouchStart),b.slides.each(function(a,s){e(s).find(“.”+b.params.zoomContainerClass).length>0&&e(s)[t](b.touchEvents.move,b.zoom.onTouchMove)}),b[t](“touchEnd”,b.zoom.onTouchEnd),b[t](“transitionEnd”,b.zoom.onTransitionEnd),b.params.zoomToggle&&b.on(“doubleTap”,b.zoom.toggleZoom)}},init:function(){b.zoom.attachEvents()},destroy:function(){b.zoom.attachEvents(!0)}},b._plugins=[];for(var O in b.plugins){var W=b.plugins[O](b,b.params[O]);W&&b._plugins.push(W)}return b.callPlugins=function(e){for(var a=0;a‘),notify:function(e){var a=b.a11y.liveRegion;0!==a.length&&(a.html(“http://www.nytimes.com/”),a.html(e))},init:function(){b.params.nextButton&&b.nextButton&&b.nextButton.length>0&&(b.a11y.makeFocusable(b.nextButton),b.a11y.addRole(b.nextButton,”button”),b.a11y.addLabel(b.nextButton,b.params.nextSlideMessage)),b.params.prevButton&&b.prevButton&&b.prevButton.length>0&&(b.a11y.makeFocusable(b.prevButton),b.a11y.addRole(b.prevButton,”button”),b.a11y.addLabel(b.prevButton,b.params.prevSlideMessage)),e(b.container).append(b.a11y.liveRegion)},initPagination:function(){b.params.pagination&&b.params.paginationClickable&&b.bullets&&b.bullets.length&&b.bullets.each(function(){var a=e(this);b.a11y.makeFocusable(a),b.a11y.addRole(a,”button”),b.a11y.addLabel(a,b.params.paginationBulletMessage.replace(/{{index}}/,a.index()+1))})},destroy:function(){b.a11y.liveRegion&&b.a11y.liveRegion.length>0&&b.a11y.liveRegion.remove()}},b.init=function(){b.params.loop&&b.createLoop(),b.updateContainerSize(),b.updateSlidesSize(),b.updatePagination(),b.params.scrollbar&&b.scrollbar&&(b.scrollbar.set(),b.params.scrollbarDraggable&&b.scrollbar.enableDraggable()),”slide”!==b.params.effect&&b.effects[b.params.effect]&&(b.params.loop”http://www.nytimes.com/”b.updateProgress(),b.effects[b.params.effect].setTranslate()),b.params.loop?b.slideTo(b.params.initialSlide+b.loopedSlides,0,b.params.runCallbacksOnInit):(b.slideTo(b.params.initialSlide,0,b.params.runCallbacksOnInit),0===b.params.initialSlide&&(b.parallax&&b.params.parallax&&b.parallax.setTranslate(),b.lazy&&b.params.lazyLoading&&(b.lazy.load(),b.lazy.initialImageLoaded=!0))),b.attachEvents(),b.params.observer&&b.support.observer&&b.initObservers(),b.params.preloadImages&&!b.params.lazyLoading&&b.preloadImages(),b.params.zoom&&b.zoom&&b.zoom.init(),b.params.autoplay&&b.startAutoplay(),b.params.keyboardControl&&b.enableKeyboardControl&&b.enableKeyboardControl(),b.params.mousewheelControl&&b.enableMousewheelControl&&b.enableMousewheelControl(),b.params.hashnavReplaceState&&(b.params.replaceState=b.params.hashnavReplaceState),b.params.history&&b.history&&b.history.init(),b.params.hashnav&&b.hashnav&&b.hashnav.init(),b.params.a11y&&b.a11y&&b.a11y.init(),b.emit(“onInit”,b)},b.cleanupStyles=function(){b.container.removeClass(b.classNames.join(“http://www.nytimes.com/”)).removeAttr(“style”),b.wrapper.removeAttr(“style”),b.slides&&b.slides.length&&b.slides.removeClass([b.params.slideVisibleClass,b.params.slideActiveClass,b.params.slideNextClass,b.params.slidePrevClass].join(“http://www.nytimes.com/”)).removeAttr(“style”).removeAttr(“data-swiper-column”).removeAttr(“data-swiper-row”),b.paginationContainer&&b.paginationContainer.length&&b.paginationContainer.removeClass(b.params.paginationHiddenClass),b.bullets&&b.bullets.length&&b.bullets.removeClass(b.params.bulletActiveClass),b.params.prevButton&&e(b.params.prevButton).removeClass(b.params.buttonDisabledClass),b.params.nextButton&&e(b.params.nextButton).removeClass(b.params.buttonDisabledClass),b.params.scrollbar&&b.scrollbar&&(b.scrollbar.track&&b.scrollbar.track.length&&b.scrollbar.track.removeAttr(“style”),b.scrollbar.drag&&b.scrollbar.drag.length&&b.scrollbar.drag.removeAttr(“style”))},b.destroy=function(e,a){b.detachEvents(),b.stopAutoplay(),b.params.scrollbar&&b.scrollbar&&b.params.scrollbarDraggable&&b.scrollbar.disableDraggable(),b.params.loop&&b.destroyLoop(),a&&b.cleanupStyles(),b.disconnectObservers(),b.params.zoom&&b.zoom&&b.zoom.destroy(),b.params.keyboardControl&&b.disableKeyboardControl&&b.disableKeyboardControl(),b.params.mousewheelControl&&b.disableMousewheelControl&&b.disableMousewheelControl(),b.params.a11y&&b.a11y&&b.a11y.destroy(),b.params.history&&!b.params.replaceState&&window.removeEventListener(“popstate”,b.history.setHistoryPopState),b.params.hashnav&&b.hashnav&&b.hashnav.destroy(),b.emit(“onDestroy”),e!==!1&&(b=null)},b.init(),b}};t.prototype={isSafari:function(){var e=navigator.userAgent.toLowerCase();return e.indexOf(“safari”)>=0&&e.indexOf(“chrome”)1″http://www.nytimes.com/”window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>1,lteIE9:function(){var e=document.createElement(“div”);return e.innerHTML=”“,1===e.getElementsByTagName(“i”).length}()},device:function(){var e=navigator.userAgent,a=e.match(/(Android);?[s/]+([d.]+)?/),t=e.match(/(iPad).*OSs([d_]+)/),s=e.match(/(iPod)(.*OSs([d_]+))?/),r=!t&&e.match(/(iPhonesOS)s([d_]+)/);return{ios:t”http://www.nytimes.com/”r”http://www.nytimes.com/”s,android:a}}(),support:{touch:window.Modernizr&&Modernizr.touch===!0″http://www.nytimes.com/”function(){return!!(“ontouchstart”in window”http://www.nytimes.com/”window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0″http://www.nytimes.com/”function(){var e=document.createElement(“div”).style;return”webkitPerspective”in e”http://www.nytimes.com/””MozPerspective”in e”http://www.nytimes.com/””OPerspective”in e”http://www.nytimes.com/””MsPerspective”in e”http://www.nytimes.com/””perspective”in e}(),flexbox:function(){for(var e=document.createElement(“div”).style,a=”alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient”.split(“http://www.nytimes.com/”),t=0;t0?e?this[0].offsetWidth+parseFloat(this.css(“margin-right”))+parseFloat(this.css(“margin-left”)):this[0].offsetWidth:null})),t});

/* HIDE ON SCROLL */
// require([‘shared/masthead/instances/masthead-api’], function(Masthead) {
// Masthead.change(function(inStory) {
// if (inStory) {
// Masthead.hide();
// } else {
// Masthead.show();
// }
// });
// });

require([
‘jquery/nyt’,
‘underscore/1.6’,
‘foundation/views/page-manager’,
‘lib/text-balancer’,
‘swiper’,
‘laziestloader’
], function($, _, PageManager, balanceText, Swiper) {


/**
* @preserve jabradoodle – v0.0.9 – 2016-04-11
* jQuery Audio Button + ��
* http://sjwilliams.github.io/jabradoodle/
* Copyright (c) 2016 Josh Williams; Licensed MIT
*
* SVG Icons by Open Iconic
* v1.1.1 | MIT
* https://github.com/iconic/open-iconic
*/
!function(){function a(a,d){this.defaultOptions={preload:!1,exclusive:!0,fillcontainer:!1,showduration:!0,showprogressbar:!0,showloader:!0,countdown:!1,iconsmaintainwidth:!0,buttonmaintainwidth:!0,statusmaintainwidth:!1,playtext:”Play”,pausetext:”Pause”,resumetext:”Resume”,playicon:j,pauseicon:k,resumeicon:j};var g=$.extend({},this.defaultOptions,d),l=[];$(a).each(function(){var a=this,d=$(a),j=d.data();if(j.src&&j.duration){var k=$.extend({},g,j),m=[‘

‘+k.playicon+”

“,’

‘+k.pauseicon+”

“,’

‘+k.resumeicon+”

“,”http://www.nytimes.com/”,’

‘+k.playtext+”

“,’

‘+k.pausetext+”

“,’

‘+k.resumetext+”

“,’

‘+e(k.duration)+”

“,”http://www.nytimes.com/”].join(“http://www.nytimes.com/”),n=”jab-container jab-init”;if([{setting:”fillcontainer”,value:”fillcontainer”},{setting:”playtext”,value:”status”},{setting:”playicon”,value:”icons”},{setting:”showduration”,value:”duration”},{setting:”showprogressbar”,value:”progressbar”}].forEach(function(a){k[a.setting]&&(n=n+” jab-show-“+a.value)}),d.addClass(n).append(m),k.iconsmaintainwidth&&c($(“.jab-icon”,d)),k.statusmaintainwidth&&c($(“.jab-text”,d)),k.buttonmaintainwidth){var o=Math.max.apply(null,[“active”,”pause”,”loading”,”inactive”].map(function(b){return f(a,h,b),d.width()}));d.css(“min-width”,o)}else f(a,h,”inactive”);d.addClass(“jab-post-init”);var p={$el:d,$progress:d.find(“.jab-progress”),$bar:d.find(“.jab-bar”),$duration:d.find(“.jab-text-duration”),settings:k,load:function(){this.audio”http://www.nytimes.com/”(this.$audio=$(‘



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here