(function (_win, $, extend) { 'use strict'; // Final Push - Chad to update eVar to "ye - Fiscal Year End Donation 2018 - Final Push" AND add countdown timer counting down to midnight 1/1 in users respective timezone. User should see no banner and write no eVar after 1/1 00:00:00 in their TZ. extend(window, { ye: { campaign: "August Fundraising 2019", offerName: "August Fundraising", appName: 'augustFundraising', expiry: '08/21/2019', timeOffset: 86400000, URL_PARAMS_REG_EXP: /(?:[{])(\w+)(?:[}])/ig, DONATION_URL_BASE: 'https://oascentral.consumerreports.org/RealMedia/ads/click_lx.ads/cu/cro/homepage_v2/index/L24/1409613938/x97/Consumer/Membership_Fundraising_Challenge_x97_Aug2019/august_2a_V2.html/6258693056313165487a514143376f42?https://donateconsumers.org/page/46404/donate/1?supporter.NOT_TAGGED_1={sourcecode}&ask={amount}&ask_selected={ask_start}&en_txn6={sourcecode}', debugHashName: function(appName) { return '#'.concat(appName, 'Debug'); }, _isDebug: false, baseImageUrl: 'https://cdn.oas-c17.adnxs.com/RealMedia/ads/Creatives/Consumer/Membership_Fundraising_Challenge_x97_Aug2019/', isDebugHash: function () { return (_win.location.hash && _win.location.hash === ye.debugHashName(ye.appName)); }, model: { //set to either 'control' or 'challenger' version: 'challenger', //set to either 'gray' or 'white' background: 'white', //set to either 'ask1' or 'ask2' ask: 'ask2', donations: { desktop: { 50: { ask_start: 50, sourcecode: '0023808220' }, 75: { ask_start: 75, sourcecode: '0023808221' }, 100: { ask_start: 100, sourcecode: '0023808222' }, other: { ask_start: 'other', sourcecode: '0023808223' } }, mobile: { 50: { ask_start: 50, sourcecode: '0023808224' }, 75: { ask_start: 75, sourcecode: '0023808225' }, 100: { ask_start: 100, sourcecode: '0023808226' }, other: { ask_start: 'other', sourcecode: '0023808227' } } } }, getDonationConfig: function () { var isMobile = $(_win).width() < 768; return ye.model.donations[isMobile ? 'mobile' : 'desktop']; }, // returns object of all query params //Example if URL = www.google.com?test=a object will be {'test':'a'} queryParams: (function() { var search = window.location.search.substring(1).split('&'), tempSearch, searchObj = {}; for (var i = 0; i < search.length; i++) { tempSearch = search[i].split('='); searchObj[tempSearch[0]] = tempSearch[1]; } return searchObj; })(), // If query params include the letters ye show console.log statements verbose: window.location.search.indexOf('ye') !== -1, debug: function(msg, color) { if (window.console && msg && ye.verbose === true) { var isMSIE = /*@cc_on!@*/ false; if (isMSIE) { console.log(msg); } else { console.log("%c" + msg, "color:" + color + ";font-weight:normal;"); } } }, cookie: { set: function(cookieName, cookieValue, expireDays) { expireDays = expireDays || 1; var vDate = new Date(); vDate.setTime(vDate.getTime() + (expireDays * 24 * 60 * 60 * 1000)); var vExpires = 'expires=' + vDate.toUTCString(); document.cookie = cookieName + '=' + cookieValue + '; ' + vExpires + ";domain=" + document.domain + ";path=/"; }, get: function(cookieName) { var vName = cookieName + '='; var vCookies = document.cookie.split(';'); for (var i = 0; i < vCookies.length; i++) { var vCookie = vCookies[i]; while (vCookie.charAt(0) == ' ') vCookie = vCookie.substring(1); if (vCookie.indexOf(vName) === 0) return vCookie.substring(vName.length, vCookie.length); } return ""; }, delete: function(cookieName) { document.cookie = cookieName + "= ; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/"; } }, setCloseCookie: function() { !ye.isDebugHash() && ye.cookie.set('augustFundraising', 'closed', 1); }, runPoll: function(selector, pollFunction, duration, count, failureCallback) { var pollLimit = 100; var pollDuration = duration || 50; var curCount = count || 0; var pollCondition; failureCallback = failureCallback || function() { ye.debug('Poll' + selector + ' Timed out'); }; if (typeof $ !== 'undefined') { if (typeof(selector) === 'function') { pollCondition = selector(); } else { pollCondition = $(selector).length > 0; } } else { pollCondition = false; } if (pollCondition) { pollFunction(); return true; } else { if (curCount > pollLimit) { //console.log('poll timed out ' + typeof(failureCallback)); if (typeof failureCallback === 'function') { failureCallback(); } return false; } else { curCount++; setTimeout(function() { ye.runPoll(selector, pollFunction, pollDuration, curCount, failureCallback); }, pollDuration); } } }, pollCondition: function() { return $('body').length > 0; }, addCustomCss: function(cssText) { var $styleSheet = $(''); if(!cssText){ return; } $styleSheet.append(cssText); $('body').append($styleSheet); }, getCssText: function() { return [ '.augustFundraising #headerMobile {', 'display: none !important;', '}', '.augustFundraising #donationWrapper h3 {', 'color: #000;', 'margin: 0;', 'font-family: "Averta W01 Regular", sans-serif;', 'font-size: 18px;', 'font-weight: normal;', 'line-height: 1.22;', 'text-align: left;', 'color: #000000;', 'padding-bottom: 15px;', 'padding-right: 16px;', '}', '.augustFundraising #headerDesktop {', 'display: block;', '}', '.augustFundraising #headerDesktop > span {', 'color: #00ae4d;', 'font-family: Averta W01 bold, sans-serif;', 'font-weight: bold;', 'font-kerning: none;', '}', '.augustFundraising .global_nav__top--mobile {', 'z-index: 240 !important;', '}', '.augustFundraising .top-nav__overlay--show {', 'z-index: 230;', '}', '.augustFundraising .top-nav {', 'z-index: 231;', '}', '.augustFundraising #augustFundraisingBannerContainer * {', 'box-sizing: border-box;', 'align-self: center;', '}', '.augustFundraising #augustFundraisingBannerContainer {', 'position: relative;', 'height: auto;', 'min-height: 170px;', 'margin-top: -314px;', 'overflow: hidden;', '}', '.augustFundraising #augustFundraisingBannerWrapper {', 'width: 1170px;', 'margin: 0 auto;', 'padding: 25px 0 0;', 'overflow: hidden;', 'display: flex;', '}', '.augustFundraising #augustFundraisingBannerContainer.gray {', 'background: #f0f0f0;', 'border: 1px solid #979797;', '}', '.augustFundraising #augustFundraisingBannerContainer.white {', 'background: #fff;', 'border: 1px solid #505050;', '}', '.augustFundraising #logoWrapper {', 'background-image: url("'.concat(ye.baseImageUrl, 'Aug_30th_calendar_Image.png");'), 'background-repeat: no-repeat;', 'background-position: top center;', 'width: auto;', 'height: auto;', 'align-self: center;', 'width: 93px;', 'height: 114px;', 'text-align: left;', 'background-size: contain;', 'flex-shrink: 0;', '}', '.augustFundraising #logo {', 'width: auto;', 'height: auto;', 'margin: auto;', '}', '.augustFundraising #copyWrapper {', 'margin: 0 60px 0 75px;', 'flex-grow: 1;', '}', '.augustFundraising #copyWrapper h1 {', 'display: block;', 'margin: 0 0 10px 0;', 'font-family: "Averta W01 Bold", Helvetica, Arial, sans-serif;', 'font-weight: 600;', 'font-size: 26px;', 'line-height: 1.23;', 'color: black !important;', 'font-kerning: none;', '}', '.augustFundraising.countdown #copyWrapper h1 {', 'width: 640px;', 'color: black !important;', 'font-kerning: none;', '}', '.augustFundraising #copyWrapper p {', 'font-family: Averta W01 Regular, sans-serif;', 'font-size: 18px;', 'line-height: 26px;', 'color: black !important;', 'font-kerning: none;', '}', '.augustFundraising #copyWrapper p span {', 'margin: 0 -5px;', 'padding: 0 5px;', 'background: #ffd500;', 'font-kerning: none;', '}', '.augustFundraising #donationWrapper {', 'text-align: right;', 'align-self: center;', 'flex-shrink: 0;', '}', '.augustFundraising #donationOptions {', 'margin: 0;', 'padding: 0;', 'list-style: none;', 'position: relative;', '}', '.augustFundraising #donationOptions li {', 'display: inline-block;', 'margin: 0 16px 0 0;', 'font-family: "Averta W01 Regular", Helvetica, Arial, sans-serif;', '}', '.augustFundraising #donationOptions li:last-child {', 'margin: 0;', '}', '.augustFundraising #donationOptions li a {', 'display: block;', 'width: 72px;', 'height: 45px;', 'padding: 10px;', 'text-align: center;', 'font-size: 18px;', 'font-weight: bold;', 'color: black;', 'outline: none;', 'transition: .15s ease-in-out;', 'line-height: 25px;', '}', '.augustFundraising #augustFundraisingBannerContainer.gray #donationOptions li a {', 'background: white;', '}', '.augustFundraising #augustFundraisingBannerContainer.white #donationOptions li a {', 'background: #f0f0f0;', 'text-transform: capitalize;', '}', '.augustFundraising #donationOptions li a:hover,', '.augustFundraising #donationOptions li a:focus,', '.augustFundraising #donationOptions li a:active,', '.augustFundraising #donationOptions li a:visited {', 'color: black;', 'text-decoration: none;', '}', '.augustFundraising #augustFundraisingBannerContainer.white #donationOptions li:nth-child(2) a,', '.augustFundraising #augustFundraisingBannerContainer.gray #donationOptions li:nth-child(2) a {', 'background: #00ae4d;', 'color: white;', '}', '.augustFundraising #CloseWrapper {', 'background-image: url("'.concat(ye.baseImageUrl, 'close-icon.png");'), 'position: absolute;', 'background-repeat: no-repeat;', 'background-position: top center;', 'top: 30px;', 'right: 35px;', 'width: 17px;', 'height: 17px;', 'float: left;', '}', '.augustFundraising #CloseWrapper:hover {', 'cursor: pointer;', '}', '/* countdown styles */', '#yecountdown {', 'position: relative;', 'left: -7px;', 'text-align: center;', 'margin-top: 25px;', 'min-width: 190px;', 'display: inline-block;', '}', '.countdown-row {', 'font-size: 36px;', 'line-height: 0.44;', 'letter-spacing: 2.6px;', 'text-align: center;', 'font-family: Averta W01 bold, sans-serif;', 'margin-top: -5px;', 'color: #000000;', '}', '#yeHoursLeft {', 'font-size: 14px;', 'color: #000;', 'text-align: center;', 'font-family: Averta W01 bold, sans-serif;', 'margin-top: 10px;', 'display: inline-block;', '}', '@media screen and (max-width: 1199px) {', '.augustFundraising #logo {', 'display: block;', 'height: auto;', 'margin: 0;', 'width: 100px;', '}', '.augustFundraising #logoWrapper {', 'width: 93px;', '}', '.augustFundraising #augustFundraisingBannerWrapper {', 'width: 738px;', '}', '.augustFundraising #augustFundraisingBannerContainer {', 'height: 210px;', '}', '.augustFundraising #copyWrapper {', 'margin: 0 30px;', '}', '.augustFundraising #donationOptions li {', 'margin: 0 8px 8px 0;', '}', '.augustFundraising #donationWrapper {', 'width: 175px;', 'text-align: left;', '}', '.augustFundraising #copyWrapper h1 {', 'font-size: 24px;', 'line-height: 28px', '}', '.augustFundraising #donationWrapper #donationOptions {', 'width: 175px;', '}', '.augustFundraising #donationWrapper #donationOptions li a {', 'width: 66px;', 'height: 40px;', 'padding: 8px;', 'font-size: 16px;', '}', '.augustFundraising #donationWrapper h3 {', 'padding-top: 0;', '}', '.augustFundraising #CloseWrapper {', 'top: 30px;', 'right: 30px;', '}', '}', '@media screen and (max-width: 767px) {', '.augustFundraising #donationWrapper h3 {', 'display: none !important;', '}', '.augustFundraising #CloseWrapper {', 'top: 25px;', 'right: 15px;', '}', '.augustFundraising #headerMobile {', 'display: block !important;', '}', '.augustFundraising #headerMobile > span {', 'color: #00ae4d;', '}', '.augustFundraising #headerDesktop {', 'display: none !important;', '}', '.augustFundraising #copyWrapper p {', 'font-size: 18px;', '}', '.augustFundraising #augustFundraisingBannerContainer {', 'height: auto;', '}', '.augustFundraising #augustFundraisingBannerWrapper {', 'display: block;', 'width: auto;', 'overflow: auto;', 'margin: 15px 15px 15px;', 'padding: 0;', '}', '.augustFundraising #logoWrapper {', 'background-image: url("'.concat(ye.baseImageUrl, 'Aug_30th_calendar_Image.png");'), 'background-position: top left;', 'width: 93px;', 'height: 114px;', 'margin: 15px auto 15px;', 'float: none;', 'text-align: center;', '}', '.augustFundraising #donationWrapper #donationOptions {', 'width: 100%;', '}', '.augustFundraising #copyWrapper {', 'width: 100%;', 'margin: 0;', 'float: none;', 'display: block;', 'text-align: center;', '}', '.augustFundraising #copyWrapper h1 {', 'font-size: 20px;', 'line-height: 24px;', '}', '.augustFundraising #donationWrapper {', 'width: 100%;', 'margin: 0;', 'margin-top: 20px;', '}', '.augustFundraising #donationWrapper #donationOptions li {', 'margin: 0 10px 10px 0;', 'width: calc(50% - 10px);', 'font-family: "Averta W01 Regular", Helvetica, Arial, sans-serif;', '}', '.augustFundraising #donationWrapper #donationOptions li:nth-child(2n) {', 'margin-right: 0;', '}', '.augustFundraising #donationWrapper #donationOptions li a {', 'width: 100%;', 'height: 45px;', 'padding: 10px 0;', 'font-size: 18px;', 'font-weight: normal;', '}', '#augustFundraisingHoursLeft {', 'float: none;', 'font-size: 16px;', 'line-height: 26px;', 'font-family: "Averta W01 Regular", Helvetica, Arial, sans-serif;', '}', '.countdown-row {', 'font-size: 17px;', 'text-align: center;', 'font-family: Averta W01 bold, sans-serif;', 'min-width: 150px;', 'line-height: 1.2px;', 'font-weight: bold;', '}', '#augustFundraisingcountdown {', 'min-width: auto;', 'float: none;', 'margin-left: 2%;', '}', '.augustFundraising #logo {', 'display: block;', 'width: 200px;', 'float: none;', 'margin: 0 0 10px;', '}', '.augustFundraising .mobile-visible:empty,', '.augustFundraising .mobile-hidden {', 'display: none;', '}', '}', '@media screen and (min-width: 768px) {', '.augustFundraising .mobile-hidden:empty,', '.augustFundraising .mobile-visible {', 'display: none;', '}', '}' ].join(''); }, closeButtonHandler: function(s, augustFundraisingBannerContainer) { ye.setCloseCookie(); //animate banner sliding up if ($(window).width() <= 625) { $(augustFundraisingBannerContainer).animate({ 'margin-top': '-408px' }, 750, function() { //set cookie advising that user has closed the banner //animation complete $(augustFundraisingBannerContainer).detach(); }); } else { $(augustFundraisingBannerContainer).animate({ 'margin-top': '-314px' }, 750, function() { //set cookie advising that user has closed the banner //animation complete $(augustFundraisingBannerContainer).detach(); }); } }, offer: function() { if (ye.cookie.get('augustFundraising') !== 'closed') { $('body').addClass('augustFundraising'); $('#augustFundraisingBannerContainer').remove(); $('.augustFundraisingBannerContainer_style').remove(); ye.addCustomCss(ye.getCssText()); var augustFundraisingBannerContainer = $('
', { id: 'augustFundraisingBannerContainer', class: ye.model.background }); var augustFundraisingBannerWrapper = $('
', { id: 'augustFundraisingBannerWrapper' }); var logoWrapper = $('
', { id: 'logoWrapper' }); $(logoWrapper).appendTo(augustFundraisingBannerWrapper); var copyWrapper = $('
', { id: 'copyWrapper' }); $('

Help Us Raise $125,000 By August 30th

').appendTo(copyWrapper); $('

Help Us Raise $125,000 By
August 30th

').appendTo(copyWrapper); $('

We test products & services and call it as we see it so you know what’s safe, and what isn’t. Donate today to have your gift matched and go twice as far to keep consumers informed.

').appendTo(copyWrapper); $('

').appendTo(copyWrapper); $(copyWrapper).appendTo(augustFundraisingBannerWrapper); var donationWrapper = $('
', { id: 'donationWrapper' }); var donationOptions = $('