if (window.location.protocol != "https:" && window.location.href.indexOf("formulate") == -1 && "False" === "True") { window.location.href = "https:" + window.location.href.substring(window.location.protocol.length); } var fbScriptTag = document.getElementsByClassName("5d71fff1-dbbc-4910-aa10-fda381abb20f"), fbBodyTag = document.body, fbHeadTag = document.head, fbIsTestResponse = 'False', fbEnableInstaMedScript = 'False', fbRenderContainer = document.createElement("div"), fbRenderedCssContainer = document.createElement("div"), fbConfigScript = document.createElement("script"), fbRequireJSScript = document.createElement("script"), fbInstaMedJSScript = document.createElement("script"), fbGeoCaptchaCallback = document.createElement("script"), fbGeoReCaptchaCallback = document.createElement("script"), fbFormulateRenderer = document.createElement("script"), fbRenderedIntegrations = document.createElement("script"), fbRenderedScripts = document.createElement("script"), fbAutoPopulateFromQueryString = document.createElement("script"), fbEmbeddedCss = "", renderedScripts = 'var totalCostElementJs = function () {\ requirejs([window.formHost + \'/Scripts/require/fbRequire.config.js\'], function (fbRequireConfig) {\ var fbRequire = fbRequireConfig.fbRequire;\ \ fbRequire([\'jquery\'], function ($) {\ \ $(\'.paymentTotalCost\').hide();\ \ });\ });\ };\ \ fbRequireJSScript.addEventListener("load", totalCostElementJs);var conditionalSectionJs = function () {\ requirejs([window.formHost + \'/Scripts/require/fbRequire.config.js\'], function (fbRequireConfig) {\ var fbRequire = fbRequireConfig.fbRequire;\ \ fbRequire([\'jquery\', \'he\'], function ($, he) {\ he.encode.options.decimal = true;\ he.encode.options.allowUnsafeSymbols = true;\ \ var sectionConditions = JSON.parse(\'[{"ElementName":"FormField8_5d71fff1-dbbc-4910-aa10-fda381abb20f","Value":"Show my support by making this a recurring donation."}]\');\ var conditionOperator = \'and\';\ \ sectionConditions.forEach(function (sectionCondition) {\ $("select[id=" + sectionCondition.ElementName + "]").addClass(\'conditionalSectionListSelection\');\ $("input[id^=\'" + sectionCondition.ElementName + "\'][type=\'checkbox\']").addClass(\'conditionalSectionListSelection\');\ $("input[id^=\'" + sectionCondition.ElementName + "\'][type=\'radio\']").addClass(\'conditionalSectionListSelection\');\ \ $("select[id=" + sectionCondition.ElementName + "]").on(\'change\', function () {\ checkShowHide();\ });\ \ $("input[id^=\'" + sectionCondition.ElementName + "\'][type=\'checkbox\']").on(\'change\', function () {\ checkShowHide();\ });\ \ $("input[id^=\'" + sectionCondition.ElementName + "\'][type=\'radio\']").on(\'change\', function () {\ checkShowHide();\ });\ });\ \ function checkShowHide() {\ var shouldShowSection = conditionOperator === \'and\'; /* set default to true for AND operation and false for OR operation */\ \ sectionConditions.forEach(function (sectionCondition) {\ checkSelect(sectionCondition); \ checkCheckbox(sectionCondition); \ checkRadio(sectionCondition); \ });\ \ showHideSection(shouldShowSection);\ \ function checkSelect(sectionCondition) {\ var matchingSelect = $("select[id=" + sectionCondition.ElementName + "]")[0];\ \ if (!matchingSelect) {\ return;\ }\ \ if (matchingSelect.type === \'select-multiple\') {\ var hasOneMatchingValue = false;\ \ for (var i = 0; i < matchingSelect.selectedOptions.length; i++) {\ if (encode(matchingSelect.selectedOptions[i].value) === sectionCondition.Value) {\ hasOneMatchingValue = true;\ }\ }\ \ shouldShowSection = mergeCondition(shouldShowSection, hasOneMatchingValue, matchingSelect);\ } else {\ shouldShowSection = mergeCondition(shouldShowSection, encode(matchingSelect.value) === sectionCondition.Value, matchingSelect);\ }\ }\ \ function checkCheckbox(sectionCondition) {\ var matchingCheckboxes = $("input[id^=\'" + sectionCondition.ElementName + "\'][type=\'checkbox\']");\ \ for (var i = 0; i < matchingCheckboxes.length; i++) {\ if (encode(matchingCheckboxes[i].value) === sectionCondition.Value) {\ shouldShowSection = mergeCondition(shouldShowSection, matchingCheckboxes[i].checked, matchingCheckboxes[i]);\ }\ }\ }\ \ function checkRadio(sectionCondition) {\ var matchingRadios = $("input[id^=\'" + sectionCondition.ElementName + "\'][type=\'radio\']");\ \ for (var i = 0; i < matchingRadios.length; i++) {\ if (encode(matchingRadios[i].value) === sectionCondition.Value) {\ shouldShowSection = mergeCondition(shouldShowSection, matchingRadios[i].checked, matchingRadios[i]);\ }\ }\ }\ }\ \ function mergeCondition(overallResult, newResult, element) {\ newResult = newResult && isParentVisible(element);\ \ if (conditionOperator === \'and\') {\ return overallResult && newResult;\ } else {\ return overallResult || newResult;\ }\ }\ \ function isParentVisible(element) {\ var parentSectionDiv = $(\'#\' + element.id).closest(".fb-section");\ return parentSectionDiv && !parentSectionDiv.is(":hidden");\ }\ \ function encode(myString) {\ myString = he.encode(he.escape(myString));\ \ /* Fixes issues with single quote and backtick encoding */\ var i,\ entities = [\ [\''\', \''\'],\ [\'`\', \'`\']\ ];\ \ for (i = 0; i < entities.length; i++) {\ myString = String(myString).replace(new RegExp(entities[i][0], \'g\'), entities[i][1]);\ }\ \ return myString;\ }\ \ function showHideSection(showSection) {\ if (showSection) {\ $(\'#FormField12_5d71fff1-dbbc-4910-aa10-fda381abb20f\').show();\ } else {\ $(\'#FormField12_5d71fff1-dbbc-4910-aa10-fda381abb20f\').hide();\ }\ \ $("#FormField12_5d71fff1-dbbc-4910-aa10-fda381abb20f .conditionalSectionListSelection").each(function (i, obj) {\ if (obj.type === \'radio\' || obj.type === \'checkbox\') {\ if (obj.checked) {\ $(\'#\' + obj.id).change();\ }\ } else {\ $(\'#\' + obj.id).change();\ }\ });\ }\ });\ });\ };\ \ fbRequireJSScript.addEventListener("load", conditionalSectionJs);var overridePaymentJS = function () {\ requirejs([window.formHost + \'/Scripts/require/fbRequire.config.js\'], function (fbRequireConfig) {\ var fbRequire = fbRequireConfig.fbRequire;\ \ fbRequire([\'jquery\'], function ($) {\ var formId = \'5d71fff1-dbbc-4910-aa10-fda381abb20f\',\ $formElementsContainer = $(\'.fbFormContainer_\' + formId);\ \ $(\'#OverridePaymentCheckbox\').click(function() {\ if ($(this).prop(\'checked\') === true) {\ $formElementsContainer.find(\'div.stripePaymentElement\').hide();\ $formElementsContainer.find(\'div.convergePaymentElement\').hide();\ $formElementsContainer.find(\'div.braintreePaymentElement\').hide();\ $formElementsContainer.find(\'div.braintreePaymentElement\').addClass(\'no-charge\');\ $formElementsContainer.find(\'div.instaMedPaymentElement\').hide();\ $formElementsContainer.find(\'div.authorizeDotNetPaymentElement\').hide();\ }\ else {\ $formElementsContainer.find(\'div.stripePaymentElement\').show();\ $formElementsContainer.find(\'div.convergePaymentElement\').show();\ $formElementsContainer.find(\'div.braintreePaymentElement\').show();\ $formElementsContainer.find(\'div.braintreePaymentElement\').removeClass(\'no-charge\');\ $formElementsContainer.find(\'div.instaMedPaymentElement\').show();\ $formElementsContainer.find(\'div.authorizeDotNetPaymentElement\').show();\ }\ });\ \ /* Hack until some way more concrete to detect whether to show the override payment checkbox. \ * Maybe update renderer? */\ if (window.location.href.indexOf(\'iframe-components/clean/form-renderer.html\') === -1\ && window.location.href.indexOf(\'submittableFormTest\') === -1\ && window.location.href.indexOf(\'registrations/add\') === -1) {\ $(\'.fbFormContainer_\' + formId + \' div.overridePayment\').remove();\ }\ });\ });\ };\ \ fbRequireJSScript.addEventListener(\'load\', overridePaymentJS);var paymentJs = function () {\ requirejs([window.formHost + \'/Scripts/require/fbRequire.config.js\'], function (fbRequireConfig) {\ var fbRequire = fbRequireConfig.fbRequire;\ \ fbRequire([\'jquery\'], function ($) {\ \ window.getStripeToken = getStripeToken;\ \ var processChange = function (result, field) {\ if (result.error) {\ if (field === \'cardnumber\') {\ var e = $(\'#validateCardNumber\');\ e.val(\'\');\ e.trigger(\'change\');\ } else if (field === \'cardexpire\') {\ var e = $(\'#validateCardExpiration\');\ e.val(\'\');\ e.trigger(\'change\');\ } else if (field === \'cardcvc\') {\ var e = $(\'#validateCardCvc\');\ e.val(\'\');\ e.trigger(\'change\');\ }\ } else if (field === \'cardnumber\') {\ if (result.complete) {\ $(\'#validateCardNumber\').val(\'ZZZ\');\ $(\'#validateCardNumber\').trigger(\'change\');\ }\ } else if (field === \'cardexpire\') {\ if (result.complete) {\ $(\'#validateCardExpiration\').val(\'ZZZ\');\ $(\'#validateCardExpiration\').trigger(\'change\');\ }\ } else if (field === \'cardcvc\') {\ if (result.complete) {\ $(\'#validateCardCvc\').val(\'ZZZ\');\ $(\'#validateCardCvc\').trigger(\'change\');\ }\ }\ };\ \ var processBlur = function (result, container) {\ if (container === \'#CardNumber\') {\ if ($(container).hasClass(\'StripeElement--empty\')) {\ $(\'#validateCardNumber\').val(\'\');\ $(\'#validateCardNumber\').trigger(\'change\');\ }\ } else if (container === \'#Expiration\') {\ if ($(container).hasClass(\'StripeElement--empty\')) {\ $(\'#validateCardExpiration\').val(\'\');\ $(\'#validateCardExpiration\').trigger(\'change\');\ }\ } else if (container === \'#CVC\') {\ if ($(container).hasClass(\'StripeElement--empty\')) {\ $(\'#validateCardCvc\').val(\'\');\ $(\'#validateCardCvc\').trigger(\'change\');\ }\ }\ };\ \ var stripeElements = {};\ var stripe = {};\ \ $(function () {\ $.getScript(\'https://js.stripe.com/v3/\', function (data, textStatus, jqxhr) {\ stripe = Stripe(\'pk_live_nPPnJc9ZetGgfJPpoK6a11xm\');\ \ var style = {\ base: {\ \'lineHeight\': \'2\',\ \'fontSize\': \'14px\',\ \'color\': \'#030303\',\ \'fontFamily\': \'"Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif\'\ }\ };\ \ var elements = stripe.elements();\ \ var cardNumberElement = elements.create(\'cardNumber\', {\ \'style\': style\ });\ cardNumberElement.mount(\'#CardNumber\');\ stripeElements.cardNumberElement = cardNumberElement;\ cardNumberElement.on(\'change\', function (event) {\ processChange(event, \'cardnumber\');\ });\ cardNumberElement.on(\'blur\', function (event) {\ processBlur(event, \'#CardNumber\');\ });\ \ var cardExpiryElement = elements.create(\'cardExpiry\', {\ \'style\': style\ });\ cardExpiryElement.mount(\'#Expiration\');\ stripeElements.cardExpiryElement = cardExpiryElement;\ cardExpiryElement.on(\'change\', function (event) {\ processChange(event, \'cardexpire\');\ });\ cardExpiryElement.on(\'blur\', function (event) {\ processBlur(event, \'#Expiration\');\ });\ \ var cardCvcElement = elements.create(\'cardCvc\', {\ \'style\': style\ });\ cardCvcElement.mount(\'#CVC\');\ stripeElements.cardCvcElement = cardCvcElement;\ cardCvcElement.on(\'change\', function (event) {\ processChange(event, \'cardcvc\');\ });\ cardCvcElement.on(\'blur\', function (event) {\ processBlur(event, \'#CVC\');\ });\ });\ });\ \ function getStripeToken(container, successCallBack, failureCallBack) {\ var options = {};\ var inputs = document.querySelectorAll(\'#ccfields input\');\ for (var i = 0; i < inputs.length; ++i) {\ var input = inputs[i];\ var attr = input.getAttribute(\'data-cc\');\ if (input.value != null && input.value != \'\') {\ options[attr] = input.value;\ }\ }\ \ stripe.createToken(stripeElements.cardNumberElement, options).then(handleStripeResponse);\ \ function handleStripeResponse(result) {\ if (result.token) {\ var token = result.token.id;\ \ var address = {\ streetAddress: \'\',\ city: \'\',\ state: \'\',\ zip: \'\'\ };\ \ var customer = {\ firstName: \'\',\ lastName: \'\',\ id: \'\'\ };\ \ successCallBack(token, customer, address);\ } else if (result.error) {\ if (typeof (failureCallBack) === \'function\') {\ failureCallBack(container, [\'Payment Profile currently unavailable. Please try again later.\']);\ }\ }\ }\ }\ });\ });\ };\ \ fbRequireJSScript.addEventListener("load", paymentJs);'; if(fbScriptTag.length === 0) { fbScriptTag = document.querySelector("script[src*='5d71fff1-dbbc-4910-aa10-fda381abb20f']"); } else { fbScriptTag = fbScriptTag[0]; } fbRenderContainer.id = "formRenderContainer"; fbRenderContainer.className = " fbRenderContainer fbRenderContainer_5d71fff1-dbbc-4910-aa10-fda381abb20f"; fbRenderedCssContainer.id = "fbRenderedCssContainer"; fbConfigScript.type = "text/javascript"; fbRequireJSScript.type = "text/javascript"; fbInstaMedJSScript.type = "text/javascript"; fbGeoCaptchaCallback.type = "text/javascript"; fbGeoReCaptchaCallback.type = "text/javascript"; fbFormulateRenderer.type = "text/javascript"; fbRenderedIntegrations.type = "text/javascript"; fbRenderedScripts.type = "text/javascript"; fbAutoPopulateFromQueryString.type = "text/javascript"; fbRequireJSScript.src = "https://formulate.geonetric.com/Scripts/require.min.js"; fbInstaMedJSScript.src = "https://formulate.geonetric.com/Scripts/vendor/instamed/token.js"; fbInstaMedJSScript.id = "instamed-sdk"; fbGeoCaptchaCallback.src = "https://formulate.geonetric.com/Scripts/geo-captcha-callback.js"; fbGeoReCaptchaCallback.src = "https://www.google.com/recaptcha/api.js?onload=geoFbCaptchaCallback&render=6LdxkTEpAAAAAMKbkhz8-INpQis_mvSaIXnoyC2V"; fbFormulateRenderer.src = "https://formulate.geonetric.com/Scripts/require/formulate-renderer.js?embeddedCssType=0&isTestResponse=False&hasGoogleAnalytics=False"; fbFormulateRenderer.id = "formulateRendererScript"; fbAutoPopulateFromQueryString.src = "https://formulate.geonetric.com/Scripts/auto-populate-from-query-string.js"; if (fbEnableInstaMedScript === 'True') { fbInstaMedJSScript.setAttribute("data-displaymode", "embedded"); fbInstaMedJSScript.setAttribute("data-environment", "UAT"); fbInstaMedJSScript.setAttribute("data-mobiledisplaymode", "embedded"); } fbGeoCaptchaCallback.onload = function() { if(document.querySelectorAll('.geo-fb-recaptcha').length > 0) { fbBodyTag.appendChild(fbGeoReCaptchaCallback); } } fbRequireJSScript.addEventListener("load", function() { fbBodyTag.appendChild(fbFormulateRenderer); fbBodyTag.appendChild(fbAutoPopulateFromQueryString); }); fbFormulateRenderer.addEventListener("load", function () { initFormBuilderForm(); }); var embeddedCssType = 0 switch (embeddedCssType) { case 1: fbEmbeddedCss = ''; break; case 2: fbEmbeddedCss = ''; break; default: fbEmbeddedCss = ''; } if (fbIsTestResponse === 'True') { fbRenderContainer.setAttribute('data-test-mode', 'true'); } else { fbRenderContainer.setAttribute('data-test-mode', 'false'); } fbRenderContainer.innerHTML = "
Required fields are marked with *
\ \ \ \ \ \ \ \ \The following fields are required or invalid.