Tell the EPA: Protect the air we breathe from “chemical recycling” pollution
April 28, 2026
Tell the EPA: Protect the air we breathe from “chemical recycling” pollution
Re: Docket ID EPA-HQ-OAR-2025-0068
Burning plastic is not recycling. Pyrolysis, or plastic-to-fuel chemical recycling, is a form of incineration. Strong clean air regulations are vital for protecting our health from dangerous toxins like those released by pyrolysis. Pyrolysis can emit up to 96 different types of toxic pollutants into our air, including some known to cause cancer, reproductive harm and other health problems.
Our environment needs protection from plastic pollution, but more “chemical recycling” will just trade one form of pollution for another. I strongly urge you to protect our clean air and our health by continuing to regulate pyrolysis as a form of incineration under the Clean Air Act.
markup += ‘
‘;
markup += ‘
‘;
markup += ‘
‘;
var sustainModal = document.createElement(‘div’);
sustainModal.innerHTML = markup;
element.after(sustainModal);
//console.log($(‘#modal1’));
/**
* MODIFY WITH CAUTION: new templates depend on method structure
*/
function newAmount(old)
var newSustainAmount = “”;
switch (true)
case (old<=7):
newSustainAmount = “5.00”;
break;
case (old<=10):
newSustainAmount = “6.00”;
break;
case (old<=15):
newSustainAmount = “7.00”;
break;
case (old<=20):
newSustainAmount = “8.00”;
break;
case (old<=25):
newSustainAmount = “10.00”;
break;
case (old<=30):
newSustainAmount = “12.00”;
break;
case (old<=35):
newSustainAmount = “13.00”;
break;
case (old<=40):
newSustainAmount = “14.00”;
break;
case (old<=50):
newSustainAmount = “16.00”;
break;
case (old<=60):
newSustainAmount = “19.00”;
break;
case (old<=75):
newSustainAmount = “21.00”;
break;
case (old<=100):
newSustainAmount = “23.00”;
break;
case (old<=130):
newSustainAmount = “28.00”;
break;
case (old<=150):
newSustainAmount = “30.00”;
break;
case (old<=200):
newSustainAmount = “32.00”;
break;
case (old<=300):
newSustainAmount = “39.00”;
break;
case (old<=400):
newSustainAmount = “49.00”;
break;
case (old<=600):
newSustainAmount = “74.00”;
break;
case (old<=800):
newSustainAmount = “99.00”;
break;
default:
newSustainAmount = “100.00”;
break
return newSustainAmount
/**
* @param name of group
*
* After clicking “donate” on a one time donation, render modal prompting switch to monthly
*/
function renderMonthlyRequestModal(group)
//get one time donation amount
const oneTimeAmount = $(‘.sli-oneTimeAmountRadio:checked’)[0].getAttribute(“data-ignite-amount”) ?? $(‘.sli-oneTimeAmountInput’)[0].value;
//insert amounts into html text and button functions
$(‘.js-original-amt’).text(oneTimeAmount);
$(‘.js-group-name’).text(group);
var sustainAmount = newAmount(oneTimeAmount);
$(‘.js-upsell-amt’).text(sustainAmount);
if (group == “Environment America”)
$(‘.js-help-text’).text(“us sustain our work for a greener, healthier world, with clean air, clean water and clean energy”);
else if (group == “Environmental Action”)
$(‘.js-help-text’).text(“fuel our work to protect wildlife and the wild places they call home”);
else
$(‘.js-help-text’).text(“us champion policies that protect consumers and enable citizens to lead healthier, safer lives”);
$(‘#confirmModalB’).attr(“onclick”, “changeToSustain(“+oneTimeAmount+”);”);
$(‘#noModalB’).attr(“onclick”, “closeModal()”);
//show modal
$(‘#modal1’)[0].style.display = “block”;
function closeModal()
showWhichButton(ButtonType.THEIRS);
//submit form and close modal
$(‘a[data-ignite-submit-button=”data-ignite-submit-button”]’)[0].click();
$(‘#modal1’)[0].style.display = “none”;
function changeToSustain(old)
//add tag for tracking
if(document.querySelector(“[salsa-reference-name=’gen_embed_page_url’]”).value.includes(“?”))
$(“textarea[salsa-reference-name=’gen_embed_page_url’]”).val($(“textarea[salsa-reference-name=’gen_embed_page_url’]”).val() + “&tag=lightbox:success”);
else
$(“textarea[salsa-reference-name=’gen_embed_page_url’]”).val($(“textarea[salsa-reference-name=’gen_embed_page_url’]”).val() + “?tag=lightbox:success”);
//set old value off and hide div
if ($(‘.sli-oneTimeCustomAmount’).is(‘:checked’))
$(‘.sli-oneTimeAmountInput’)[0].value = “”; // for some reason this sets the checkbox of onTimeCustomAmount back to checked?
$(‘.sli-oneTimeCustomAmount’).click();
else
$(‘.sli-oneTimeAmountRadio:checked’).click();
$(‘.sli-oneTimeDonation’).attr(“style”, “display:none”);
//get new value and set new checked
var value = newAmount(old);
//set monthly recurring divs to show
$(‘.sli-recurringDonationMonthly’).attr(“style”, “display:block”);
$(‘input[name=”makeRecurring”]’).click();
if ($(‘div[data-ignite-field-id=”MakeRecurring”]’).length > 0 && $(‘div[data-ignite-field-id=”MakeRecurring”]’).is(“:visible”))
$(‘.sli-recurring-interval’).attr(“style”, “display:block”);
else if ($(‘div[class=”tm-recurring-toggle”]’).length > 0)
$(‘.sli-recurring-interval’).attr(“style”, “display:none”);
$(‘a.sli-button-monthly’)[0].click();
window[$(‘.sli-form’).attr(‘id’).replace(‘form’,”)].data[‘enableRecuring’].value = true;
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”][data-ignite-amount=”‘+value+'”]’).length > 0)
$(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”][data-ignite-amount=”‘+value+'”]’).click();
else
$(‘.sli-recurringAmountInput’)[0].value = value;
$(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0].focus();
$(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0].click();
$(“.sli-recurringAmountLabel.sli-customAmount”).addClass(“sli-custom-amount-label-selected”);
$(‘.sli-recurringDonationMonthly input[type=”radio”]’).prop(‘checked’, false);
//currentBrowserSafari = checkBrowser();
if (currentBrowserSafari)
var elementToFocus = $(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0];
fakeForSafari(elementToFocus);
showWhichButton(ButtonType.THEIRS);
$(‘a[data-ignite-submit-button=”data-ignite-submit-button”]’).text(“Donate $”+parseFloat(value)+” Monthly”);
//hide modal and submit form
$(‘#modal1’)[0].style.display = “none”;
$(‘a[data-ignite-submit-button=”data-ignite-submit-button”]’)[0].click();
var thisURL = window.location.href;
const currentBrowserSafari = checkBrowser();
// section for hiding sustainer option for already sustainers, including right earmarking disclosures — JMS
var pageInfo =
// object to hold donation information for purchase event to fire on successful submit
var donationInfo = “donationPage”: false
var submittedalready = false;
// run when widget loads
function salsaWidgetFinished(activityID)
// dispatch an event other functions can listen for
const event = new CustomEvent(‘TMsalsaWidgetFinished’, activityID: activityID ); // MODIFY WITH CAUTION: also in TEAL repo
document.dispatchEvent(event);
var activityId = activityID;
// fill in embed page url if field included in widget
try
$(“textarea[salsa-reference-name=’gen_embed_page_url’]”).val(window.location.href);
catch(e)
try
document.querySelector(“textarea[salsa-reference-name=’gen_embed_page_url’]”).value = window.location.href;
catch(err)
console.log(err);
//register an event that catches the error for looking at
gtag(“event”, “embedError”,
caught_error: err,
);
var versionKey = localStorage.getItem(“version”);
if (versionKey) versionKey == “Slot 7”
const urlParams = new URLSearchParams(window.location.search);
// get brand, group, and tax status from domain
pageInfo.thisBrand = “”;
pageInfo.thisGroupCode = “”;
pageInfo.thisGroup = “”;
pageInfo.thisTax = “”;
var useSuffix = false // true iff it’s a policy/foundation c3 website for a group
switch (true)
if (pageInfo.thisBrand != “” && pageInfo.thisGroup == “”)
pageInfo.thisGroup = groupCodeMappings[pageInfo.thisGroupCode].name + (useSuffix ? groupCodeMappings[pageInfo.thisGroupCode].suffix : “”);
pageInfo.refName = “”;
var isPACPage = false;
try
if ($(‘div.split1 > div.split1-side > div.box1’)[0].hasAttribute(“data-internal-id”))
pageInfo.refName = $(‘div.split1 > div.split1-side > div.box1’).attr(“data-internal-id”);
if (pageInfo.refName[3] == “5”)
isPACPage = true;
var eavaImage = document.createElement(“img”);
eavaImage.setAttribute(“src”, “https://environmentamerica.org/wp-content/uploads/2024/07/EAVA_WEB-LOGO.png”);
eavaImage.setAttribute(“alt”, “Environment America Voter Action”);
var eavaParent = document.createElement(“a”);
eavaParent.setAttribute(“href”, “https://environmentamerica.org/environment-america-voter-action/”);
eavaParent.append(eavaImage);
var eavaFigure = document.createElement(“figure”);
eavaFigure.setAttribute(“style”, “–ofs: 70rem;margin-bottom:0px”);
eavaFigure.setAttribute(“class”, “logo1”);
eavaFigure.append(eavaParent);
var logo = document.querySelector(‘figure.logo1’);
logo.insertBefore(eavaFigure, logo.firstChild);
document.querySelector(‘.footer2-main’).firstElementChild.firstElementChild.innerHTML = document.querySelector(‘.footer2-main’).firstElementChild.firstElementChild.innerHTML.substring(0, document.querySelector(‘.footer2-main’).firstElementChild.firstElementChild.innerHTML.indexOf(“Environment “)) + “Environment America Voter Action, ” + document.querySelector(‘.footer2-main’).firstElementChild.firstElementChild.innerHTML.substring(document.querySelector(‘.footer2-main’).firstElementChild.firstElementChild.innerHTML.indexOf(“Environment “));
if (document.querySelector(‘.footer2-main’).firstElementChild.firstElementChild.nextElementSibling)
document.querySelector(‘.footer2-main’).firstElementChild.firstElementChild.nextElementSibling.innerHTML = “Contributions or gifts to Environment America Voter Action are not deductible as charitable contributions for federal income tax purposes and they are voluntary. The suggested amounts are only suggestions and you may contribute less or not at all without any advantage or disadvantage to you. Your gift will be used for federal elections and is subject to the Federal Election Campaign Act. We can only accept contributions from donors who are U.S. citizens or legal permanent residents, who are making this contribution voluntarily, from their own funds and not from a corporation, union, federal contractor, or in the name of another person. By sending us a contribution you are affirming that you meet these requirements.”;
else
var pElement = document.createElement(“p”);
pElement.innerHTML = “Contributions or gifts to Environment America Voter Action are not deductible as charitable contributions for federal income tax purposes and they are voluntary. The suggested amounts are only suggestions and you may contribute less or not at all without any advantage or disadvantage to you. Your gift will be used for federal elections and is subject to the Federal Election Campaign Act. We can only accept contributions from donors who are U.S. citizens or legal permanent residents, who are making this contribution voluntarily, from their own funds and not from a corporation, union, federal contractor, or in the name of another person. By sending us a contribution you are affirming that you meet these requirements.”
document.querySelector(‘.footer2-main’).firstElementChild.append(pElement);
else if ($(‘div.split1 > div.split1-side > div.box1 > div.colored1’)[0].hasAttribute(“data-internal-id”))
pageInfo.refName = $(‘div.split1 > div.split1-side > div.box1 > div.colored1’).attr(“data-internal-id”);
//check for reference name in url params and reset pageInfo.refName if exists
if (urlParams.has(‘reference’))
pageInfo.refName = urlParams.get(‘reference’);
else if (urlParams.toString().includes(“tag=reference”))
var refParam = new URL(thisURL).searchParams.getAll(“tag”);
for (var tagparamValue in refParam)
if (refParam[tagparamValue].includes(“reference”))
const refParamList = refParam[tagparamValue].split(/:(.*)/);
pageInfo.refName = refParamList[1];
catch(e)
console.log(“error: “, e);
pageInfo.arcCode = pageInfo.refName.split(” “)[0];
console.log(“ref name is: “, pageInfo.refName);
if (!window.hasOwnProperty(“pageType”))
if (document.querySelector(“[ignite-activity-type=’Targeted_letter’]”))
pageInfo.pageType = “targeted”;
else if (thisURL.includes(“/events/”))
pageInfo.pageType = “event”;
else if (document.querySelector(“.sli-tl-msg”))
pageInfo.pageType = “long_petition”;
else if (document.querySelector(“[ignite-activity-type=’Fundraise’]”))
pageInfo.pageType = “donate_page”;
else
pageInfo.pageType = “short_petition”;
else
pageInfo.pageType = window.pageType;
if (pageInfo.pageType == “survey”)
$(‘.sli-tl-letter-box’).attr(“style”, “display:none”);
$(‘div#submit_results_EMAIL_OR_FORM’).attr(“style”, “display:none”);
$(“.sli-orientation-horizontal”).addClass(“sli-orientation-vertical”).removeClass(“sli-orientation-horizontal”);
$(‘.sli-orientation-vertical > label’).attr(“style”, “padding-bottom: 5px”);
$(‘.sli-orientation-vertical’).attr(“style”, “padding-bottom: 10px”);
//set some css for the form buttons.
var submitLink = $(‘a[data-ignite-submit-button=”data-ignite-submit-button”]’);
submitLink.css(“font-size”,”1.05em”).css(“padding”,”1.125em 2.25em 1.1875em 2.25em”);
var submitButton = submitLink.parent();
submitButton.attr(“style”, “text-align: center!important”);
// check if we’re on a donation page
if ($(“div[ignite-activity-type=’Fundraise’]”).length > 0) $(‘input[name=”name_on_card”]’).is(“:visible”) == false)
submitButton.append(“”);
else
submitButton.prepend(“”);
var confDiv = $(‘div[id=”confirmation”]’);
console.log(“A”);
if (donationInfo.frequency == DonationFrequency.ONCE)
confDiv.html(“
” + pageInfo.earmarkingDisc + “
“);
if (isPACPage)
confDiv.html(‘
Federal law requires us to use our best efforts to collect and report the name, mailing address, occupation and name of employer of individuals whose contributions exceed $200 per calendar year.
By clicking “Contribute,” I certify that: (1) I am a U.S. citizen or lawfully admitted permanent resident of the U.S.; (2) I am making this contribution on a personal card with my own personal funds, not those of another person or entity; (3) I am not a federal contractor; and (4) I am at least 18 years old.
‘);
else if (donationInfo.frequency == DonationFrequency.MONTHLY && (pageInfo.matching == false))
confDiv.html(“
” + pageInfo.monthlyDisc + “
“);
else if (donationInfo.frequency == DonationFrequency.ANNUAL && (pageInfo.matching == false))
confDiv.html(“
” + pageInfo.annualDisc + “
“);
else if (donationInfo.frequency == DonationFrequency.MONTHLY && (pageInfo.matching == true))
confDiv.html(“
” + pageInfo.monthlyDisc + pageInfo.matchingDisc + “
“);
else if (donationInfo.frequency == DonationFrequency.ANNUAL && (pageInfo.matching == true))
confDiv.html(“
” + pageInfo.annualDisc + pageInfo.matchingDisc + “
“);
// section for sustainer lightbox — JM
buildModal(submitLink); // append modal to submit button
//build new button
var buttonClone = submitLink.clone()
buttonClone.attr(“onclick”, “renderMonthlyRequestModal(‘” +pageInfo.thisGroup+ “‘);”);
buttonClone.attr(“id”, “buttonClone”);
buttonClone.removeAttr(“data-ignite-submit-button”);
submitLink.after(buttonClone);
//build a second new button for warning text
var buttonWarning = submitLink.clone()
buttonWarning.attr(“id”, “buttonWarning”);
buttonWarning.css(“color”,”white”);
submitLink.after(buttonWarning);
//show right button on load
if ($(‘div[data-ignite-field-id=”MakeRecurring”]’).length > 0 && $(‘div[data-ignite-field-id=”MakeRecurring”]’).is(“:visible”))
if ($(‘input[salsa-reference-name=”makerecurringcb”]’).prop(‘checked’) == true)
showWhichButton(ButtonType.THEIRS, isFirst=true);
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”]:checked’).length > 0)
var loadedValue = $(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”]:checked’)[0].getAttribute(“data-ignite-amount”);
else
var loadedValue = $(‘.sli-recurringAmountInput’)[0].value;
submitLink.text(“Donate $”+parseFloat(loadedValue)+” Monthly”);
else
showWhichButton(ButtonType.OURS, isFirst=true);
else if ($(‘div[class=”tm-recurring-toggle”]’).length > 0)
if ($(‘a.sli-button-one-time’)[0].classList.contains(“selected”))
showWhichButton(ButtonType.OURS, isFirst=true);
else
showWhichButton(ButtonType.THEIRS, isFirst=true);
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”]:checked’).length > 0)
var loadedValue = $(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”]:checked’)[0].getAttribute(“data-ignite-amount”);
else
var loadedValue = $(‘.sli-recurringAmountInput’)[0].value;
submitLink.text(“Donate $”+parseFloat(loadedValue)+” Monthly”);
else
showWhichButton(ButtonType.THEIRS, isFirst=true);
// this is to reset the button if buttonWarning gets triggered, because it’s oneTime we can show our button
$(‘.sli-oneTimeAmountRadio’).on(‘click’, function() $(‘div[class=”tm-recurring-toggle”]’).length > 0 )
showWhichButton(ButtonType.OURS);
);
// section for earmarking. add event listener to makeRecurringCB so that if someone unchecks it we set the disclaimer back to earmarking; if checks, it determine if monthly or annual and adjust disclaimer. also set our donationInfo variables for later ga purchase event — JMS
const makeRecurringCB = $(‘[salsa-reference-name=”makerecurringcb”]’);
makeRecurringCB.on(‘change’, function(e)
if ($(this).is(“:checked”) == false)
const event = new CustomEvent(‘TMsalsaRecurringChange’, detail: enableRecuring: false ); // MODIFY WITH CAUTION: also in TEAL repo
document.dispatchEvent(event);
else if ($(this).is(“:checked”) == true)
const event = new CustomEvent(‘TMsalsaRecurringChange’, detail: enableRecuring: true ); // MODIFY WITH CAUTION: also in TEAL repo
document.dispatchEvent(event);
);
document.addEventListener(‘TMsalsaRecurringChange’, function( event )
//console.log(“TMsalsaRecurringChange”);
var confDiv = $(‘div[id=”confirmation”]’);
if ($(‘input[salsa-reference-name=”makerecurringcb”]’).prop(‘checked’) == false)
showWhichButton(ButtonType.OURS); //show our button
if ($(‘div[data-ignite-field-id=”MakeRecurring”]’).length > 0 && $(‘div[data-ignite-field-id=”MakeRecurring”]’).is(“:visible”))
if ($(‘select.sli-recurring-interval-select.sli-input :selected’).val() == “Monthly”)
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”]:checked’).length >0)
var recurringToSet = $(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”]:checked’)[0].getAttribute(“data-ignite-amount”);
else
var recurringToSet = $(‘.sli-recurringAmountInput’)[0].value;
else if ($(‘select.sli-recurring-interval-select.sli-input :selected’).val() == “Yearly”)
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleYearly”]:checked’).length >0)
var recurringToSet = $(‘.sli-recurringAmountRadio[name=”donationAmtToggleYearly”]:checked’)[0].getAttribute(“data-ignite-amount”);
else
var recurringToSet = $(‘.sli-recurringAmountInput’)[1].value;
else if ($(‘div[class=”tm-recurring-toggle”]’).length > 0)
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”]:checked’).length >0)
var recurringToSet = $(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”]:checked’)[0].getAttribute(“data-ignite-amount”);
else
var recurringToSet = $(‘.sli-recurringAmountInput’)[0].value;
if ($(‘.sli-oneTimeAmountRadio[name=”donationAmtToggle”][data-ignite-amount=”‘+recurringToSet+'”]’).length > 0)
$(‘.sli-oneTimeAmountRadio[name=”donationAmtToggle”][data-ignite-amount=”‘+recurringToSet+'”]’).click();
else
$(‘.sli-oneTimeAmountLabel.sli-amount-label.sli-customAmount’)[0].focus();
$(‘.sli-oneTimeAmountLabel.sli-amount-label.sli-customAmount’)[0].click();
$(‘.sli-oneTimeAmountInput’)[0].value = recurringToSet;
$(‘.sli-oneTimeAmountLabel.sli-customAmount’).addClass(“sli-custom-amount-label-selected”);
if (currentBrowserSafari)
var elementToFocus = $(‘.sli-oneTimeAmountLabel.sli-amount-label.sli-customAmount’)[0];
fakeForSafari(elementToFocus);
submitLink.text(“Donate”);
confDiv.html(“
” + pageInfo.earmarkingDisc + “
“);
donationInfo.frequency = DonationFrequency.ONCE;
else if ($(‘input[salsa-reference-name=”makerecurringcb”]’).prop(‘checked’) == true)
showWhichButton(ButtonType.THEIRS); //show their button
//set chosen donation amount for other amountblocks
if ( $(‘.sli-oneTimeAmountInput’)[0].value == “”)
var oneTimeToSet = $(‘.sli-oneTimeAmountRadio:checked’)[0].getAttribute(“data-ignite-amount”);
else
var oneTimeToSet = $(‘.sli-oneTimeAmountInput’)[0].value;
if ($(‘div[data-ignite-field-id=”MakeRecurring”]’).length > 0 && $(‘div[data-ignite-field-id=”MakeRecurring”]’).is(“:visible”))
if ($(‘select.sli-recurring-interval-select.sli-input :selected’).val() == “Monthly”)
submitLink.text(“Donate $”+parseFloat(oneTimeToSet)+” Monthly”);
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”][data-ignite-amount=”‘+oneTimeToSet+'”]’).length > 0)
$(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”][data-ignite-amount=”‘+oneTimeToSet+'”]’).click();
$(“.sli-recurringAmountLabel.sli-customAmount”).removeClass(“sli-custom-amount-label-selected”);
else
$(‘.sli-recurringAmountInput’)[0].value = oneTimeToSet;
$(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0].focus();
$(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0].click();
$(“.sli-recurringAmountLabel.sli-customAmount”).addClass(“sli-custom-amount-label-selected”);
if (currentBrowserSafari)
var elementToFocus = $(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0];
fakeForSafari(elementToFocus);
donationInfo.frequency = DonationFrequency.MONTHLY;
if (pageInfo.matching == false)
confDiv.html(“
” + pageInfo.monthlyDisc + “
“);
else if (pageInfo.matching == true)
confDiv.html(“
” + pageInfo.monthlyDisc + pageInfo.matchingDisc + “
“);
else if ($(‘select.sli-recurring-interval-select.sli-input :selected’).val() == “Yearly”)
submitLink.text(“Donate $”+parseFloat(oneTimeToSet)+” Yearly”)
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleYearly”][data-ignite-amount=”‘+oneTimeToSet+'”]’).length > 0)
$(‘.sli-recurringAmountRadio[name=”donationAmtToggleYearly”][data-ignite-amount=”‘+oneTimeToSet+'”]’).click();
$(“.sli-recurringAmountLabel.sli-customAmount”).removeClass(“sli-custom-amount-label-selected”);
else
$(‘.sli-recurringAmountInput’)[1].value = oneTimeToSet;
$(‘.sli-recurringDonationYearly > ul > li > div[class=”sli-input-group”] > input[name=”customAnnualRecurringAmount”]’).focus();
$(‘.sli-recurringDonationYearly > ul > li > div[class=”sli-input-group”] > input[name=”customAnnualRecurringAmount”]’).click();
$(“.sli-recurringAmountLabel.sli-customAmount”).addClass(“sli-custom-amount-label-selected”);
if (currentBrowserSafari)
var elementToFocus = $(‘.sli-recurringDonationYearly > ul > li > div[class=”sli-input-group”] > input[name=”customAnnualRecurringAmount”]’);
fakeForSafari(elementToFocus);
donationInfo.frequency = DonationFrequency.ANNUAL;
if (pageInfo.matching == false)
confDiv.html(“
” + pageInfo.annualDisc + “
“);
else if (pageInfo.matching == true)
confDiv.html(“
” + pageInfo.annualDisc + pageInfo.matchingDisc + “
“);
else if ($(‘div[class=”tm-recurring-toggle”]’).length > 0)
submitLink.text(“Donate $”+parseFloat(oneTimeToSet)+” Monthly”);
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”][data-ignite-amount=”‘+oneTimeToSet+'”]’).length > 0)
$(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”][data-ignite-amount=”‘+oneTimeToSet+'”]’).click();
$(“.sli-recurringAmountLabel.sli-customAmount”).removeClass(“sli-custom-amount-label-selected”);
else
$(‘.sli-recurringAmountInput’)[0].value = oneTimeToSet;
$(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0].focus();
$(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0].click();
$(“.sli-recurringAmountLabel.sli-customAmount”).addClass(“sli-custom-amount-label-selected”);
if (currentBrowserSafari)
var elementToFocus = $(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0];
fakeForSafari(elementToFocus);
donationInfo.frequency = DonationFrequency.MONTHLY;
if (pageInfo.matching == false)
confDiv.html(“
” + pageInfo.monthlyDisc + “
“);
else if (pageInfo.matching == true)
confDiv.html(“
” + pageInfo.monthlyDisc + pageInfo.matchingDisc + “
“);
);
//add and remove styling of $ button label for custom amounts on recurring interval change
$(‘select.sli-recurring-interval-select.sli-input’).on(‘change’, function()
if ($(‘select.sli-recurring-interval-select.sli-input :selected’).val() == “Monthly”)
if ( $(‘.sli-recurringAmountInput’)[1].value == “”)
var ToggledToSet = $(‘.sli-recurringAmountRadio[name=”donationAmtToggleYearly”]:checked’)[0].getAttribute(“data-ignite-amount”);
else
var ToggledToSet = $(‘.sli-recurringAmountInput’)[1].value;
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”][data-ignite-amount=”‘+ToggledToSet+'”]’).length > 0)
$(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”][data-ignite-amount=”‘+ToggledToSet+'”]’).click();
$(“.sli-recurringAmountLabel.sli-customAmount”).removeClass(“sli-custom-amount-label-selected”);
else
$(‘.sli-recurringAmountInput’)[0].value = ToggledToSet;
$(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0].focus();
$(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0].click();
$(“.sli-recurringAmountLabel.sli-customAmount”).addClass(“sli-custom-amount-label-selected”);
if (currentBrowserSafari)
var elementToFocus = $(‘.sli-recurringAmountLabel.sli-amount-label.sli-customAmount’)[0];
fakeForSafari(elementToFocus);
submitLink.text(“Donate $”+parseFloat(ToggledToSet)+” Monthly”)
else if ($(‘select.sli-recurring-interval-select.sli-input :selected’).val() == “Yearly”)
if ($(‘.sli-recurringAmountInput’)[0].value == “”)
var ToggledToSet = $(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”]:checked’)[0].getAttribute(“data-ignite-amount”);
else
var ToggledToSet = $(‘.sli-recurringAmountInput’)[0].value;
if ($(‘.sli-recurringAmountRadio[name=”donationAmtToggleYearly”][data-ignite-amount=”‘+ToggledToSet+'”]’).length > 0)
$(‘.sli-recurringAmountRadio[name=”donationAmtToggleYearly”][data-ignite-amount=”‘+ToggledToSet+'”]’).click();
$(“.sli-recurringAmountLabel.sli-customAmount”).removeClass(“sli-custom-amount-label-selected”);
else
$(‘.sli-recurringAmountInput’)[1].value = ToggledToSet;
$(‘.sli-recurringDonationYearly > ul > li > div[class=”sli-input-group”] > input[name=”customAnnualRecurringAmount”]’).focus();
$(‘.sli-recurringDonationYearly > ul > li > div[class=”sli-input-group”] > input[name=”customAnnualRecurringAmount”]’).click();
$(“.sli-recurringAmountLabel.sli-customAmount”).addClass(“sli-custom-amount-label-selected”);
//$(‘.sli-recurringAmountInput’).click();
if (currentBrowserSafari)
var elementToFocus = $(‘.sli-recurringDonationYearly > ul > li > div[class=”sli-input-group”] > input[name=”customAnnualRecurringAmount”]’);
fakeForSafari(elementToFocus);
submitLink.text(“Donate $”+parseFloat(ToggledToSet)+” Yearly”)
);
//set minimum donation values and message for validator
var amountMin = 5;
if (window.hasOwnProperty(“pageAmountMin”))
if (window.pageAmountMin != “”)
amountMin = window.pageAmountMin;
var amountErrorMsg = `Please enter a donation amount of at least $$amountMin`;
if (window.hasOwnProperty(“pageAmountErrorMsg”))
if (window.pageAmountErrorMsg != “”)
amountErrorMsg = window.pageAmountErrorMsg;
// section for sustainer lightbox — JM add event listener for custom one time amount, this is the min and max values for showing our modal popup
$(‘.sli-oneTimeAmountInput’).on(‘change’, function()
$(“.sli-oneTimeAmountLabel.sli-customAmount”).addClass(“sli-custom-amount-label-selected”);
var oneTimeCustom = this.value
var expiryYear = $(‘[data-fv-field=”expiry_year”] :selected’).text();
if (($(‘div[data-ignite-field-id=”MakeRecurring”]’).length > 0 && $(‘div[data-ignite-field-id=”MakeRecurring”]’).is(“:visible”)) );
// add event listener for button amounts to hide our validator on click
$(‘.sli-oneTimeDonationAmounts’).on(‘click’, function()
$(“.sli-oneTimeAmountLabel.sli-customAmount”).removeClass(‘sli-custom-amount-label-selected’);
if ($(‘#ourErrorValidator’).length > 0) //if our validator hide
$(‘#ourErrorValidator’).attr(“style”, “display:none”);
$(‘#ourErrorValidator’).attr(“data-fv-result”, “VALID”);
if (($(‘div[data-ignite-field-id=”MakeRecurring”]’).length > 0 && $(‘div[data-ignite-field-id=”MakeRecurring”]’).is(“:visible”)) );
// add event listener for custom monthly amount
if ($(‘.sli-recurringAmountInput[name=”customMnthlyRecurringAmount”]’).length > 0)
$(‘.sli-recurringAmountInput[name=”customMnthlyRecurringAmount”]’).on(‘change’, function()
$(“.sli-recurringAmountLabel.sli-customAmount”).addClass(“sli-custom-amount-label-selected”);
var recCustom = this.value
submitLink.text(“Donate $”+parseFloat(recCustom)+” Monthly”);
//if donation is less than 5 show our validator that doesn’t let them donate
if (recCustom 0)
if ($(‘#ourMonthlyErrorValidator’).length > 0) //if our validator exists show it and set
$(‘#ourMonthlyErrorValidator’).attr(“style”, “display:block”);
$(‘#ourMonthlyErrorValidator’).attr(“data-fv-result”, “INVALID”);
else //our validator doesn’t exist. Build it, show it, set it invalid
var valMonthlyError = $(‘small[data-fv-validator=”greaterThan”][data-fv-for=”customMnthlyRecurringAmount”]’);
var ourMonthlyError = valMonthlyError.clone();
ourMonthlyError[0].innerHTML=amountErrorMsg;
ourMonthlyError.attr(“style”, “display:block”);
ourMonthlyError.attr(“id”, “ourMonthlyErrorValidator”);
ourMonthlyError.attr(“data-fv-validator”, “greaterThan5”);
ourMonthlyError.attr(“data-fv-result”, “INVALID”);
valMonthlyError.after(ourMonthlyError)
else //greater than 5 – if our validator exists, hide it and set valid
if ($(‘#ourMonthlyErrorValidator’).length > 0)
$(‘#ourMonthlyErrorValidator’).attr(“style”, “display:none”);
$(‘#ourMonthlyErrorValidator’).attr(“data-fv-result”, “VALID”);
);
// add event listener for button amounts to hide our validator on click
$(‘.sli-recurringDonationAmounts > li > input[name=”donationAmtToggleMonthly”]’).on(‘click’, function()
var donateButtonAmount = $(‘.sli-recurringAmountRadio[name=”donationAmtToggleMonthly”]:checked’)[0].getAttribute(“data-ignite-amount”);
submitLink.text(“Donate $”+parseFloat(donateButtonAmount)+” Monthly”);
$(“.sli-recurringAmountLabel.sli-customAmount”).removeClass(“sli-custom-amount-label-selected”);
if ($(‘#ourMonthlyErrorValidator’).length > 0) //if our validator hide
$(‘#ourMonthlyErrorValidator’).attr(“style”, “display:none”);
$(‘#ourMonthlyErrorValidator’).attr(“data-fv-result”, “VALID”);
);
// add event listener for custom yearly amount
if ($(‘.sli-recurringAmountInput[name=”customAnnualRecurringAmount”]’).length > 0)
$(‘.sli-recurringAmountInput[name=”customAnnualRecurringAmount”]’).on(‘change’, function()
$(“.sli-recurringAmountLabel.sli-customAmount”).addClass(“sli-custom-amount-label-selected”);
var recYearCustom = this.value
submitLink.text(“Donate $”+parseFloat(recYearCustom)+” Yearly”);
//if donation is less than 5 show our validator that doesn’t let them donate
if (recYearCustom 0)
if ($(‘#ourYearlyErrorValidator’).length > 0) //if our validator exists show it and set
$(‘#ourYearlyErrorValidator’).attr(“style”, “display:block”);
$(‘#ourYearlyErrorValidator’).attr(“data-fv-result”, “INVALID”);
else //our validator doesn’t exist. Build it, show it, set it invalid
var valYearError = $(‘small[data-fv-validator=”greaterThan”][data-fv-for=”customAnnualRecurringAmount”]’);
var ourYearError = valYearError.clone();
ourYearError[0].innerHTML=amountErrorMsg;
ourYearError.attr(“style”, “display:block”);
ourYearError.attr(“id”, “ourYearlyErrorValidator”);
ourYearError.attr(“data-fv-validator”, “greaterThan5”);
ourYearError.attr(“data-fv-result”, “INVALID”);
valYearError.after(ourYearError)
else //greater than 5 – if our validator exists, hide it and set valid
if ($(‘#ourYearlyErrorValidator’).length > 0)
$(‘#ourYearlyErrorValidator’).attr(“style”, “display:none”);
$(‘#ourYearlyErrorValidator’).attr(“data-fv-result”, “VALID”);
);
// add event listener for button amounts to hide our validator on click
$(‘.sli-recurringDonationAmounts > li > input[name=”donationAmtToggleYearly”]’).on(‘click’, function()
var donateButtonAmount = $(‘.sli-recurringAmountRadio[name=”donationAmtToggleYearly”]:checked’)[0].getAttribute(“data-ignite-amount”);
submitLink.text(“Donate $”+parseFloat(donateButtonAmount)+” Yearly”);
$(“.sli-recurringAmountLabel.sli-customAmount”).removeClass(“sli-custom-amount-label-selected”);
if ($(‘#ourYearlyErrorValidator’).length > 0) //if our validator hide
$(‘#ourYearlyErrorValidator’).attr(“style”, “display:none”);
$(‘#ourYearlyErrorValidator’).attr(“data-fv-result”, “VALID”);
);
else
const showCheckbox = false;
const checkboxStatements =
“AME”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“AZE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“CAE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“COE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“CTE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“FLE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“GAE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“IAE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“ILE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“MAE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“MDE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“MEE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“MIE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“MNE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“MOE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“MTE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“NCE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“NHE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“NJE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“NME”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“NYE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“OHE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“ORE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“PAE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“RIE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“TXE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“VAE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“WAE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“WIE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“NVE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“AKE”: “YES! I’LL STAND WITH BEES, FORESTS, CLEAN AIR AND CLEAN WATER BY MAKING A SPECIAL EARTH DAY DONATION TO “+pageInfo.thisGroup.toUpperCase()+”.”,
“EAC”: “YES! I PLEDGE TO DO EVEN MORE TO PROTECT WILDLIFE AND WILD PLACES BY MAKING A SPECIAL DONATION IN HONOR OF EARTH DAY.”,
“AZP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“CAP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“COP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“CTP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“FLP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“GAP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“IAP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“ILP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“MAP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“MDP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“MIP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“MOP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“NCP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“NHP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“NJP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“NMP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“OHP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“ORP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“PAP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“RIP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“TXP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“WAP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“WIP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”,
“USP”: “I PLEDGE TO DO EVEN MORE TO SUPPORT PIRG BY MAKING A SPECIAL EARTH DAY DONATION.”
;
if (!window.hasOwnProperty(“hide_checkbox”))
var hide_checkbox = false;
else
hide_checkbox = window.hide_checkbox;
if (pageInfo.thisTax == “c4” && showCheckbox && !thisURL.includes(“/events/”))
if (!hide_checkbox)
if (pageInfo.thisGroupCode in checkboxStatements)
var buttonParent = $(‘a[data-ignite-submit-button=”data-ignite-submit-button”]’).parent();
var checkboxHTML = `
`;
buttonParent.prepend(checkboxHTML);
if ($(‘p[class=checkbox_statement]’).length > 0)
$(‘p[class=checkbox_statement]’).insertBefore($(‘a[data-ignite-submit-button=”data-ignite-submit-button”]’)[0]).css(“padding-bottom”,”1.25em”);
gtag(“event”, “actionClickThrough”,
action_name: pageInfo.refName,
group_name: pageInfo.thisGroup,
pageType: pageInfo.pageType
);
// set up the mutation observer
var observer = new MutationObserver(function (mutations, me)
// `mutations` is an array of mutations that occurred
// `me` is the MutationObserver instance
if ($(‘.sli-end > div > div > div[class=”result”] > ul > li’).length > 0)
const textCompare = “You’ve already signed this petition. We appreciate the support!”;
let errorText = $(‘.sli-end > div > div > div[class=”result”] > ul > li’)[0].innerText;
if (errorText == textCompare)
$(‘.sli-end > div > div > div[class=”result”]’).css(“visibility”,”hidden”);
if (!window.hasOwnProperty(“redirectPath”))
//set a generic redirect for the page if there isn’t one defined, based on tax code and brand
var redirectPath = “”;
if(pageInfo.thisBrand == “PIRG” && pageInfo.thisTax == “c4”)
redirectPath = “/take-action/thank-you-for-taking-action-95/”;
else if(pageInfo.thisBrand == “PIRG” && pageInfo.thisTax == “c3”)
redirectPath = “/take-action/thank-you-for-taking-action-11/”;
else if(pageInfo.thisBrand == “Enviro” && pageInfo.thisTax == “c4”)
redirectPath = “/take-action/thank-you-for-taking-action-101/”;
if(thisURL.includes(“/california/”))
redirectPath = “/take-action/thank-you-for-taking-action-101-2/”;
else if(pageInfo.thisBrand == “Enviro” && pageInfo.thisTax == “c3”)
redirectPath = “/take-action/thank-you-for-taking-action-17/”;
var baseURL = “”;
if(thisURL.includes(“/take-action/”))
baseURL = thisURL.substring(0, thisURL.indexOf(“/take-action/”)).replace(“dev.ea-test.com”,”environmentamerica.org”).replace(“dev.pirg-test.com”,”pirg.org”);
else if (thisURL.includes(“/events/”))
baseURL = thisURL.substring(0, thisURL.indexOf(“/events/”)).replace(“dev.ea-test.com”,”environmentamerica.org”).replace(“dev.pirg-test.com”,”pirg.org”);
//if both base and redirect, redirect includes base. if either blank, we’re on an undefined page (not PIRG/Enviro or not action/event page) set generic message
if (baseURL !== “” && redirectPath !== “”)
redirectPath = baseURL + redirectPath;
else
redirectPath = “Thank you for taking action!”;
else //the redirect has already been defined, just set it to the variable from the window
redirectPath = window.redirectPath;
//console.log(redirectPath);
//determine if redirectpath is a url – if it is handle the params to rename reference and set a redirect tag, if it’s not display message.
if (redirectPath.startsWith(“https://”)
);
// start observing
observer.observe(document,
childList: true,
subtree: true
);
// Section for earmarking — JMS. run function if recurring value changes (include or remove monthly/annual disclaimer along with earmarking disclaimer; if matching, also include matching sentence if including monthly/annual disclaimer). will already only run if a donation page so no need to check
// function only runs when someone goes from one time to recurring or the interval option is changed, not when someone goes from recurring to one time.
// will already have disclaimers defined from when widget launched
function salsaWidgetRecurringIntervalChange()
donationInfo.donationPage = true;
var activityId = arguments[0][“activityId”];
var frequency = arguments[0][“frequency”]; // “Monthly” or “Yearly”
var confDiv = $(‘div[id=”confirmation”]’);
if (frequency == “Monthly”)
donationInfo.frequency = DonationFrequency.MONTHLY;
confDiv.html(“
” + pageInfo.monthlyDisc + (pageInfo.matching ? pageInfo.matchingDisc : “”) + “
“);
else if (frequency == “Yearly”)
donationInfo.frequency = DonationFrequency.ANNUAL;
confDiv.html(“
” + pageInfo.annualDisc + (pageInfo.matching ? pageInfo.matchingDisc : “”) + “
“);
// Section for GA donation info — JMS save donation amount in donationInfo object so that we can fire ga event on successful submit with purchase info
function salsaWidgetDonationAmountChange()
donationInfo.donationPage = true;
donationInfo.amount = arguments[0].donationAmount;
// on successful submit event on a donation page, fire the ga purchase event. on successful non-donation action page submit, fire ga custom event
function salsaWidgetPageSubmit(eventObj)
// dispatch an event other functions can listen for
const event = new CustomEvent(‘TMsalsaWidgetPageSubmit’, eventObj);
document.dispatchEvent(event);
if (donationInfo.donationPage == true)
// set up required fields for purchase event
// transaction id group name + time to millisecond
const nowTime = new Date().getTime();
var transID = pageInfo.thisGroup.replaceAll(” “, “_”) + nowTime;
// fire purchase event
gtag(“event”, “salsa_purchase”,
currency: “USD”,
transaction_id: transID,
value: donationInfo.amount,
purchase_id: pageInfo.refName,
action_name: pageInfo.refName,
purchase_name: donationInfo.frequency,
pageType: pageInfo.pageType
);
else
if(!submittedalready)
submittedalready = true;
gtag(“event”, “takeAction”,
action_name: pageInfo.refName,
group_name: pageInfo.thisGroup,
pageType: pageInfo.pageType,
referrer: document.referrer
);
console.log(“post page submit – page submitted: “,submittedalready);
Topics
Search
RECENT PRESS RELEASES
Related Post


