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("c5ed1ff0-d4be-4681-b4da-16481faeae88"), 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 optionRateCostJs = function () {\ requirejs([window.formHost + \'/Scripts/require/fbRequire.config.js\'], function (fbRequireConfig) {\ var fbRequire = fbRequireConfig.fbRequire;\ \ fbRequire([\'jquery\', \'AutoNumeric\', \'cost\', \'he\'], function ($, AutoNumeric, cost, he) {\ var options = JSON.parse(\'[{"name":"$20","amount":20.0},{"name":"$50","amount":50.0},{"name":"$100","amount":100.0},{"name":"$250","amount":250.0},{"name":"$500","amount":500.0}]\'),\ formId = \'c5ed1ff0-d4be-4681-b4da-16481faeae88\',\ $formElementsContainer = $(\'.fbFormContainer_\' + formId),\ selectionType = \'Dropdown\',\ elementName = \'FormField5_c5ed1ff0-d4be-4681-b4da-16481faeae88\',\ $selectedItem = $formElementsContainer.find(\'[name="\' + elementName + \'_selected_item"]\'),\ $amount = $formElementsContainer.find(\'[name="\' + elementName + \'_amount"]\'),\ otherOptionMin = \'0.01\',\ otherOptionMax = \'1000000\',\ requiredMessage = \'Donation Amount is required.\';\ \ function removeOtherInput() {\ $formElementsContainer.find(\'#\' + elementName + \'_other_item_input_container\').remove();\ }\ \ $selectedItem.on(\'change\', function () {\ var selectedOptionId;\ if (selectionType === \'Dropdown\') {\ selectedOptionId = $(this).children(\':selected\').attr(\'id\');\ } else {\ selectedOptionId = $(this).attr(\'id\');\ }\ \ var selectedOptionValue = $(this).val();\ \ removeOtherInput();\ \ updateAmount(selectedOptionId, selectedOptionValue);\ \ cost.setTotalCost($formElementsContainer);\ });\ \ function addOtherInput() {\ var $otherInputContainer = $(\'
\');\ \ var $otherInputLabel = $(\'\');\ $otherInputLabel.text(\'Min: $\' + otherOptionMin + \' Max: $\' + otherOptionMax);\ $otherInputLabel.appendTo($otherInputContainer);\ \ var $otherInput = $(\'\');\ $otherInput.on(\'input\', function () {\ var amountString = $(this).val();\ amountString = amountString.replace(/[,$]/g, \'\');\ \ $amount.val(amountString);\ \ cost.setTotalCost($formElementsContainer);\ });\ $otherInput.trigger(\'input\');\ $otherInput.appendTo($otherInputContainer);\ \ if (selectionType === \'Dropdown\') {\ $otherInputContainer.insertAfter($selectedItem);\ } else {\ $otherInputContainer.insertAfter($selectedItem.closest(\'.fb-radio-group\'));\ }\ \ var otherInputAutoNumeric = new AutoNumeric(\'#\' + elementName + \'_other_item_input\', [\'dollarPos\', {\ emptyInputBehavior: \'zero\'\ }]);\ \ $(\'#\' + elementName + \'_other_item_input\').rules(\'add\', {\ required: true,\ range: [otherOptionMin,otherOptionMax],\ normalizer: function (value) {\ return $.trim(value).replace(/[,$]/g, \'\');\ },\ messages: {\ required: requiredMessage\ }\ });\ }\ \ function resetAmount() {\ $amount.val(0);\ }\ \ function updateAmount(optionId, optionValue) {\ resetAmount();\ \ if (typeof optionId !== \'undefined\' && optionId.indexOf(\'_other_selected_item\')) {\ addOtherInput();\ } else {\ for (var i = 0; i < options.length; i++) {\ if (he.decode(options[i].name) === optionValue) {\ $amount.val(options[i].amount);\ }\ }\ }\ }\ });\ });\ };\ \ fbRequireJSScript.addEventListener("load", optionRateCostJs);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 overridePaymentJS = function () {\ requirejs([window.formHost + \'/Scripts/require/fbRequire.config.js\'], function (fbRequireConfig) {\ var fbRequire = fbRequireConfig.fbRequire;\ \ fbRequire([\'jquery\'], function ($) {\ var formId = \'c5ed1ff0-d4be-4681-b4da-16481faeae88\',\ $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 processStripePaymentJs = function () {\ requirejs([window.formHost + \'/Scripts/require/fbRequire.config.js\'], function (fbRequireConfig) {\ var fbRequire = fbRequireConfig.fbRequire;\ \ fbRequire([\'jquery\'], function ($) {\ $(function () {\ var jsElm = document.createElement(\'script\');\ jsElm.type = \'text/javascript\';\ jsElm.src = \'https://js.authorize.net/v1/Accept.js\';\ jsElm.charset = \'utf-8\';\ document.body.appendChild(jsElm);\ });\ \ window.getAuthorizeDotNetToken = function (container, successCallBack, failureCallBack) {\ \ var authData = {\ clientKey: \'6g25nMf2m8z4yRc98fM45M2y2TrAB5dMASj3jaBdWQmMpU23r924xE7ByQ7auu7T\',\ apiLoginID: \'83ynPt6TB2S5\'\ };\ \ var cardExpiration = container.find(\'.cardExpiration\').val().split("/");\ if (cardExpiration.length !== 2) {\ cardExpiration = [\'\', \'\'];\ }\ \ var cardData = {\ cardNumber: container.find(\'.cardNumber\').val().replace(/ /g, \'\'),\ month: cardExpiration[0].trim(),\ year: cardExpiration[1].trim(),\ cardCode: container.find(\'.cardCvc\').val(),\ zip: container.find(\'.billingZip\').val(),\ fullName: container.find(\'.firstNameCard\').val() + \' \' + container.find(\'.lastNameCard\').val()\ };\ \ var secureData = {\ authData: authData,\ cardData: cardData\ };\ \ Accept.dispatchData(secureData, responseHandler);\ \ function responseHandler(response) {\ \ if (response.messages.resultCode === \'Error\') {\ var errorMessages = [];\ \ for (var i = 0; i < response.messages.message.length; i++) {\ errorMessages.push(response.messages.message[i].text);\ }\ \ failureCallBack(container, errorMessages);\ } else {\ var token = response.opaqueData.dataValue;\ \ var customer = {\ firstName: container.find(\'.firstNameCard\').val(),\ lastName: container.find(\'.lastNameCard\').val(),\ id: container.find(\'.customerId\').val()\ };\ \ var address = {\ streetAddress: container.find(\'.billingStreetAddress\').val(),\ city: container.find(\'.billingCity\').val(),\ state: container.find(\'.billingState\').val(),\ zip: container.find(\'.billingZip\').val()\ };\ \ successCallBack(token, customer, address);\ }\ }\ };\ });\ });\ };\ \ fbRequireJSScript.addEventListener("load", processStripePaymentJs);'; if(fbScriptTag.length === 0) { fbScriptTag = document.querySelector("script[src*='c5ed1ff0-d4be-4681-b4da-16481faeae88']"); } else { fbScriptTag = fbScriptTag[0]; } fbRenderContainer.id = "formRenderContainer"; fbRenderContainer.className = " fbRenderContainer fbRenderContainer_c5ed1ff0-d4be-4681-b4da-16481faeae88"; 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 *
\ \ \ \ \ \ \ \ \ \