//#domainIdString-88180-domainIdString# // cached: 2018-09-25T19:50:32.007Z (Tue Sep 25 2018 15:50:32 GMT-0400 (EDT)) /*hidden*/ var VCN = '_e44fd'; var camHead = false; var camhead_widget_id = false; var camHead_cookie_name = false; var nativeInjectionPlugs = false; var burst = false; var p_name = false; var p_settings = false; var p_expires = false; var p_widget_id = false; var sn = false; var snId = false; var snCN = false; var tars = false; var camHead_Url = false; var vOw = false; var vOwf = function(){}; var vOwb = false; var vOwbi = false; var vOwv = false; var vOwvi = false; var domains_delivery = 'd.smopy.com'; var conf_delivery_resource_http = '/d/'; var conf_delivery_resource_ws = '/ws/'; var nativeInjectionPlugsId = ''; var integrationScriptCreatedTimestamp = "&isct=undefined"; var prr = ""; var integrationTypeAdblockSafe = ""; Function.prototype.bind = Function.prototype.bind || function(b) { if (typeof this !== "function") { throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); } var a = Array.prototype.slice; var f = a.call(arguments, 1); var e = this; var c = function() {}; var d = function() { return e.apply(this instanceof c ? this : b || window, f.concat(a.call(arguments))); }; c.prototype = this.prototype; d.prototype = new c(); return d; }; function PRPub2(container) { window.prpubappended = true; if (document.getElementsByClassName) { this.containers = document.getElementsByClassName(VCN); } else { this.containers = document.querySelectorAll('.' + VCN); } this.widgetIds = []; this.count = []; this.totalNumOfElements = 0; this.firstRequest = true; this.resizeTimeout = 100; this.resizeInProgress = null; this.request = null; this.blocker = false; this.blockerTestElement = {}; this.widthRanges = [ [160, 220] ]; this.requestCounter = 0; this.requestCounterName = 'reqc'; this.extraWidgets = {}; var self = this; // self initiate setTimeout(function () { self.initiate(); }, 10); } PRPub2.readyCheck = function(readyStates, callback) { if (document.addEventListener) { if ( (readyStates.indexOf('interactive') >= 0 && document.readyState == "interactive") || (readyStates.indexOf('complete') >= 0 && document.readyState == "complete") ) { callback(); } else { document.addEventListener( "DOMContentLoaded", function() { if (readyStates.indexOf('interactive') >= 0) { callback(); } }, false ); } } else if (document.all&&!window.opera) { if (document.readyState != "complete") { document.onreadystatechange = function() { if (this.readyState == "complete" && readyStates.indexOf('complete') >= 0) { callback(); } } } else { callback(); } } var oldLoad = undefined; if (window.onload) { oldLoad = window.onload; } window.onload = function() { callback(); window.onload = oldLoad; if (typeof window.onload === "function") { window.onload(); } } }; PRPub2.extras = []; PRPub2.prototype.initiate = function() { this.testForBlockers(); this.websocketSupported = typeof WebSocket == 'function'; this.widgets = {}; this.setupWidgetData(); for (var key in this.widgets) { var id = this.widgets[key].id; this.widgets[key].container.setAttribute('id', id); } PRPub2.executeExtras(); // Set listener, resize and visibility for each item. var self = this; if (window.addEventListener) { window.addEventListener('resize', function() {self.handleResize();}); } else { window.attachEvent('onresize', function() {self.handleResize();}); } this.resized(); }; PRPub2.registerExtra = function(func) { PRPub2.extras.push(func); }; PRPub2.executeExtras = function() { for(var i = 0; i < PRPub2.extras.length; i++) { PRPub2.extras[i](); } }; if (camHead) { PRPub2.registerExtra(function() { pub.extraWidgets.ch = { widgetId: camhead_widget_id }; var div = document.createElement("div"); div.id = "_" + camhead_widget_id; div.style.display = "none"; document.body.appendChild(div); pub.extraWidgets.ch.container = div; }); } if (nativeInjectionPlugs) { PRPub2.registerExtra(function() { PRPub2.readyCheck(['complete'], function() { if (_WiInP === 1) { return; } _WiInP = 1; /**if (window.location.pathname != '/') { return; }*/ var native_adzone=function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{configurable:!1,enumerable:!0,get:d})},b.n=function(a){var c=a&&a.__esModule?function(){return a['default']}:function(){return a};return b.d(c,'a',c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p='',b(b.s=0)}([function(a,b,c){'use strict';function d(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(b,'__esModule',{value:!0});var e,f=c(1),g=function(a){return a&&a.__esModule?a:{default:a}}(f);e=function a(){d(this,a),this.plugs=new g.default(document.getElementsByTagName('body')[0])},b.default=e},function(a,b,c){'use strict';function d(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(b,'__esModule',{value:!0});var e,f=function(){function a(a,b){for(var c,d=0;dthis.imgs.length||(this.sortImgsByWidth(),this.setLargestImageCountByWidth(),this.detectLikelyPlugs([function(a){return a.clientWidth===+c.largestImgCountByWidthKey},function(b){var c,d;return c=b.parentNode.getElementsByTagName('img'),d=Array.from(c).filter(function(b){return b.clientWidth>a.MIN_IMG_SIZE}),!(1d&&(e=b,d=this.imgsSortedByImgWidth[b].length);return this.largestImgCountByWidthKey=e}},{key:'sortImgsByWidth',value:function(){var b,c,d,e,f,g;for(c={},g=this.imgs,(d=0,e=g.length);da.numOfPlugs&&(a=b);return this.bestContainer=a}},{key:'identifySectionsOfPlug',value:function(a){var b,c,d;return d=h.default.textNodesUnder(a),d=d.filter(function(a){return 0c(b)?a:b})),a.plugTitleNode=b,a.titleAttrNode=a.querySelectorAll('*[title]'),a.imgs=a.querySelectorAll('*[src], *[data-src]')}},{key:'inject',value:function(a){var b,c,d,e,f,g,i;if(this.bestContainer&&a&&!(1>a.length)){for(i=h.default.getAllAfter(this.bestContainer.firstPossiblePlug,b=function(a){if(1===a.imageCount)return!0}),i.unshift(this.bestContainer.firstPossiblePlug),g=[],(c=e=1,f=this.bestContainer.colsOfPlugs);1<=f?e<=f:e>=f;c=1<=f?++e:--e)d=Math.floor(Math.random()*this.bestContainer.numOfPlugs),g.push(this.bestContainer.insertBefore(this.newPlug(this.bestContainer.firstPossiblePlug,a[(c-1)%a.length]),i[d]));return g}}},{key:'markContainers',value:function(){var a,b,c,d;if(!(1>Object.keys(this.imgsSortedByImgWidth))){for(d=this.imgsSortedByImgWidth[this.largestImgCountByWidthKey],b=0,c=d.length;bb.imageCount)return!1;if(0===a.identifyRowsAndColsOf(b))return!1;if(1>b.rowsOfPlugs)return!1;for(f=b.childNodes,d=0,e=f.length;df.length)h.onclick=function(){return window.location=c.clickUrl};else for(q=0,D=F.length;q=s.parentNode.clientWidth?(g=getComputedStyle(t),e=t.getBoundingClientRect(),v=e.width,u=e.height,g.paddingLeft&&(v-=g.paddingLeft.replace('px','')),g.paddingRight&&(v-=g.paddingRight.replace('px','')),g.paddingTop&&(u-=g.paddingTop.replace('px','')),g.paddingBottom&&(u-=g.paddingBottom.replace('px','')),i.style.width=v+'px',i.style.height=u+'px',h):(i.style.opacity=1,n&&(n.style.overflow='hidden'),i.parentNode&&(i.parentNode.style.overflow='hidden'),p=s.clientWidth/s.clientHeight,j=c.thumbWidth/c.thumbHeight,p>j?(i.style.width=s.clientWidth+'px',i.style.height=s.clientWidth*(1/j)+'px',i.parentNode.style.height=s.clientHeight+'px'):(i.style.height=s.clientHeight+'px',i.style.width=s.clientHeight*j+'px',console.log(s.clientHeight,c.thumbHeight)),h)}},{key:'getCount',value:function(){return this.bestContainer?this.bestContainer.colsOfPlugs:0}},{key:'getWidth',value:function(){return+this.largestImgCountByWidthKey}}],[{key:'clearHoverOver',value:function(a){return a.addEventListener('mouseover',function(a){if(a.preventDefault&&a.preventDefault(),a.stopPropagation)return a.stopPropagation()})}},{key:'removeIds',value:function(b){var c,d,e,f,g;if(b.removeAttribute&&b.removeAttribute('id'),b.childNodes){for(f=b.childNodes,g=[],(d=0,e=f.length);dc&&(c=k.top,0===h&&(h=i),j++),i++);return b.rowsOfPlugs=j,b.colsOfPlugs=h,b.numOfPlugs=i,j}},{key:'isPossiblePlug',value:function(a){return'IMG'===a.tagName}}]),a}();return a.prototype.rootNode=null,a.prototype.containerClassName='native_plug_container',a.prototype.possibleContainers=[],a.prototype.bestContainer=null,a.prototype.largestImgCountByWidthKey=null,a.prototype.imgsSortedByImgWidth={},a.prototype.imgs=[],a.MIN_IMG_SIZE=50,a}.call(void 0),b.default=e},function(a,b){'use strict';function c(a,b){if(!(a instanceof b))throw new TypeError('Cannot call a class as a function')}Object.defineProperty(b,'__esModule',{value:!0});var d,e=function(){function a(a,b){for(var c,d=0;d= this.widthRanges[0][0] && calculated <= this.widthRanges[0][1]) { this.widgets[key].optimalNumOfElements = i; break; } } }; /** * Fetch more content if more elements are needed. */ PRPub2.prototype.getMoreContents = function() { if (this.needMoreContent()) { this.getContents(); } }; /** * Can our container fit more elements than it currently is set to show? * * @returns {boolean} */ PRPub2.prototype.needMoreContent = function() { if (this.firstRequest) { return true; } var ret = false; for (key in this.widgets) { if (this.widgets[key].optimalNumOfElements > this.widgets[key].numOfElements) { ret = true; } } return ret; }; PRPub2.prototype.getContents = function() { this.setNumberOfElements(); this.gatherWidgetCountAndIds(); var extraWidgetsKeys = Object.keys(this.extraWidgets); if ((extraWidgetsKeys.length === 0 || !this.firstRequest) && this.totalNumOfElements < 1) { return; } if (this.websocketSupported && this.blocker) { //this.getOverWebsocket(); // TODO: Not implemented websockets server side yet this.getOverHttp(); } else { this.getOverHttp(); } this.firstRequest = false; }; PRPub2.prototype.getOverWebsocket = function() { var widgetIds = this.widgetIds.join(',').replace(/_/g, ''); this.request = new WebSocket('ws://' + domains_delivery + conf_delivery_resource_ws + '?resource=bundler&counts=' + this.count.join(',') + '&widgetIds=' + widgetIds); this.request.onmessage = this.handleWebsocketResponse.bind(this); }; PRPub2.prototype.getOverHttp = function(url, callback) { url = url || false; var request; if (window.XDomainRequest) { request = new XDomainRequest(); if (!callback) { request.onload = this.handleHttpResponse.bind(this); } else { request.onload = callback.bind(this); } } else if (window.XMLHttpRequest) { request = new XMLHttpRequest(); //request.withCredentials = true; if (!callback) { request.onloadend = this.handleHttpResponse.bind(this); } else { request.onloadend = callback.bind(this); } } else { request = new ActiveXObject('Microsoft.XMLHTTP'); if (!callback) { request.onloadend = this.handleHttpResponse.bind(this); } else { request.onloadend = callback.bind(this); } } if (!url) { url = '//' + domains_delivery + conf_delivery_resource_http + '?resource=bundler&widgets=' + this.widgetValues(); } url += integrationScriptCreatedTimestamp; url += prr; url += integrationTypeAdblockSafe; url += this.appendRequestCounter(); request.open('GET', url); if (!callback) { this.request = request; } request.send(); }; PRPub2.prototype.appendRequestCounter = function() { return "&" + this.requestCounterName + "=" + (++this.requestCounter); }; PRPub2.prototype.widgetValues = function() { var ret = []; for (var i = 0; i < this.widgetIds.length; i++) { ret.push(this.widgetIds[i].replace(/_/g, '') + ":" + (this.count[i] ? this.count[i] : '1')); } if (this.firstRequest && typeof this.extraWidgets === "object") { var keys = Object.keys(this.extraWidgets); for (var i = 0; i < keys.length; i++) { ret.push(this.extraWidgets[keys[i]].widgetId + ":1"); } } return ret.join(','); } PRPub2.prototype.handleWebsocketResponse = function(response) { var data = JSON.parse(response.data); for (key in this.widgets) { var dataKey = key.replace('_', ''); this.widgets[key].container.innerHTML = data[dataKey]; } }; PRPub2.prototype.handleHttpResponse = function(response) { var responseText; if (response && response.target && response.target.responseText) { responseText = response.target.responseText; } else if (this && this.request && this.request.responseText) { responseText = this.request.responseText; } else { return; } var data = JSON.parse(responseText); var widgets = Object.assign({}, this.widgets); var extraKeys = this.extraWidgets ? Object.keys(this.extraWidgets) : []; for (var i = 0; i < extraKeys.length; i++) { widgets[this.extraWidgets[extraKeys[i]].widgetId] = this.extraWidgets[extraKeys[i]]; } for (key in widgets) { var dataKey = key.replace('_', ''); this.insertAndHandleResponse(widgets[key].container, data[dataKey]); } }; PRPub2.prototype.insertAndHandleResponse = function(container, data) { if (!data) { return; } var JSONParse; if (JSONParse = pub.parseJSON(data)) { pub.createScriptTagFromObject(container, JSONParse); return; } if (data.substring(0, 10) == '/*Script*/') { var scriptTag = document.createElement('script'); scriptTag.type = 'text/javascript'; scriptTag.innerHTML = data; container.appendChild(scriptTag); return; } container.innerHTML = data; this.calculateSizesAndShowContents(container); }; PRPub2.prototype.parseJSON = function(data) { try { var JSONTemplate = JSON.parse(data); } catch (err) { return false; } return JSONTemplate }; PRPub2.prototype.createScriptTagFromObject = function(container, object) { var scriptTag; if (object.hasOwnProperty('contents')) { scriptTag = document.createElement('script'); scriptTag.type = 'text/javascript'; scriptTag.innerHTML = object.contents; container.appendChild(scriptTag); } scriptTag = document.createElement('script'); scriptTag.type = 'text/javascript'; scriptTag.src = object.src; scriptTag.id = object.id; container.appendChild(scriptTag); }; PRPub2.prototype.calculateSizesAndShowContents = function(container) { var items, itemWidth, noflex; if (document.getElementsByClassName) { noflex = container.getElementsByClassName('praz--noflex'); items = container.getElementsByClassName('praz__item'); } else { noflex = container.querySelectorAll('.praz--noflex'); items = container.querySelectorAll('.praz__item'); } if (noflex.length > 0) { itemWidth = 100 / items.length; for (var i = 0; i < items.length; i++) { items[i].style.width = String(itemWidth)+'%'; } } container.style.display = 'block'; }; /** * Sets the number of elements each widget should request based on what is optimal. */ PRPub2.prototype.setNumberOfElements = function() { this.totalNumOfElements = 0; for (key in this.widgets) { this.widgets[key].numOfElements = this.widgets[key].optimalNumOfElements; this.totalNumOfElements += this.widgets[key].optimalNumOfElements; } }; /** * Collects the widget count and widget ids in their own separate arrays. */ PRPub2.prototype.gatherWidgetCountAndIds = function() { for (key in this.widgets) { this.count.push(this.widgets[key].numOfElements); this.widgetIds.push(key); } }; /** * Creates and adds a style tag for this zone. */ PRPub2.prototype.addStyleTag = function(key) { var id = '_'+this.widgets[key].id; var styleTagId = id+'_style'; this.widgets[key].styleTag = document.createElement('style'); this.widgets[key].styleTag.setAttribute('id', styleTagId); this.widgets[key].container.parentNode.insertBefore(this.widgets[key].styleTag, document.getElementById(id)); }; PRPub2.prototype.hasCookie = function(cookieName) { var p = document.cookie.split(';'); for (var i=0; i < p.length; i++) { var cn = p[i].replace(' ',''); if (cn.substring(0, cookieName.length) == cookieName) { return true; } } return false; }; function getStyle(el,styleProp) { var camelize = function (str) { return str.replace(/\-(\w)/g, function(str, letter){ return letter.toUpperCase(); }); }; if (el.currentStyle) { return el.currentStyle[camelize(styleProp)]; } else if (document.defaultView && document.defaultView.getComputedStyle) { return document.defaultView.getComputedStyle(el,null) .getPropertyValue(styleProp); } else { return el.style[camelize(styleProp)]; } } var _WiState = 0; var pub; PRPub2.readyCheck(['interactive', 'complete'], function() { if (_WiState !== 1) { _WiState = 1; if (!window.prpubappended) pub = new PRPub2(); } }); /** * Polyfills */ /** * Object.assign polyfill for old browsers */ if (typeof Object.assign !== 'function') { /* Must be writable: true, enumerable: false, configurable: true */ Object.defineProperty(Object, "assign", { value: function assign(target, varArgs) { /* .length of function is 2 */ 'use strict'; if (target == null) { /* TypeError if undefined or null */ throw new TypeError('Cannot convert undefined or null to object'); } var to = Object(target); for (var index = 1; index < arguments.length; index++) { var nextSource = arguments[index]; if (nextSource != null) { /* Skip over if undefined or null */ for (var nextKey in nextSource) { /* Avoid bugs when hasOwnProperty is shadowed */ if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { to[nextKey] = nextSource[nextKey]; } } } } return to; }, writable: true, configurable: true }); }