vendor: 8,545 bytes, line 1
1;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)k.setAttribute("type",f=a[d]),e=k.type!=="text",e&&(k.value=l,k.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&k.style.WebkitAppearance!==c?(g.appendChild(k),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(k,null).WebkitAppearance!=="textfield"&&k.offsetHeight!==0,g.removeChild(k)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=k.checkValidity&&k.checkValidity()===!1:e=k.value!=l)),t[a[d]]=!!e;return t}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k=b.createElement("input"),l=":)",m={}.toString,n=" -webkit- -moz- -o- -ms- ".split(" "),o="Webkit Moz O ms",p=o.split(" "),q=o.toLowerCase().split(" "),r={svg:"http://www.w3.org/2000/svg"},s={},t={},u={},v=[],w=v.slice,x,y=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(["#",h,"{font:0/0 a}#",h,':after{content:"',l,'";visibility:hidden;font:3px/1 a}'].join(""),function(b){a=b.offsetHeight>=3}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="<svg/>",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;
1return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))};(function($){$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var cfg={interval:100,sensitivity:6,timeout:0};if(typeof handlerIn==="object"){cfg=$.extend(cfg,handlerIn)}else{if($.isFunction(handlerOut)){cfg=$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector})}else{cfg=$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut})}}var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(Math.sqrt((pX-cX)*(pX-cX)+(pY-cY)*(pY-cY))<cfg.sensitivity){$(ob).off("mousemove.hoverIntent",track);ob.hoverIntent_s=true;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=false;return cfg.out.apply(ob,[ev])};var handleHover=function(e){var ev=$.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t)}if(e.type==="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).on("mousemove.hoverIntent",track);if(!ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}}else{$(ob).off("mousemove.hoverIntent",track);if(ob.hoverIntent_s){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}}};return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}})(jQuery);(function($,window,document,undefined){$.fn.doubleTap=function(params){if(!$("html").hasClass("touch"))return false;this.each(function(){var curItem=false;$(this).on("click",function(e){var item=$(this);if(item[0]!=curItem[0]){e.preventDefault();curItem=item;}});$(document).on('click touchstart MSPointerDown',function(e){var resetItem=true,parents=$(e.target).parents();for(var i=0;i<parents.length;i++) 2if(parents[i]==curItem[0]) 3resetItem=false;if(resetItem) 4curItem=false;});});return this;};})(jQuery,window,document);function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},a='android',g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' '+a+(/version\/(\d+)/.test(ua)?' default':' chrome'):is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js'];c=b.join(' ');h.className+=' '+c;return c;};css_browser_selector(navigator.userAgent);if(typeof console==="undefined"||typeof console.log==="undefined"){console={};console.log=function(){};} 5(function(factory){if(typeof define!=='undefined'&&define.amd){define(['jquery'],factory);}else if(typeof module!=='undefined'&&module.exports){var $=require('jquery');module.exports=factory($);}else{window.scrollMonitor=factory(jQuery);}})(function($){var exports={};var $window=$(window);var $document=$(document);var watchers=[];var VISIBILITYCHANGE='visibilityChange';
5var ENTERVIEWPORT='enterViewport';var FULLYENTERVIEWPORT='fullyEnterViewport';var EXITVIEWPORT='exitViewport';var PARTIALLYEXITVIEWPORT='partiallyExitViewport';var LOCATIONCHANGE='locationChange';var STATECHANGE='stateChange';var eventTypes=[VISIBILITYCHANGE,ENTERVIEWPORT,FULLYENTERVIEWPORT,EXITVIEWPORT,PARTIALLYEXITVIEWPORT,LOCATIONCHANGE,STATECHANGE];var defaultOffsets={top:0,bottom:0};exports.viewportTop;exports.viewportBottom;exports.documentHeight;exports.viewportHeight=windowHeight();var previousDocumentHeight;var latestEvent;function windowHeight(){return window.innerHeight||document.documentElement.clientHeight;} 6var calculateViewportI;function calculateViewport(){exports.viewportTop=$window.scrollTop();exports.viewportBottom=exports.viewportTop+exports.viewportHeight;exports.documentHeight=$document.height();if(exports.documentHeight!==previousDocumentHeight){calculateViewportI=watchers.length;while(calculateViewportI--){watchers[calculateViewportI].recalculateLocation();} 7previousDocumentHeight=exports.documentHeight;}} 8function recalculateWatchLocationsAndTrigger(){exports.viewportHeight=windowHeight();calculateViewport();updateAndTriggerWatchers();} 9var recalculateAndTriggerTimer;function debouncedRecalcuateAndTrigger(){clearTimeout(recalculateAndTriggerTimer);recalculateAndTriggerTimer=setTimeout(recalculateWatchLocationsAndTrigger,100);} 10var updateAndTriggerWatchersI;function updateAndTriggerWatchers(){updateAndTriggerWatchersI=watchers.length;while(updateAndTriggerWatchersI--){watchers[updateAndTriggerWatchersI].update();} 11updateAndTriggerWatchersI=watchers.length;while(updateAndTriggerWatchersI--){watchers[updateAndTriggerWatchersI].triggerCallbacks();}} 12function ElementWatcher(watchItem,offsets){var self=this;this.watchItem=watchItem;if(!offsets){this.offsets=defaultOffsets;}else if(offsets===+offsets){this.offsets={top:offsets,bottom:offsets};}else{this.offsets=$.extend({},defaultOffsets,offsets);} 13this.callbacks={};for(var i=0,j=eventTypes.length;i<j;i++){self.callbacks[eventTypes[i]]=[];} 14this.locked=false;var wasInViewport;var wasFullyInViewport;var wasAboveViewport;var wasBelowViewport;var listenerToTriggerListI;var listener;function triggerCallbackArray(listeners){if(listeners.length===0){return;} 15listenerToTriggerListI=listeners.length;while(listenerToTriggerListI--){listener=listeners[listenerToTriggerListI];listener.callback.call(self,latestEvent);if(listener.isOne){listeners.splice(listenerToTriggerListI,1);}}} 16this.triggerCallbacks=function triggerCallbacks(){if(this.isInViewport&&!wasInViewport){triggerCallbackArray(this.callbacks[ENTERVIEWPORT]);} 17if(this.isFullyInViewport&&!wasFullyInViewport){triggerCallbackArray(this.callbacks[FULLYENTERVIEWPORT]);} 18if(this.isAboveViewport!==wasAboveViewport&&this.isBelowViewport!==wasBelowViewport){triggerCallbackArray(this.callbacks[VISIBILITYCHANGE]);if(!wasFullyInViewport&&!this.isFullyInViewport){triggerCallbackArray(this.callbacks[FULLYENTERVIEWPORT]);triggerCallbackArray(this.callbacks[PARTIALLYEXITVIEWPORT]);} 19if(!wasInViewport&&!this.isInViewport){triggerCallbackArray(this.callbacks[ENTERVIEWPORT]);triggerCallbackArray(this.callbacks[EXITVIEWPORT]);}} 20if(!this.isFullyInViewport&&wasFullyInViewport){triggerCallbackArray(this.callbacks[PARTIALLYEXITVIEWPORT]);} 21if(!this.isInViewport&&wasInViewport){triggerCallbackArray(this.callbacks[EXITVIEWPORT]);} 22if(this.isInViewport!==wasInViewport){triggerCallbackArray(this.callbacks[VISIBILITYCHANGE]);} 23switch(true){case wasInViewport!==this.isInViewport:case wasFullyInViewport!==this.isFullyInViewport:case wasAboveViewport!==this.isAboveViewport:case wasBelowViewport!==this.isBelowViewport:triggerCallbackArray(this.callbacks[STATECHANGE]);} 24wasInViewport=this.isInViewport;wasFullyInViewport=this.isFullyInViewport;wasAboveViewport=this.isAboveViewport;wasBelowViewport=this.isBelowViewport;};this.recalculateLocation=function(){if(this.locked){return;} 25var previousTop=this.top;var previousBottom=this.bottom;if(this.watchItem.nodeName){var cachedDisplay=this.watchItem.style.display;if(cachedDisplay==='none'){this.watchItem.style.display='';} 26var elementLocation=$(this.watchItem).offset();this.top=elementLocation.top;this.bottom=elementLocation.top+this.watchItem.offsetHeight;if(cachedDisplay==='none'){this.watchItem.style.display=cachedDisplay;}}else if(this.watchItem===+this.watchItem){if(this.watchItem>0){this.top=this.bottom=this.watchItem;}else{this.top=this.bottom=exports.documentHeight-this.watchItem;}}else{this.top=this.watchItem.top;this.bottom=this.watchItem.bottom;} 27this.top-=this.offsets.top;this.bottom+=this.offsets.bottom;this.height=this.bottom-this.top;
27if((previousTop!==undefined||previousBottom!==undefined)&&(this.top!==previousTop||this.bottom!==previousBottom)){triggerCallbackArray(this.callbacks[LOCATIONCHANGE]);}};this.recalculateLocation();this.update();wasInViewport=this.isInViewport;wasFullyInViewport=this.isFullyInViewport;wasAboveViewport=this.isAboveViewport;wasBelowViewport=this.isBelowViewport;} 28ElementWatcher.prototype={on:function(event,callback,isOne){switch(true){case event===VISIBILITYCHANGE&&!this.isInViewport&&this.isAboveViewport:case event===ENTERVIEWPORT&&this.isInViewport:case event===FULLYENTERVIEWPORT&&this.isFullyInViewport:case event===EXITVIEWPORT&&this.isAboveViewport&&!this.isInViewport:case event===PARTIALLYEXITVIEWPORT&&this.isAboveViewport:callback();if(isOne){return;}} 29if(this.callbacks[event]){this.callbacks[event].push({callback:callback,isOne:isOne});}else{throw new Error('Tried to add a scroll monitor listener of type '+event+'. Your options are: '+eventTypes.join(', '));}},off:function(event,callback){if(this.callbacks[event]){for(var i=0,item;item=this.callbacks[event][i];i++){if(item.callback===callback){this.callbacks[event].splice(i,1);break;}}}else{throw new Error('Tried to remove a scroll monitor listener of type '+event+'. Your options are: '+eventTypes.join(', '));}},one:function(event,callback){this.on(event,callback,true);},recalculateSize:function(){this.height=this.watchItem.offsetHeight+this.offsets.top+this.offsets.bottom;this.bottom=this.top+this.height;},update:function(){this.isAboveViewport=this.top<exports.viewportTop;this.isBelowViewport=this.bottom>exports.viewportBottom;this.isInViewport=(this.top<=exports.viewportBottom&&this.bottom>=exports.viewportTop);this.isFullyInViewport=(this.top>=exports.viewportTop&&this.bottom<=exports.viewportBottom)||(this.isAboveViewport&&this.isBelowViewport);},destroy:function(){var index=watchers.indexOf(this),self=this;watchers.splice(index,1);for(var i=0,j=eventTypes.length;i<j;i++){self.callbacks[eventTypes[i]].length=0;}},lock:function(){this.locked=true;},unlock:function(){this.locked=false;}};var eventHandlerFactory=function(type){return function(callback,isOne){this.on.call(this,type,callback,isOne);};};for(var i=0,j=eventTypes.length;i<j;i++){var type=eventTypes[i];ElementWatcher.prototype[type]=eventHandlerFactory(type);} 30try{calculateViewport();}catch(e){$(calculateViewport);} 31function scrollMonitorListener(event){latestEvent=event;calculateViewport();updateAndTriggerWatchers();} 32$window.on('scroll',scrollMonitorListener);$window.on('resize',debouncedRecalcuateAndTrigger);exports.beget=exports.create=function(element,offsets){if(typeof element==='string'){element=$(element)[0];} 33if(element instanceof $){element=element[0];} 34var watcher=new ElementWatcher(element,offsets);watchers.push(watcher);watcher.update();return watcher;};exports.update=function(){latestEvent=null;calculateViewport();updateAndTriggerWatchers();};exports.recalculateLocations=function(){exports.documentHeight=0;exports.update();};return exports;});var siteHeader={init:function(){siteHeader.navHover();siteHeader.navLazyLoad();siteHeader.listeners();siteHeader.stickyMenu();siteHeader.activeMenu();siteHeader.subMenu();siteHeader.touchMenu();siteHeader.searchField();siteHeader.timestamp();siteHeader.subPageAds();siteHeader.adCollapse();},navHover:function(){$('.topnav').hoverIntent({selector:'.subMenuContainer',timeout:250,over:function(){$(this).addClass("hover");},out:function(){$(this).removeClass("hover");}});},navLazyLoad:function(){function srcSwitch(){$(".subnav .nav-hcat img").each(function(){$(this).attr("src",$(this).data("src"));$(this).removeAttr("data-src");});} 35$(".topnav").one("mouseenter",function(){srcSwitch();});$(".menu-bar").one("touchstart",function(){srcSwitch();});},stickyMenu:function(){var core=($("body").hasClass("core_homepage"))?1:0,wrapper=($("body").hasClass("bg-ad-on"))?1:0,winSize=window.innerWidth,ctplFullBanner=$("#ctpl-fullbanner1"),subHead=$("#subHead"),subHeadSpacer=$("#subHead-spacer"),siteNav=$("#siteNav"),menuBar=$("#menuBar");if(siteNav.length===0)return false;var subHeadWatcher=scrollMonitor.create(subHead);if(core===0){$("#ctpl-fullbanner1").removeClass("fixed");} 36if(core===1&&wrapper===0&&winSize>=1092){var subHeadSpacerWatcher=scrollMonitor.create(subHeadSpacer);subHeadSpacerWatcher.lock();if(ctplFullBanner.hasClass("fixed")){subHeadSpacerWatcher.visibilityChange(function(){siteNav.toggleClass("fixed-low",!subHeadSpacerWatcher.isInViewport);menuBar.toggleClass("fixed-low",!subHeadSpacerWatcher.isInViewport);});} 37function fixedLowCheck(){if(ctplFullBanner.hasClass("fixed")){$(window).scrollTop()>="50"?siteNav.addClass("fixed-low"):siteNav.removeClass("fixed-low");} 38else{siteNav.removeClass("fixed-low");}} 39$(window).scroll(function(){fixedLowCheck();});fixedLowCheck();subHeadSpacerWatcher.exitViewport(function(){setTimeout(function(){subHeadSpacerWatcher.destroy();},2000);});subHeadWatcher.visibilityChange(function(){siteNav.toggleClass("fixed",!subHeadWatcher.isInViewport);menuBar.toggleClass("fixed",!subHeadWatcher.isInViewport);});} 40else{subHeadWatcher.visibilityChange(function(){siteNav.toggleClass("fixed",!subHeadWatcher.isInViewport);menuBar.toggleClass("fixed",!subHeadWatcher.isInViewport);});}},timestamp:function(){if($("#ctpl-fullbanner1").hasClass("fixed")&&!$("html").hasClass("cropped")){window.matchMedia('(min-width: 1092px)').matches?$("#homepage-timestamp").addClass("fixed"):$("#homepage-timestamp").removeClass("fixed");} 41else{$("#homepage-timestamp").removeClass("fixed");}},adCollapse:function(){var timer=0;var position=0;
41var collapseTimer=$("#ctpl-fullbanner1").data("collapseTimer")*1000;setTimeout(function(){timer=1;if(timer===1&&position===1){$("#ctpl-fullbanner1, #siteNav").addClass("off-screen");$("#homepage-timestamp").removeClass("fixed");$("#siteNav").removeClass("fixed-low");setTimeout(function(){$("#ctpl-fullbanner1").removeClass("fixed off-screen");$("#siteNav").removeClass("fixed-low off-screen");},1000);}},collapseTimer);if($("#MW728_1").length===0)return false;var _adCollapse=$("#MW728_1"),adCollapse=scrollMonitor.create(_adCollapse);adCollapse.stateChange(function(){if(adCollapse.isInViewport){position=1;if(timer===1&&position===1){$("#ctpl-fullbanner1, #siteNav").addClass("off-screen");$("#homepage-timestamp").removeClass("fixed");$("#siteNav").removeClass("fixed-low");setTimeout(function(){$("#ctpl-fullbanner1").removeClass("fixed off-screen");$("#siteNav").removeClass("fixed-low off-screen");},1000);} 42adCollapse.destroy();}});},subPageAds:function(){try{hearstRefreshInterstitialAds(["MW728_2","LA300","B728"]);}catch(e){}},searchField:function(){var _input=$("input[name=query]");$(_input).focus(function(){$(this).parent(".searchWrapper").addClass("focus");$("html").addClass("mobile-searchbar");$(this).next().removeAttr("disabled");}).blur(function(){if($(this).val().length===0){$(this).val("").parent(".searchWrapper").removeClass("focus");$(this).next().attr("disabled","disabled");$("html").removeClass("mobile-searchbar");}});$(_input).focusout(function(){$(this).parent(".searchWrapper").removeClass("focus");$("html").removeClass("mobile-searchbar");});$("#search_form button").on("click touchstart",function(){_input.val("");$("#search_form").removeClass("focus");$("html").removeClass("mobile-searchbar");});if(window.location.hash=="#mobile-filter-button"){$("html").toggleClass("mobile-filter");} 43$("#mobile-filter-button, .gsa-filters-box .close").on("click",function(){$("html").toggleClass("mobile-filter");});},activeMenu:function(){$(".subMenuContainer[location='ae']").attr("location","entertainment");var channels=[];$(".subMenuContainer").each(function(){channels.push($(this).attr("location"));});var needle=$("body").attr("location"),haystack=jQuery.inArray(needle,channels);-1!==haystack&&$(".subMenuContainer").eq(haystack).addClass("active");},listeners:function(){window.addEventListener("resize",function(){$("html").hasClass("menu-open")&&($("html").toggleClass("menu-open"));$(".topnav").css("transform","");$(".subMenuLink.open").removeClass("open");if(window.matchMedia('(min-width: 654px)').matches&&$("#siteNav").hasClass("wide-nav")){$("#siteNav").removeClass("wide-nav");}});},subMenu:function(){if(1030>window.innerWidth){$('.topnav').on('click','.subMenuItemLink .icon',function(e){e.preventDefault();e.stopPropagation();var s=$(this).closest("li").index(),t=$(this).parent().next().hasClass("open")?1:0,n=$(this).closest("ul").children().length,i=45*(n-s+$(this).parent().next().children().children().length),l=$(".subMenuItem.open"),a=$(".submenu.open");try{HDN.sendAnalyticsData($(this).closest("li").hasClass("open")?$(this).prev().html().replace("visit","close"):$(this).prev().html().replace("visit","open"));}catch(e){} 44window.innerWidth<600&&(1===t?$(this).closest("ul").css("transform","translateY(0)"):$(this).closest("ul").css("transform","translateY(-"+45*s+"px)"),1===t?$(".subnav").css("height","auto"):$(".subnav").css("height",i+"px")),l.index()!==s?(l.removeClass("open"),a.removeClass("open"),$(this).parent().next().toggleClass("open"),$(this).closest("li").toggleClass("open")):($(this).parent().next().toggleClass("open"),$(this).closest("li").toggleClass("open"));});} 45else{$('.topnav').on('click','.subMenuItemLink.hasSubmenu',function(e){e.preventDefault();var s=$(this).closest("li").index(),t=$(".subMenuItem.open");t.index()!==s?(t.removeClass("open"),$(this).closest("li").toggleClass("open")):$(this).closest("li").toggleClass("open");});}},touchMenu:function(){$("#menuBar, section, #content, footer").on("touchmove",function(n){var t=$("html").hasClass("menu-open")?1:0;0!==t&&(n.preventDefault(),n.stopPropagation());});if(window.matchMedia('(min-width: 986px)').matches){$("header").on("touchmove",function(n){var t=$("html").hasClass("menu-open")?1:0;0!==t&&(n.preventDefault(),n.stopPropagation());});}},openMenu:function(){if(!($("header").hasClass("noflyouts"))){var a=$("html").hasClass("menu-open")?'close':'open',p=$(".menu-bar").offset().top;try{HDN.sendAnalyticsData(a+'|hamburger-menu|hamburger-menu|0');}catch(e){} 46function activateMenu(){$("html").toggleClass("menu-open");$("html").hasClass("menu-open")?$("html").removeClass("menu-close"):$("html").addClass("menu-close");} 470!==p?$("html").hasClass("webkit")?$("body").animate({scrollTop:p+2},500,function(){var navPos=$(".menu-bar").offset().top;activateMenu();}):$("html").animate({scrollTop:p+2},500,function(){activateMenu();}):activateMenu();}},openSubMenu:function(n){n.preventDefault();n.stopPropagation();var t=$(n.target).closest("li").index(),s=$(n.target).parent(),r=s.hasClass("open")?1:0,q=$(".subMenuLink.open");try{HDN.sendAnalyticsData(1!==r?$(this).prev().html().replace("visit","o
47pen"):$(this).prev().html().replace("visit","close"));}catch(e){} 48window.innerWidth<600&&(1===r?$(".topnav").css("transform","translateY(0)"):$(".topnav").css("transform","translateY(-"+45*t+"px)")),q.parent().index()!==t?(q.removeClass("open"),$("nav").removeClass("wide-nav"),s.toggleClass("open"),$("nav").toggleClass("wide-nav")):(s.toggleClass("open"),$("nav").toggleClass("wide-nav"));}};var centerpiece={init:function(){$(".core-centerpiece").each(function(){var cp=$(this);if(cp.find(".centerpiece-headlinelist").children().length==0){cp.find(".centerpiece-headlinelist").css("width","0");cp.find(".centerpiece-tabs").css({"border":"0","padding":"0","width":"100%"});cp.find(".centerpiece-tabs > div:last-child .core-centerpiece-tab").css("padding-bottom","0");} 49else{setTimeout(function(){if(window.matchMedia('(min-width: 760px) and (max-width: 985px)').matches||window.matchMedia('(min-width: 1092px)').matches){cp.find(".core-headline-list .item.hidden").removeClass("hidden");cp.find(".centerpiece-tabs").css("height","auto");if(cp.find(".centerpiece-tabs").hasClass("total-3")){var tab_height1=cp.find(".centerpiece-tabs > div:first-child .core-centerpiece-tab").outerHeight();var tab_height2=cp.find(".centerpiece-tabs > div:nth-child(2) .core-centerpiece-tab").outerHeight();var tab_height3=cp.find(".centerpiece-tabs > div:nth-child(3) .core-centerpiece-tab").outerHeight();var tab_height23=tab_height2+tab_height3;var tab_height_total=0;var current_height=30;tab_height_total=tab_height1>tab_height23?tab_height1:tab_height23;cp.find(".centerpiece-tabs").css("height",tab_height_total);if(tab_height1>tab_height23){cp.find(".centerpiece-tabs > div:first-child .core-centerpiece-tab").css("border-right","1px solid #ccc");cp.find(".centerpiece-tabs > div:nth-child(2) .core-centerpiece-tab").css("border","0");cp.find(".centerpiece-tabs > div:nth-child(3) .core-centerpiece-tab").css("border","0");}} 50else{var tab_height1=cp.find(".centerpiece-tabs > div:first-child .core-centerpiece-tab").outerHeight();var tab_height_total=0;var max_tab_height=0;var current_height=30;cp.find(".centerpiece-tabs > div:not(:first-child) .core-centerpiece-tab").each(function(){max_tab_height=max_tab_height>$(this).outerHeight()?max_tab_height:$(this).outerHeight();});tab_height_total=tab_height1+max_tab_height;} 51cp.find(".core-headline-list .item").each(function(){current_height+=$(this).outerHeight(true);if(current_height>tab_height_total){$(this).addClass("hidden");}});var latest_news_sponsor=cp.find(".core-headline-list #latest-news-sponsor");if(latest_news_sponsor.height()>3){cp.find(".core-headline-list .item:not(.hidden)").last().addClass("hidden");latest_news_sponsor.removeClass("hidden");} 52cp.find(".core-headline-list .item").removeAttr("style");cp.find(".core-headline-list .item:not(.hidden):not(#latest-news-sponsor)").last().css("border-bottom","0");} 53else{cp.find(".centerpiece-headlinelist .core-headline-list .item.hidden").removeClass("hidden");cp.find(".core-headline-list .item").removeAttr("style");cp.find(".centerpiece-tabs").css("height","auto");}},500);}});}};var threecolzones={resetMax:function(){$(".three-col").find("> div > div >:first-child").each(function(){$(this).css("height","auto");});},setMax:function(){threecolzones.resetMax();if(window.matchMedia('(min-width: 1198px)').matches){$(".three-col").each(function(){var maxHeight=-1;$(this).find("> div > div >:first-child").each(function(){maxHeight=maxHeight>$(this).height()?maxHeight:$(this).height();});$(this).find("> div > div >:first-child").each(function(){$(this).height(maxHeight);});});} 54else if(window.matchMedia('(min-width: 986px)').matches){$(".three-col").each(function(){var maxHeight=-1;$(this).find("> div > div >:first-child").not(":first").each(function(){maxHeight=maxHeight>$(this).height()?maxHeight:$(this).height();});$(this).find("> div > div >:first-child").not(":first").each(function(){$(this).height(maxHeight);});});}},init:function(){if($("body").hasClass("core_homepage")){setTimeout(function(){threecolzones.setMa
54x();},500);}}};document.addEventListener('DOMContentLoaded',function(){centerpiece.init();siteHeader.init();threecolzones.init();},false);window.addEventListener('load',function(){centerpiece.init();threecolzones.init();},false);window.addEventListener('resize',function(event){AdTools.init();centerpiece.init();siteHeader.stickyMenu();siteHeader.timestamp();threecolzones.init();},false);var HDN=window.HDN||{};HDN.spotim=HDN.spotim||{};HDN.spotim.info=HDN.spotim.info||{};HDN.spotim.launch=function(siteFormat,dynamicallyLoadComments,initCommentPath){HDN.spotim.info.siteFormat=siteFormat;HDN.spotim.info.dynamicallyLoadComments=dynamicallyLoadComments;HDN.spotim.info.initCommentPath=initCommentPath;if(HDN.hasOwnProperty('dataLayer')){if(HDN.dataLayer.hasOwnProperty('site')){if(HDN.dataLayer.site.hasOwnProperty('commentSiteKey')){HDN.spotim.info.spotId=HDN.dataLayer.site.commentSiteKey;} 55if(HDN.dataLayer.site.entitledComments){HDN.spotim.info.entitledComments=HDN.dataLayer.site.entitledComments;}} 56if(HDN.dataLayer.hasOwnProperty('source')&&HDN.dataLayer.source.hasOwnProperty('publishingSite')){HDN.spotim.info.propid=HDN.dataLayer.source.publishingSite.replace(/^mobile/,"").replace(/^premium/,"");}} 57document.addEventListener('spot-im-api-ready',function(event){HDN.spotim.log('sptim: spot-im-api-ready fired');HDN.spotim.log(event.detail);HDN.spotim.onReady(siteFormat,dynamicallyLoadComments,initCommentPath);});HDN.spotim.info.commentsContainer=document.getElementById('spotim-comments');if(HDN.spotim.info.commentsContainer===null){HDN.spotim.log('sptim: spotim-comments element not found. Done.');return;} 58var cs=HDN.spotim.setComments(HDN.spotim.info.commentsContainer);HDN.spotim.log(HDN.spotim.info);if(HDN.spotim.info.commentsContainer.dataset.spotimUseRecirculation){HDN.spotim.setRecirculation(HDN.spotim.info.commentsContainer);} 59HDN.spotim.info.commentsContainer.appendChild(cs);cs.src=cs.dataset.js;};HDN.spotim.onReady=function(siteFormat,dynamicallyLoadComments,initCommentPath){HDN.spotim.log('HDN.spotim.onReady');if(window.SPOTIM&&window.SPOTIM.startSSOForProvider){HDN.spotim.log('window.SPOTIM is defined.');window.treg=window.treg||{};var treg=window.treg;HDN.tRegSwitch=(typeof treg!=="undefined"&&typeof treg.html!=="undefined");HDN.spotim.log('sptim: HDN.tRegSwitch: '+HDN.tRegSwitch);HDN.spotim.announceEvent("hdnSpotImReady","SPOTIM object is loaded");document.addEventListener('spot-im-login-start',function(event){if(HDN.tRegHasActiveSession||(!HDN.tRegSwitch&&HDN.spotim.hdnToken()!=="")){HDN.spotim.toggleLogin('close');HDN.spotim.log('sptim: treg has active session check if spImReqAuth(): '+HDN.spotim.reqAuth());if(HDN.spotim.reqAuth()){if(HDN.tRegSwitch&&(typeof(window.syncPaymeter)!=="undefined"&&typeof(window.syncPaymeter.checkComments)==="function")&&treg.isUserPremiumSubscriber()){HDN.spotim.log('sptim: hdnLoginSuccess: (treg.isUserPremiumSubscriber() === true): calling HDN.spotim.login');} 60HDN.spotim.log('sptim: hdnLoginSuccess: calling HDN.spotim.login');HDN.spotim.login();}}else{HDN.spotim.log('sptim: spot-im-login-start fired');window.setTimeout(function(){window.HDN.spotim.toggleLogin('open');},10);}});document.addEventListener("hdnLoginSuccessful",function(){HDN.spotim.log('sptim: hdnLoginSuccess');if(typeof HDN.onLoginSuccess==='function'){HDN.spotim.log('sptim: hdnLoginSuccess: typeof HDN.onLoginSuccess === \'function\'');HDN.onLoginSuccess('reg_member');} 61if(!HDN.tRegSwitch&&siteFormat==='mobile'&&typeof(HDN.mobileCommentsSTop)!=="undefined"){if(typeof HDN.hideMenu==='function'){HDN.hideMenu();} 62if(window.pageYOffset){window.pageYOffset=HDN.mobileCommentsSTop;}else{document.documentElement.scrollTop=HDN.mobileCommentsSTop;}} 63if(HDN.spotim.reqAuth()){if(HDN.tRegSwitch&&(typeof(window.syncPaymeter)!=="undefined"&&typeof(window.syncPaymeter.checkComments)==="function")&&treg.isUserPremiumSubscriber()){HDN.spotim.log('sptim: hdnLoginSuccess: (treg.isUserPremiumSubscriber() === true): calling HDN.spotim.login');} 64HDN.spotim.log('sptim: hdnLoginSuccess: calling HDN.spotim.login');HDN.spotim.login();}});document.addEventListener('spot-im-post-login',function(e){HDN.spotim.log('sptim: onLoginSuccess');HDN.spotim.log(e);HDN.spotim.toggleLogin('close');var tok=HDN.spotim.hdnToken(true);if(HDN.spotim.info.entitledComments){var dn=document.getElementsByClassName('comments-bar')[0];if(dn){var tcs=Array.apply(null,dn.getElementsByClassName('treg-conditional'));if(tcs.length===2){tcs[1].innerHTML='<span class="treg-gya-displayname">'+tok.displayName+'</span> is currently signed in';}}}});document.addEventListener("hdnLogoutSuccessful",function(){HDN.spotim.log('sptim: hdnLogoutSuccessful fired');window.SPOTIM.logout();HDN.spotim.toggleLogin('close');if(HDN.spotim.info.subscribePopup){var spup=HDN.spotim.info.subscribePopup;if(spup.parentElement){spup.parentElement.removeChild(spup);} 65HDN.spotim.info.subscribePopup=undefined;} 66if(HDN.spotim.info.curentUserTyping){document.addEventListener('spot-im-current-user-typing-start',HDN.spotim.info.curentUserTyping);}});var commentsPerPage=10;HDN.tRegHasActiveSession=false;window.treg.cmd=window.treg.cmd||[];window.treg.cmd.push(function(){var treg=window.treg;treg.realm.events.registerReplayLast("realm.Oidc.refreshLogicComplete",function(){treg.realm.events.registerReplayLast("treg.onSessionFound",function(){HDN.spotim.log('treg: onSessionFound');HDN.tRegHasActiveSession=treg.hasActiveSession();if(HDN.spotim.reqAuth()){HDN.spotim.log('treg: onSessionFound: spImReqAuth()');HDN.spotim.announceEvent("hdnLoginSuccessful","treg object is starting it's session");} 67return true;});treg.realm.events.registerReplayLast("treg.onSessionNotFound",function(){HDN.spotim.log('sptim: treg.event.onSessionEnd fired');HDN.tRegHasActiveSession=false;document.cookie='at=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/';
67HDN.spotim.log('sptim: hdnLogoutSuccessful called');HDN.spotim.announceEvent("hdnLogoutSuccessful","treg object is ending it's session");return true;});});});if(!HDN.tRegSwitch){if(HDN.spotim.hdnToken()!==""){HDN.spotim.log('sptim: treg has active session check if spImReqAuth(): '+HDN.spotim.reqAuth());if(HDN.spotim.reqAuth()){HDN.spotim.log('sptim: spImReqAuth() is true so HDN.spotim.hdnToken() and HDN.publishVf()');HDN.spotim.announceEvent("hdnLoginSuccessful","treg object is starting it's session");}else{var lu=HDN.spotim.hdnToken(true);var ru=HDN.spotim.currentUser();if(lu.hasOwnProperty('displayName')&&(lu.displayName!==""&&lu.displayName!==null)&&lu.displayName!==ru.displayName){window.SPOTIM.logout();HDN.spotim.login();}}}else{HDN.spotim.log('sptim: HDN.tRegSwitch && !HDN.tRegHasActiveSession: check user');var spCU=HDN.spotim.currentUser();if(spCU&&spCU.isRegistered===true){window.SPOTIM.logout();} 68if(HDN.spotim.info.entitledComments){var dn=document.getElementsByClassName('comments-bar')[0];if(dn){var tcs=Array.apply(null,dn.getElementsByClassName('treg-conditional'));if(tcs.length===2){tcs[0].innerHTML='You must be signed in and an active subscriber to comment';}} 69HDN.spotim.info.curentUserTyping=function(e){window.HDN.spotim.toggleLogin('open');var hcbw=document.getElementById('hearst-commenting-bar-widget-screen-set');if(hcbw){var rsi=hcbw.getElementsByClassName('realm-sign-in')[0];if(rsi){rsi.setAttribute('href','javascript:void(0)');rsi.focus();}}};document.addEventListener('spot-im-current-user-typing-start',HDN.spotim.info.curentUserTyping);}}}}};HDN.spotim.setComments=function(container,reset){var cs=document.createElement('script');cs.type='text/javascript';cs.async=!0;['spotId','js','postId','postUrl','spotimModule','articleTags','liveBlog','liveEventCode','enableLiveBlogReplies'].forEach(function(ds){if((!HDN.spotim.info[ds]||reset)&&(ds in container.dataset)){HDN.spotim.info[ds]=container.dataset[ds];delete container.dataset[ds];cs.dataset[ds]=HDN.spotim.info[ds];}});if(reset){container.append(cs);cs.src=cs.dataset.js;return;} 70return cs;};HDN.spotim.setRecirculation=function(container){var rd=document.createElement('div');rd.dataset.spotimModule='recirculation';rd.dataset.spotId=HDN.spotim.info.spotId;var rs=document.createElement('script');rs.type='text/javascript';rs.async=!0;container.append(rd);container.append(rs);rs.src='https://recirculation.spot.im/spot/'+HDN.spotim.info.spotId;};HDN.spotim.currentUser=function(){if(localStorage.SPOTIM_CURRENT_USER){var cu=JSON.parse(localStorage.SPOTIM_CURRENT_USER);if(cu.hasOwnProperty('data')){HDN.spotim.log('sptim: remoteUser.data found in localStorage');return cu.data;}} 71return undefined;};HDN.spotim.reqAuth=function(){HDN.spotim.log('sptim: spImReqAuth');var lu=HDN.spotim.hdnToken(true);HDN.spotim.log(lu);var ru=HDN.spotim.currentUser();HDN.spotim.log(ru);if(!ru){HDN.spotim.log('sptim: no remote user found in localStorage');return true;} 72if(lu.email){if(!ru.isRegistered||lu.email!==ru.email){if(ru.isRegistered&&lu.email!==ru.email){HDN.spotim.log('sptim: email address not matched - logging out');window.SPOTIM.logout();} 73return true;}}else if(ru.isRegistered){HDN.spotim.log('sptim: auth state not matched - logging out');window.SPOTIM.logout();} 74return false;};HDN.spotim.startSSO=function(sessionId){window.SPOTIM.startSSOForProvider({provider:'hearst',token:sessionId}).then(function(userData){HDN.spotim.log('sptim: Logged in successfully');HDN.spotim.log(userData);if(HDN.spotim.alertBody){pe=HDN.spotim.alertBody.parentElement;pe.parentElement.removeChild(pe);}}).catch(function(reason){HDN.spotim.toggleLogin('close');HDN.spotim.log('sptim: onLoginFailed fired: ');HDN.spotim.log(reason);if(reason.indexOf('ReadTimeout')>-1&&reason.indexOf('endpoint: POST /complete')>-1){if(HDN.spotim.hasOwnProperty('timeoutFailure')){if(HDN.spotim.alertBody){HDN.spotim.alertBody.innerHTML='<span class="bold">Readers:</span> We are aware of a technical issue with our commenting platform and are working on a fix. In the meantime, please refresh your page and try your comment again.';} 75console.log('Endpoint timeout: Too many failures.');return;} 76HDN.spotim.timeoutFailure=true;var tBars=document.getElementsByClassName('treg-gya-commenting-bar');if(tBars.length>0){var timeoutAlert=document.createElement('div');timeoutAlert.classList.add('timeout-alert');var closeAlert=document.createElement('div');closeAlert.classList.add('close-alert');timeoutAlert.appendChild(closeAlert);var alertBody=document.createElement('div');alertBody.classList.add('alert-body');alertBody.innerHTML='Commenting authentication failed, trying again...';timeoutAlert.appendChild(alertBody);var commentsBox=document.getElementById('spotim-comments');var tBar=tBars[tBars.length-1];commentsBox.insertBefore(timeoutAlert,tBar.nextElementSibling);HDN.spotim.alertBody=alertBody;console.log('Endpoint timeout: Trying login second time');HDN.spotim.startSSO(sessionId);}}});};HDN.spotim.login=function(){HDN.spotim.log('HDN.spotim.login');var tok=HDN.spotim.hdnToken(true);if(HDN.spotim.info.entitledComments&&!tok.entitlementId){HDN.spotim.toggleLogin('close');var dn=document.getElementsByClassName('comments-bar')[0];if(dn){var tcs=Array.apply(null,dn.getElementsByClassName('treg-conditional'));if(tcs.length===2){tcs[0].innerHTML='You must be signed in and an active subscriber to comment';tcs[1].innerHTML='You must be an active subscriber to comment';} 77if(!HDN.spotim.info.subscribePopup){HDN.spotim.info.subscribePopup=document.createElement('div');HDN.spotim.info.subscribePopup.classList.add('gya-toggle');var x=document.createElement('div');x.innerHTML='<a href="javascript:void(0)" onclick="var pe = this.parentElement.parentElement; pe.parentElement.removeChild(pe); return false;">X</a>';x.style.position='absolute';x.style.top='10px';x.style.right='10px';x.style.fontWeight='bold';HDN.spotim.info.subscribePopup.appendChild(x);var glw=document.createElement('div');glw.classList.add('treg-gya-login-widget');glw.classList.add('treg-loggedin-instanced');HDN.spotim.info.subscribePopup.appendChild(glw);var tc=document.querySelector('.treg-conditional.treg-is-not-subscriber').cloneNode(true);tc.removeChild(tc.firstElementChild);tc.removeChild(tc.firstElementChild);glw.appendChild(tc);document.removeEventListener('spot-im-current-user-typing-start',HDN.spotim.info.curentUserTyping);document.addEventListener('spot-im-current-user-typing-start',function(e){HDN.spotim.log('sptim: current-user-typing-start');
77var spcm=document.getElementsByClassName('spot-im-conversation-module')[0];var dr=spcm.getBoundingClientRect();var spup=HDN.spotim.info.subscribePopup;spup.style.top=(dr.y+window.scrollY)+'px';spup.style.left=dr.x+'px';spup.style.paddingTop='35px';spup.style.position='absolute';spcm.parentElement.insertBefore(spup,spcm);spup.style.display='block';spup.setAttribute('tabindex','100');spup.focus();});var ru=HDN.spotim.currentUser();HDN.spotim.log(ru);if(ru&&ru.isRegistered){HDN.spotim.log('sptim: non-subscriber logged in - logging out old users');window.SPOTIM.logout();}}} 78return false;} 79tok=HDN.spotim.hdnToken();if(tok!==""&&window.SPOTIM&&window.SPOTIM.startSSOForProvider){HDN.spotim.startSSO(tok);}};HDN.spotim.hdnToken=function(returnObject){HDN.spotim.log('HDN.spotim.hdnToken');if(typeof treg!=="undefined"&&typeof(treg.html)!=="undefined"&&typeof(treg.identity)!=="undefined"){HDN.spotim.log('HDN.spotim.hdnToken: treg.identity');if(returnObject){return treg.identity;} 80if(treg.identity.id){var propid='';if(HDN.spotim.info.propid!==undefined){propid='&propid='+HDN.spotim.info.propid;} 81var jRC=treg.identity.id+'&sLId='+treg.identity.edbId+'&ssoId='+treg.ssoId+propid;if(treg.realm&&treg.realm.OidcData){var oidc=treg.realm.OidcData;if(oidc.spotImCode&&oidc.tenantId){jRC+='&code='+oidc.spotImCode+'&tenantId='+oidc.tenantId;}} 82var date=new Date();date.setTime(date.getTime()+(365*24*60*60*1000));document.cookie='at=u='+jRC+'; expires='+date.toUTCString()+'; path=/';return jRC;} 83return'';}else{HDN.spotim.log('HDN.spotim.hdnToken: not for treg');var atC=document.cookie.split(/\bat=/);if(atC.length==2){atC=atC.pop().split(";").shift();HDN.spotim.log('HDN.spotim.hdnToken: return standard cookie value');if(returnObject){if(atC!==''&&atC.indexOf("=")===-1){HDN.spotim.log('HDN.spotim.hdnToken: return decoded cookie value');atC=decodeURIComponent(atC);} 84var atObj=JSON.parse('{"'+atC.replace(/&/g,'","').replace(/=/g,'":"')+'"}',function(key,value){return key===""?value:decodeURIComponent(value);});atObj.email=atObj.e;return atObj;} 85return atC;}} 86HDN.spotim.log('HDN.spotim.hdnToken: return nothing');if(returnObject){return{};} 87return'';};HDN.spotim.toggleLogin=function(state){if(state&&state!=='open'&&state!=='close'){state='open';} 88if(!HDN.tRegSwitch){if(HDN.spotim.info.siteFormat==='mobile'&&state==='open '){if(typeof HDN.showSignIn==='function'){HDN.mobileCommentsSTop=document.body.scrollTop+document.documentElement.scrollTop;HDN.showSignIn();}}else if(HDN.spotim.info.siteFormat=='free'){var msd=document.getElementById('modal_signin_div');if(msd){if(state==='open'){msd.classList.add('open');msd.style.setProperty('display','block');}else{msd.classList.remove('open');msd.style.setProperty('display','none');}}}}else{var hcbw=document.getElementById('hearst-commenting-bar-widget-screen-set');if(hcbw){Array.apply(null,hcbw.getElementsByClassName('comments-toggle')).forEac
88h(function(ct){if(state==='open'){ct.classList.add('open');}else{ct.classList.remove('open');}});Array.apply(null,hcbw.getElementsByClassName('gya-toggle')).forEach(function(gt){if(state==='open'){gt.style.display="block";}else{gt.style.display="none";}});}}};HDN.spotim.commentCount=function(elements,domain,noZero){if(typeof domain==='undefined'){domain=window.location.hostname;} 89if(typeof elements==='undefined'){elements=document;} 90var spotDomains=[];var spotCounters=Array.apply(null,elements.querySelectorAll('span.vf-counter[data-spot-post-id]'));var rCount=0;var comma="";spotDomains[rCount]="";if(spotCounters.length>0){spotCounters.forEach(function(sc,sci){if(sci>0&&sci%15===0){rCount++;comma="";} 91spotDomains[rCount]+=comma+sc.dataset.spotPostId;comma=",";});} 92HDN.spotim.log('getSpotCommentCount');HDN.spotim.log(spotDomains);if(spotDomains[0]!==""){if(HDN.dataLayer&&HDN.dataLayer.site&&HDN.dataLayer.site.commentSiteKey&&!HDN.spotim.info.hasOwnProperty('spotId')){HDN.spotim.info.spotId=HDN.dataLayer.site.commentSiteKey;} 93var countCallback=function(data){HDN.spotim.log(data);if(typeof data==='object'&&data.hasOwnProperty('messages_count')){for(var dcnt in data.messages_count){Array.apply(null,document.querySelectorAll('[data-spot-post-id="'+dcnt+'"]')).forEach(function(spim){if(data.messages_count[dcnt]!==0||!noZero){spim.innerHTML=data.messages_count[dcnt];}});}}};var requestCounts=function(url,callback){var xmlhttp=new XMLHttpRequest();xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState===4&&xmlhttp.status===200){console.log('responseText:'+xmlhttp.responseText);try{var data=JSON.parse(xmlhttp.responseText);callback(data);}catch(err){console.log(err.message+" in "+xmlhttp.responseText);}}};xmlhttp.open("GET",url,true);xmlhttp.send();};for(var sd in spotDomains){HDN.spotim.log(spotDomains);HDN.spotim.log(sd);console.log(HDN.spotim.info.spotId);console.log(spotDomains[sd]) 94requestCounts('https://open-api.spot.im/v1/messages-count?spot_id='+HDN.spotim.info.spotId+'&posts_ids='+spotDomains[sd],countCallback);}}};HDN.spotim.blogCommentCount=function(){HDN.spotim.commentCount(undefined,"blog."+HDN.domain);};HDN.spotim.log=function(logOut){if(HDN.spotim.debug){console.log(logOut);}};HDN.spotim.announceEvent=function(eName,message,data){var event=document.createEvent('Event');if(typeof message==="undefined"){message="";} 95if(typeof data==="undefined"){data={};} 96event.initEvent(eName,true,true);event.message=message;event.time=new Date();event.details={eventData:data};document.dispatchEvent(event);};HDN.spotim.announceEvent("hdnSpotImCodeLoaded","SPOTIM code is loaded");var HDNFlexGallery=function(outerContainer,itemContainer,thumbContainer,controlBar,navs,caption,firstItem){"use strict";this._outerContainer=outerContainer;this.mode=this._outerContainer.dataset.galleryMode;if(this.mode!==null){if(this.mode===""){this.mode="standard";this.isListView=this.isGridView=this.isArbitrage=false;}else if(this.mode==="grid"){this.isGridView=true;this.isListView=this.isArbitrage=false;}else if(this.mode==="listview"){this.isListView=true;this.isArbitrage=this.isGridView=false;}else if(this.mode==="arbitrage"){this.isListView=this.isArbitrage=true;this.isGridView=false;}}else{var oCCL=this._outerContainer.classList;this.isListView=oCCL.contains('hst-lvgallery-container');this.isGridView=(oCCL.contains('hst-resgallery-container')&&oCCL.contains('grid'));this.isBlog=oCCL.contains('hst-blog');} 97this._parentContainer=this._outerContainer.parentNode;this._itemContainer=itemContainer;this._itemContainerParent=this._itemContainer.parentNode;this._controlPanel=this._outerContainer.getElementsByClassName('control-panel')[0];this._items=Array.apply(null,this._itemContainer.querySelectorAll('li'+(this.isListView?'.hst-lvgalleryitem':'')));this._showing=this._items.filter(function(i){return!i.classList.contains('hidden');});this._showing=(this._showing.length>0?this._showing[0]:undefined);if(this._showing){var showingImg=this._showing.getElementsByTagName('img')[0];if(showingImg){this.addRatioClass(showingImg);}} 98this.imgWrapSelector='img-wrap';this._showingWrap=this._showing.getElementsByClassName(this.imgWrapSelector)[0];this.showingIndex=parseInt(this._showing.dataset.frameIndex);this.lastIndex=this._items.length-1;this._imgsLoadLazy=this._items.map(function(i){var img=i.getElementsByTagName('img')[0];if(img!==null&&typeof img!=="undefined"){var state=img.dataset.lazyState;if(state!==null&&state==="queue"){return 1;}} 99return null;});this._interstitialLazyLoad=this._items.map(function(t){if(t.getElementsByClassName(this.imgWrapSelector+' '+'taboolaloader')[0]){this.interstitialId='taboola';return 1;}else if(t.getElementsByClassName(this.imgWrapSelector+' '+'dfploader')[0]){this.interstitialId='dfp';return 1;} 100return null;},this);this._controlBar=controlBar;this._navs=Array.apply(null,navs);this._caption=caption;this._captions=this._items.map(function(i){return i.getElementsByClassName('caption')[0];});this._socialLinks=Array.apply(null,this._outerContainer.querySelectorAll('.social-links'));this._thumbContainer=thumbContainer;this.setLoaders();this.viewportMaxSide=(document.documentElement.clientWidth||window.innerWidth);if(this.isGridView){this.isGridSmall=(this.viewportMaxSide<768);if(this.isGridSmall){this._outerContainer.classList.add('grid-small');this._itemContainer.classList.add('grid-small');}} 101this.imageFormats=[480,'480x480.jpg','gallery_3x2_480.jpg',696,'696x696.jpg','gallery_3x2_696.jpg',768,'768x768.jpg','gallery_3x2_768.jpg',900,'900x900.jpg','gallery_3x2_900.jpg',1024,'1024x1024.jpg','gallery_3x2_1023.jpg'];var imgFormatStyle=this.imageFormats[this.imageFormats.length-2];var imgCropFormatStyle=this.imageFormats[this.imageFormats.length-1];for(var w=0;w<this.imageFormats.length;w+=3){if(this.imageFormats[w]>=this.viewportMaxSide){imgFormatStyle=this.imageFormats[w+1];imgCropFormatStyle=this.imageFormats[w+2];break;}} 102this.imgFormatStyle=imgFormatStyle.replace('.jpg','');this.imgCropFormatStyle=imgCropFormatStyle.replace('.jpg','');if(!this.hasOwnProperty('jsonData')&&!this.isBlog&&imgFormatStyle!==''){this._items.forEac
102h(function(i){var q=i.querySelector('img[data-lazy-state^="queue"]');if(q&&q.hasAttribute('data-src')){var dataSrc=imgFormatStyle;if(/gallery_3x2/.test(q.dataset.src)){dataSrc=imgCropFormatStyle;} 103q.setAttribute('data-src',q.dataset.src.replace(/\/[^\/]*$/,'/'+dataSrc));var iSrc=imgFormatStyle;if(/-[0-9]+\.jpg$/i.test(q.dataset.src)){var quality=q.dataset.src.match(/(-[0-9]+)\.jpg$/i);iSrc=iSrc.replace(/\.jpg$/,quality[1]+'.jpg');} 104q.setAttribute('data-src',q.dataset.src.replace(/\/[^\/]*$/,'/'+iSrc));}});} 105if(this.isBlog){if(this._items.length>2){this._outerContainer.classList.add('three-wide');}} 106this.galleryTitle='';this.galleryId='';this.galleryType='wcm';if(this.isBlog){var galleryMetadata=this._outerContainer.getElementsByClassName('gallery-metadata')[0];this.galleryId=this.galleryTitle="";if(galleryMetadata!==null){if(galleryMetadata.hasAttribute('data-gallery-id')){this.galleryId=galleryMetadata.dataset.galleryId;} 107if(galleryMetadata.hasAttribute('data-gallery-title')){this.galleryTitle=galleryMetadata.dataset.galleryTitle;}} 108this.galleryType='wp';}else{this.galleryTitle=this._outerContainer.dataset.title;this.galleryId=this._outerContainer.parentNode.dataset.gid;} 109window.HDN_ResponsiveGallery=window.HDN_ResponsiveGallery||{'galleries':[],'fullscreen':undefined};this.refIndex=(window.HDN_ResponsiveGallery.galleries.push(this)-1);this.onLoadEvents=[];var self=this;if(this.mode==="standard"||this.mode==="grid"){this.onLoadEvents.push(self.onLoadStandard.bind(self));}else if(this.isListView===true){this.onLoadEvents.push(this.onLoadListview.bind(this));if(this.isArbitrage===true){this.onLoadEvents.push(this.onLoadArbitrage.bind(this));}} 110if(typeof this.onLoad==='function'){this.onLoad();} 111if(this.onLoadEvents.length>0){this.onLoadEvents.forEach(function(f){f();});}};HDNFlexGallery.prototype.showItem=function(elem,direction){var fast='fast';if(this.hasThumbs&&!this._thumbContainer.classList.contains('hidden'))this.toggleThumbContainer();this._itemContainer.style.height=this._showingWrap.style.height;var HDN=window.HDN||{};if(fast=='fast'||this.isListView){if(!this.isListView){this.closeShowing();} 112this.setShowing(elem);this.openShowing();if(!this.firstOverlayView&&!this.inFullscreenMode&&(typeof(this.refIndex)!=='undefined')){this.firstOverlayView=true;this.showOverlay('fullscreen');} 113if(this.reportPageView){try{HDN.refresh('photo',(this.showingIndex+1)+':'+(this.lastIndex+1),this.galleryType,this.galleryId,this.galleryTitle);}catch(e){} 114this.reportPageView=false;}}else{var mythis=this;this._showing.fadeOut(function(){mythis.closeShowing();mythis.setShowing(elem);mythis._showing.fadeIn(function(){mythis.openShowing();});if(!mythis.firstOverlayView&&!mythis.inFullscreenMode&&(typeof(mythis.refIndex)!=='undefined')){mythis.firstOverlayView=true;mythis.showOverlay('fullscreen');} 115if(mythis.reportPageView){try{HDN.refresh('photo',(mythis.showingIndex+1)+':'+(mythis.lastIndex+1),mythis.galleryType,mythis.galleryId,mythis.galleryTitle);}catch(e){} 116mythis.reportPageView=false;}});} 117this.loadLazy(this._showing,direction);};HDNFlexGallery.prototype.setShowing=function(elem){this._showing=elem;this.showingIndex=parseInt(elem.dataset.frameIndex,10);this._itemContainer.setAttribute('data-current-index',elem.dataset.frameIndex);this._showingWrap=elem.getElementsByClassName(this.imgWrapSelector)[0];this.setLineup(elem);this.setDynamicLoader(this._showingWrap);if(this._currentItemCount&&this._currentItemCount.length>0){var itemCount=parseInt(elem.dataset.frameIndex,10)+1;if(this.jsonData!==undefined&&!this.jsonData.complete&&itemCount>this.jsonData.minOffset){itemCount-=this.jsonData.offsetId;} 118this._currentItemCount.forEach(function(cic){cic.innerHTML=itemCount;});} 119var showingImg=this._showing.getElementsByTagName('img')[0];if(showingImg){this.addRatioClass(showingImg);} 120if(typeof(this.refIndex)!=='undefined'&&!this.isListView){if(this._showing.hasAttribute('data-item-url')){var ags=this._outerContainer.parentNode;if(typeof ags!=="undefined"&&ags!==null){if(ags.classList.contains('asset_gallery')&&ags.classList.contains('slideshow')) 121this.updateGalleryState();}}else{if(typeof this.replaceHash==='function'){this.replaceHash(this._showing.dataset.itemId);}}} 122if(!this.isListView){} 123if(this._overlayTitles&&this._overlayTitles!==null){this._overlayTitles.classList.add('showing');} 124if(this.inFullscreenMode){}};HDNFlexGallery.prototype.openShowing=function(){var itemsIndex=this.showingIndex;if(this.hasOwnProperty('galleryStateIndexes')){itemsIndex=this.galleryStateIndexes.indexOf(this.showingIndex);} 125if(this.hasThumbs){var thmb=this._thumbContainer.querySelector('.thumb[data-frame-index="'+this.showingIndex+'"]');if(thmb!==null){thmb.classList.add('selected');}} 126this._showing.classList.remove("hidden");if(typeof this.animateFrameClass!=='undefined'&&this.animateFrameClass!==""){this._showing.classList.add(this.animateFrameClass);} 127if(this.hasThumbs&&typeof this._caption!=="undefined"){var cs=this._captions[itemsIndex];var credit="",caption="";if(cs!==null){cs.classList.remove('staged');caption=cs.innerHTML;var csCredit=cs.getElementsByClassName('credit')[0];if(csCredit!==null&&typeof csCredit!=="undefined"){credit=csCredit.innerHTML;}} 128this._caption.innerHTML=caption;var controlCap=this._controlBar.getElementsByClassName('credit');
128if(controlCap.length>0){this._controlBar.getElementsByClassName('credit')[0].innerHTML=credit;}} 129this.startDynamicLoader();if(this.mode==="standard"){this._itemContainer.style.height="";if(this._captions[itemsIndex].classList.contains('open')&&this._captions[itemsIndex].classList.remove('open')&&this.scrollSwipe.persistentCaptions){this._captions[itemsIndex].classList.add('open');}else{this._overlay.classList.remove('caption');} 130if(this._showing.classList.contains('taboola-frame')||this._showing.classList.contains('dfp-frame')){this._navs[1].classList.add('taboola');}else{this._navs[1].classList.remove('taboola');}}};HDNFlexGallery.prototype.closeShowing=function(elem){var thmb;if(typeof(elem)!=='undefined'){elem.classList.add('hidden');elem.classList.remove(this.animateFrameClass);this.stopDynamicLoader(elem);if(this.hasThumbs){thmb=this._thumbContainer.querySelector('.thumb[data-frame-index="'+elem.dataset.frameIndex+'"]');if(thmb!==null){thmb.classList.remove('selected');}}}else{this._showing.classList.add('hidden');if(typeof this.animateFrameClass!=='undefined'&&this.animateFrameClass!==""){this._showing.classList.remove(this.animateFrameClass);} 131this.stopDynamicLoader();if(this.hasThumbs){thmb=this._thumbContainer.querySelector('.thumb[data-frame-index="'+this.showingIndex+'"]');if(thmb!==null){thmb.classList.remove('selected');}}}};HDNFlexGallery.prototype.setLineup=function(elem){var sIndex=parseInt(elem.dataset.frameIndex);this.prevIndex=(sIndex===0?this.lastIndex:sIndex-1);this.nextIndex=(sIndex===this.lastIndex?0:sIndex+1);if(this.jsonData!==undefined&&!this.jsonData.complete){var maxLowId=this.jsonData.maxLowId,minHighId=this.jsonData.minHighId;if(this.useInterstitial){maxLowId+=parseInt(maxLowId/this.jsonData.metadata[this.interstitialId].frameDivision,10);minHighId+=parseInt(minHighId/this.jsonData.metadata[this.interstitialId].frameDivision,10);} 132if(this.prevIndex<minHighId&&this.prevIndex>maxLowId){this.prevIndex=maxLowId;} 133if(this.nextIndex<minHighId&&this.nextIndex>maxLowId){this.nextIndex=minHighId;}} 134var pIndex=this.prevIndex,nIndex=this.nextIndex;if(this.hasOwnProperty('galleryStateIndexes')){pIndex=this.galleryStateIndexes.indexOf(this.prevIndex);nIndex=this.galleryStateIndexes.indexOf(this.nextIndex);} 135this._prev=this._items[pIndex];this._next=this._items[nIndex];this._prevWrap=this._prev.getElementsByClassName(this.imgWrapSelector)[0];this._nextWrap=this._next.getElementsByClassName(this.imgWrapSelector)[0];};HDNFlexGallery.prototype.calculatePercentVisible=function(img){var ratio=window.HDN.dataLayer.site.galleryRatio;var boundingRatio=ratio.split(':').map(function(r){return parseInt(r,10);});if(boundingRatio.length!==2||boundingRatio[0]<=0||boundingRatio[1]<=0||img.naturalWidth<=0||img.naturalHeight<=0){return 0;} 136var givenRatio=boundingRatio[0]/boundingRatio[1];var imageRatio=img.naturalWidth/img.naturalHeight;if(givenRatio>imageRatio){return Math.round((boundingRatio[1]/((img.naturalHeight/img.naturalWidth)*boundingRatio[0]))*100);}else if(givenRatio<imageRatio){return Math.round((boundingRatio[0]/(imageRatio*boundingRatio[1]))*100);}else{return 100;}};HDNFlexGallery.prototype.addRatioClass=function(img){if(window.HDN&&window.HDN.dataLayer&&window.HDN.dataLayer.site&&window.HDN.dataLayer.site.galleryRatio){if(!this.imageRatioStore){this.imageRatioStore={};} 137var p=img.parentNode;if(img.src in this.imageRatioStore){if(this.imageRatioStore[img.src]==='open-width'){p.style.backgroundImage='url('+img.src+')';} 138p.classList.add(this.imageRatioStore[img.src]);return;} 139var pv=this.calculatePercentVisible(img);if(pv>=84&&pv<100){var c='';if(img.height===this._itemContainer.clientHeight){c='open-height';}else{p.style.backgroundImage='url('+img.src+')';c='open-width';} 140p.classList.add(c);this.imageRatioStore[img.src]=c;}}};HDNFlexGallery.prototype.loadLazy=function(elem,direction){var eNext,ePrev;var lazyIndex=parseInt(elem.dataset.frameIndex);var imgQuery='.'+this.imgWrapSelector+' img';if(lazyIndex>=0&&this._imgsLoadLazy[lazyIndex]!==null){this._imgsLoadLazy[lazyIndex]=null;var lazyImg=elem.querySelector(imgQuery);if(lazyImg!==null){var HDNFG=this;lazyImg.onload=function(event){this.setAttribute('data-lazy-state','loaded');HDNFG.addRatioClass(this);};lazyImg.onerror=function(event){this.setAttribute('data-lazy-state','error');};lazyImg.setAttribute('data-lazy-state','loading');lazyImg.setAttribute('src',lazyImg.dataset.src);lazyImg.removeAttribute('data-src');if(lazyImg.dataset.followState==='hold'){lazyImg.setAttribute('data-follow-state','');return;}}} 141var idx,iElem;if(direction!=='reverse'&&direction!=='reverseEnd'){idx=this._imgsLoadLazy.indexOf(1,lazyIndex+1);if(idx<0&&lazyIndex>0){idx=this._imgsLoadLazy.indexOf(1);} 142if(idx<0){return;} 143if(this.hasOwnProperty('galleryStateIndexes')){iElem=this.galleryStateIndexes.indexOf(idx);if(iElem>-1){eNext=this._items[iElem];}}else{eNext=this._items[idx];} 144if(eNext&&eNext!==elem){if(direction!=='forward'){eNext.querySelector(imgQuery).setAttribute('data-follow-state','hold');}else{eNext.querySelector(imgQuery).setAttribute('data-follow-state','forwardEnd');direction='forwardEnd';} 145this.loadLazy(eNext,direction);}} 146if(direction!=='forward'&&direction!=='forwardEnd'){idx=this._imgsLoadLazy.lastIndexOf(1,lazyIndex-1);if(idx<0&&lazyIndex>0){idx=this._imgsLoadLazy.lastIndexOf(1);} 147if(idx<0){return;} 148if(this.hasOwnProperty('galleryStateIndexes')){iElem=this.galleryStateIndexes.indexOf(idx);if(iElem>-1){ePrev=this._items[iElem];}}else{ePrev=this._items[idx];} 149if(ePrev&&ePrev!==elem){if(direction!='reverse'){ePrev.querySelector(imgQuery).setAttribute('data-follow-state','hold');}else{ePrev.querySelector(imgQuery).setAttribute('data-follow-state','reverseEnd');direction='reverseEnd';} 150this.loadLazy(ePrev,direction);}}};HDNFlexGallery.prototype.makeSocialCall=function(elem){var utmParam
150s='&utm_source=CMS%20Sharing%20Button&utm_medium=social';var shareId=elem.dataset.shareId;var getMetaContent=function(propName){var content='';var meta=document.querySelector('meta[property="'+propName+'"]');if(meta!==null){content=meta.getAttribute('content');} 151return content;};var urlObj={'email':{'href':'mailto:','params':{},'attr':{},'subject':function(){return encodeURIComponent('Your friend has shared a '+getMetaContent('og:site_name')+' link with you');},'site':{},'utm_campaign':'email','utm_source':'share-by-email','utm_medium':'email','position':1},'facebook':{'href':'https://www.facebook.com/v2.8/dialog/feed','params':{'display':'popup'},'attr':{'link':'socialUrl',},'container':{'name':'data-title',},'image':{'picture':'src','description':'alt',},'site':{'app_id':function(){return getMetaContent('fb:app_id');},'redirect_uri':function(){var HDN=window.HDN||{};var siteUrl='';if(HDN.hasOwnProperty('siteUrl')){siteUrl=encodeURIComponent(HDN.siteUrl+'wclose.html');} 152return siteUrl;},},'utm_campaign':'fb','utm_source':'facebook.com','utm_medium':'referral','window':{'width':'626','height':'436'},'position':2},'twitter':{'href':'https://twitter.com/intent/tweet','params':{},'attr':{'url':'socialUrl',},'container':{'text':'data-title',},'site':{'via':function(){var HDN=window.HDN||{};var ta='';if(HDN.hasOwnProperty('twitterAcc')){ta=HDN.twitterAcc;} 153return ta;},},'utm_campaign':'twitter','utm_source':'t.co','utm_medium':'referral','window':{'width':'626','height':'436'},'position':3},'pinterest':{'href':'https://www.pinterest.com/pin/create/button/','params':{},'attr':{'url':'socialUrl',},'image':{'media':'src','description':'alt',},'site':{},'utm_campaign':'pinterest','utm_source':'pinterest.com','utm_medium':'referral','window':{'width':'750','height':'436'},'position':4},'reddit':{'href':'https://www.reddit.com/submit','params':{},'attr':{'url':'socialUrl',},'container':{'title':'data-title',},'site':{},'utm_campaign':'reddit','utm_source':'reddit.com','utm_medium':'referral','window':{'width':'823','height':'436'},'position':5},'google':{'href':'https://plus.google.com/share','params':{'hl':'en'},'attr':{'url':'socialUrl',},'site':{},'utm_campaign':'gplus','utm_source':'plus.url.google.com','utm_medium':'referral','window':{'width':'626','height':'436'},'position':6},'flipboard':{'href':'https://share.flipboard.com/bookmarklet/popout','params':{'v':'2','utm_campaign':'tools','utm_medium':'article-share',},'attr':{'url':'socialUrl',},'container':{'title':'data-title',},'site':{'t':function(){return(new Date).getTime();},'utm_source':function(){return window.location.hostname;},},'utm_campaign':'flipboard','utm_source':'flipboard.com','utm_medium':'referral','window':{'width':'626','height':'436'},'position':6},}[shareId];if(typeof urlObj!=='undefined'){var HDN=window.HDN||{};var utm_source=urlObj.utm_source;if(shareId==='facebook'&&HDN.site.indexOf('mobile')>-1){utm_source='m.'+utm_source;} 154utmParams='&utm_source='+utm_source+'&utm_medium='+urlObj.utm_medium;var url=urlObj.href+'?';var amp='';var shareContainer=elem.parentNode.parentNode;var cfi=shareContainer.dataset.frameIndex;if(!cfi){cfi=this.showingIndex;}else{cfi=parseInt(cfi);} 155if(this.hasOwnProperty('galleryStateIndexes')){cfi=this.galleryStateIndexes.indexOf(cfi);} 156var attrElem=this._items[cfi];var shareFrom='CMS%20Sharing%20Tools%20';if(HDN.site.indexOf('premium')>-1){shareFrom+='(Premium)';}else if(HDN.site.indexOf('mobile')>-1){shareFrom+='(Mobile)';}else{shareFrom+='(Desktop)';} 157var sTitle="";var sTElems=this._showing.getElementsByClassName('caption-title');if(sTElems.length>0){sTitle=sTElems[0].innerHTML;} 158var itemId='%23'+attrElem.dataset.itemId;if(attrElem.dataset.itemUrl!==undefined){itemId="";} 159var key,tAmp;for(key in urlObj.params){url+=amp+key+'='+urlObj.params[key];amp='&';} 160for(key in urlObj.attr){if(key=='url'||(shareId=='facebook'&&key=='link')){tAmp=(window.location.search.length>1)?'&':'?';url+=amp+key+'='+encodeURIComponent(window.location.href.replace(window.location.hash,'') 161+tAmp+"utm_campaign=")+encodeURIComponent(shareFrom) 162+encodeURIComponent(utmParams)+itemId;}else{url+=amp+key+'='+attrElem.dataset[urlObj.attr[key]];} 163amp='&';} 164for(key in urlObj.container){if(key==="name"&&sTitle!==""){url+=amp+key+'='+encodeURIComponent(sTitle);}else{url+=amp+key+'='+encodeURIComponent(this._outerContainer.getAttribute(urlObj.container[key]));} 165amp='&';} 166for(key in urlObj.image){url+=amp+key+'='+attrElem.getElementsByTagName('img')[0].getAttribute(urlObj.image[key]);amp='&';} 167for(key in urlObj.site){url+=amp+key+'='+urlObj.site[key]();amp='&';} 168if(shareId=='email'){tAmp=(window.location.search.length>1)?'&':'?';var body=encodeURIComponent(this._outerContainer.dataset.title)+'%0D%0A';body+=encodeURIComponent(window.location.href.replace(window.location.hash,'')+tAmp 169+'utm_campaign=')+encodeURIComponent(shareFrom)+encodeURIComponent(utmParams) 170+itemId+'%0D%0A%0D%0A' 171+encodeURIComponent('This message was sent via '+HDN.domain+'.');url+=amp+'subject='+urlObj.subject()+'&body='+body;document.location.href=url;}else if(shareFrom.indexOf('Mobile')===-1){window.open(url,shareId+'sharer','toolbar=0,status=0,width='+urlObj.window.width+',height='+urlObj.window.height);}else{window.open(url,'_blank');} 172try{var shareLocation='_inline';if(this.inFullscreenMode){shareLocation='_overlay';} 173HDN.sendAnalyticsData(shareId+'_share'+shareLocation+'|'+attrElem.dataset.itemId+'|'+this._outerContainer.dataset.id+'|'+urlObj.position);}catch(e){}}};HDNFlexGallery.prototype.handleTouchButtonEvent=function(elem,callback,tracker,cClass){return function(e){var eventType=e.type;if(cClass&&!e.target.classList.contains(cClass)){return;} 174var touch,d;switch(eventType){case('touchstart'):document.getElementsByTagName('html')[0].classList.add('touch');if(tracker){elem.setAttribute('data-touched','1');touch=e.touches[0]||e.changedTouches[0];tracker.startY=touch.pageY;d=document.documentElement.clientHeight?document.documentElement:document.body;tracker.scrollTop=d.scrollTop;tracker.noClick=true;}else{e.preventDefault();e.stopPropagation();callback(elem);} 175break;case('touchmove'):callback(elem);break;case('touchend'):document.getElementsByTagName('html')[0].classList.add('touch');if(tracker){if(typeof tracker.startY!=="undefined"){var sy=tracker.startY;var st,tst=tracker.scrollTop;d=document.documentElement.clientHeight?document.documentElement:document.body;st=d.scrollTop;tracker.startY=null;touch=e.touches[0]||e.changedTouches[0];var x=touch.pageX;var y=touch.pageY;if(elem.hasAttribute('data-touched')){if(Math.abs(st-tst)>5){}else{var br=elem.getBoundingClientRect();if(!(x<=br.left||x>=br.left+br.width||Math.abs(y-sy)>9)){e.preventDefault();e.stopPropagation();callback(elem);}} 176elem.removeAttribute('data-touched');}}} 177break;case('click'):e.preventDefault();e.stopPropagation();if(!tracker||(typeof tracker.startY==="undefined"||tracker.noClick!==true)){callback(elem);} 178break;}};};HDNFlexGallery.prototype.isThisDynamicLoader=function(elem){if(elem.hasAttribute('data-loader-id')){return elem.hasAttribute('data-loader-id');} 179return elem.hasAttribute('loader-id');};HDNFlexGallery.prototype.startDynamicLoader=function(elem){if(typeof(elem)==='undefined'){elem=this._showingWrap;} 180if(this.isThisDynamicLoader(elem)&&(!elem.hasAttribute('data-load-state')||elem.dataset.loadState!=='loaded')){var template=this._loader[this.loaderType].template(this.loaderId);
180if(template){elem.appendChild(template);} 181this._loader[this.loaderType].add(this.loaderId,elem);}};HDNFlexGallery.prototype.setDynamicLoader=function(elem){this.loaderType='';if(this.isThisDynamicLoader(elem)){if(elem.hasAttribute('data-loader-id')){this.loaderId=elem.dataset.loaderId;}else{this.loaderId=elem.getAttribute('loader-id');} 182if(typeof(this.loaderId)!=='undefined'){var loader=elem.getAttribute('class').match(/\s(\w+loader)/);if(loader){this.loaderType=loader[1];}}} 183return this.isDynamicLoader;};HDNFlexGallery.prototype.stopDynamicLoader=function(elem){var tempLoaderType;if(typeof(elem)!=='undefined'){elem=elem.getElementsByClassName(this.imgWrapSelector)[0];tempLoaderType=this.returnLoaderType(elem);}else{elem=this._showingWrap;} 184if(this.isThisDynamicLoader(elem)){var loader;if(tempLoaderType){loader=this._loader[tempLoaderType];}else{loader=this._loader[this.loaderType];} 185if(typeof(loader)!=="undefined"&&typeof(loader.remove)==='function'){try{if(loader.remove(elem)){return;}}catch(e){}} 186elem.setAttribute('data-load-state','queue');}};HDNFlexGallery.prototype.returnLoaderType=function(elem){if(this.isThisDynamicLoader(elem)){var loaderId=elem.dataset.loaderId;if(typeof(loaderId)!=='undefined'&&loaderId!==null){var loader=elem.getAttribute('class').match(/\s(\w+loader)/);if(loader){return loader[1];}}} 187return;};HDNFlexGallery.prototype.setLoaders=function(){this._loader={};this._loader.genericloader={'template':function(id){return'';},'add':function(id,target){var lt=target.parentNode.getElementsByClassName('loader-template')[0];if(lt===null||typeof lt==="undefined"){return;} 188target.innerHTML=lt.innerHTML;Array.apply(null,target.querySelectorAll('iframe[data-lazyload-src]')).forEach(function(ifs){ifs.setAttribute('src',ifs.dataset.lazyloadSrc);ifs.removeAttribute('data-lazyload-src');});Array.apply(null,target.querySelectorAll('iframe[lazyload-src]')).forEach(function(ifs){ifs.setAttribute('src',ifs.getAttribute('lazyload-src'));ifs.removeAttribute('lazyload-src');});Array.apply(null,target.querySelectorAll('span[data-loader-script]')).forEach(function(sps){var lscript=document.createElement('script');lscript.setAttribute('type','text/javascript');lscript.innerHTML=sps.innerHTML;target.appendChild(lscript);lt.parentNode.removeChild(lt);});target.attr('load-state','loaded');}};this._loader.taboolaloader={'template':function(id){return null;},'add':function(id,target){var lt=target.parentNode.getElementsByClassName('loader-template')[0];if(lt===null||typeof lt==="undefined"){return;} 189target.innerHTML=lt.innerHTML;Array.apply(null,target.querySelectorAll('div[data-id]')).forEach(function(did){did.setAttribute('id',did.dataset.id);did.removeAttribute('data-id');});Array.apply(null,target.querySelectorAll('span[data-loader-script]')).forEach(function(sps){var lscript=document.createElement('script');lscript.setAttribute('type','text/javascript');lscript.innerHTML=sps.innerHTML;target.appendChild(lscript);lt.parentNode.removeChild(lt);});target.setAttribute('load-state','loaded');},'remove':function(id,target){return true;}};this._loader.dfploader={'template':function(id){return null;},'add':function(id,target){var lt=target.parentNode.getElementsByClassName('loader-template')[0];if(lt===null||typeof lt==="undefined"){return;} 190target.innerHTML=lt.innerHTML;Array.apply(null,target.querySelectorAll('div[data-id]')).forEach(function(did){did.setAttribute('id',did.dataset.id);did.removeAttribute('data-id');});Array.apply(null,target.querySelectorAll('span[data-loader-script]')).forEach(function(sps){var lscript=document.createElement('script');lscript.setAttribute('type','text/javascript');lscript.innerHTML=sps.innerHTML;target.appendChild(lscript);lt.parentNode.removeChild(lt);});target.setAttribute('load-state','loaded');},'remove':function(id,target){return true;}};};HDNFlexGallery.prototype.updateGalleryState=function(noReset){var itemUrl=this._showing.dataset.itemUrl;if(!(this.showingIndex===0&&typeof(noReset)!=='undefined')){var stateChangeResult=window.History.replaceState({url:itemUrl,title:document.title},document.title,itemUrl);} 191var metaTitle=document.querySelector('meta[property="og:title"]');var metaUrl=document.querySelector('meta[property="og:url"]');var metaImage=document.querySelector('meta[property="og:image"]');if(metaTitle!==null&&typeof metaTitle!=="undefined"){metaTitle.setAttribute('content',this._showing.getElementsByClassName('caption-title')[0].innerHTML);} 192if(metaUrl!==null&&typeof metaUrl!=="undefined"){metaUrl.setAttribute('content',window.location.protocol+"//"+window.location.host+itemUrl);} 193if(metaImage!==null&&typeof metaImage!=="undefined"){var imgSelector='.'+this.imgWrapSelector+' img';var showingImg=this._showing.querySelector(imgSelector);if(showingImg!==null&&typeof showingImg!=="undefined"&&showingImg.hasAttribute('src')){metaImage.setAttribute('content',showingImg.getAttribute('src'));}} 194if(window.showFBCommentBlock){try{window.showFBCommentBlock(commentID);}catch(e){}}};HDNFlexGallery.prototype.announceEvent=function(eName,message,data){var event=document.createEvent('Event');if(typeof message==="undefined"){message="";} 195if(typeof data==="undefined"){data={};} 196event.initEvent(eName,true,true);event.message=message;event.time=new Date();event.details={eventData:data};document.dispatchEvent(event);};HDNFlexGallery.prototype.openiOSNativeViewer=function(){if(typeof HDNNative!=='undefined'&&typeof HDNNative.openGalleryWithDataAtIndex!=='undefined'&&typeof HDNNative.openGalleryWithDataAtIndex==='function'){var dataArray=[];this._items.filter(function(i){return i.querySelector('img[data-lazy-state]')!==null;}
196).forEach(function(i){var dataElem={};dataElem.image=(i.getAttribute('src')?i.getAttribute('src').replace(/\/[^\/]*(\.\w{3,4})$/g,'/960x960$1'):i.dataset.loadSrc.replace(/\/[^\/]*(\.\w{3,4})$/g,'/960x960$1'));dataElem.description=i.getAttribute('alt');dataArray.push(dataElem);});try{HDNNative.openGalleryWithDataAtIndex(dataArray,this.showingIndex);}catch(e){}}};var HDN=window.HDN||{};HDN.HDNFlexGalleryOnReady=function(){var glist=Array.apply(null,document.querySelectorAll(".hst-resgallery-container, .hst-lvgallery-container, .hst-gdgallery-container"));glist.forEach(function(cv,i,arr){if(cv.classList.contains('hst-blog')){return;} 197if(typeof HDNNative!=='undefined'&&typeof HDNNative.openGalleryWithDataAtIndex==='function'){cv.classList.add('app-wrapper');cv.querySelectorAll('.control-bar .overlaylink.thumbs').classList.add('hidden');} 198if(!document.querySelector('html.touch')&&!("ontouchend"in document)){document.getElementsByTagName('html')[0].classList.add('no-touch');} 199new HDNFlexGallery(cv,cv.getElementsByClassName('hst-resgallery')[0],cv.getElementsByClassName('hst-resgallerynav')[0],cv.getElementsByClassName('control-bar')[0],cv.querySelectorAll('.nav'),cv.getElementsByClassName('caption-remote')[0]);});};if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){HDN.HDNFlexGalleryOnReady();}else{document.addEventListener("DOMContentLoaded",function(){HDN.HDNFlexGalleryOnReady();});} 200HDNFlexGallery.prototype.onLoadStandard=function(){var self=this;self._overlay=self._outerContainer.getElementsByClassName('gallery-overlay-outer')[0];self._innerlay=self._overlay.getElementsByClassName('gallery-overlay-inner')[0];self._currentItemCount=Array.apply(null,self._outerContainer.getElementsByClassName('item-count-current'));self._totalItemCount=Array.apply(null,self._outerContainer.getElementsByClassName('item-count-total'));self._titleContainer=self._innerlay.getElementsByClassName('gallery-overlay-title-container')[0];self._overlayTitles=self._outerContainer.getElementsByClassName('photo-title')[0];self._inlineAnalytics=self._parentContainer.querySelectorAll('[data-hdn-analytics*="_inline|"]');self._socialLinks=self._socialLinks[0];self.inFullscreenMode=false;self.inExpandedMode=false;self.reportPageView=false;self.firstOverlayView=true;self.animateFrameClass='';if('replaceState'in history){self.replaceHash=function(newhash){if((''+newhash).charAt(0)!=='#')newhash='#'+newhash;history.replaceState('','',newhash);};}else{self.lastHash=location.hash;self.replaceHash=function(newhash){if(location.hash!==self.lastHash)history.back();location.hash=newhash;};} 201var HDN=window.HDN||{};if(HDN.hasOwnProperty('article')&&'jsonGalleries'in HDN.article){var jsonGalleryID=this._outerContainer.dataset.id;if(jsonGalleryID in HDN.article.jsonGalleries){var store=Object.assign({},HDN.article.jsonGalleries[jsonGalleryID]);store.metadata=Object.assign({},HDN.article.jsonGalleries.metadata);this.firstThumbLoadCount=(store.maxLowId?store.maxLowId:(store.count>15?15:store.count));this.jsonData={'items':[],'store':store,'complete':store.complete,'maxLowId':store.maxLowId,'minHighId':store.minHighId,'tmpCount':store.tmpCount,'lastId':store.lastId};if(!store.complete){document.addEventListener("HDNJsonGalleriesLoaded",function(){var jsonGalleryID=this._outerContainer.dataset.id;var store=Object.assign({},HDN.article.jsonGalleries[jsonGalleryID]);var items=[];for(var i=0;i<store.count;i++){items.push(store[i.toString()]);} 202this.jsonData.items=items;this.jsonData.store=store;var mediaCount=this.jsonData.metadata.mediaCount;this._totalItemCount.forEach(function(tic){tic.innerHTML=mediaCount;});var fi=parseInt(this._showing.dataset.frameIndex,10);this._currentItemCount.forEach(function(cic){cic.innerHTML=fi+1;});if(this.hasThumbs&&this.firstThumbLoadCount==this.jsonData.items.length){while(this._carouselUL.childNodes.length>0){this._carouselUL.removeChild(this._carouselUL.firstChild);} 203this.firstThumbLoadCount=-1;this.populateLastThumbs();} 204this.jsonData.complete=true;}.bind(this));} 205for(var k=0;k<store.count;k++){if(!store.complete&&store.maxLowId!==undefined&&k>
205store.maxLowId&&k<store.minHighId){k=store.minHighId;} 206this.jsonData.items[k]=store[k.toString()];} 207this.useInterstitial=false;if(store.hasOwnProperty('metadata')){this.jsonData.metadata=store.metadata;this.jsonData.metadata.mediaCount=store.count;['taboola','dfp'].forEach(function(i){if(store.metadata.hasOwnProperty(i)){this.useInterstitial=true;this.interstitialId=i;this.interstitialCounter=1;}}.bind(this));if(this.useInterstitial){var metaInterstitial=store.metadata[this.interstitialId];metaInterstitial.frameDivision=metaInterstitial['taboolaFrameCount']-1;if(this.jsonData.metadata.mediaCount<metaInterstitial['taboolaFrameCount']-1){this.jsonData.metadata.mediaCount++;metaInterstitial[this.interstitialId+'Frames']=1;}else{metaInterstitial[this.interstitialId+'Frames']=parseInt(store.count/metaInterstitial.frameDivision,10);if(metaInterstitial[this.interstitialId+'Frames']>0){this.jsonData.metadata.mediaCount=store.count+metaInterstitial[this.interstitialId+'Frames'];if(this.jsonData.metadata.mediaCount%metaInterstitial['taboolaFrameCount']>0){this.jsonData.metadata.mediaCount++;metaInterstitial[this.interstitialId+'Frames']++;}}} 208if(metaInterstitial.hasOwnProperty(this.interstitialId+'Slide')){metaInterstitial[this.interstitialId+'Slide']=metaInterstitial[this.interstitialId+'Slide'].replace(/<script.*?>/,'<span data-loader-script="add" style="display:none;">').replace('</script>','</span>').replace(' id="'+this.interstitialId+'-interstitial',' data-id="'+this.interstitialId+'-interstitial');} 209this.jsonData.metadata[this.interstitialId]=metaInterstitial;}}else{this.jsonData.metadata={mediaCount:store.count};} 210if(!this.jsonData.complete){var tmpMediaCount=this.jsonData.tmpCount;this.jsonData.offsetId=this.jsonData.minHighId-(this.jsonData.maxLowId+1);this.jsonData.minOffset=this.jsonData.maxLowId+1;if(this.useInterstitial){metaInterstitial=this.jsonData.metadata[this.interstitialId];var maxLowId=this.jsonData.maxLowId,minHighId=this.jsonData.minHighId;maxLowId+=parseInt(maxLowId/metaInterstitial.frameDivision,10);minHighId+=parseInt(minHighId/metaInterstitial.frameDivision,10);this.jsonData.offsetId=minHighId-(maxLowId+1);this.jsonData.minOffset=maxLowId+1;tmpMediaCount+=parseInt(tmpMediaCount/metaInterstitial.frameDivision,10);if(tmpMediaCount%metaInterstitial['taboolaFrameCount']>0){tmpMediaCount++;}} 211this._totalItemCount.forEach(function(tic){tic.innerHTML=tmpMediaCount;});} 212var jd=this.jsonData.metadata;this.lastIndex=jd.mediaCount-1;this._imgsLoadLazy=[null];this._interstitialLazyLoad=[null];this.thumbLazyLoadTail=1;var fIndex=1;for(var i=fIndex;i<jd.mediaCount;i++){if(this.useInterstitial&&((i+1)%jd[this.interstitialId]['taboolaFrameCount'])===0||i===jd.mediaCount-1){this._interstitialLazyLoad.push(1);this._imgsLoadLazy.push(null);}else{this._interstitialLazyLoad.push(null);this._imgsLoadLazy.push(1);fIndex++;}}}} 213if(self._thumbContainer){self._thumbs=Array.apply(null,self._thumbContainer.getElementsByClassName('thumb'));self.hasThumbs=(self._thumbs.length>0);self._carousel=self._thumbContainer.getElementsByClassName('carousel')[0];self._carouselUL=self._carousel.getElementsByTagName('ul')[0];if(self._lazyThumbs===undefined){self._lazyThumbs=self._thumbs.filter(function(t){var i=t.getElementsByTagName('img')[0];if(!i){i=t.getElementsByClassName('icon-thumb')[0];} 214if(i.hasAttribute('data-src')){return 1;} 215return null;});}}else{self.hasThumbs=false;} 216var usedHashLoading=false;if(window.location.hash!==''){var itemId=window.location.hash.substring(1);var showingId=this._showing.dataset.itemId;if(itemId!==showingId){var reqItem,reqItemIndex;if(this.hasOwnProperty('jsonData')&&itemId.indexOf('photo-')!==-1){itemId=parseInt(itemId.replace(/^photo-/,''),10);for(var i=0;i<this.jsonData.items.length;i++){if(this.jsonData.items[i]&&this.jsonData.items[i].id===itemId){reqItemIndex=i;if(this.useInterstitial){reqItemIndex+=parseInt(reqItemIndex/this.jsonData.metadata[this.interstitialId].frameDivision,10);} 217reqItem=this.setGalleryStateFromStore(reqItemIndex);break;}}}else{reqItem=this._itemContainer.querySelector('[data-item-id="'+itemId+'"]');} 218if(reqItem&&reqItem!==this._showing){this.showItem(reqItem);usedHashLoading=true;}}} 219if(!usedHashLoading){if(this.hasOwnProperty('jsonData')){var ifi=this._itemContainer.children[0].dataset.frameIndex;this.setGalleryStateFromStore(ifi);} 220this.loadLazy(this._showing);this.setDynamicLoader(this._showingWrap);this.startDynamicLoader();this._itemContainer.style.height="";} 221if(self._items.length>1){self.animateFrameClass='active';self.initSwipe=function(e){self.swipe(self._showing,e);};var touch=true;self.scrollSwipe={maxTime:1500,maxHDistance:10,maxVDistance:10,twoWide:(self.lastIndex===1?true:false),swipeRate:.2,startEvent:(touch)?'touchstart':'mousedown',moveEvent:(touch)?'touchmove':'mou
221semove',endEvent:(touch)?'touchend':'mouseup',timingFunction:'ease-out',swipeRates:{480:.092,696:.136,768:.15,900:.176,1024:.2},noHover:false};var gf=Array.apply(null,self._outerContainer.getElementsByClassName(self._itemContainer.getAttribute('class')));gf.forEach(function(f){var evts=['touchstart','touchmove','touchend'];for(var i=0;i<evts.length;i++){f.addEventListener(evts[i],self.initSwipe);}});} 222self.setLineup(self._showing);if(self._interstitialLazyLoad[self.nextIndex]&&!self._nextWrap.classList.contains('dfploader')){self.setDynamicLoader(self._nextWrap);self.startDynamicLoader(self._nextWrap);} 223var ags=self._outerContainer.parentNode.getElementsByClassName('asset_gallery slideshow')[0];if(typeof ags!=="undefined"&&ags!==null){self.updateGalleryState(true);} 224self._closeDFP=null;if(self.interstitialId==='dfp'){self._closeDFP=self._itemContainerParent.getElementsByClassName('close-dfp')[0];if(self._closeDFP){self._closeDFP.addEventListener('click',function(e){this.classList.add('hidden');self._navs[parseInt(this.dataset.direction,10)].click();e.stopPropagation();e.preventDefault();if(self.inFullscreenMode){var gco=self._overlay.querySelector('.gallery-close-overlay');if(gco){gco.classList.remove('hidden');}}});}}
224 225self._navs.map(function(n){var analyticsElem=n.querySelector('[data-hdn-analytics]');if(analyticsElem!==null){n.querySelector('[data-hdn-analytics]').unbind('click');} 226n.addEventListener("click",function(event){event.stopPropagation();event.preventDefault();self.reportPageView=true;self.announceEvent("HDNGalleryActionOnReadyState","HDN Gallery Action Ready");var elem=self._next,direction='forward',fIndex=self.nextIndex;if(n.classList.contains('left')){elem=self._prev;direction='reverse';fIndex=self.prevIndex;} 227if(self.hasOwnProperty('jsonData')){var siElem=self.setGalleryStateFromStore(fIndex);if(siElem!==undefined){elem=siElem;}} 228self.showItem(elem,direction);try{HDN.sendAnalyticsData(HDN.getAnalyticsData(n,true));}catch(e){} 229self.announceEvent("HDNGalleryActionOnChangeState","HDN Gallery Actions Complete");if(self._interstitialLazyLoad[self.nextIndex]&&!self._nextWrap.classList.contains('dfploader')){self.setDynamicLoader(self._nextWrap);self.startDynamicLoader(self._nextWrap);}});});self._itemContainerParent.addEventListener('click',function(e){if(self._showing.classList.contains('taboola-frame')||self._showing.classList.contains('dfp-frame')){return;} 230e.preventDefault();e.stopPropagation();if(self.isGridView&&!self.inFullscreenMode&&window.innerWidth>736){try{var pds=e.target.parentNode.parentNode;if(pds.dataset.itemId){HDN.sendAnalyticsData('gallery_overlay_open_from_grid|'+pds.dataset.itemId+'|'+pds.dataset.itemId+'|0');}}catch(e){}} 231var siElem,pnElem;if(!self.isGridView||(self.isGridView&&(self.inFullscreenMode||self._outerContainer.classList.contains('grid-small')))){self.reportPageView=true;pnElem=self._next;if(self.hasOwnProperty('jsonData')){siElem=self.setGalleryStateFromStore(self.nextIndex);if(siElem!==undefined){pnElem=siElem;}} 232self.showItem(pnElem,'forward');if(self._interstitialLazyLoad[self.nextIndex]&&!self._nextWrap.classList.contains('dfploader')){self.setDynamicLoader(self._nextWrap);self.startDynamicLoader(self._nextWrap);} 233try{HDN.sendAnalyticsData(HDN.getAnalyticsData(this,true));}catch(e){} 234self.announceEvent("HDNGalleryActionOnChangeState","HDN Gallery Actions Complete");if(self._closeDFP){if(self.inFullscreenMode){gco=self._overlay.querySelector('.gallery-close-overlay');} 235if(self._showing.classList.contains('dfp-frame')){self._closeDFP.dataset.direction=1;self._closeDFP.classList.remove('hidden');if(gco){if(document.getElementsByTagName('html')[0].classList.contains('touch')){gco.classList.add('hidden');}}}else{self._closeDFP.classList.add('hidden');if(gco){gco.classList.remove('hidden');}}}}else{if(!self.inFullscreenMode){var ei=-1;var telem=e.target;if(telem.classList.contains('img-wrap')){ei=parseInt(telem.parentNode.dataset.frameIndex,10);}else{telem=telem.parentNode;if(telem.classList.contains('img-wrap')){ei=parseInt(telem.parentNode.dataset.frameIndex,10);}} 236if(ei<0){return;} 237pnElem=self._items[ei];if(self.hasOwnProperty('jsonData')){siElem=self.setGalleryStateFromStore(ei);if(siElem!==undefined){pnElem=siElem;}} 238self.showItem(pnElem,'forward');self.showOverlay('fullscreen');
238try{hearstRefreshInterstitialAds(['GO300']);}catch(e){}}}});if(self.hasThumbs){self.populateFirstThumbs();} 239var olay=self._controlBar.getElementsByClassName('overlaylink fullscreen')[0];self.overlaylinkTouch={};olay.addEventListener('touchstart',self.handleTouchButtonEvent(olay,self.openOverlay.bind(self),self.overlaylinkTouch));olay.addEventListener('touchend',self.handleTouchButtonEvent(olay,self.openOverlay.bind(self),self.overlaylinkTouch));olay.addEventListener('click',self.handleTouchButtonEvent(olay,self.openOverlay.bind(self),self.overlaylinkTouch));var ilay=self._innerlay.getElementsByClassName('gallery-close-overlay')[0];if(ilay!==null){ilay.addEventListener('touchstart',self.handleTouchButtonEvent(ilay,self.closeOverlay.bind(self)));ilay.addEventListener('click',self.handleTouchButtonEvent(ilay,self.closeOverlay.bind(self)));} 240var tco=self._innerlay.getElementsByClassName('thumbs-close-overlay')[0];if(tco!==null){tco.addEventListener('touchstart',self.handleTouchButtonEvent(tco,self.closeThumbs.bind(self)));tco.addEventListener('click',self.handleTouchButtonEvent(tco,self.closeThumbs.bind(self)));} 241var othmb=Array.apply(null,self._controlBar.querySelectorAll('.overlaylink.thumbs, .thumblink'));if(self.hasThumbs&&othmb.length>0){self.thumblinkTouch={};othmb.forEach(function(tl){tl.addEventListener('touchstart',self.handleTouchButtonEvent(tl,self.openThumbs.bind(self),self.thumblinkTouch));tl.addEventListener('touchend',self.handleTouchButtonEvent(tl,self.openThumbs.bind(self),self.thumblinkTouch));tl.addEventListener('click',self.handleTouchButtonEvent(tl,self.openThumbs.bind(self),self.thumblinkTouch));});} 242if(self.mode!=="grid"){self._controlBar.getElementsByClassName('share-toggle')[0].onmouseover=function(event){if(self.inFullscreenMode)return;self._socialLinks.classList.remove('hidden');};self._socialLinks.onmouseover=function(event){if(self.inFullscreenMode)return;self._socialLinks.classList.remove('hidden');};self._socialLinks.onmouseout=function(event){if(self.inFullscreenMode)return;self._socialLinks.classList.add('hidden');};self.expandShareToggle=function(event){self._socialLinks.classList.remove('hidden');setTimeout(function(){self._socialLinks.classList.add('hidden');},2000);};self.expandShareToggleTouch={};var stgl=self._controlBar.getElementsByClassName('share-toggle')[0];stgl.addEventListener('touchstart',self.handleTouchButtonEvent(stgl,self.expandShareToggle.bind(self),self.expandShareToggleTouch));stgl.addEventListener('touchend',self.handleTouchButtonEvent(stgl,self.expandShareToggle.bind(self),self.expandShareToggleTouch));stgl.addEventListener('click',self.handleTouchButtonEvent(stgl,self.expandShareToggle.bind(self),self.expandShareToggleTouch));} 243self.sociallinkTouch={};Array.apply(null,self._socialLinks.querySelectorAll('.socialIcon[data-share-id]')).forEach(function(si){si.addEventListener('touchstart',self.handleTouchButtonEvent(si,self.makeSocialCall.bind(self),self.sociallinkTouch));si.addEventListener('touchend',self.handleTouchButtonEvent(si,self.makeSocialCall.bind(self),self.sociallinkTouch));si.addEventListener('click',self.handleTouchButtonEvent(si,self.makeSocialCall.bind(self),self.sociallinkTouch));});this.thumbsScrollStartPos=0;this.thumbsScrollLastPos=0;this.thumbScrollRegistered=false;self.thumbItemTouch={};this._carousel.addEventListener('touchmove',self.handleTouchButtonEvent(this._carousel,function(){self.thumbScrollRegistered=true;}));this._carousel.addEventListener('touchend',self.handleTouchButtonEvent(this._carousel,function(c){self.thumbsScrollLastPos=c.scrollTop;},{startY:null}));self._thumbs.map(function(t){t=t.getElementsByTagName('a')[0];t.addEventListener('click',self.handleTouchButtonEvent(t,self.thumbEvent.bind(self)));});self.toggleCaption=function(c){var self=this;var cap;if(self._overlay.classList.contains('caption')){self._overlay.classList.remove('caption');cap=self._controlPanel.getElementsByClassName('caption');if(cap.length!==0){cap[0].classList.remove('open');}}else{self._overlay.classList.add('caption');cap=self._controlPanel.getElementsByClassName('caption');if(cap.length!==0){cap[0].classList.add('open');}}};self.expandCaptionToggleTouch={};var clks=self._controlBar.getElementsByClassName('captionlink')[0];if(clks!==null){clks.addEventListener('touchstart',self.handleTouchButtonEvent(clks,self.toggleCaption.bind(self)));clks.addEventListener('click',self.handleTouchButtonEvent(clks,self.toggleCaption.bind(self)));} 244self.toggleMoreCaption=function(){self=this;self._outerContainer.classList.toggle('caption');try{HDN.sendAnalyticsData(HDN.getAnalyticsData(this,true));}catch(e){}};self.moreCaptionLinkToggle={};self._caption.addEventListener('touchstart',self.handleTouchButtonEvent(self._caption,self.toggleMoreCaption.bind(self),this.moreCaptionLinkToggle,'more-caption'));self._caption.addEventListener('touchend',self.handleTouchButtonEvent(self._caption,self.toggleMoreCaption.bind(self),this.moreCaptionLinkToggle,'more-caption'));self._caption.addEventListener('click',self.handleTouchButtonEvent(self._caption,self.toggleMoreCaption.bind(self),this.moreCaptionLinkToggle,'more-caption'));document.addEventListener('keydown',function(event){var el=self._showing;var rect=el.getBoundingClientRect();var pnElem,siElem;var gco=null;if(!(rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth))){return;}
245if(event.keyCode==27){if(self.inFullscreenMode){self.hideOverlay();try{HDN.sendAnalyticsData(HDN.getAnalyticsData(self._innerlay.getElementsByClassName('gallery-close-overlay')[0],true));}catch(e){}}}else if(event.keyCode==37){pnElem=self._prev;if(self.hasOwnProperty('jsonData')){siElem=self.setGalleryStateFromStore(self.prevIndex);if(siElem!==undefined){pnElem=siElem;}} 246self.reportPageView=true;self.showItem(pnElem,'reverse');try{HDN.sendAnalyticsData(HDN.getAnalyticsData(self._navs[0],true));}catch(e){} 247self.announceEvent("HDNGalleryActionOnChangeState","HDN Gallery Actions Complete");if(self._closeDFP){if(self.inFullscreenMode){gco=self._overlay.querySelector('.gallery-close-overlay');} 248if(self._showing.classList.contains('dfp-frame')){self._closeDFP.dataset.direction=0;self._closeDFP.classList.remove('hidden');if(gco){if(document.getElementsByTagName('html')[0].classList.contains('touch')){gco.classList.add('hidden');}}}else{self._closeDFP.classList.add('hidden');if(gco){gco.classList.remove('hidden');}}}}else if(event.keyCode==39){pnElem=self._next;if(self.hasOwnProperty('jsonData')){siElem=self.setGalleryStateFromStore(self.nextIndex);if(siElem!==undefined){pnElem=siElem;}} 249self.reportPageView=true;self.showItem(pnElem,'forward');try{HDN.sendAnalyticsData(HDN.getAnalyticsData(self._navs[1],true));}catch(e){} 250if(self._interstitialLazyLoad[self.nextIndex]&&!self._nextWrap.classList.contains('dfploader')){self.setDynamicLoader(self._nextWrap);self.startDynamicLoader(self._nextWrap);} 251self.announceEvent("HDNGalleryActionOnChangeState","HDN Gallery Actions Complete");if(self._closeDFP){if(self.inFullscreenMode){gco=self._overlay.querySelector('.gallery-close-overlay');} 252if(self._showing.classList.contains('dfp-frame')){self._closeDFP.dataset.direction=1;self._closeDFP.classList.remove('hidden');if(gco){if(document.getElementsByTagName('html')[0].classList.contains('touch')){gco.classList.add('hidden');}}}else{self._closeDFP.classList.add('hidden');if(gco){gco.classList.remove('hidden');}}}}});window.addEventListener('resize',function(g){return function(e){if(g.isGridView){var isGridSmall=((window.innerWidth||document.documentElement.clientWidth)<768);if(g.isGridSmall!==isGridSmall){if(isGridSmall){g._outerContainer.classList.add('grid-small');g._itemContainer.classList.add('grid-small');}else{g._outerContainer.classList.remove('grid-small');g._itemContainer.classList.remove('grid-small');} 253g.isGridSmall=isGridSmall;}}};}(self));};HDNFlexGallery.prototype.thumbEvent=function(t){t=t.parentNode;if(this.thumbScrollRegistered){this.thumbsScrollLastPos=this._carousel.scrollTop;this.thumbScrollRegistered=false;return false;} 254if(this._thumbs[this.showingIndex]&&this._thumbs[this.showingIndex].classList){this._thumbs[this.showingIndex].classList.remove('selected');} 255t.classList.add('selected');this.toggleThumbContainer();this.reportPageView=true;var ei=parseInt(t.dataset.frameIndex,10);var pnElem=this._items[ei];if(this.hasOwnProperty('jsonData')){var siElem=this.setGalleryStateFromStore(ei);if(siElem!==undefined){pnElem=siElem;}} 256this.showItem(pnElem);try{var HDN=window.HDN||{};HDN.sendAnalyticsData(HDN.getAnalyticsData(t.getElementsByClassName('hdn-analytics')[0],true));}catch(e){} 257if(this._interstitialLazyLoad[this.nextIndex]&&!this._nextWrap.classList.contains('dfploader')){this.setDynamicLoader(this._nextWrap);this.startDynamicLoader(this._nextWrap);} 258if(self._closeDFP){var gco=null;if(self.inFullscreenMode){gco=self._overlay.querySelector('.gallery-close-overlay');} 259if(self._showing.classList.contains('dfp-frame')){self._closeDFP.dataset.direction=1;self._closeDFP.classList.remove('hidden');if(gco){if(document.getElementsByTagName('html')[0].classList.contains('touch')){gco.classList.add('hidden');}}}else{self._closeDFP.classList.add('hidden');if(gco){gco.classList.remove('hidden');}}}};HDNFlexGallery.prototype.toggleThumbContainer=function(elem,fast){if(typeof HDNNative!=='undefined'&&typeof HDNNative.openGalleryWithDataAtIndex==='function'&&!this.inFullscreenMode){return;} 260fast='fast';var header=((document.documentElement.clientHeight||window.innerWidth)>
260767)?'calc(100% - 61px)':'calc(100% - 64px)';var inFullscreenMode=this.inFullscreenMode;var thumbsCloseOverlay=this._titleContainer.getElementsByClassName('thumbs-close-overlay')[0];var overlayTitle=this._titleContainer.getElementsByClassName('gallery-overlay-title')[0];if(fast==='fast'){this._thumbContainer.style.overflow="";this._thumbContainer.classList.toggle('hidden');if(this._thumbContainer.classList.contains('hidden')){this._controlPanel.classList.remove('hidden');thumbsCloseOverlay.classList.add('hidden');this._overlay.classList.remove('thumbs');overlayTitle.classList.remove('thumbs');}else{thumbsCloseOverlay.classList.remove('hidden');this._overlay.classList.add('thumbs');overlayTitle.classList.add('thumbs');this._carousel.scrollTop=this.thumbsScrollLastPos;if(document.getElementsByTagName('html')[0].classList.contains('ui-mobile')){this._controlPanel.classList.add('hidden');} 261this.populateLastThumbs();}}else{this._thumbContainer.style.height=(!this._thumbContainer.classList.contains('hidden')?header:0);this._thumbContainer.classList.remove('hidden');this._thumbContainer.style.overflow='';if(inFullscreenMode){if(this._thumbContainer.style.height===0){thumbsCloseOverlay.classList.add('hidden');this._overlay.classList.add('thumbs');}else{this._overlay.classList.remove('thumbs');thumbsCloseOverlay.classList.remove('hidden');}}}};HDNFlexGallery.prototype.escapeHtml=function(text){var map={'&':'&','<':'<','>':'>','"':'"',"'":'''};if(typeof text==='undefined'){return;} 262return text.replace(/[&<>"']/g,function(m){return map[m];});};HDNFlexGallery.prototype.renderTpl=function(tpl,data){var output='',template=document.getElementById(tpl);if(template!==null){output=template.innerHTML;if('replace'in template.dataset){var tVars=template.dataset.replace.split(',');tVars.forEach(function(v){if(data.hasOwnProperty(v)){output=output.replace('{{'+v+'}}',data[v]);}});}} 263return output;};HDNFlexGallery.prototype.frameStore=document.createDocumentFragment();HDNFlexGallery.prototype.renderFrameToStore=function(index){var md=this.jsonData.metadata;if(index>md.mediaCount-1){return;} 264var item;var d=document.createElement('div');if(this.useInterstitial&&(((index+1)%md[this.interstitialId]['taboolaFrameCount'])===0||index===md.mediaCount-1)){var fKey=(this.interstitialId==='taboola'?'tbla':(this.interstitialId==='dfp'?'dfp':''));var fID=(this.interstitialId==='taboola'?'item-'+md[this.interstitialId][this.interstitialId+'SlideId']:'dfpAd');item={'fid':(fID+'-'+fKey+'-'+this.interstitialCounter),'index':index,'adCounter':this.interstitialCounter++};if(this.interstitialId==='taboola'){item[this.interstitialId+'Slide']=md[this.interstitialId][this.interstitialId+'Slide'];var rexpigt=new RegExp('(interstitial(.)gallery.thumbnails)',"gi");item[this.interstitialId+'Slide']=item[this.interstitialId+'Slide'].replace(rexpigt,"$1$2"+(index+1));} 265d.innerHTML=this.renderTpl(this.interstitialId+'Frame.tpl',item).trim();}else{var itemIndex=index;if(this.useInterstitial){itemIndex-=parseInt(index/md[this.interstitialId]['taboolaFrameCount'],10);} 266item=Object.assign({},this.jsonData.items[itemIndex]);item.fid='photo-'+item.id;item.photoBaseUrl=this.jsonData.metadata.photoBaseUrl;item.imgFormatStyle=this.imgFormatStyle;if(item.hasOwnProperty('format')&&item.format==='gallery_3x2'){item.imgFormatStyle=this.imgCropFormatStyle;} 267item.quality=(item.hasOwnProperty('quality')?item.quality:"");item.index=index;item.captionTruncated=(item.captionDiff?item.captionTruncated:item.caption);item.captionStripped=this.escapeHtml(item.captionTruncated);if(item.captionDiff){item.captionTruncated+='<a class="more-caption"> ... more</a>';item.caption+='<a class="more-caption"> ... less</a>';} 268item.orientation=(item.orientation==='l'?'landscape':'portrait');item.captions=((item.hasOwnProperty('caption')&&item.caption!=="")?this.renderTpl("captions.tpl",item):'');item.credits=((item.hasOwnProperty('credits')&&item.credits!=="")?this.renderTpl("credits.tpl",item):'');item.resaleLink=(item.hasOwnProperty('resaleLink')?this.renderTpl("resaleLink.tpl",item):'');
268if(this._imgsLoadLazy[index]===null){item.lazyState='loaded';item.imgSrcAttribute='src';}else{item.lazyState='queue';item.imgSrcAttribute='data-src';} 269item.img=((item.hasOwnProperty('url')&&item.url!=="")?this.renderTpl("img.tpl",item):'');d.innerHTML=this.renderTpl("frame.tpl",item).trim();} 270var elem=d.children[0];this.frameStore.appendChild(elem);return elem;};HDNFlexGallery.prototype.thumbStore=document.createDocumentFragment();HDNFlexGallery.prototype.renderThumbToStore=function(index){var md=this.jsonData.metadata;if(index>md.mediaCount-1){return;} 271var item=Object.assign({},this.jsonData.items[index]);var d=document.createElement('div');item.fid='photo-'+item.id;var reqItemIndex=index;if(this.useInterstitial){reqItemIndex+=parseInt(reqItemIndex/this.jsonData.metadata[this.interstitialId].frameDivision,10);} 272item.index=reqItemIndex;item.photoBaseUrl=this.jsonData.metadata.photoBaseUrl;item.imgSrcAttribute='data-src';item.selectedClass=(this.showingIndex===reqItemIndex?"selected":"");item.img=((item.hasOwnProperty('url')&&item.url!=="")?this.renderTpl("thumbImg.tpl",item):'');d.innerHTML=this.renderTpl("thumb.tpl",item).trim();var elem=d.firstElementChild;var ta=elem.getElementsByTagName('a')[0];ta.addEventListener('click',this.handleTouchButtonEvent(ta,this.thumbEvent.bind(this)));this.thumbStore.appendChild(elem);return elem;};HDNFlexGallery.prototype.renderGalleryStateThroughStore=function(indexes,showingIndex){var elem,si;var itemsIndexes=Array.apply(null,this._itemContainer.children).map(function(ics){return parseInt(ics.dataset.frameIndex,10);});showingIndex=parseInt(showingIndex,10);var ioi;var overlap=false;var generated=false;var headElements=document.createDocumentFragment();for(var i=0;i<indexes.length;i++){ioi=itemsIndexes.indexOf(indexes[i]);if(ioi>-1){if(overlap===false){headElements.appendChild(this.frameStore);} 273overlap=true;elem=this._itemContainer.children[ioi];}else{elem=this.renderFrameToStore(indexes[i]);generated=true;} 274if(indexes[i]===showingIndex){si=elem;}} 275if(!generated&&itemsIndexes.length===indexes.length){var cs=[];for(var i=0;i<indexes.length;i++){ioi=itemsIndexes.indexOf(indexes[i]);cs.push(this._itemContainer.children[ioi]);} 276for(var c in cs){this._itemContainer.appendChild(cs[c]);} 277return si;} 278var staleIndexes=itemsIndexes.filter(function(ii){return(indexes.indexOf(ii)===-1);});var staleElements=[];for(var i=0;i<staleIndexes.length;i++){staleElements.push(this._itemContainer.children[itemsIndexes.indexOf(staleIndexes[i])]);} 279this._itemContainer.insertBefore(headElements,this._itemContainer.firstChild);this._itemContainer.appendChild(this.frameStore);for(var i=0;i<staleElements.length;i++){this._itemContainer.removeChild(staleElements[i]);} 280return si;};HDNFlexGallery.prototype.setGalleryStateFromStore=function(showingIndex){var indexes=this.setStateIndexes(showingIndex);while(this.frameStore.childNodes.length>0){this.frameStore.removeChild(this.frameStore.firstChild);} 281var si=this.renderGalleryStateThroughStore(indexes,showingIndex);this._items=Array.apply(null,this._itemContainer.querySelectorAll('li'));this._captions=this._items.map(function(i){return i.getElementsByClassName('caption')[0];});this.galleryStateIndexes=indexes;return si;};HDNFlexGallery.prototype.setStateIndexes=function(showingIndex){var toggleDirection='forward';if(showingIndex===undefined){showingIndex=0;}else{showingIndex=parseInt(showingIndex,10);} 282var indexes=[showingIndex],maxLowId,minHighId,curVal;if(!this.jsonData.complete){maxLowId=this.jsonData.maxLowId;minHighId=this.jsonData.minHighId;if(this.useInterstitial){maxLowId+=parseInt(maxLowId/this.jsonData.metadata[this.interstitialId].frameDivision,10);minHighId+=parseInt(minHighId/this.jsonData.metadata[this.interstitialId].frameDivision,10);}} 283for(var i=1;i<=this.lastIndex&&i<5;i++){if(toggleDirection==='forward'){curVal=parseInt(indexes[indexes.length-1],10)+1;if(curVal>this.lastIndex){curVal=0;} 284if(!this.jsonData.complete){if(curVal>maxLowId&&curVal<minHighId){curVal=minHighId;}} 285indexes.push(curVal);toggleDirection='reverse';}else{curVal=parseInt(indexes[0],10);curVal--;if(curVal===-1){curVal=this.lastIndex;} 286if(!this.jsonData.complete){if(curVal<minHighId&&curVal>maxLowId){curVal=maxLowId;}} 287indexes.unshift(curVal);toggleDirection='forward';}} 288return indexes;};HDNFlexGallery.prototype.populateFirstThumbs=function(){for(var i=1;i<=this.firstThumbLoadCount;i++){this.renderThumbToStore(i);} 289this._carouselUL.appendChild(this.thumbStore);};HDNFlexGallery.prototype.populateLastThumbs=function(){for(var i=this.firstThumbLoadCount+1;i<this.jsonData.items.length;i++){if(typeof this.jsonData.items[i]!=='undefined'){this.renderThumbToStore(i);}} 290this.firstThumbLoadCount=this.jsonData.items.length;this._carouselUL.appendChild(this.thumbStore);};HDNFlexGallery.prototype.revealImageSource=function(elem){var ds=elem.querySelector('img[data-src]');if(ds===null){return false;} 291if(ds!==null){ds.setAttribute('src',ds.dataset.src);ds.removeAttribute('data-src');}};HDNFlexGallery.prototype.showOverlay=function(expantionType,toParent){if(expantionType==='fullscreen'&&typeof HDNNative!=='undefined'&&typeof HDNNative.openGalleryWithDataAtIndex==='function'){window.HDN_ResponsiveGallery.fullscreen=this;this.openiOSNativeViewer();}else{if(expantionType=='fullscreen'){this.inFullscreenMode=true;window.HDN_ResponsiveGallery.fullscreen=this;}else{this.inExpandedMode=true;} 292if(typeof(this._uniquePlaceholder)==='undefined'){this._uniquePlaceholder=document.createElement('div');this._uniquePlaceholder.classList.add('placeholder');this._uniquePlaceholder.style.display="none";this._outerContainer.parentNode.insertBefore(this._uniquePlaceholder,this._outerContainer.nextElementSibling);} 293if(this.inFullscreenMode){var adhesion=document.getElementById('hst-adhesion');if(adhesion!==null&&typeof adhesion!=="undefined"){document.getElementById('hst-adhesion').classList.toggle('unlocked');} 294var b=document.getElementsByTagName('body')[0];b.insertBefore(this._overlay,b.firstChild);this._overlay.style.display="block";this._overlay.classList.remove('hidden');this._overlay.classList.add('fullscreen');b.classList.add('hst-resgallery-fullscreen');var ipad=document.querySelector('html.ipad');if(ipad!==null){ipad.style.overflow='hidden';} 295this.announceEvent("HDNGalleryActionOnFullscreenLoad","HDN Gallery Action Entering Fullscreen");}else if(this.inExpandedMode){} 296var sl=this._socialLinks;this._itemContainer.parentNode.appendChild(sl);sl.classList.remove('hidden');sl.classList.add('showing');var br=this._outerContainer.getBoundingClientRect();this._uniquePlaceholder.style.width=br.width;this._uniquePlaceholder.style.height=br.height;this._uniquePlaceholder.style.display="block";this._innerlay.appendChild(this._outerContainer);if(this.inFullscreenMode){if(document.querySelector('html.touch')!==null){this._overlay.classList.add('caption');var cap=this._controlPanel.getElementsByClassName('caption');if(cap.length!==0){cap[0].classList.add('open');}}}}};HDNFlexGallery.prototype.hideOverlay=function(expantionType){this._uniquePlaceholder.style.display="none";var pn=this._uniquePlaceholder.parentNode;pn.insertBefore(this._outerContainer,this._uniquePlaceholder);this._outerContainer.appendChild(this._overlay);this._overlay.style.display="none";this._overlay.classList.add('hidden');this._overlay.classList.remove('fullscreen');this._overlay.classList.remove('expanded');this._overlay.setAttribute('style','');document.getElementsByTagName('body')[0].classList.remove('hst-resgallery-fullscreen');this._innerlay.setAttribute('style','');this._socialLinks.classList.add('hidden');if(this.hasThumbs&&(this._thumbContainer.getBoundingClientRect().height!==0||!this._thumbContainer.classList.contains('hidden'))){this._thumbContainer.style.height="";this._thumbContainer.classList.add('hidden');} 297if(expantionType==="fullscreen"){this._controlBar.parentNode.insertBefore(this._socialLinks,this._controlBar);var ip=document.querySelector('html.ipad');if(ip!==null){ip.style.overflow='auto';} 298var adhesion=document.getElementById('hst-adhesion');if(adhesion!==null&&typeof adhesion!=="undefined"){document.getElementById('hst-adhesion').classList.toggle('unlocked');} 299window.HDN_ResponsiveGallery.fullscreen=undefined;this.inFullscreenMode=false;this.announceEvent("HDNGalleryActionOnFullscreenUnload","HDN Gallery Action Leaving Fullscreen");}else if(this.inExpandedMode){this.inExpandedMode=false;}};HDNFlexGallery.prototype.openOverlay=function(elem){if(elem.classList.contains('fullscreen')||elem.classList.contains('thumbs')){if(!this.inFullscreenMode){this.inFullscreenMode=true;this.showOverlay('fullscreen');if(typeof this.initCaptionsSwipe!=="function"){this.initCaptionsSwipe=this.initSwipe;} 300var of=this._overlay.getElementsByClassName(this._caption.getAttribute('class'))[0];if(of!==null){var evts=['touchstart','touchmove','touchend'];for(var i=0;i<evts.length;i++){of.addEventListener(evts[i],this.initCaptionsSwipe);}} 301if(this.hasThumbs&&elem.classList.contains('thumbs')){this.toggleThumbContainer((event.type==='touchend'?this._showing:this._outerContainer));}
302try{hearstRefreshInterstitialAds(['GO300']);}catch(e){}}}else if(elem.classList.contains('expanded')){if(!this.inExpandedMode){this.showOverlay('expanded',document.getElementsByClassName('span-21b')[0]);}} 303try{var HDN=window.HDN||{};HDN.sendAnalyticsData(HDN.getAnalyticsData(elem,true));}catch(e){}};HDNFlexGallery.prototype.closeOverlay=function(elem){this.inFullscreenMode=false;this._socialLinks.classList.add('closed');if(this.hasThumbs&&!this._thumbContainer.classList.contains('hidden')){this.toggleThumbContainer();} 304var of=this._overlay.getElementsByClassName(this._caption.getAttribute('class'))[0];if(of!==null){var evts=['touchstart','touchmove','touchend'];for(var i=0;i<evts.length;i++){of.removeEventListener(evts[i],this.initCaptionsSwipe);}} 305this.hideOverlay('fullscreen');try{var HDN=window.HDN||{};HDN.sendAnalyticsData(HDN.getAnalyticsData(elem,true));}catch(e){}};HDNFlexGallery.prototype.openThumbs=function(elem){if(!this.inFullscreenMode){this.showOverlay('fullscreen');} 306this.toggleThumbContainer();if(typeof this.initCaptionsSwipe!=="function"){this.initCaptionsSwipe=this.initSwipe;var of=this._overlay.getElementsByClassName(this._caption.getAttribute('class'))[0];if(of!==null){var evts=['touchstart','touchmove','touchend'];var self=this;for(var i=0;i<evts.length;i++){of.addEventListener(evts[i],self.initCaptionsSwipe);}}} 307try{var HDN=window.HDN||{};HDN.sendAnalyticsData(HDN.getAnalyticsData(elem,true));}catch(e){}};HDNFlexGallery.prototype.closeThumbs=function(tco){this.toggleThumbContainer();tco.classList.add('hidden');this._titleContainer.getElementsByClassName('gallery-overlay-title')[0].classList.remove('thumbs');try{var HDN=window.HDN||{};HDN.sendAnalyticsData(HDN.getAnalyticsData(tco,true));}catch(e){}};HDNFlexGallery.prototype.swipe=function(target,e){var gallery=this,touch;var pnElem,siElem;if(gallery._showing.classList.contains('dfp-frame')){e.preventDefault();e.stopPropagation();return;} 308switch(e.type){case'touchstart':if(gallery.scrollSwipe.changeFrame===true){e.preventDefault();e.stopPropagation();return;} 309touch=e.touches?e.touches[0]:e;gallery.scrollSwipe.startTime=e.timeStamp;gallery.scrollSwipe.startX=touch.pageX;gallery.scrollSwipe.startY=touch.pageY;gallery.scrollSwipe.actionTop=gallery.scrollSwipe.startY-5;gallery.scrollSwipe.actionBottom=gallery.scrollSwipe.startY+5;gallery.scrollSwipe.actionLeft=gallery.scrollSwipe.startX-5;gallery.scrollSwipe.actionRight=gallery.scrollSwipe.startX+5;gallery.scrollSwipe.moveStart=[touch.pageX,e.timeStamp,Date.now()];gallery.scrollSwipe.moveEnd=undefined;gallery.scrollSwipe.inSwipe=false;gallery.scrollSwipe.inMotion=false;gallery.scrollSwipe.directionLock=false;gallery.scrollSwipe.changeFrame=false;gallery.scrollSwipe.inLoop=false;gallery.scrollSwipe.noHover=true;break;case'touchend':if(gallery.scrollSwipe.directionLock){gallery.scrollSwipe.directionLock=false;return;} 310if(gallery.scrollSwipe.changeFrame===true){e.preventDefault();e.stopPropagation();return;} 311var noMove=(typeof(gallery.scrollSwipe.moveEnd)==="undefined"||gallery.scrollSwipe.inSwipe===false);if(noMove&&(gallery._showing.classList.contains('taboola-frame')||gallery._showing.classList.contains('dfp-frame')||gallery._showing.classList.contains('outbrain-frame'))){return;} 312e.preventDefault();e.stopPropagation();if(typeof(gallery.scrollSwipe.moveEnd)==="undefined"||gallery.scrollSwipe.inSwipe===false){pnElem=gallery._next;if(gallery.hasOwnProperty('jsonData')){siElem=gallery.setGalleryStateFromStore(gallery.nextIndex);if(siElem!==undefined){pnElem=siElem;}} 313gallery.reportPageView=true;gallery.showItem(pnElem,'forward');try{var HDN=window.HDN||{};HDN.sendAnalyticsData(HDN.getAnalyticsData(this,true));}catch(e){} 314gallery.announceEvent("HDNGalleryActionOnChangeState","HDN Gallery Actions Complete");if(gallery._closeDFP){var gco=null;if(gallery.inFullscreenMode){gco=gallery._overlay.querySelector('.gallery-close-overlay');} 315if(gallery._showing.classList.contains('dfp-frame')){gallery._closeDFP.dataset.direction=1;gallery._closeDFP.classList.remove('hidden');if(gco){gco.classList.add('hidden');}}else{gallery._closeDFP.classList.add('hidden');if(gco){gco.classList.remove('hidden');}}} 316gallery.scrollSwipe.inSwipe=false;gallery.scrollSwipe.noHover=false;gallery.scrollSwipe.changeFrame=false;return;} 317gallery.scrollSwipe.changeFrame=true;var ol=Math.abs(gallery.scrollSwipe.startX-gallery.scrollSwipe.moveEnd[0]);gallery.scrollSwipe.swipeClass='swipe-center';var distanceToTravel;var ignoreTouches=false;var maxTimeReached=false;if((Date.now()-gallery.scrollSwipe.moveEnd[2])>gallery.scrollSwipe.maxTime){if(gallery.scrollSwipe.scrollLimit/3>=ol){maxTimeReached=true;}else{ignoreTouches=true;}} 318if(gallery.scrollSwipe.moveEnd[0]-gallery.scrollSwipe.startX>0){if((ignoreTouches||gallery.scrollSwipe.moveStart[0]-gallery.scrollSwipe.moveEnd[0]<0)&&maxTimeReached===false){gallery.scrollSwipe.swipeClass='swipe-right';distanceToTravel=gallery.scrollSwipe.scrollLimit-ol;gallery.scrollSwipe.stageFrame={'elem':gallery._prev,'close':gallery._showing,'hide':gallery._next,'lazyDirection':'reverse'};}else{distanceToTravel=ol;if(gallery.scrollSwipe.twoWide){gallery.scrollSwipe.swipeClass+='-right';}}}else if(gallery.scrollSwipe.moveEnd[0]-gallery.scrollSwipe.startX<0){if((ignoreTouches||gallery.scrollSwipe.moveStart[0]-gallery.scrollSwipe.moveEnd[0]>0)&&maxTimeReached===false){gallery.scrollSwipe.swipeClass='swipe-left';distanceToTravel=gallery.scrollSwipe.scrollLimit-ol;gallery.scrollSwipe.stageFrame={'elem':gallery._next,'close':gallery._showing,'hide':gallery._prev,'lazyDirection':'forward'};}else{distanceToTravel=ol;if(gallery.scrollSwipe.twoWide){gallery.scrollSwipe.swipeClass+='-left';}}} 319for(var key in gallery.scrollSwipe.swipeRates){if(gallery.scrollSwipe.scrollLimit
319<=key){break;}else{gallery.scrollSwipe.swipeRate=gallery.scrollSwipe.swipeRates[key];}} 320gallery.onTransitionEndOnce=function(eType){gallery._itemContainer.addEventListener(eType,function(e){gallery.swipeTransition();e.target.removeEventListener(e.type,arguments.callee);});};gallery.onTransitionEndOnce('webkitTransitionEnd');gallery.onTransitionEndOnce('otransitionend');gallery.onTransitionEndOnce('oTransitionEnd');gallery.onTransitionEndOnce('msTransitionEnd');gallery.onTransitionEndOnce('transitionend');var transistionDuration=Math.round(distanceToTravel*gallery.scrollSwipe.swipeRate);transistionDuration=(transistionDuration<=0?1:transistionDuration);gallery._itemContainer.style.transitionDuration=gallery._itemContainer.style.webkitTransitionDuration=gallery._itemContainer.style.mozTransitionDuration=transistionDuration+'ms';gallery._outerContainer.classList.add('swipe-trans');gallery._outerContainer.classList.add(gallery.scrollSwipe.swipeClass);gallery.scrollSwipe.noHover=false;return;case'touchmove':if(gallery.scrollSwipe.changeFrame===true){e.preventDefault();e.stopPropagation();return;} 321touch=e.touches[0]||e.changedTouches[0]||e;if(gallery.scrollSwipe.directionLock===true){return true;} 322if(gallery.scrollSwipe.inSwipe===true){e.preventDefault();e.stopPropagation();if(touch.pageX==gallery.scrollSwipe.moveEnd[0]||Math.abs(touch.pageX-gallery.scrollSwipe.startX)>gallery.scrollSwipe.scrollLimit){return;} 323gallery.scrollSwipe.moveStart=gallery.scrollSwipe.moveEnd;gallery.scrollSwipe.moveEnd=[touch.pageX,e.timeStamp,Date.now()];if(gallery.scrollSwipe.twoWide){if(touch.pageX-gallery.scrollSwipe.startX>0){if(gallery.scrollSwipe.headToTail){gallery._itemContainer.insertBefore(gallery._next,gallery._itemContainer.firstChild);gallery.scrollSwipe.scrollLeft=gallery.scrollSwipe.scrollLimit*-1;gallery.scrollSwipe.headToTail=0;}else if(gallery.showingIndex===0&&!gallery.scrollSwipe.tailToHead){gallery._itemContainer.insertBefore(gallery._next,gallery._itemContainer.firstChild);gallery.scrollSwipe.scrollLeft=gallery.scrollSwipe.scrollLimit*-1;gallery.scrollSwipe.tailToHead=1;}}else if(touch.pageX-gallery.scrollSwipe.startX<0){if(gallery.scrollSwipe.tailToHead){gallery._itemContainer.appendChild(gallery._prev);gallery.scrollSwipe.tailToHead=0;gallery.scrollSwipe.scrollLeft=0;}else if(gallery.showingIndex===gallery.lastIndex&&!gallery.scrollSwipe.headToTail){gallery._itemContainer.appendChild(gallery._next);gallery.scrollSwipe.scrollLeft=0;gallery.scrollSwipe.headToTail=1;}}} 324gallery.scrollSwipe.curLeft=(gallery.scrollSwipe.scrollLeft+touch.pageX-gallery.scrollSwipe.startX);gallery._itemContainer.style.transform=gallery._itemContainer.style.webkitTransform=gallery._itemContainer.style.mozTransform='translateX('+gallery.scrollSwipe.curLeft+'px)';return;} 325if(gallery.scrollSwipe.inSwipe===false){if(typeof(gallery.scrollSwipe.moveEnd)!=="undefined"){gallery.scrollSwipe.moveStart=gallery.scrollSwipe.moveEnd;} 326gallery.scrollSwipe.moveEnd=[touch.pageX,e.timeStamp,Date.now()];if(touch.pageX>=gallery.scrollSwipe.actionRight||touch.pageX<=gallery.scrollSwipe.actionLeft){if(touch.pageY>gallery.scrollSwipe.actionBottom||touch.pageY<gallery.scrollSwipe.actionTop){var ot=Math.abs(touch.pageY-gallery.scrollSwipe.startY);var at=Math.abs(touch.pageX-gallery.scrollSwipe.startX);var sa=Math.atan(ot/at)*(180/Math.PI);if(sa>30){gallery.scrollSwipe.directionLock=true;return;}} 327gallery.scrollSwipe.inSwipe=true;e.preventDefault();e.stopPropagation();gallery.scrollSwipe.scrollLimit=gallery._itemContainer.getBoundingClientRect().width;gallery.scrollSwipe.scrollLeft=(gallery.scrollSwipe.twoWide?0:gallery.scrollSwipe.scrollLimit*-1);if(!gallery.hasOwnProperty('jsonData')){if(touch.pageX>=gallery.scrollSwipe.actionRight){if(gallery.showingIndex===0){gallery._itemContainer.insertBefore(gallery._prev,gallery._itemContainer.firstChild);gallery.scrollSwipe.tailToHead=1;}else if(gallery.showingIndex===gallery.lastIndex&&!gallery.scrollSwipe.twoWide){gallery._itemContainer.appendChild(gallery._next);gallery.scrollSwipe.headToTail=1;} 328if(gallery.scrollSwipe.twoWide){gallery.scrollSwipe.scrollLeft=gallery.scrollSwipe.scrollLimit*-1;}}else{if(gallery.showingIndex===gallery.lastIndex){gallery._itemContainer.appendChild(gallery._next);gallery.scrollSwipe.headToTail=1;}else if(gallery.showingIndex==0&&!gallery.scrollSwipe.twoWide){gallery._itemContainer.insertBefore(gallery._prev,gallery._itemContainer.firstChild);gallery.scrollSwipe.tailToHead=1;}}} 329gallery._next.classList.remove('hidden');gallery._prev.classList.remove('hidden');gallery._outerContainer.classList.add('in-motion');gallery.scrollSwipe.curLeft=(gallery.scrollSwipe.scrollLeft+touch.pageX-gallery.scrollSwipe.startX);gallery._itemContainer.style.transform=gallery._itemContainer.style.webkitTransform=gallery._itemContainer.style.mozTransform='translateX('+gallery.scrollSwipe.curLeft+'px)';return;}} 330if(gallery.scrollSwipe.directionLock===false){if(touch.pageY>gallery.scrollSwipe.actionBottom||touch.pageY<gallery.scrollSwipe.actionTop){gallery.scrollSwipe.directionLock=true;return;}} 331break;}};HDNFlexGallery.prototype.swipeTransition=function(){var gallery=this;if(gallery.scrollSwipe.inSwipe){if(gallery.scrollSwipe.changeFrame){gallery._itemContainer.style.transitionDuration=gallery._itemContainer.style.webkitTransitionDuration=gallery._itemContainer.style.mozTransitionDuration=gallery._itemContainer.style.transform=gallery._itemContainer.style.webkitTransform=gallery._itemContainer.style.mozTransform="";gallery._outerContainer.classList.remove('in-motion');gallery._outerContainer.classList.remove('swipe-trans');gallery._outerContainer.classList.remove(gallery.scrollSwipe.swipeClass);if(~gallery.scrollSwipe.swipeClass.indexOf('swipe-center')){gallery._prev.classList.add('hidden');gallery._next.classList.add('hidden');if(gallery.scrollSwipe.headToTail){gallery._itemContainer.insertBefore(gallery._next,gallery._itemContainer.firstChild);gallery.scrollSwipe.headToTail=0;}else if(gallery.scrollSwipe.tailToHead){gallery._itemContainer.appendChild(gallery._prev);gallery.scrollSwipe.tailToHead=0;}}else{gallery.scrollSwipe.stageFrame.hide.classList.add('hidden');gallery.scrollSwipe.stageFrame.hide.classList.remove(this.animateFrameClass);gallery.scrollSwipe.stageFrame.close.classList.add('hidden');gallery.scrollSwipe.stageFrame.close.classList.remove(this.animateFrameClass);if(gallery.scrollSwipe.headToTail){gallery._itemContainer.insertBefore(gallery._next,gallery._itemContainer.firstChild);gallery.scrollSwipe.headToTail=0;}else if(gallery.scrollSwipe.tailToHead){gallery._itemContainer.appendChild(gallery._prev);gallery.scrollSwipe.tailToHead=0;} 332gallery.animateFrameClass='';gallery.setShowing(gallery.scrollSwipe.stageFrame.elem);gallery.openShowing();if(gallery.hasOwnProperty('jsonData')){gallery.setGalleryStateFromStore(gallery.showingIndex);} 333if(gallery.hasThumbs){if(gallery.hasThumbs){var dfi=gallery.scrollSwipe.stageFrame.close.dataset.frameIndex;var thmb=gallery._thumbContainer.querySelector('.thumb[data-frame-index="'+dfi+'"]');if(thmb!==null){thmb.classList.remove('selected');}}} 334gallery.loadLazy(gallery.scrollSwipe.stageFrame.elem,gallery.scrollSwipe.stageFrame.lazyDirection);gallery.animateFrameClass='active';var HDN=window.HDN||{};try{var navElement=gallery._navs.filter(function(ne){return ne.classList.contains((gallery.scrollSwipe.stageFrame.lazyDirection==='forward'?'right':'left'));});HDN.sendAnalyticsData(HDN.getAnalyticsData(navElement,true));}catch(e){} 335if(!gallery.firstOverlayView&&!gallery.inFullscreenMode){gallery.firstOverlayView=true;gallery.showOverlay('fullscreen');} 336gallery.reportPageView=true;if(gallery.reportPageView){try{HDN.refresh('photo',(gallery.showingIndex+1)+':'+(gallery.lastIndex+1),gallery.galleryType,gallery.galleryId,gallery.galleryTitle);}catch(e){} 337gallery.reportPageView=false;} 338gallery.announceEvent("HDNGalleryActionOnChangeState","HDN Gallery Actions Complete");if(gallery.scrollSwipe.stageFrame.lazyDirection==='forward'){if(gallery._interstitialLazyLoad[gallery.nextIndex]&&!gallery._nextWrap.classList.contains('dfploader')){gallery.setDynamicLoader(gallery._nextWrap);gallery.startDynamicLoader(gallery._nextWrap);}} 339if(gallery._closeDFP){var gco=null;if(gallery.inFullscreenMode){gco=gallery._overlay.querySelector('.gallery-close-overlay');} 340if(gallery._showing.classList.contains('dfp-frame')){gallery._closeDFP.dataset.direction=1;if(gallery.scrollSwipe.stageFrame.lazyDirection==='reverse'){gallery._closeDFP.dataset.direction=0;} 341gallery._closeDFP.classList.remove('hidden');if(gco){gco.classList.add('hidden');}}else{gallery._closeDFP.classList.add('hidden');if(gco){gco.classList.remove('hidden');}}}} 342gallery.scrollSwipe.changeFrame=false;} 343gallery.scrollSwipe.inSwipe=false;}};if(typeof Object.assign!='function'){Object.defineProperty(Object,"assign",{value:function assign(target,varArgs){'use strict';if(target==null){throw new TypeError('Cannot convert undefined or null to object');} 344var to=Object(target);for(var index=1;index<arguments.length;index++){var nextSource=arguments[index];if(nextSource!=null){for(var nextKey in nextSource){if(Object.prototype.hasOwnProperty.call(nextSource,nextKey)){to[nextKey]=nextSource[nextKey];}}}} 345return to;},writable:true,configurable:true});} 346HDNFlexGallery.prototype.onLoadListview=function(){this.firstOverlayView=true;this.loadLazy=function(elem,direction){var lazyIndex=parseInt(elem.dataset.frameIndex);if(lazyIndex>=0&&this._imgsLoadLazy[lazyIndex]!==null){this._imgsLoadLazy[lazyIndex]=null;var lazyImg=elem.querySelector('.'+this.imgWrapSelector+' img');lazyImg.onload=function(event){this.setAttribute('data-lazy-state','loaded');};lazyImg.onerror=function(event){this.setAttribute('data-lazy-state','error');};lazyImg.setAttribute('data-lazy-state','loading');lazyImg.setAttribute('src',lazyImg.dataset.src);lazyImg.removeAttribute('data-src');if(lazyImg.dataset.followState==='hold'){lazyImg.setAttribute('data-follow-state','');return;}}};this.animateFrameClass='active';var maxInitialDisplay=10;for(var c=0;c<maxInitialDisplay&&c<this._items.length;c++){this.showItem(this._items[c]);this._items[c].classList.remove('hidden');} 347this.createScrollMarkers();this.setLineup(this._showing);var self=this;this._navs.map(function(n){var analyticsElem=n.querySelector('[data-hdn-analytics]');if(analyticsElem!==null){n.querySelector('[data-hdn-analytics]').onclick=function(){};} 348n.addEventListener("click",function(event){event.stopPropagation();event.preventDefault();var analyticsMeta=HDN.getAnalyticsData(n,true);var analyticsElem=n.querySelector('[data-hdn-analytics]');var sWrapAd=document.getElementById('S300wrap');var actionIcon=n.getElementsByClassName('icon action');if(n.classList.contains('hide')){self._items.slice(10).map(function(i){self.closeShowing(i);if(sWrapAd!==null){sWrapAd.classList.add('hidden');}});n.classList.remove('hide');actionIcon[0].innerHTML('More');actionIcon[0].classList.remove('less-icon');analyticsMeta='photo_less_listview|'+analyticsMeta.split('|').splice(1,3).join('|');}else{self._items.filter(function(i){return i.classList.contains('hidden');}
348).slice(0,10).forEach(function(i){i.classList.remove('hidden');self.showItem(i);if(sWrapAd!==null){sWrapAd.classList.remove('hidden');}});self.setScrollMarkerStatus();if(self._items.filter(function(i){return i.classList.contains('hidden');}).length===0){n.classList.add('hide');actionIcon[0].innerHTML="Less";actionIcon[0].classList.add('less-icon');} 349if(analyticsMeta.indexOf('photo_less_listview|')>-1){analyticsMeta='photo_more_listview_p2|'+analyticsMeta.split('|').splice(1,3).join('|');}else{var pageNo=analyticsMeta.split('|')[0].replace('photo_more_listview_p','');analyticsMeta='photo_more_listview_p'+(parseInt(pageNo)+1)+'|' 350+analyticsMeta.split('|').splice(1,3).join('|');}} 351HDN.setAnalyticsData(analyticsElem,analyticsMeta);try{HDN.sendAnalyticsData(analyticsMeta);}catch(e){}});});self.expandShareToggle=function(stgl){var frameIndexElem=stgl.parentNode.parentNode.previousElementSibling;frameIndexElem.classList.add('showing');setTimeout(function(){frameIndexElem.classList.remove('showing');},2000);};var stgls=Array.apply(null,self._outerContainer.getElementsByClassName('share-toggle'));self.expandShareToggleTouch={};if(stgls.length>0){stgls.forEach(function(stgl){stgl.addEventListener('touchstart',self.handleTouchButtonEvent(stgl,self.expandShareToggle.bind(self),self.expandShareToggleTouch));stgl.addEventListener('touchend',self.handleTouchButtonEvent(stgl,self.expandShareToggle.bind(self),self.expandShareToggleTouch));stgl.addEventListener('click',self.handleTouchButtonEvent(stgl,self.expandShareToggle.bind(self),self.expandShareToggleTouch));});} 352self.sociallinkTouch={};self._socialLinks.forEach(function(sl){Array.apply(null,sl.querySelectorAll('.socialIcon[data-share-id]').forEach(function(si){si.addEventListener('touchstart',self.handleTouchButtonEvent(si,self.makeSocialCall.bind(self),self.sociallinkTouch));si.addEventListener('touchend',self.handleTouchButtonEvent(si,self.makeSocialCall.bind(self),self.sociallinkTouch));si.addEventListener('click',self.handleTouchButtonEvent(si,self.makeSocialCall.bind(self),self.sociallinkTouch));}));});};HDNFlexGallery.prototype.makeHalves=function(whole){var half=parseInt(whole)/2;return half-(half-parseInt(half));};HDNFlexGallery.prototype.createScrollMarkers=function(){this.scrollMarker=0;this.scrollMarkers=[];this.scrollMarkers[1]={'item':this.makeHalves(this._items.length)};this.scrollMarkers[0]={'item':this.makeHalves(this.scrollMarkers[1].item)};this.scrollMarkers[2]={'item':this.makeHalves(this._items.length-this.scrollMarkers[1].item)+this.scrollMarkers[1].item};this.scrollMarkers[3]={'item':this._items.length};for(var cnt=0;cnt<this.scrollMarkers.length;++cnt){this.scrollMarkers[cnt].elem=this._items[this.scrollMarkers[cnt].item-1];} 353this.setScrollMarkerStatus();document.addEventListener('scroll.listview',this.watchForScrollMarker.bind(this));};HDNFlexGallery.prototype.setScrollMarkerStatus=function(){for(var cnt=this.scrollMarker;cnt<this.scrollMarkers.length;++cnt){this.scrollMarkers[cnt].visible=!this.scrollMarkers[cnt].elem.classList.contains("hidden");if(!this.scrollMarkers[cnt].visible){continue;} 354this.scrollMarkers[cnt].top=this.scrollMarkers[cnt].elem.getBoundingClientRect().top;}};HDNFlexGallery.prototype.watchForScrollMarker=function(){if(this.scrollMarkers[this.scrollMarker].visible&&(document.documentElement.scrollTop||document.body.scrollTop)>this.scrollMarkers[this.scrollMarker].elem.getBoundingClientRect().top){var milestone=(this.scrollMarker*0.25)+0.25;try{if(milestone==1){omni_trackListViewComplete();}else{omni_trackListView(""+milestone);}}catch(e){} 355if(this.scrollMarker++>=(this.scrollMarkers.length-1)){document.removeEventListener('scroll.listview');}}};HDNFlexGallery.prototype.onLoadArbitrage=function(){this._fullListView=Array.apply(null,this._itemContainer.querySelectorAll('[data-fulllist-index]'));this.ArbAdsIndexList=Array.apply(null,this._fullListView).map(function(a){if(a.classList.contains('hst-lvgalleryitem-arb')&&!a.classList.contains('active')){return 1;} 356return null;});this._scrollMoreMarker=this._navs[this._navs.length-1];this.findListViewEnd=function(){var br=this._scrollMoreMarker.getBoundingClientRect();this.moreScrollMarker=br.top+br.height;};this.fullListShowingIndex=this._showing.dataset.fulllistIndex;this.setLineup=function(elem){var sIndex=parseInt(elem.dataset.frameIndex,10);this.prevIndex=(sIndex===0?this._items.length-1:sIndex-1);this.nextIndex=(sIndex===this._items.length-1?0:sIndex+1);this._prev=this._items[this.prevIndex];this._next=this._items[this.nextIndex];this._prevWrap=this._prev.getElementsByClassName(this.imgWrapSelector)[0];this._nextWrap=this._next.getElementsByClassName(this.imgWrapSelector)[0];this.fullListShowingIndex=parseInt(elem.dataset.fulllistIndex,10);};this.lazyLoadArbAds();var self=this;document.addEventListener('scroll',self.watchForScrollMore.bind(self),false);};HDNFlexGallery.prototype.watchForScrollMore=function(){if(!this.moreScrollMarker||this.scrollPosChecked){return;} 357this.scrollPosChecked=true;var self=this;var start=self.showingIndex+1;var end=Math.min(self.showingIndex+10,self.lastIndex);if(start<=end){setTimeout(self.checkMoreScrollPosition.bind(self),80);}};HDNFlexGallery.prototype.checkMoreScrollPosition=function(){var self=this;this.findListViewEnd();if((document.documentElement.clientHeight||window.innerWidth)>this.moreScrollMarker){this.moreScrollMarker+=1500;var start=self.showingIndex+1;var end=Math.min(self.showingIndex+10,self.lastIndex);
357self._items.slice(start,(end+1)).forEach(function(i){self.showItem(i);i.classList.remove('hidden');});self.lazyLoadArbAds();self.setScrollMarkerStatus();var eData={setStart:(start+1),setEnd:(end+1),gallerySize:(self.lastIndex+1)};self.announceEvent("HDNGalleryActionListviewScrollMore","HDN Gallery Action Expanding Arbitrage List",eData);} 358if(this.showingIndex===this.lastIndex){document.removeEventListener('scroll',self.watchForScrollMore.bind(self));this._scrollMoreMarker.parentNode.removeChild(this._scrollMoreMarker);} 359self.scrollPosChecked=false;};HDNFlexGallery.prototype.lazyLoadArbAds=function(){if(this.bufferArbCalls===1){var self=this;setTimeout(self.lazyLoadArbAds.bind(self),1000);} 360var arbIndex=this.ArbAdsIndexList.indexOf(1);if(arbIndex===-1||arbIndex>this.fullListShowingIndex){return;} 361this.bufferArbCalls=1;var expandedArbs=[];for(var i=arbIndex;i!==-1&&i<this.fullListShowingIndex;i=this.ArbAdsIndexList.indexOf(1)){this.ArbAdsIndexList[i]=null;var aa=this._fullListView[i];aa.classList.add('active');var arbElem=document.getElementById(aa.dataset.arbId);if(arbElem){expandedArbs.push(document.getElementById(aa.dataset.arbId));} 362if(expandedArbs.length>4){try{aps.showArb(expandedArbs);expandedArbs=[];}catch(e){console.warn('WARNING: Could not call function aps.showArb: '+e.meessage);} 363this.findListViewEnd();}} 364if(expandedArbs.length>0){aps.showArb(expandedArbs);} 365this.findListViewEnd();this.bufferArbCalls=0;};(function(){var HDN=window.HDN;HDN.mmplayers=HDN.mmplayers||{};HDN.MinuteMedia={maybeReady:function(){if(window.location.href.indexOf('debug=mm')!==-1){console.log('mm-realm-editorial-maybeReady');new Image().src="https://p.ctpost.com/datalog/mm-realm-editorial-maybeReady";} 366if(typeof window.treg==="object"&&typeof window.treg.realm==="object"){var self=this;treg.realm.events.registerReplayLast("realm.Oidc.refreshLogicComplete",function(parms){if(window.location.href.indexOf('debug=mm')!==-1){console.log('mm-realm-editorial-refreshLogicComplete');new Image().src="https://p.ctpost.com/datalog/mm-realm-editorial-refreshLogicComplete";} 367self.onReady();});}else{if(window.location.href.indexOf('debug=mm')!==-1){console.log('mm-realm-editorial-NON-realm');new Image().src="https://p.ctpost.com/datalog/mm-realm-editorial-NON-realm";} 368this.onReady();}},onReady:function(){if(window.location.href.indexOf('debug=mm')!==-1){console.log('mm-realm-editorial-onReady-called');new Image().src="https://p.ctpost.com/datalog/mm-realm-editorial-onReady-called";} 369var pc=Object.values(HDN.mmplayers).length;this.__loaded=false,this.__requested=false,this.__activePlayer=null,this.__players=HDN.mmplayers,this.__playersIndex=[],this.__settings=(pc>0?Object.values(this.__players)[0].settings:{}),this.__containers=Array.apply(null,document.querySelectorAll('.hearst-mmplayer')),this.__gaActive=(typeof window.ga==="function"),this.__eventStack=[];if(pc>0){this.loadLibrary();}},loadLibrary:function(){if(!this.__requested){this.__requested=true;var s=document.createElement('script');s.type='text/javascript';s.async=true;document.head.appendChild(s);s.onload=function(){this.submitDFPReport();this.__loadedTime=Date.now();this.__loaded=true;this.initWatcher();}.bind(this);this.__requestedTime=Date.now();s.src='https://www.oo-syringe.com/prod/players/mplayer_wrapper_v3_latest.js';}},initWatcher:function(){var MM=this;for(var pid in this.__players){var p=this.getPlayer(pid);p.__id=pid;p.__playlistIndex=0;p.__playerDiv=document.getElementById(pid);p.__container=document.getElementById(pid+'-container');p.__playlistDiv=document.getElementById(pid+'-playlist');if(p.__playlistDiv!==null){p.__playlistContainer=p.__playlistDiv.getElementsByClassName('related-items-container')[0];} 370p.__hasPlaylist=(p.playlist.length>1);MM.rszt(pid);window.addEventListener("resize",function(e){MM.rszt(this.__id);}.bind(p),{passive:true},false);
370if(pid.indexOf('filmstrip-')===0){p.__isStandalonePlaylist=true;MM.buildPlaylist(pid);MM.repackagePlaylist(pid);return;} 371MM.__playersIndex.push(pid);if(p.pageIndex===0){if(!p.useFilmstripOnly){if(p.settings.playbackMode!=='none'){this.initScrollBeacon(pid);continue;}}} 372p.__playerDiv.addEventListener('click',function(e){var p=this;if(p.loaded){return;} 373if(MM.__activePlayer!==null&&MM.__activePlayer!==p){var ap=MM.__activePlayer.player;if(ap){ap.pause();if(MM.__settings.anchor){ap.setAnchorEnabled(false);}}} 374MM.__activePlayer=p;MM.loadPlayer(p.__id);}.bind(p));} 375this.onVisibilityChange();document.addEventListener('visibilitychange',MM.onVisibilityChange.bind(this),false);},loadPlayer:function(pid){if(this.__players.hasOwnProperty(pid)){if(!this.getPlayer(pid).hasOwnProperty('loaded')){var player=this.getPlayer(pid);player.loaded=true;var video=player.playlist[player.__playlistIndex];var settings=this.__settings;settings.autoplayNextVideo=true;var state={firstFrame:false,hasPaused:false,quartiles:[]};settings.titleDiv=this.getContainer(pid).getElementsByClassName('hearst-mmplayer-float-title')[0];settings.adTimeDiv=settings.titleDiv.getElementsByClassName('ad-time')[0];settings.adSecondsDiv=settings.adTimeDiv.getElementsByClassName('ad-seconds')[0];var adTag=this.obtainAdTag(pid);if(settings.useJuice){adTag=this.obtainJUICEAdTag(pid);} 376var MM=this;
376var iO={"player_pos":document.getElementById(pid),"content_type":"specific","content_id":video.payload_id,"uniq_key":pid,"playback_method":settings.playbackMode,"powered_by_strip":false,};if(!settings.isSensitive){iO.monetization={"ad_break_slots":{"on":settings.adBreaks},"ad_tag":adTag,"ad_request_timeout":"10000"};} 377if(settings.anchor){iO.anchor_options={"orientation":settings.orientation,"can_close":(settings.canClose!==1?false:true),"continue_streaming":true,"anchoring_appearance":settings.anchoring,"width":"60","margins":{"top":10,"bottom":10,"left":(settings.orientation==="right"?50:20),"right":(settings.orientation==="right"?20:50),}};} 378var pD=MM.getPlayerDiv(pid);pD.classList.remove('queued');pD.classList.add('loading');window.monti().initiate(iO).then(function(p){var pNow=Math.round(performance.now()/1000);var s=MM.__settings;player.player=p;pD.style.backgroundImage="";pD.classList.remove('loading');pD.classList.add('loaded');var c=p.getContainer();c.parentNode.insertBefore(s.titleDiv,c.nextSiblingElement);if(player.__playlistDiv!==null){c.appendChild(player.__playlistDiv);} 379MM.dispatchEvent(null,'Initialize',{objKey:'eventData',obj:{'initTime':pNow+'_sec_since_page_start'}});if(settings.playbackMode==='none'){p.once('firstFrame',function(){p.setMute((settings.mute===1?true:false));});} 380p.once('firstFrame',function(){if(!MM.__firstFrame){MM.__firstFrame=true;MM.buildPlaylist(pid);}});p.on('firstFrame',function(){state.firstFrame=true;state.hasPaused=false;var v=MM.getCurrentPlaylistItem(pid);state.quartiles=MM.getQuartiles(v.duration);p.setVideoTitle(v.title);s.titleDiv.getElementsByClassName('float-title')[0].innerHTML=v.title;});p.on('play',function(){if(MM.__activePlayer!==null&&MM.__activePlayer!==player){var ap=MM.__activePlayer.player;if(ap){ap.pause();if(MM.__settings.anchor){ap.setAnchorEnabled(false);}} 381MM.__activePlayer=player;} 382if(MM.__visibilityHidden){player.player.pause();return;} 383MM.closePlaylistFrame(pid);if(MM.__settings.anchor){p.setAnchorEnabled(true);} 384if(MM.__visibilityRestored){MM.__visibilityRestored=null;return;} 385if(player.__resetFirstFrame){player.__resetFirstFrame=false;state.hasPaused=false;state.firstFrame=true;var v=MM.getCurrentPlaylistItem(pid);state.quartiles=MM.getQuartiles(v.duration);p.setVideoTitle(v.title);s.titleDiv.getElementsByClassName('float-title')[0].innerHTML=v.title;} 386s.adTimeDiv.style.display="none";player.__complete=false;MM.dispatchEvent(pid,(state.hasPaused?'Resume':'Play'));});p.on('pause',function(){state.hasPaused=true;if(MM.__visibilityHidden){return;} 387MM.dispatchEvent(pid,'Pause');});p.on('complete',function(){state.hasPaused=false;MM.dispatchEvent(pid,'Complete');state.quartiles[3]=0;if(MM.playNextVideo(pid)){MM.dispatchEvent(pid,'Playlist Auto-Advance');return;} 388player.__complete=true;if(player.__completeplaylistDiv){MM.openPlaylistFrame(pid);} 389if(MM.__settings.playbackMode==='none'){return;} 390if(MM.__settings.anchor){p.setAnchorEnabled(false);} 391if(MM.__playersIndex.length-1>player.pageIndex){for(var i=player.pageIndex+1;i<Object.keys(MM.__players).length;i++){if(!MM.getPlayerByIndex(i).__complete){MM.__activePlayer=MM.getPlayerByIndex(i);MM.initScrollBeacon(MM.__activePlayer.__id);}}}});p.on('time',function(){if(state.isOnTime)return;state.isOnTime=true;setTimeout(function(){var pos=p.getPosition();if(state.quartiles[0]>0&&state.quartiles[0]<pos){MM.dispatchEvent(pid,'Video Progress 25%');state.quartiles[0]=0;}else if(state.quartiles[1]>0&&state.quartiles[1]<pos){MM.dispatchEvent(pid,'Video Progress 50%');state.quartiles[1]=0;}else if(state.quartiles[2]>0&&state.quartiles[2]<pos){MM.dispatchEvent(pid,'Video Progress 75%');state.quartiles[2]=0;} 392state.isOnTime=false;},1000);});p.on('mute',function(muted){HDN.MinuteMedia.dispatchEvent(pid,(muted.state?'Mute':'Unmute'));});p.on('fullscreen',function(fullscreen){MM.dispatchEvent(pid,(fullscreen.state?'Enter':'Exit')+' Fullscreen');});p.on('anchorStatusChanged',function(anchor){MM.sizeMe(pid);if(anchor.status==="activated"){if(s.showFloatTitle){pD.classList.add('anchored');} 393MM.dispatchEvent(pid,'Show Anchored Player');return;} 394pD.classList.remove('anchored');
394if(!MM.__firstFrame||player.__complete){return;} 395MM.dispatchEvent(pid,'Close Anchored Player');});p.on('anchorClosed',function(t){MM.dispatchEvent(pid,'Close Anchored Player');s.titleDiv.style.display="none";});p.on('adPlay',function(t){if(s.showAdCountdown){s.adTimeDiv.style.display="block";}});p.on('adComplete',function(t){s.adTimeDiv.style.display="none";});p.on('adTime',function(t){if(state.isOnAdTime)return;state.isOnAdTime=true;setTimeout(function(){var sec=t.duration-t.position;var min=parseInt(((sec)/60),10);sec-=min*60;sec=sec.toString();var o=min.toString()+':'+(sec.split('').length>1?sec:"0"+sec);s.adSecondsDiv.innerHTML=o;state.isOnAdTime=false;},500);});p.on('adError',function(t){MM.dispatchEvent(pid,'Ad Error',{objKey:'eventAdMetadata',obj:t});});p.on('adRequest',function(t){MM.dispatchEvent(pid,'Ad Request',{objKey:'eventAdMetadata',obj:t});});p.on('adOpportunity',function(t){MM.dispatchEvent(pid,'Ad Opportunity',{objKey:'eventAdMetadata',obj:t});});p.on('adImpression',function(t){MM.dispatchEvent(pid,'Ad Impression',{objKey:'eventAdMetadata',obj:t});});if(settings.playbackMode==='none'){p.play();}}).catch(function(err){console.error(err);});}}},sizeMe:function(pid){var player=this.getPlayer(pid);if(!player.hasOwnProperty('player')&&!player.__isStandalonePlaylist){return;} 396var pd=this.getContainer(pid);var p=(player.__isStandalonePlaylist?pd:player.player.getContainer());var c=false;if(p.offsetWidth<=470&&!pd.classList.contains('compact')){pd.classList.add('compact');c=true;} 397if(p.offsetWidth>470&&pd.classList.contains('compact')){pd.classList.remove('compact');c=true;} 398if(p.offsetWidth<=499&&!pd.classList.contains('tiny-controls')){pd.classList.add('tiny-controls');} 399if(p.offsetWidth>499&&pd.classList.contains('tiny-controls')){pd.classList.remove('tiny-controls');} 400if(p.offsetWidth<=540&&!pd.classList.contains('tiny')){pd.classList.add('tiny');c=true;} 401if(p.offsetWidth>540&&pd.classList.contains('tiny')){pd.classList.remove('tiny');c=true;} 402if(p.offsetWidth<=639&&!pd.classList.contains('petite')){pd.classList.add('petite');} 403if(p.offsetWidth>639&&pd.classList.contains('petite')){pd.classList.remove('petite');} 404if(p.offsetWidth<=860&&!pd.classList.contains('small')){pd.classList.add('small');c=true;} 405if(p.offsetWidth>860&&pd.classList.contains('small')){pd.classList.remove('small');c=true;} 406if(c){this.repackagePlaylist(pid);}},rszt:function(pid){var p=this.getPlayer(pid);var t=this;if(p.__isResizingTimeOn)return;p.__isResizingTimeOn=true;setTimeout(function(){p.__isResizingTimeOn=false;t.sizeMe(pid);},66);},obtainAdTag:function(pid){var now=new Date();var adTag='https://pubads.g.doubleclick.net/gampad/ads?iu=/175840252/MMPlus/Hearst/MasterTag&description_url='+encodeURIComponent(document.location.href)+'&env=vp&impl=s&correlator='+now.getTime()+'&tfcd=0&npa=0&gdfp_req=1&output=vast&sz=400x300%7C480x270%7C640x360%7C640x480&unviewed_position_start=1&url='+encodeURIComponent(document.location.href);var p=this.getPlayer(pid);var pl=p.playlist[p.__playlistIndex];var np=this.getNecleusCategoryParams(pl);adTag+=np;return adTag;},obtainJUICEAdTag:function(pid){try{HDN.videoJWAdTag=hearstGetVideoAdTag('Video_MOS');HDN.videoJWAdTag=HDN.videoJWAdTag.replace("video_player%3Dmos","video_player%3Djw");HDN.videoJWAdTag=HDN.videoJWAdTag.replace("&cust_params=","&cust_params="+this.compileCustomAdParams(pid));}catch(e){HDN.videoJWAdTag=null;this.dispatchEvent(pid,'Ad Tag Failed',{objKey:'eventAdMetadata',obj:{error:e.message,firstLoad:(this.__players[pid].adTagRequested?1:0)}});this.__players[pid].adTagRequested=1;console.log(e.message);return false;} 407this.getPlayer(pid).adTagRequested=1;return true;},compileCustomAdParams:function(pid){var v=this.getCurrentPlaylistItem(pid);var s=this.__settings;var kvps=Array();kvps['div_id']='vid'+0;kvps['videoId']=v.bizobjectId;kvps['videoSource']=v.provider;kvps['videoTitle']=v.title;kvps['vidId']=v.payload_id;kvps['video_state']=s.playbackMode;var aps=window.aps;if(undefined!==aps&&'keyword'===aps.key&&undefined!==aps.values&&aps.values.length>0){kvps['keyword']=aps.values.join(',');} 408if(v.vcampaigns){kvps['vcampaigns']=v.vcampaigns;} 409var kv='';for(var k in kvps){kv+=k+"="+encodeURI(kvps[k])+"&";} 410if(v.vnlp){kv+="vnlp="+v.vnlp+"&";} 411return encodeURIComponent(kv);},dispatchEvent:function(pid,eventAction,meta){var s=this.__settings;var eventData={};if(pid){var v=this.getCurrentPlaylistItem(pid);var p=this.getPlayer(pid).player;if(typeof v.duration_f==="undefined"){var date=new Date(null);date.setSeconds(this.hmsToSecondsOnly(v.duration));v.duration_f=date.toISOString().substr(11,8);}
412var dm='inline';if(p.getFullscreen()){dm='fullscreen';}else if(p.isAnchored()){dm='anchored';} 413eventData={title:v.title,duration:v.duration_f,bizObjectId:v.bizobjectId,sourceId:v.payload_id,sourceName:v.provider,autoPlayState:s.playbackMode,displayMode:dm,isMuted:p.getMute(),playlist:(v.playlistId?v.playlistId:''),};} 414var event=document.createEvent('Event');var eventCategory='HNP MPlayer'+(eventAction.indexOf('Ad ')===0?'Ads':'');event.initEvent('hdn.mmplayer',true,true);event.details={eventAction:eventAction,eventCategory:eventCategory,eventData:eventData};if(meta){event.details[meta.objKey]=meta.obj;} 415if(this.__gaActive){document.dispatchEvent(event);return;} 416this.__eventStack.unshift(event);},processEventStack:function(){while(this.__eventStack.length>0){var event=this.__eventStack.pop();document.dispatchEvent(event);}},submitDFPReport:function(){this.constructDFPReport();this.postDFPReport();},constructDFPReport:function(){if(window.location.href.indexOf('debug=mm')!==-1){console.log('mm-realm-editorial-constructDFPReport-called');new Image().src="https://p.ctpost.com/datalog/mm-realm-editorial-constructDFPReport-called";} 417var HDN=window.HDN;if(!HDN||!HDN.hasOwnProperty('dataLayer')||!HDN.dataLayer.hasOwnProperty('source')||!HDN.dataLayer.hasOwnProperty('content')){return;} 418var isMobile=false;if(HDN.dataLayer.source.publishingSite.indexOf('mobile')===0||HDN.dataLayer.source.sourceSite.indexOf('mobile')===0){isMobile=true;} 419if(!isMobile){var mql=window.matchMedia("only screen and (max-width: 760px)");if(mql.matches){isMobile=true;}} 420var adType=(isMobile)?"mobile":"desktop-tablet";var isUS=true;var ld=document.cookie.match('(^|;)\\s*location_data\\s*=\\s*([^;]+)');if(ld){var data=JSON.parse(decodeURIComponent(ld.pop()));if(typeof data['country_code']!=='undefined'){if(data['country_code']!=='US'){isUS=false;}}} 421if(!isUS){adType=adType+"-intl";} 422var objectType=window.HDN.dataLayer.content.objectType||'';var now=Date.now();var iframe=document.createElement("iframe");iframe.src=["https://pubads.g.doubleclick.net/gampad/adx","?iu=/36117602/hnp-90min-video/"+adType,"&sz=1x1","&t=PageUrl%3D"+encodeURIComponent(location.hostname+"&page_type2="+objectType),"&c="+now].join('');iframe.height="0";iframe.width="0";iframe.style="display:none;visibility:hidden";document.body.appendChild(iframe);this.__gaEventLabel=Math.round(performance.now()/1000)+"_sec_since_page_start";this.__gaDimension62=document.visibilityState;},postDFPReport:function(){var MM=this;if(MM.__gaActive=(typeof window.ga==="function")){window.ga("hnp.send",{hitType:"event",eventCategory:"HNP MPlayer",eventAction:"Libraries Loaded",eventLabel:MM.__gaEventLabel,dimension62:MM.__gaDimension62,nonInteraction:true});MM.processEventStack();}else{setTimeout(MM.postDFPReport.bind(this),300);}},initScrollBeacon:function(pid){var p=this.getPlayer(pid);if(!p.useFilmstripOnly){p.playerDiv=document.getElementById(pid);p.playerContainer=document.getElementById(pid+'-container');p.scrollBeacon=this.fetchScrollBeacon(pid);p.scrollBeacon();window.addEventListener('scroll',p.scrollBeacon);return;}},getElementOffsetTop:function(el){var bCR=el.getBoundingClientRect();var b=document.body;var d=document.documentElement;var sT=window.pageYOffset||d.scrollTop||b.scrollTop;var cT=d.clientTop||b.clientTop||0;return Math.round(bCR.top+sT-cT);},getScrollTop:function(){var d=document.documentElement;return(window.pageYOffset||d.scrollTop)-(d.clientTop||0);},fetchScrollBeacon:function(pid){var p=this.getPlayer(pid);var t=this;return function(){if(p.isScrollBeaconTimeout)return;p.isScrollBeaconTimeout=true;setTimeout(function(){t.onScrollBeacon(pid);p.isScrollBeaconTimeout=false;},80);};},onScrollBeacon:function(pid){var p=this.getPlayer(pid);var pt=this.getElementOffsetTop(p.playerContainer);var ch=document.documentElement.clientHeight;var st=this.getScrollTop();if(st+ch>=pt){window.removeEventListener('scroll',p.scrollBeacon);p.scrollBeacon=function(){return;};this.__activePlayer=p;if(!p.loaded){this.loadPlayer(pid);}else if(p.player){p.player.play();}}},onVisibilityChange:function(){this.__visibilityHidden=document.hidden;if(this.__activePlayer){var p=this.__activePlayer.player;if(p){if(this.__visibilityHidden){if(this.__activePlayer.__isPlaylistOpen){this.closePlaylistFrame(this.__activePlayer.__id);}else{this.__activePlayer.__oldVideoState=p.videoState;} 423p.pause();return;} 424this.__visibilityRestored=true;if(this.__activePlayer.__oldVideoState!==p.videoState){p.play();}}}},getQuartiles:function(secs){secs=this.hmsToSecondsOnly(secs);var q=parseInt(secs/4,10);return Array(q,(q*2),(q*3));},hmsToSecondsOnly:function(str){str=str.toString();var p=str.split(':'),s=0,m=1;while(p.length>0){s+=m*parseInt(p.pop(),10);m*=60;} 425return s;},getPlayer:function(pid){return this.__players[pid];},getPlayerByIndex:function(i){return this.getPlayer(this.__playersIndex[i]);},getPlayerDiv:function(pid){return this.getPlayer(pid).__playerDiv;},getContainer:function(pid){return this.getPlayer(pid).__container;},getPlaylistDiv:function(pid){return this.getPlayer(pid).__playlistDiv;},getPlaylistIndex:function(pid){return this.getPlayer(pid).__playlistIndex;},getPlaylist:function(pid){return this.getPlayer(pid).playlist;},getCurrentPlaylistItem:function(pid){return this.getPlaylist(pid)[this.getPlaylistIndex(pid)];},buildPlaylist:function(pid){var p=this.getPlayer(pid);if(!p.__hasPlaylist){return;} 426if(!p.__playlistContainer){return;} 427p.__playlistNextUpDiv=p.__playlistContainer.getElementsByClassName('next-up-label')[0];if(!p.__playlistNextUpDiv){p.__playlistNextUpDiv=document.createElement('span');p.__playlistNextUpDiv.classList.add('next-up-label');p.__playlistNextUpDiv.innerHTML='Next Up';} 428var mfb=this.getPlayerDiv(pid).getElementsByClassName('monti-fullscreen-button');var opc=p.__playlistDiv.getElementsByClassName('open-playlist-control
428s');if(mfb.length>0&&opc.length>0){opc[0].removeAttribute('style');opc[0].addEventListener('click',function(e){this.repackagePlaylist(pid);var p=this.getPlayer(pid);if(p.hasOwnProperty('player')){p.__oldVideoState=p.player.videoState;p.player.pause();} 429this.openPlaylistFrame(pid);e.stopPropagation();}.bind(this));mfb[0].parentNode.insertBefore(opc[0],mfb[0]);} 430var cpc=p.__playlistDiv.getElementsByClassName("close-playlist-controls");if(cpc.length>0){cpc[0].addEventListener('click',function(e){var p=this.getPlayer(pid);if(p.hasOwnProperty('player')){if(p.__oldVideoState!==p.player.videoState){p.player.play();}} 431this.closePlaylistFrame(pid);e.stopPropagation();}.bind(this));} 432var mpa=p.__playlistDiv.getElementsByClassName("mm-playlist-arrow");if(mpa.length>1){p.__playlistLeftNav=mpa[0];mpa[0].addEventListener('click',function(e){this.updatePlaylistFrame(pid,-1);}.bind(this));p.__playlistRightNav=mpa[1];mpa[1].addEventListener('click',function(e){this.updatePlaylistFrame(pid,1);}.bind(this));} 433p.__playlistItems=Array.apply(null,p.__playlistDiv.getElementsByClassName('related-item'));if(p.__playlistItems.length===0){var pli,el,el2;for(var i=0;i<p.playlist.length;i++){pli=document.createElement('div');pli.classList.add('related-item');el=document.createElement('a');el.style.backgroundImage='url('+p.playlist[i].thumbnail+')';el.href=p.playlist[i].bizobjectUrl;el2=document.createElement('div');el2.classList.add('init-playback-button');el2.innerHTML='<svg width="100%" height="100%" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M24,20 L34,26 34,38 24,44 M34,26 L44,32 44,32 34,38"></path></svg>';el.appendChild(el2);pli.appendChild(el);el=document.createElement('span');el.classList.add('filmstrip-duration');el.innerHTML=p.playlist[i].duration_f;pli.appendChild(el);el=document.createElement('span');el.classList.add('filmstrip-title');el2=document.createElement('span');el2.classList.add('index');el2.innerHTML=(i+1)+'.';el.appendChild(el2);el2=document.createTextNode(p.playlist[i].title);el.appendChild(el2);pli.appendChild(el);el=document.createElement('span');el.classList.add('filmstrip-credit');el.innerHTML=p.playlist[i].captionCredit;pli.appendChild(el);el=document.createElement('span');el.classList.add('filmstrip-description');el.innerHTML=p.playlist[i].description;pli.appendChild(el);p.__playlistItems.push(pli);}} 434var MM=this;p.__playlistItems.forEach(function(pi,i){pi.addEventListener('onmouseover',function(e){this.classList.add('active');}.bind(pi));pi.addEventListener('onmouseout',function(e){this.classList.remove('active');}.bind(pi));pi.addEventListener('click',function(e){var p=this.getPlayer(pid);if(p.__isStandalonePlaylist){var pfm=p.playlistFilmstripMap;if(!pfm||(pfm.hasOwnProperty('linkTarget')&&pfm.linkTarget==='new')){document.location.href=p.playlist[i].bizobjectUrl;}else if(pfm.linkTarget==='inline'){p.__isStandalonePlaylist=false;var pd=this.getPlayerDiv(pid);pd.style.backgroundImage='url("'+p.playlist[i].image+'")';var ilt=pd.getElementsByClassName('init-lead-title')[0];if(ilt){ilt.innerHTML=p.playlist[i].title;} 435var ild=pd.getElementsByClassName('init-lead-description')[0];if(ild){ild.innerHTML=p.playlist[i].description;} 436this.getPlaylistDiv(pid).classList.add('closed');this.getContainer(pid).classList.remove('standalone-filmstrip');this.__playersIndex.push(p.__id);p.__playlistIndex=i;this.loadPlayer(p.__id);}}else{p.__resetFirstFrame=true;this.playVideoItem(pid,i);MM.dispatchEvent(pid,'Playlist Select');} 437e.preventDefault();}.bind(MM));});p.__playlistBuilt=true;},clearPlaylist:function(pid){var p=this.getPlayer(pid);while(p.__playlistContainer.firstElementChild){p.__playlistContainer.removeChild(p.__playlistContainer.firstElementChild);}},setPlaylist:function(pid){var p=this.getPlayer(pid);var plc=p.__playlistContainer;var i=parseInt(this.getPlaylistIndex(pid),10)+1;if(i>=p.__playlistItems.length||p.__isStandalonePlaylist){i=0;} 438var ic=i+(p.__maxbatches-p.__maxnp);var playlistNavBlocks=[];var bn=0;var plb=[];var ri,pi;if(i>0){for(pi=i-1;pi>-1;pi--){plb.push(this.preparePlaylistItem(p.__playlistItems[pi]));if(plb.length>=p.__maxbatches){playlistNavBlocks.unshift(plb.reverse());plb=[];bn++;}} 439if(plb.length>0){playlistNavBlocks.unshift(plb.reverse());plb=[];bn++;}} 440if(ic>p.__playlistItems.length-1){ic=p.__playlistItems.length-1;} 441for(pi=i;pi<=ic;pi++){ri=this.preparePlaylistItem(p.__playlistItems[pi]);plb.push(ri);plc.appendChild(ri);} 442p.__curPlaylistNavBlock=bn;playlistNavBlocks.push(plb);plb=[];for(pi=ic+1;pi<p.__playlistItems.length;pi++){plb.push(this.preparePlaylistItem(p.__playlistItems[pi]));if(plb.length>=p.__maxbatches){playlistNavBlocks.push(plb);plb=[];}} 443if(plb.length>0){playlistNavBlocks.push(plb);} 444p.__playlistNavBlocks=playlistNavBlocks;
444if(!p.__isStandalonePlaylist){plc.firstElementChild.classList.add('next-up');var fst=plc.firstElementChild.getElementsByClassName('filmstrip-title')[0];if(fst===undefined){fst=plc.firstElementChild.firstElementChild;} 445plc.firstElementChild.insertBefore(p.__playlistNextUpDiv,fst);if(plc.firstElementChild.getElementsByClassName('filmstrip-description')[0]===undefined){var fsd=document.createElement('span');fsd.classList.add('filmstrip-description');fsd.innerHTML=p.playlist[i].description;plc.firstElementChild.appendChild(fsd);}} 446this.renderNavArrows(pid);},repackagePlaylist:function(pid){var p=this.getPlayer(pid);if(!p.hasOwnProperty('__playlistContainer')||!p.__playlistBuilt){return;} 447this.clearPlaylist(pid);this.calculatePlaylistBatches(pid);this.setPlaylist(pid);},preparePlaylistItem:function(pi){var a=pi.getElementsByTagName('a');if(a.length===0){return;} 448var bi=a[0].style.backgroundImage;a[0].style.backgroundImage=bi.replace('/196x0.jpg','/380x0.jpg');if(pi.classList.contains('next-up')){pi.classList.remove('next-up');} 449return pi;},calculatePlaylistBatches:function(pid){var p=this.getPlayer(pid);var cl=this.getContainer(pid).classList;var maxbatches=9;var maxnp=3;if(p.__isStandalonePlaylist&&p.playlistFilmstripMap){maxbatches=p.playlistFilmstripMap.default;if(cl.contains('compact')){maxbatches=p.playlistFilmstripMap.compact;}else if(cl.contains('tiny')){maxbatches=p.playlistFilmstripMap.tiny;}else if(cl.contains('small')){maxbatches=p.playlistFilmstripMap.small;} 450maxnp=1;}else{if(cl.contains('compact')){maxbatches=1;maxnp=1;}else if(cl.contains('tiny')){maxbatches=4;maxnp=2;}else if(cl.contains('small')){maxbatches=6;maxnp=2;}} 451this.getPlayer(pid).__maxbatches=maxbatches;this.getPlayer(pid).__maxnp=maxnp;},openPlaylistFrame:function(pid){this.repackagePlaylist(pid);this.getPlaylistDiv(pid).classList.remove('closed');this.getPlayer(pid).__isPlaylistOpen=true;},closePlaylistFrame:function(pid){if(this.getPlayer(pid).__isPlaylistOpen){this.getPlaylistDiv(pid).classList.add('closed');this.getPlayer(pid).__isPlaylistOpen=false;}},updatePlaylistFrame:function(pid,choice){var p=this.getPlayer(pid);var nb=p.__curPlaylistNavBlock;if(nb+choice<0||nb+choice>=p.__playlistNavBlocks.length){return;} 452this.clearPlaylist(pid);p.__curPlaylistNavBlock=nb+choice;var bk=p.__playlistNavBlocks[p.__curPlaylistNavBlock];this.renderNavArrows(pid);var plc=p.__playlistContainer;for(var i=0;i<bk.length;i++){plc.appendChild(bk[i]);}},renderNavArrows:function(pid){var p=this.getPlayer(pid);if(p.__curPlaylistNavBlock===0){p.__playlistLeftNav.classList.remove('enabled');}else{p.__playlistLeftNav.classList.add('enabled');} 453if(p.__curPlaylistNavBlock===p.__playlistNavBlocks.length-1){p.__playlistRightNav.classList.remove('enabled');}else{p.__playlistRightNav.classList.add('enabled');}},playVideoItem:function(pid,i){var p=this.getPlayer(pid);if(i<0||i>p.playlist.length-1){i=0;} 454p.__playlistIndex=i;var vid=p.playlist[i].payload_id;p.player.playNewVideo(vid);},playNextVideo:function(pid){var p=this.__players[pid];if(p.playlist.length-1>p.__playlistIndex){if(this.__settings.autoplayNextVideo){this.playVideoItem(pid,p.__playlistIndex+1);return true;}else{this.openPlaylistFrame(pid);}} 455return false;},getNecleusCategoryParams:function(pl){var nlpc=pl.vnlp;if(!nlpc){return'&custom=[News]';} 456var categoryMap={'Arts & Entertainment':'Arts & Entertainment','Books & Literature':'Arts & Entertainment','Food & Drink':'Arts & Entertainment','Games':'Arts & Entertainment','Hobbies & Leisure':'Arts & Entertainment','Business & Industrial':'Business','Shopping':'Business','Adult':'Business','Autos & Vehicles':'Business','Real Estate':'Business','Beauty & Fitness':'Business','News':'News','Health':'News','Home & Garden':'News','Jobs & Education':'News','Law & Government':'News','People & Society':'News','Pets & Animals':'News','Reference':'News','Finance':'Personal Finance','Sports':'Sports','Computers & Electronics':'Technology','Internet & Telecom':'Technology','Science':'Technology','Online Communities':'Technology','Travel':'Travel'};nlpc=nlpc.replace(/\+/g,' ');var cds={};var cats=nlpc.split(',');var cat='';for(var i=0;i<cats.length;i++){cat=cats[i].split('/')[1];if(cat){cat=cat.trim();if(cat in categoryMap){cds[categoryMap[cat]]=categoryMap[cat];continue;}} 457cds['News']='News';} 458var ncats='';var ci=1;for(var c in cds){ncats+='&c'+(ci===1?'ustom':ci)+'=['+c+']';ci++;} 459return ncats;}};if(document.readyState==="complete"||(document.readyState!=="loading"&&!document.documentElement.doScroll)){HDN.MinuteMedia.maybeReady();}else{document.addEventListener("DOMContentLoaded",function(){HDN.MinuteMedia.maybeReady();});}}());
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.