var DfpSlotManagerMixin = DfpSlotManagerMixin || (function() { var DfpSlotManager = function() { this.dfpSlots = {}; this.initialize = function() { $(document).on('dfpSlotManager::updateSlot', function(e, data) { this.updateSlot(data); }.bind(this)); $(document).on('adsRefresher::beforeDfpRefresh', function() { this.beforeSlotRefresh(); }.bind(this)); }; this.getSlots = function() { return this.dfpSlots; }.bind(this); this.updateSlot = function(payload) { payload = typeof payload === 'object' ? payload : {}; if (!this.dfpSlots[payload.id]) { this.dfpSlots[payload.id] = payload; } else if (!$('#' + payload.id).hasClass('permanent_hide')) { $.extend(this.dfpSlots[payload.id], payload); } }.bind(this); this.handleSlotStacking = function(slot) { var direction = slot.refreshWhenNodeHasContent; var refreshable = true; if (!direction || direction === 'None') { return refreshable; } var slotNode = $('#' + slot.id)[0]; var $slotParent = $(slotNode.parentElement); var nodesToCheck = []; var $firstNodeToCheck = {}; var $secondNodeToCheck = {}; if (direction === 'Next') { $firstNodeToCheck = $slotParent.next(); $secondNodeToCheck = $firstNodeToCheck.next(); } else { $firstNodeToCheck = $slotParent.prev(); $secondNodeToCheck = $firstNodeToCheck.prev(); } nodesToCheck.push($firstNodeToCheck); nodesToCheck.push($secondNodeToCheck); var allChildrenEmpty = true; var nodesOk = false; nodesToCheck.forEach(function($nodeToCheck) { $nodeToCheck.children().each(function() { if ($(this).children().length || !!$.trim($(this).html())) { allChildrenEmpty = false; } return allChildrenEmpty; }); var isDfpSlot = $nodeToCheck.hasClass('ads_dfpslot') || $nodeToCheck.hasClass('v2_ads_dfpslot'); var nodeHasChildren = !!$nodeToCheck.children().length; var nodeHasText = $.trim($nodeToCheck.text()) !== ''; var nodeHasMarkup = $.trim($nodeToCheck.html()) !== ''; if (!isDfpSlot && ((!allChildrenEmpty && nodeHasText) || nodeHasChildren || nodeHasMarkup)) { nodesOk = true; } return nodesOk; }); if (!nodesOk) { slot.refresh = false; $('#' + slot.id).hide(); $('#' + slot.id).addClass('permanent_hide'); // Don't apply ad stacking logic if slot explicitly set { hidden: true }, // if hidden === true, slot is unaffiliated with ad stacking } else if (!slot.hidden) { slot.refresh = true; $('#' + slot.id).show(); } refreshable = slot.refresh; return refreshable; }; this.beforeSlotRefresh = function() { for (var key in this.dfpSlots) { this.handleSlotStacking(this.dfpSlots[key]); } }.bind(this); }; var dfpSlotManager = new DfpSlotManager(); dfpSlotManager.initialize(); var exposedManagerMethods = { getSlots: dfpSlotManager.getSlots, updateSlot: dfpSlotManager.updateSlot, beforeSlotRefresh: dfpSlotManager.beforeSlotRefresh }; return exposedManagerMethods; })(); var PageDepthManager = PageDepthManager || (function() { var pageDepth = 0; var prevHref; var attributes = { pageDepthVariableName: 'guteref' }; function initialize(options) { $.extend(attributes, options); function sameDomain() { return document.domain === sessionStorage.prevDomain; }; function uniqueReferal() { var uniq = document.referrer !== sessionStorage.prevReferrer; return !!document.referrer && uniq; }; if (sameDomain() && uniqueReferal()) { pageDepth = Number(sessionStorage.pageDepth); } sessionStorage.prevDomain = document.domain || ''; sessionStorage.prevReferrer = document.referrer || ''; initialize = function() { return this; } return this; } function emitDepth() { try { googletag.cmd.push(function() { googletag.pubads().setTargeting(attributes.pageDepthVariableName, String(pageDepth)); }); } catch(e) { // window.googletag || googletag.cmd undefined } return this; }; function incrementDepth() { var pageChange = prevHref !== location.href; if (pageChange) { pageDepth += 1; sessionStorage.pageDepth = pageDepth; } prevHref = location.href; return this; }; function getDepth() { return pageDepth; }; return { initialize: initialize, emitDepth: emitDepth, incrementDepth: incrementDepth, getDepth: getDepth }; })(); var AppContentData = AppContentData || (function() { var moduleName = 'js_app_contentdata-0'; var ContentDataController = function() { var pageData = __page_data__ || {}; var data = pageData[moduleName]; var actionHandlers = function() { return { 'contentData::getCategories': this.getCategories, 'contentData::getTitle': this.getTitle }; }.bind(this); var bindActionHandlers = function() { actionHandlers = actionHandlers(); var keys = Object.keys(actionHandlers); for (var i = 0; i < keys.length; i++) { var action = keys[i]; var handler = actionHandlers[keys[i]]; $(document).on(action, handler); } }; this.initialize = function() { bindActionHandlers(); }; this.getCategories = function(event, payload) { payload = payload || {}; if (!data.categories) { return undefined; } var categories = { category: data.categories.category, subcategory: data.categories.subcategory }; if (!!payload.done) { payload.done.call(payload.done, categories); } return categories; }.bind(this); this.getTitle = function(event, payload) { payload = payload || {}; if (!data.title) { return undefined; } if (!!payload.done) { payload.done.call(payload.done, data.title); } return data.title; }.bind(this); }; var controller = new ContentDataController() controller.initialize() return { getCategories: function(payload) { return controller.getCategories(null, payload); }, getTitle: function(payload) { return controller.getTitle(null, payload); } }; })(); /* prebid.js v0.8.1 Updated : 2016-04-26 */ !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(){for(var e=0;e<_.que.length;e++)if(I(_.que[e].called)===x)try{_.que[e].call(),_.que[e].called=!0}catch(t){E.logError("Error processing command :","prebid.js",t)}}function i(e,t){var n=0;if(n=("undefined"==typeof e?"undefined":I(e))===x||null===e?_.bidderTimeout:e,!o())return E.logMessage("No adUnits configured. No bids requested."),void 0;if(setTimeout(w.executeCallback,n),t&&E.isArray(t)){for(var r=0;r0&&r.push({cpm:a.cpm,bid:a}),t.push(i)}}if(n&&0!==r.length){var d=c(r),s=d.adserverTargeting;q[n]=E.extend(q[n],s)}return t}function g(e){var t={};if(e){var n=JSON.stringify(e);t=JSON.parse(n),delete t.pbLg,delete t.pbMg,delete t.pbHg}return t}function m(){w.clearAllBidResponses(),M={},k=[],q={},F=!1}function b(e){m(),i(e)}function h(e){var t=E._map(k,function(e){return e.code});return E.contains(t,e)?!0:(E.logError('The "'+e+'" placement is not defined.'),void 0)}function v(e){var t=null;return e&&(t=_.getAdserverTargetingForAdUnitCode(e.getSlotElementId()),t||(t=_.getAdserverTargetingForAdUnitCode(e.getAdUnitPath()))),t}function y(e){var t=B.TARGETING_KEYS,n={};return E._each(e,function(e){e.adserverTargeting&&E._each(t,function(t){n[t+"_"+e.bidderCode]=e.adserverTargeting[t]})}),n}var I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};window.pbjs=window.pbjs||{},window.pbjs.que=window.pbjs.que||[];var _=window.pbjs,B=n(1),E=n(2),w=n(4),A=n(6),T=n(9),S=n(10),C=n(17),R=n(5),D="function",x="undefined",P="object",U="string",N=B.EVENTS.BID_WON,O=B.EVENTS.BID_TIMEOUT,j=[],k=[],M={},q={},G={},F=!1,z=!1,L={bidWon:h};_.bidderTimeout=_.bidderTimeout||3e3,_.logging=_.logging||!1,_.libLoaded=!0,E.logInfo("Prebid.js v0.8.1 loaded"),_.adUnits=_.adUnits||[],_.que.push=function(e){if(("undefined"==typeof e?"undefined":I(e))===D)try{e.call()}catch(t){E.logError("Error processing command :"+t.message)}else E.logError("Commands written into pbjs.que.push must wrapped in a function")},_.getAdserverTargetingForAdUnitCodeStr=function(e){if(E.logInfo("Invoking pbjs.getAdserverTargetingForAdUnitCodeStr",arguments),e){var t=_.getAdserverTargetingForAdUnitCode(e);return E.transformAdServerTargetingObj(t)}E.logMessage("Need to call getAdserverTargetingForAdUnitCodeStr with adunitCode")},_.getAdserverTargetingForAdUnitCode=function(e){return E.logInfo("Invoking pbjs.getAdserverTargetingForAdUnitCode",arguments),_.getBidResponses(e),e?q[e]:q},_.getAdserverTargeting=function(){return E.logInfo("Invoking pbjs.getAdserverTargeting",arguments),_.getAdserverTargetingForAdUnitCode()},_.getBidResponses=function(e){E.logInfo("Invoking pbjs.getBidResponses",arguments);var t={},n=[],r={};if(e)t=f(e),n=[],t&&t.bids&&(n=p(t.bids)),r={bids:n};else{t=f();for(var i in t)t.hasOwnProperty(i)&&(t&&t[i]&&t[i].bids&&(n=p(t[i].bids)),r[i]={bids:n})}return r},_.getBidResponsesForAdUnitCode=function(e){return E.logInfo("Invoking pbjs.getBidResponsesForAdUnitCode",arguments),_.getBidResponses(e)},_.setTargetingForAdUnitsGPTAsync=function(e){if(E.logInfo("Invoking pbjs.setTargetingForAdUnitsGPTAsync",arguments),!window.googletag||!E.isFn(window.googletag.pubads)||!E.isFn(window.googletag.pubads().getSlots))return E.logError("window.googletag is not defined on the page"),void 0;a();var t=e;("undefined"==typeof e?"undefined":I(e))===U?t=[e]:("undefined"==typeof e?"undefined":I(e))===P&&(t=e);var n,r={},i=0;if(t)for(i=0;i'),e.close(),e.defaultView&&e.defaultView.frameElement&&(e.defaultView.frameElement.width=i,e.defaultView.frameElement.height=r)):E.logError("Error trying to write ad. No ad for bid response id: "+t)}else E.logError("Error trying to write ad. Cannot find ad by given id : "+t)}catch(d){E.logError("Error trying to write ad Id :"+t+" to the page:"+d.message)}else E.logError("Error trying to write ad Id :"+t+" to the page. Missing document or adId")},_.requestBidsForAdUnit=function(e){m(),i(e)},_.requestBidsForAdUnits=function(e){if(!e||e.constructor!==Array)return E.logError("requestBidsForAdUnits must pass an array of adUnits"),void 0;m();var t=_.adUnits.slice(0);_.adUnits=e,i(),_.adUnits=t},_.removeAdUnit=function(e){if(E.logInfo("Invoking pbjs.removeAdUnit",arguments),e)for(var t=0;t<_.adUnits.length;t++)_.adUnits[t].code===e&&_.adUnits.splice(t,1)},_.requestBids=function(e){if(E.logInfo("Invoking pbjs.requestBids",arguments),e){var t=e.adUnitCodes,n=e.adUnits,r=e.timeout,o=e.bidsBackHandler,a=_.adUnits.slice(0);("undefined"==typeof o?"undefined":I(o))===D&&w.addOneTimeCallback(o),t&&E.isArray(t)?(m(),i(r,t)):n&&E.isArray(n)?(m(),_.adUnits=n,i(r)):b(r),_.adUnits=a}else b()},_.addAdUnits=function(e){E.logInfo("Invoking pbjs.addAdUnits",arguments),E.isArray(e)?_.adUnits.push.apply(_.adUnits,e):("undefined"==typeof e?"undefined":I(e))===P&&_.adUnits.push(e)},_.onEvent=function(e,t,n){return E.logInfo("Invoking pbjs.onEvent",arguments),E.isFn(t)?n&&!L[e].call(null,n)?(E.logError('The id provided is not valid for event "'+e+'" and no handler was set.'),void 0):(R.on(e,t,n),void 0):(E.logError('The event handler provided is not a function and was not set on event "'+e+'".'),void 0)},_.offEvent=function(e,t,n){E.logInfo("Invoking pbjs.offEvent",arguments),(!n||L[e].call(null,n))&&R.off(e,t,n)},_.addCallback=function(e,t){E.logInfo("Invoking pbjs.addCallback",arguments);var n=null;return e&&t&&("undefined"==typeof t?"undefined":I(t))===D?(n=E.getUniqueIdentifierStr,w.addCallback(n,t,e),n):(E.logError("error registering callback. Check method signature"),n)},_.removeCallback=function(){return null},_.registerBidAdapter=function(e,t){E.logInfo("Invoking pbjs.registerBidAdapter",arguments);try{A.registerBidAdapter(e(),t)}catch(n){E.logError("Error registering bidder adapter : "+n.message)}},_.bidsAvailableForAdapter=function(e){E.logInfo("Invoking pbjs.bidsAvailableForAdapter",arguments);for(var t=M[e].bids,n=0;n0)if(2===a&&o(e[0])===c&&o(e[1])===c)t.push(this.parseGPTSingleSizeArray(e));else for(var d=0;a>d;d++)t.push(this.parseGPTSingleSizeArray(e[d]))}return t},t.parseGPTSingleSizeArray=function(e){return!this.isArray(e)||2!==e.length||isNaN(e[0])||isNaN(e[1])?void 0:e[0]+"x"+e[1]},t.getTopWindowUrl=function(){try{return window.top.location.href}catch(e){return window.location.href}},t.logWarn=function(e){E()&&console.warn&&console.warn("WARNING: "+e)},t.logInfo=function(e,t){E()&&i()&&y&&(t&&0!==t.length||(t=""),y("INFO: "+e+(""===t?"":" : params : "),t))},t.logMessage=function(e){E()&&i()&&console.log("MESSAGE: "+e)},t.hasConsoleLogger=i;var B=function(e){return e?window.console.error?"error":"log":""}(i()),E=function(){return pbjs.logging===!1&&l===!1&&(pbjs.logging="TRUE"===w(a.DEBUG_MODE).toUpperCase(),l=!0),!!pbjs.logging};t.debugTurnedOn=E,t.logError=function(e,t,n){var r=t||"ERROR";E()&&i()&&console[B].call(console,r+": "+e,n||"")},t.createInvisibleIframe=function(){var e=document.createElement("iframe");return e.id=r(),e.height=0,e.width=0,e.border="0px",e.hspace="0",e.vspace="0",e.marginWidth="0",e.marginHeight="0",e.style.border="0",e.scrolling="no",e.frameBorder="0",e.src="about:blank",e.style.display="none",e};var w=function(e){var t="[\\?&]"+e+"=([^&#]*)",n=new RegExp(t),r=n.exec(window.location.search);return null===r?"":decodeURIComponent(r[1].replace(/\+/g," "))};t.getPriceBucketString=function(e){var t="",n="",r="",i="",o=0,a={low:t,med:n,high:r,auto:i};try{o=parseFloat(e),o&&(a.low=o>f?f.toFixed(2):(Math.floor(2*e)/2).toFixed(2),a.med=o>p?p.toFixed(2):(Math.floor(10*e)/10).toFixed(2),a.high=o>g?g.toFixed(2):(Math.floor(100*e)/100).toFixed(2),a.auto=5>=o?(Math.floor(20*e)/20).toFixed(2):10>=o?(Math.floor(10*e)/10).toFixed(2):20>=o?(Math.floor(2*e)/2).toFixed(2):"20.00")}catch(d){this.logError("Exception parsing CPM :"+d.message)}return a},t.hasValidBidRequest=function(e,t,n){function r(e,n){n===t[o]&&(i=!0)}for(var i=!1,o=0;o0);for(var t in e)if(hasOwnProperty.call(e,t))return!1;return!0},t._each=function(e,t){if(!this.isEmpty(e)){if(this.isFn(e.forEach))return e.forEach(t,this);var n=0,r=e.length;if(r>0)for(;r>n;n++)t(e[n],n,e);else for(n in e)hasOwnProperty.call(e,n)&&t.call(this,e[n],n)}},t.contains=function(e,t){if(this.isEmpty(e))return!1;if(this.isFn(e.indexOf))return-1!==e.indexOf(t);for(var n=e.length;n--;)if(e[n]===t)return!0;return!1},t.indexOf=function(){return Array.prototype.indexOf?Array.prototype.indexOf:d.indexOf}(),t._map=function(e,t){if(this.isEmpty(e))return[];if(this.isFn(e.map))return e.map(t);var n=[];return this._each(e,function(r,i){n.push(t(r,i,e))}),n};var A=function(e,t){return e.hasOwnProperty?e.hasOwnProperty(t):"undefined"!=typeof e[t]&&e.constructor.prototype[t]!==e[t]};t.createTrackPixelHtml=function(e){if(!e)return"";var t=encodeURI(e),n='
';return n+='
'},t.getIframeDocument=function(e){if(e){var t=void 0;try{t=e.contentWindow?e.contentWindow.document:e.contentDocument.document?e.contentDocument.document:e.contentDocument}catch(n){this.logError("Cannot get iframe document",n)}return t}}},function(e,t){"use strict";t.indexOf=function(e,t){var n,r;if(null===this)throw new TypeError('"this" is null or not defined');var i=Object(this);if(n=i.length>>>0,0===n)return-1;var o=+t||0;if(1/0===Math.abs(o)&&(o=0),o>=n)return-1;for(r=Math.max(o>=0?o:n-Math.abs(o),0);n>r;){if(r in i&&i[r]===e)return r;r++}return-1}},function(e,t,n){"use strict";function r(){for(var e in S)delete S[e];for(var t=0;tt)&&(e=!1)}),e}function p(e){var t=e.bidderCode,n=e.cpm;if(t&&pbjs.bidderSettings&&pbjs.bidderSettings[t]&&g(pbjs.bidderSettings[t].bidCpmAdjustment)===v)try{n=pbjs.bidderSettings[t].bidCpmAdjustment.call(null,e.cpm)}catch(r){b.logError("Error during bid adjustment","bidmanager.js",r)}0!==n&&(e.cpm=n)}var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},m=n(1),b=n(2),h=n(5),v="function",y="undefined",I=[],_=[],B=null,E={},w={};t.pbCallbackMap=w;var A={};t.pbBidResponseByPlacement=A;var T={};t._adResponsesByBidderId=T;var S={};t.bidResponseReceivedCount=S;var C={},R=!1,D=!1,x=m.GRANULARITY_OPTIONS.MEDIUM,P={},U={};t.getPlacementIdByCBIdentifer=function(e){return w[e]},t.getBidResponseByAdUnit=function(){return A},t.clearAllBidResponses=function(){R=!1,D=!1,r(),o(),_.called=!1;for(var e in this.pbBidResponseByPlacement)delete this.pbBidResponseByPlacement[e]},t.getTimedOutBidders=function(){return b._map(S,function(e,t){return 0===e?t:void 0})},t.increaseBidResponseReceivedCount=function(e){i(e)},t.setExpectedBidsCount=function(e,t){C[e]=t},t.getExpectedBidsCount=a,t.addBidResponse=function(e,t){var n={};if(t){t.requestTimestamp=U[t.bidderCode],t.responseTimestamp=(new Date).getTime(),t.timeToRespond=t.responseTimestamp-t.requestTimestamp,i(t.bidderCode),2===t.getStatusCode()&&(t.cpm=0),t.bidder=t.bidderCode,h.emit(m.EVENTS.BID_ADJUSTMENT,t),h.emit(m.EVENTS.BID_RESPONSE,e,t);var r=b.getPriceBucketString(t.cpm,t.height,t.width);t.pbLg=r.low,t.pbMg=r.med,t.pbHg=r.high,t.pbAg=r.auto,t.adUnitCode=e;var o={};t.bidderCode&&0!==t.cpm&&(o=this.getKeyValueTargetingPairs(t.bidderCode,t),t.adserverTargeting=o),t.adId&&(T[t.adId]=t),e&&A[e]&&!b.isEmpty(A[e])?(n=A[e],n.bids.push(t),n.bidsReceivedCount++):b.logError("Internal error in bidmanager.addBidResponse. Params: "+e+" & "+t)}else n=this.createEmptyBidResponseObj();A[e]=n,this.checkIfAllBidsAreIn(e)},t.createEmptyBidResponseObj=function(){return{bids:[],allBidsAvailable:!1,bidsReceivedCount:0}},t.getKeyValueTargetingPairs=function(e,t){var n={},r=pbjs.bidderSettings||{};return t&&r&&(r[m.JSON_MAPPING.BD_SETTING_STANDARD]||(r[m.JSON_MAPPING.BD_SETTING_STANDARD]={adserverTargeting:[{key:"hb_bidder",val:function(e){return e.bidderCode}},{key:"hb_adid",val:function(e){return e.adId}},{key:"hb_pb",val:function(e){return x===m.GRANULARITY_OPTIONS.AUTO?e.pbAg:x===m.GRANULARITY_OPTIONS.LOW?e.pbLg:x===m.GRANULARITY_OPTIONS.MEDIUM?e.pbMg:x===m.GRANULARITY_OPTIONS.HIGH?e.pbHg:void 0}},{key:"hb_size",val:function(e){return e.size}}]}),d(n,r[m.JSON_MAPPING.BD_SETTING_STANDARD],t)),e&&t&&r&&r[e]&&r[e][m.JSON_MAPPING.ADSERVER_TARGETING]?(d(n,r[e],t),t.alwaysUseBid=r[e].alwaysUseBid):P[e]&&(d(n,P[e],t),t.alwaysUseBid=P[e].alwaysUseBid),n},t.setPriceGranularity=function(e){var t=m.GRANULARITY_OPTIONS;Object.keys(t).filter(function(n){return e===t[n]})?x=e:(b.logWarn("Prebid Warning: setPriceGranularity was called with invalid setting, using `medium` as default."),x=m.GRANULARITY_OPTIONS.MEDIUM)},t.registerDefaultBidderSetting=function(e,t){P[e]=t},t.registerBidRequestTime=function(e,t){U[e]=t},t.executeCallback=function(){var e=[];if(g(pbjs.registerBidCallbackHandler)===v&&!D)try{pbjs.registerBidCallbackHandler(),D=!0}catch(t){D=!0,b.logError("Exception trying to execute callback handler registered : "+t.message)}if(_.called!==!0&&(u(_,e),_.called=!0),B){e=[];var n=pbjs.getBidResponses();e.push(n),u(B,e),B=null}},t.allBidsBack=function(){return R},t.setBidderMap=function(e){E=e},t.checkIfAllBidsAreIn=function(e){R=f(),l(e),R&&this.executeCallback()},t.addOneTimeCallback=function(e){B=e},t.addCallback=function(e,t,n){t.id=e,m.CB.TYPE.ALL_BIDS_BACK===n?_.push(t):m.CB.TYPE.AD_UNIT_BIDS_BACK===n&&I.push(t)},h.on(m.EVENTS.BID_ADJUSTMENT,function(e){p(e)})},function(e,t,n){"use strict";var r=n(2),i=n(1),o=Array.prototype.slice,a=Array.prototype.push,d=r._map(i.EVENTS,function(e){return e}),s=i.EVENT_ID_PATHS,u=[];e.exports=function(){function e(e,t){r.logMessage("Emitting event for: "+e);var i=t[0],o=s[e],d=i[o],c=n[e]||{que:[]},l=r._map(c,function(e,t){return t}),f=[];u.push({eventType:e,args:i,id:d}),d&&r.contains(l,d)&&a.apply(f,c[d].que),a.apply(f,c.que),r._each(f,function(e){if(e)try{e.apply(null,t)}catch(n){r.logError("Error executing handler:","events.js",n)}})}function t(e){return r.contains(d,e)}var n={},i={};return i.on=function(e,i,o){if(t(e)){var a=n[e]||{que:[]};o?(a[o]=a[o]||{que:[]},a[o].que.push(i)):a.que.push(i),n[e]=a}else r.logError("Wrong event name : "+e+" Valid event names :"+d)},i.emit=function(t){var n=o.call(arguments,1);e(t,n)},i.off=function(e,t,i){var o=n[e];r.isEmpty(o)||r.isEmpty(o.que)&&r.isEmpty(o[i])||i&&(r.isEmpty(o[i])||r.isEmpty(o[i].que))||(i?r._each(o[i].que,function(e){var n=o[i].que;e===t&&n.splice(r.indexOf.call(n,e),1)}):r._each(o.que,function(e){var n=o.que;e===t&&n.splice(r.indexOf.call(n,e),1)}),n[e]=o)},i.get=function(){return n},i.getEvents=function(){var e=[];return r._each(u,function(t){var n=r.extend({},t);e.push(n)}),e},i}()},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},i=n(7),o=n(4),a=n(2),d=n(1),s=n(5),u={};t.bidderRegistry=u,t.callBids=function(e){for(var t=0;t0?"&":"?",n=e+t+"rnd="+Math.floor(1e7*Math.random()),(new Image).src=n,n):(i.logMessage("Missing or invalid pixelUrl."),void 0)}},function(e,t,n){"use strict";var r,i=n(1),o=n(2),a=n(10),d=n(4),s=n(9),u=n(12);r=function(){function e(e,t){var n=o.getBidIdParamater("placementId",e.params),r=o.getBidIdParamater("memberId",e.params),i=o.getBidIdParamater("member",e.params),a=o.getBidIdParamater("invCode",e.params),d=o.getBidIdParamater("query",e.params),s=o.getBidIdParamater("referrer",e.params),u=o.getBidIdParamater("alt_referrer",e.params),c="http"+("https:"===document.location.protocol?"s://secure.adnxs.com/jpt?":"://ib.adnxs.com/jpt?");c=o.tryAppendQueryString(c,"callback","pbjs.handleAnCB"),c=o.tryAppendQueryString(c,"callback_uid",t),c=o.tryAppendQueryString(c,"psa","0"),c=o.tryAppendQueryString(c,"id",n),i?c=o.tryAppendQueryString(c,"member",i):r&&(c=o.tryAppendQueryString(c,"member",r),o.logMessage('appnexus.callBids: "memberId" will be deprecated soon. Please use "member" instead')),c=o.tryAppendQueryString(c,"code",a),c=o.tryAppendQueryString(c,"code",a);var l="",f=o.parseSizesInput(e.sizes),p=f.length;if(p>0&&(l="size="+f[0],p>1)){l+="&promo_sizes=";for(var g=1;p>g;g++)l+=f[g]+=",";l&&","===l.charAt(l.length-1)&&(l=l.slice(0,l.length-1))}l&&(c+=l+"&");var m=o.parseQueryStringParameters(d);m&&(c+=m);var b=o.extend({},e.params);delete b.placementId,delete b.memberId,delete b.invCode,delete b.query,delete b.referrer,delete b.alt_referrer,delete b.member;var h=o.parseQueryStringParameters(b);return h&&(c+=h),""===s&&(s=o.getTopWindowUrl()),c=o.tryAppendQueryString(c,"referrer",s),c=o.tryAppendQueryString(c,"alt_referrer",u),c.lastIndexOf("&")===c.length-1&&(c=c.substring(0,c.length-1)),o.logMessage("jpt request built: "+c),e.startTime=(new Date).getTime(),c}var n=u.createNew("appnexus");return n.callBids=function(t){var r=n.getBidderCode(),i=t.bids,s=i.length;d.setExpectedBidsCount(r,s);for(var u=0;s>u;u++){var c=i[u],l=o.getUniqueIdentifierStr();a.loadScript(e(c,l)),d.pbCallbackMap[l]=c}},pbjs.handleAnCB=function(e){var t;if(e&&e.callback_uid){var n,r=e.callback_uid,a="",u=d.getPlacementIdByCBIdentifer(r);u&&(t=u.bidder,a=u.placementCode,u.status=i.STATUS.GOOD),o.logMessage("JSONP callback function called for ad ID: "+r);var c=[];if(e.result&&e.result.cpm&&0!==e.result.cpm){n=parseInt(e.result.cpm,10),n/=1e4;var l=e.result.creative_id;c=s.createBid(1),c.creative_id=l,c.bidderCode=t,c.cpm=n,c.adUrl=e.result.ad,c.width=e.result.width,c.height=e.result.height,c.dealId=e.result.deal_id,d.addBidResponse(a,c)}else o.logMessage("No prebid response from AppNexus for placement code "+a),c=s.createBid(2),c.bidderCode=t,d.addBidResponse(a,c) }else o.logMessage("No prebid response for placement %%PLACEMENT%%")},{callBids:n.callBids,setBidderCode:n.setBidderCode,createNew:t.createNew,buildJPTCall:e}},t.createNew=function(){return new r}},function(e,t){"use strict";function n(e){function t(e){i=e}function n(){return i}function r(){}var i=e;return{callBids:r,setBidderCode:t,getBidderCode:n}}t.createNew=function(e){return new n(e)}},function(e,t,n){"use strict";var r=n(2),i=n(9),o=n(4),a=n(10),d="INDEXEXCHANGE",s="indexExchange",u=function(){};window.cygnus_index_args={};var c=[[728,90],[120,600],[300,250],[160,600],[336,280],[234,60],[300,600],[300,50],[320,50],[970,250],[300,1050],[970,90],[180,150]],l=function(){function e(e){var t=o[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}function t(t){return i.lastIndex=0,i.test(t)?t.replace(i,e):t}function n(e,t,n){if(this.initialized=!1,"number"!=typeof e||e%1!==0||0>e)throw"Invalid Site ID";if("number"==typeof n&&n%1===0&&n>=0&&(this.timeoutDelay=n),this.siteID=e,this.impressions=[],this._parseFnName=void 0,top===self?(this.sitePage=location.href,this.topframe=1):(this.sitePage=document.referrer,this.topframe=0),"undefined"!=typeof t){if("function"!=typeof t)throw"Invalid jsonp target function";this._parseFnName="cygnus_index_args.parseFn"}_IndexRequestData.requestCounter="undefined"==typeof _IndexRequestData.requestCounter?Math.floor(256*Math.random()):(_IndexRequestData.requestCounter+1)%256,this.requestID=String((new Date).getTime()%2592e3*256+_IndexRequestData.requestCounter+256),this.initialized=!0}window.index_slots=[],window.cygnus_index_args.parseFn=u;var i=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};n.prototype.serialize=function(){var e='{"id":'+this.requestID+',"site":{"page":"'+t(this.sitePage)+'"';"string"==typeof document.referrer&&(e+=',"ref":"'+t(document.referrer)+'"'),e+='},"imp":[';for(var n=0;n0&&(e+=',"ext": {'+i.join()+"}"),e+=n+1===this.impressions.length?"}":"},"}return e+="]}"},n.prototype.setPageOverride=function(e){return"string"!=typeof e||e.match(/^\s*$/)?!1:(this.sitePage=e,!0)},n.prototype.addImpression=function(e,t,n,r,i,o){var a={id:String(this.impressions.length+1)};if("number"!=typeof e||1>=e)return null;if("number"!=typeof t||1>=t)return null;if(("string"==typeof i||"number"==typeof i)&&String(i).length<=50&&(a.slotID=String(i)),a.w=e,a.h=t,void 0!==n&&"number"!=typeof n)return null;if("number"==typeof n){if(0>n)return null;if(a.bidfloor=n,void 0!==r&&"string"!=typeof r)return null;a.bidfloorcur=r}if("undefined"!=typeof o){if(!("number"==typeof o&&o%1===0&&o>=0))return null;a.siteID=o}return this.impressions.push(a),a.id},n.prototype.buildRequest=function(){if(0!==this.impressions.length&&this.initialized===!0){var e=encodeURIComponent(this.serialize()),t="https:"===window.location.protocol?"https://as-sec.casalemedia.com":"http://as.casalemedia.com";return t+="/headertag?v=9&x3=1&fn=cygnus_index_parse_res&s="+this.siteID+"&r="+e,"number"==typeof this.timeoutDelay&&this.timeoutDelay%1===0&&this.timeoutDelay>=0&&(t+="&t="+this.timeoutDelay),t}};try{if("undefined"==typeof cygnus_index_args||"undefined"==typeof cygnus_index_args.siteID||"undefined"==typeof cygnus_index_args.slots)return;"undefined"==typeof window._IndexRequestData&&(window._IndexRequestData={},window._IndexRequestData.impIDToSlotID={},window._IndexRequestData.reqOptions={});var a=new n(cygnus_index_args.siteID,cygnus_index_args.parseFn,cygnus_index_args.timeout);cygnus_index_args.url&&"string"==typeof cygnus_index_args.url&&a.setPageOverride(cygnus_index_args.url),_IndexRequestData.impIDToSlotID[a.requestID]={},_IndexRequestData.reqOptions[a.requestID]={};for(var s,c,l=0;l20&&r.logError("Too many unique sizes on slots, will use the first 20.",d),o.setExpectedBidsCount(s,b),a.loadScript(l());var R=!1;window.cygnus_index_ready_state=function(){if(!R){R=!0;try{var e=_IndexRequestData.targetIDToBid;for(var t in f){var a=f[t],c=a.placementCode,l=[];for(var p in e){var g=/(T\d_)?(.+)_(\d+)_(\d+)/.exec(p),m=g[1]||"",b=g[2],h=g[3],v=g[4],y=b+"_"+h,I=n(cygnus_index_args,m+y);if(b===t){var _=i.createBid(1);_.cpm=v/100,_.ad=e[p][0],_.ad_id=t,_.bidderCode=s,_.width=I.width,_.height=I.height,_.siteID=I.siteID,l.push(_)}}var B=void 0;if(l.length>0)for(var E=0;EB.cpm&&(B=_):B=_}else{var _=i.createBid(2);_.bidderCode=s,B=_}o.addBidResponse(c,B)}}catch(w){r.logError("Error calling index adapter",d,w),u()}f={}}}}}function t(e,t){for(var n=0;n',a.adUrl=o.get("ad_url"),a.width=o.get("width"),a.height=o.get("height"),i.addBidResponse(n.placementCode,a)}else a=r.createBid(2),a.bidderCode="openx",i.addBidResponse(n.placementCode,a)},OX.Hooks.ON_AD_RESPONSE),t.load()})}var a,d,s=e||{};return{callBids:t}};e.exports=a},function(e,t,n){"use strict";var r=n(2),i=n(4),o=n(9),a=n(10),d=function(){function e(e,t){var n=o.createBid(2);return n.bidderCode=b,n.error=t,n}function t(e,t){return(t.cpm||0)-(e.cpm||0)}function n(e,t){var n=h[t.join("x")];return n?y+e+'", "'+n+I:(r.logError("fastlane: missing sizeId for size: "+t.join("x")+" could not render creative",b,h),"")}function d(i,a){a=a.sort(t);var d=o.createBid(1),s=a[0],u=s.dimensions;return u?(d.bidderCode=b,d.cpm=s.cpm,d.ad=n(i.getElementId(),u),d.width=u[0],d.height=u[1],d):(r.logError("no dimensions given",b,s),e(i,a))}function s(t,n){var r;r=n&&0!==n.length?d(t,n):e(t,n),i.addBidResponse(t.getElementId(),r)}function u(e){window.rubicontag.cmd.push(e)}function c(e,t){if(!v){v=1;var n=e.accountId,r=m+n+".js";a.loadScript(r,t)}}function l(e){r._each(e,function(e){if(!e.params.sizes){for(var t=r.parseSizesInput(e.sizes),n=[],i=0;ir;r++)t.push(f(n[r]));var o={slots:t},a=function(){p(t)};window.rubicontag.run(a,o)}))}var m=window.location.protocol+"//ads.rubiconproject.com/header/",b="rubicon",h={"728x90":2,"160x600":9,"300x600":10,"300x250":15,"320x50":43,"300x1050":54,"970x250":57},v=0,y='';window.rubicontag=window.rubicontag||{},window.rubicontag.cmd=window.rubicontag.cmd||[];var _=null;return{callBids:g}};e.exports=d},function(e,t,n){"use strict";var r,i=n(1),o=n(2),a=n(9),d=n(4),s=n(10),u=function(){function e(e){var n=e.bids||[];t(n)}function t(e){var t=window.location.host,n=window.location.pathname+location.search+location.hash,a=[];r=[],o._each(e,function(e){var t=o.getBidIdParamater("tagid",e.params),n=o.getBidIdParamater("bidfloor",e.params),i=0,s=0,u=e.sizes.length;2===u&&"number"==typeof e.sizes[0]&&"number"==typeof e.sizes[1]?(i=e.sizes[0],s=e.sizes[1]):(i=e.sizes[0][0],s=e.sizes[0][1]);var c={id:o.getUniqueIdentifierStr(),banner:{w:i,h:s},tagid:t,bidfloor:n};a.push(c),d.pbCallbackMap[c.id]=e,r.push(e.placementCode)});var c={id:o.getUniqueIdentifierStr(),imp:a,site:{domain:t,page:n}},l="//"+u+"?callback=window.pbjs.sovrnResponse&src="+i.REPO_AND_VERSION+"&br="+encodeURIComponent(JSON.stringify(c));s.loadScript(l,null)}function n(e){o._each(r,function(t){if(o.contains(e,t))return null;var n={};n=a.createBid(2),n.bidderCode="sovrn",d.addBidResponse(t,n)})}var u="ap.lijit.com/rtb/bid";return pbjs.sovrnResponse=function(e){if(e&&e.id)if(e.seatbid&&0!==e.seatbid.length&&e.seatbid[0].bid&&0!==e.seatbid[0].bid.length){var t=[];e.seatbid[0].bid.forEach(function(e){var n,r="",o=e.impid,s={},u=d.getPlacementIdByCBIdentifer(o);if(u)if(r=u.placementCode,t.push(r),u.status=i.STATUS.GOOD,n=parseFloat(e.price),0!==n){e.placementCode=r,e.size=u.sizes;var c=e.adm,l='';s=a.createBid(1),s.creative_id=e.id,s.bidderCode="sovrn",s.cpm=n,s.ad=decodeURIComponent(c+l),s.width=parseInt(e.w),s.height=parseInt(e.h),d.addBidResponse(r,s)}else s=a.createBid(2),s.bidderCode="sovrn",d.addBidResponse(r,s);else s=a.createBid(2),s.bidderCode="sovrn",d.addBidResponse(r,s)}),n(t)}else n([]);else n([])},{callBids:e}};e.exports=u},function(e,t,n){"use strict";function r(){if(_&&"function"==typeof window[I]){for(var e=0;e=0&&200>e?t="0-200ms":e>=200&&300>e?t="200-300ms":e>=300&&400>e?t="300-400ms":e>=400&&500>e?t="400-500ms":e>=500&&600>e?t="500-600ms":e>=600&&800>e?t="600-800ms":e>=800&&1e3>e?t="800-1000ms":e>=1e3&&1200>e?t="1000-1200ms":e>=1200&&1500>e?t="1200-1500ms":e>=1500&&2e3>e?t="1500-2000ms":e>=2e3&&(t="2000ms above"),t}function a(e){var t;return e>=0&&.5>e?t="$0-0.5":e>=.5&&1>e?t="$0.5-1":e>=1&&1.5>e?t="$1-1.5":e>=1.5&&2>e?t="$1.5-2":e>=2&&2.5>e?t="$2-2.5":e>=2.5&&3>e?t="$2.5-3":e>=3&&4>e?t="$3-4":e>=4&&6>e?t="$4-6":e>=6&&8>e?t="$6-8":e>=8&&(t="$8 above"),t}function d(e){e&&e.bidderCode&&y.push(function(){E++,window[I](T,"event",B,"Requests",e.bidderCode,1,v)}),r()}function s(e){e&&e.bidderCode&&y.push(function(){var t=i(e.cpm),n=e.bidderCode;if("undefined"!=typeof e.timeToRespond&&w){E++;var r=o(e.timeToRespond);window[I](T,"event","Prebid.js Load Time Distribution",r,n,1,v)}if(e.cpm>0){E+=2;var d=a(e.cpm);w&&(E++,window[I](T,"event","Prebid.js CPM Distribution",d,n,1,v)),window[I](T,"event",B,"Bids",n,t,v),window[I](T,"event",B,"Bid Load Time",n,e.timeToRespond,v)}}),r()}function u(e){e&&e.bidder&&y.push(function(){f._each(A,function(t){e.bidder===t&&(E++,window[I](T,"event",B,"Timeouts",t,e.timeToRespond,v))})}),r()}function c(e){var t=i(e.cpm);y.push(function(){E++,window[I](T,"event",B,"Wins",e.bidderCode,t,v)}),r()}var l=n(5),f=n(2),p=n(1),g=p.EVENTS.BID_REQUESTED,m=p.EVENTS.BID_TIMEOUT,b=p.EVENTS.BID_RESPONSE,h=p.EVENTS.BID_WON,v={nonInteraction:!0},y=[],I=null,_=!0,B="Prebid.js Bids",E=0,w=!1,A=[],T=null;t.enableAnalytics=function(e){I="undefined"!=typeof e.global?e.global:"ga",T=e.trackerName?e.trackerName+".send":"send","undefined"!=typeof e.enableDistribution&&(w=e.enableDistribution);var t=null,n=l.getEvents();f._each(n,function(e){var n=e.args;e&&(e.eventType===g?(t=n,d(t)):e.eventType===b?(t=n,s(t)):e.eventType===m?A=n.bidderCode:e.eventType===h&&(t=n,c(t)))}),l.on(g,function(e){d(e)}),l.on(b,function(e,t){s(t),u(t)}),l.on(m,function(e){A=e}),l.on(h,function(e){c(e)})},t.getTrackerSend=function(){return T}}]); /* global initAdserver googletagData */ var pbjs = pbjs || {}; pbjs.que = pbjs.que || []; var PrebidManager = PrebidManager || (function() { var adUnits = []; var slotNum = 0; var indexID = 0; // Used for indexExchange until they fix their bidder function initialize(timeout) { pbjs.isEnabled = true; pbjs.timeout = timeout; // Next block is used to load the Prebid.js CDN whenever we don't use a prebuilt one. // Keep for now until we work out kinks // (function() { // var pbjsEl = document.createElement('script'); // pbjsEl.type = 'text/javascript'; // pbjsEl.async = true; // pbjsEl.src = '//acdn.adnxs.com/prebid/static/0.6.0/prebid.js'; // var pbjsTargetEl = document.getElementsByTagName('head')[0]; // pbjsTargetEl.insertBefore(pbjsEl, pbjsTargetEl.firstChild); // })(); // add sovrn beacon if (googletagData.sovrn_bidder) { (function() { var sovrnBeacon = document.createElement('script'); sovrnBeacon.type = 'text/javascript'; sovrnBeacon.id = 'sBeacon'; sovrnBeacon.src = '//ap.lijit.com/www/sovrn_beacon_standalone/sovrn_standalone_beacon.js?iid=12106015&uid=answers'; var sovrnBeaconTargetEl = document.getElementsByTagName('head')[0]; sovrnBeaconTargetEl.insertBefore(sovrnBeacon, sovrnBeaconTargetEl.firstChild); })(); } return this; } function registerSlot(slot, sizes) { var slotConfig = { code: slot.container_id, sizes: sizes, bids: buildBidderParams(slot) }; adUnits.push(slotConfig); return this; } function buildBidderParams(slot) { var params = []; var explodedTag = slot.ad_unit.split('/'); var adUnit = explodedTag[explodedTag.length - 1]; var sizeRegEx = /[0-9]{2,3}x[0-9]{2,3}_.*/; var placement = (sizeRegEx.test(adUnit)) ? sizeRegEx.exec(adUnit)[0] : '300x250_' + ++slotNum; if (googletagData.sovrn_bidder && slot.enable_sovrn_bidding !== 'off') { var sovrnParams = generateSovrnParams(placement); params.push(sovrnParams); } if (googletagData.new_aol_bidder && slot.enable_aol_bidding !== 'off') { var AOLParams = generateAOLParams(placement, adUnit); params.push(AOLParams); } if (googletagData.new_indexexchange_bidder && slot.enable_indexexchange_bidding !== 'off') { var indexParams = generateIndexParams(placement); params.push(indexParams); } if (googletagData.appnexus_bidder && slot.enable_appnexus_bidding !== 'off') { var appNexusParams = generateAppNexusParams(placement); params.push(appNexusParams); } return params; } function generateSovrnParams(placement) { // Ugly mapping ahead var map = { ANSWG_160x600_1_header: 349915, ANSWG_300x250_1_header: 349891, ANSWG_300x250_2_header: 349897, ANSWG_300x250_3_header: 349903, ANSWG_300x250_4_header: 349909, ANSWG_728x90_1_header: 349852, ANSWG_728x90_2_header: 349861, ANSWG_728x90_3_header: 349867, ANSWG_728x90_4_header: 349873, ANSWG_728x90_5_header: 349879, AT_160x600_1_header: 349918, AT_300x250_1_header: 349894, AT_300x250_2_header: 349900, AT_300x250_3_header: 349906, AT_300x250_4_header: 349912, AT_728x90_1_header: 349858, AT_728x90_2_header: 349864, AT_728x90_3_header: 349870, AT_728x90_4_header: 349876, AT_728x90_5_header: 349884, BRO_160x600_1_header: 349919, BRO_300x250_1_header: 349895, BRO_300x250_2_header: 349901, BRO_300x250_3_header: 349907, BRO_300x250_4_header: 349913, BRO_728x90_1_header: 349859, BRO_728x90_2_header: 349865, BRO_728x90_3_header: 349871, BRO_728x90_4_header: 349877, BRO_728x90_5_header: 349886, CS_160x600_1_header: 349920, CS_300x250_1_header: 349896, CS_300x250_2_header: 349902, CS_300x250_3_header: 349908, CS_300x250_4_header: 349914, CS_728x90_1_header: 349860, CS_728x90_2_header: 349866, CS_728x90_3_header: 349872, CS_728x90_4_header: 349878, CS_728x90_5_header: 349890, MH_160x600_1_header: 349917, MH_300x250_1_header: 349893, MH_300x250_2_header: 349899, MH_300x250_3_header: 349905, MH_300x250_4_header: 349911, MH_728x90_1_header: 349857, MH_728x90_2_header: 349863, MH_728x90_3_header: 349869, MH_728x90_4_header: 349875, MH_728x90_5_header: 349881, ROA_160x600_1_header: 349916, ROA_300x250_1_header: 349892, ROA_300x250_2_header: 349898, ROA_300x250_3_header: 349904, ROA_300x250_4_header: 349910, ROA_728x90_1_header: 349856, ROA_728x90_2_header: 349862, ROA_728x90_3_header: 349868, ROA_728x90_4_header: 349874, ROA_728x90_5_header: 349880 }; return { bidder: 'sovrn', params: { tagid: map[googletagData.site_code + '_' + placement + '_header'] } }; } function generateAOLParams(placement, adUnit) { // Note: in Prebid.js documentation 'placement' is needed for AOL // 'placement' and 'alias' map 1:1, so only one or the other is needed per a conversation with AOL var alias = googletagData.site_code + '_' + placement + '_header'; if (adUnit.indexOf('gut_') === 0) { alias += '_mobile'; } return { bidder: 'aol', params: { network: '9424.1', alias: alias } }; } function generateIndexParams(placement) { var map = { ANSWG_160x600_1_header: 172832, ANSWG_300x250_1_header: 172833, ANSWG_300x250_2_header: 172834, ANSWG_300x250_3_header: 172835, ANSWG_300x250_4_header: 172837, ANSWG_728x90_1_header: 175090, ANSWG_728x90_2_header: 172828, ANSWG_728x90_3_header: 172829, ANSWG_728x90_4_header: 172830, ANSWG_728x90_5_header: 172831, BLE_728x90_1_header: 174945, BLE_728x90_2_header: 174946, BLE_728x90_3_header: 174947, BLE_728x90_4_header: 174948, BLE_728x90_5_header: 174949, BLE_300x250_1_header: 174950, BLE_300x250_2_header: 174951, BLE_300x250_3_header: 174952, BLE_300x250_4_header: 174953, BLE_160x600_1_header: 174954, ELS_728x90_1_header: 175039, ELS_728x90_2_header: 175040, ELS_728x90_3_header: 175041, ELS_728x90_4_header: 175042, ELS_728x90_5_header: 175043, ELS_300x250_1_header: 175044, ELS_300x250_2_header: 175045, ELS_300x250_3_header: 175046, ELS_300x250_4_header: 175047, ELS_160x600_1_header: 175048, NEW_728x90_1_header: 175049, NEW_728x90_2_header: 175050, NEW_728x90_3_header: 175051, NEW_728x90_4_header: 175052, NEW_728x90_5_header: 175053, NEW_300x250_1_header: 175054, NEW_300x250_2_header: 175055, NEW_300x250_3_header: 175056, NEW_300x250_4_header: 175057, NEW_160x600_1_header: 175058, PRE_728x90_1_header: 175059, PRE_728x90_2_header: 175060, PRE_728x90_3_header: 175061, PRE_728x90_4_header: 175062, PRE_728x90_5_header: 175063, PRE_300x250_1_header: 175064, PRE_300x250_2_header: 175065, PRE_300x250_3_header: 175066, PRE_300x250_4_header: 175067, PRE_160x600_1_header: 175068, ROA_728x90_1_header: 175069, ROA_728x90_2_header: 175070, ROA_728x90_3_header: 175071, ROA_728x90_4_header: 175072, ROA_728x90_5_header: 175073, ROA_300x250_1_header: 175074, ROA_300x250_2_header: 175075, ROA_300x250_3_header: 175076, ROA_300x250_4_header: 175077, ROA_160x600_1_header: 175078, SPL_728x90_1_header: 175079, SPL_728x90_2_header: 175081, SPL_728x90_3_header: 175082, SPL_728x90_4_header: 175083, SPL_728x90_5_header: 175084, SPL_300x250_1_header: 175085, SPL_300x250_2_header: 175086, SPL_300x250_3_header: 175087, SPL_300x250_4_header: 175088, SPL_160x600_1_header: 175089 }; return { bidder: 'indexExchange', params: { id: ++indexID, siteID: map[googletagData.site_code + '_' + placement + '_header'] } }; } function generateAppNexusParams(placement) { return { bidder: 'appnexus', params: { invCode: googletagData.site_code + '_' + placement + '_header', member: 3768 } }; } function populateAdUnits() { pbjs.que.push(function() { pbjs.addAdUnits(adUnits); pbjs.bidderSettings = { standard: { adserverTargeting: [{ key: 'hb_bidder', val: function(bidResponse) { return bidResponse.bidderCode; } }, { key: 'hb_adid', val: function(bidResponse) { return bidResponse.adId; } }, { key: 'hb_pb', val: function(bidResponse) { var cpm = bidResponse.cpm; if (cpm < 20.00) { return (Math.floor(cpm * 100) / 100).toFixed(2); } return '20.00'; } }] }, aol: { bidCpmAdjustment: function(bidCpm) { // 90% rev share with AOL return bidCpm * 0.90; } } }; }); return this; } function requestBids() { pbjs.que.push(function() { pbjs.requestBids({ bidsBackHandler: function() { window.initAdServer(); } }); }); return this; } function sendBids() { pbjs.que.push(function() { pbjs.setTargetingForGPTAsync(); }); } function refresh(name) { pbjs.que.push(function() { pbjs.requestBids({ timeout: pbjs.timeout, bidsBackHandler: function() { pbjs.setTargetingForGPTAsync(); $(document).trigger('received_partner_bid-' + name); } }); }); } return { initialize: initialize, registerSlot: registerSlot, lockInAdUnits: populateAdUnits, requestBids: requestBids, setTargeting: sendBids, refresh: refresh }; })(); var googletagData = __page_data__['ads_dfpheader2-0'] || {}; var load_group = []; var interstitial_group = []; var custom_1_group = []; var custom_2_group = []; var custom_3_group = []; var PREBID_TIMEOUT = googletagData.header_bidding_timeout; if (!googletagData.openx_bidder) { var googletag = googletag || {}; googletag.cmd = googletag.cmd || []; } if (googletagData.rubicon_bidder) { var rubicontag = rubicontag || {}; rubicontag.cmd = rubicontag.cmd || []; } if (googletagData.indexexchange_bidder) { window.headertag_ready = window.headertag_ready || false; } if (googletagData.new_aol_bidder || googletagData.new_indexexchange_bidder || googletagData.sovrn_bidder || googletagData.appnexus_bidder) { PrebidManager.initialize(PREBID_TIMEOUT); } var gptLoaded = false; function initAdServer() { if (!gptLoaded) { (function() { var gads = document.createElement('script'); gads.async = true; gads.type = 'text/javascript'; var useSSL = 'https:' == document.location.protocol; gads.src = (useSSL ? 'https:' : 'http:') + '//www.googletagservices.com/tag/js/gpt.js'; var node = document.getElementsByTagName('script')[0]; node.parentNode.insertBefore(gads, node); })(); gptLoaded = true; } } var numExpectedRequests = googletagData.rubicon_bidder + googletagData.indexexchange_bidder; var numReceivedRequests = 0; $(document).on('receivedPrepingBid', function() { numReceivedRequests++; if (numReceivedRequests === numExpectedRequests) { initAdServer(); } }); if (window.headertag_ready) { numReceivedRequests++; } // backup timer to allow for prebidding if (googletagData.rubicon_bidder || (googletagData.indexexchange_bidder && !window.headertag_ready) || pbjs.isEnabled) { setTimeout(initAdServer, PREBID_TIMEOUT); } else { initAdServer(); } var filterObject = function(obj, predicate) { var key; var result = []; for (key in obj) { if (obj.hasOwnProperty(key) && predicate(obj[key])) { result.push(obj[key]); } } return result; }; var dfpheader2 = dfpheader2 || (function() { var isArrayLike = function(variable) { var isObject = typeof variable === 'object'; var hasLength = typeof variable.length === 'number'; return isObject && hasLength; }; var Model = function(model) { // strip unnecessary 'dfp_' prefix from ads/dfpslot configs function normalizeSlotKeys() { var i = 0; while (model.dfpSlots[i]) { var slot = model.dfpSlots[i]; var keys = Object.keys(slot); for (var index = 0; index < keys.length; index++) { var key = keys[index]; if (key.match('dfp_')) { var normalKey = key.replace('dfp_', ''); if (normalKey === 'div_id') { normalKey = 'container_id'; } slot[normalKey] = slot[key]; delete slot[key]; } } model.dfpSlots[i] = slot; i++; } } this.each = function(key, callback) { var value = model[key]; var i, len; if (typeof value === 'object' && !!value.push) { for (i = 0, len = value.length; i < len; i++) { callback.call(model, value[i]); } } else if (typeof value === 'object') { var keys = Object.keys(value); for (i = 0, len = keys.length; i < len; i++) { callback.call(model, value[keys[i]]); } } }; this.get = function(key) { return typeof model[key] === 'undefined' ? {} : model[key]; }; (function initialize() { if (model.dfpSlots) { normalizeSlotKeys(); } })(); }; // if ads/dfpheader2 config 'load_on_carousel_ready' set to 'on' // && have dfpslot objects && carousel has images // then load make initial call for dfpslots var handleCarouselCoupledSlotInitialization = function() { var initializeSlots = function() { DfpSlotManagerMixin.beforeSlotRefresh(); var slotsToInit = filterObject(DfpSlotManagerMixin.getSlots(), function(slot) { return slot.refresh === true; }); slotsToInit = $.map(slotsToInit, function(slot) { return slot.object; }); // Func '..refresh()' is a misnomer in this case // because disableInitialLoad called, slots have yet to initialize googletag.pubads().refresh(slotsToInit); } var checkReady = function() { var slots = DfpSlotManagerMixin.getSlots(); var hasSlots = Object.keys(slots).length > 0; if (hasSlots) { var imageWrapper = document.getElementsByClassName('carousel_ui_img-0')[0]; var sectionWrapper = document.getElementsByClassName('subject_section')[0]; var image; var embed; if (!!imageWrapper) { image = imageWrapper.getElementsByTagName('img')[0]; embed = imageWrapper.getElementsByClassName('embed')[0]; if (!!image || !!embed) { window.clearInterval(check); initializeSlots(); } } else if (!!sectionWrapper) { section = sectionWrapper.getElementsByClassName('section')[0]; if (!!section) { window.clearInterval(check); setTimeout(function() { initializeSlots(); }, 50); } } else { return false; } } } var check = window.setInterval(checkReady, 50); }; var sandboxDfpslots = function() { var whitelist = filterObject(DfpSlotManagerMixin.getSlots(), function(slot) { return slot.sandboxWhitelist; }); Node.prototype.appendChild_ = Node.prototype.appendChild; Node.prototype.appendChild = function(el) { if (el.nodeName === 'IFRAME') { var shouldFilter = true; // never sandbox FB ad iframes if ( this.nodeName === 'FB:AD' || (this.closest && this.closest('fb\\:ad')) || (this.closest && this.closest('.fb-page')) || (this.closest && this.closest('.fb-banner')) || (window.jQuery && jQuery(this).closest('fb\\:ad').length) || (window.jQuery && jQuery(this).closest('.fb-page').length) || (window.jQuery && jQuery(this).closest('.fb-banner').length) || (el.src && el.src.search('facebook.com') !== -1 && el.src.search('plugins/ad.php') !== -1) ) { shouldFilter = false; } if (shouldFilter && whitelist.length > 0) { for (var i = 0, len = whitelist.length; i < len; i++) { if (whitelist[i].ad_unit && el.id.search(whitelist[i].ad_unit) !== -1) { shouldFilter = false; } } } if (shouldFilter) { el.sandbox = 'allow-forms allow-popups allow-scripts allow-same-origin'; } } Node.prototype.appendChild_.apply(this, arguments); return el; } var documentWriteFilter = function(html) { try { var shouldFilter = false; // never sandbox FB ad iframes if (html && !(html.search('facebook.com') !== -1 && html.search('plugins/ad.php') !== -1)) { shouldFilter = true; if (whitelist.length > 0) { for (var i = 0, len = whitelist.length; i < len; i++) { // could generate false positives, if becomes an issue make more specific if (whitelist[i].id && html.search(whitelist[i].id) !== -1) { shouldFilter = false; } } } } if (shouldFilter) { html = html.replace(/