.wForm form{text-align: left;}
.captcha {
padding-bottom: 1em !important;
}
.wForm .captcha .oneField {
margin: 0;
padding: 0;
}
// initialize our variables
var captchaReady = 0;
var wFORMSReady = 0;
var isConditionalSubmitEnabled = false;
// when wForms is loaded call this
var wformsReadyCallback = function () {
// using this var to denote if wForms is loaded
wFORMSReady = 1;
isConditionalSubmitEnabled = document.getElementById('submit_button').hasAttribute('data-condition');
// call our recaptcha function which is dependent on both
// wForms and an async call to google
// note the meat of this function wont fire until both
// wFORMSReady = 1 and captchaReady = 1
onloadCallback();
}
var gCaptchaReadyCallback = function() {
// using this var to denote if captcha is loaded
captchaReady = 1;
isConditionalSubmitEnabled = document.getElementById('submit_button').hasAttribute('data-condition');
// call our recaptcha function which is dependent on both
// wForms and an async call to google
// note the meat of this function wont fire until both
// wFORMSReady = 1 and captchaReady = 1
onloadCallback();
};
// add event listener to fire when wForms is fully loaded
document.addEventListener("wFORMSLoaded", wformsReadyCallback);
var enableSubmitButton = function() {
var submitButton = document.getElementById('submit_button');
var explanation = document.getElementById('disabled-explanation');
var isConditionalSubmitConditionMet = wFORMS.behaviors.condition.isConditionalSubmitConditionMet;
if (
submitButton != null &&
(isConditionalSubmitEnabled && isConditionalSubmitConditionMet) ||
!isConditionalSubmitEnabled
)
{
submitButton.removeAttribute('disabled');
if (explanation != null) {
explanation.style.display = 'none';
}
}
};
var disableSubmitButton = function() {
var submitButton = document.getElementById('submit_button');
var explanation = document.getElementById('disabled-explanation');
if (submitButton != null) {
submitButton.disabled = true;
if (explanation != null) {
explanation.style.display = 'block';
}
}
};
// call this on both captcha async complete and wforms fully
// initialized since we can't be sure which will complete first
// and we need both done for this to function just check that they are
// done to fire the functionality
var onloadCallback = function () {
// if our captcha is ready (async call completed)
// and wFORMS is completely loaded then we are ready to add
// the captcha to the page
if (captchaReady && wFORMSReady) {
// Prevent both concurrent and sequential executions
if (window.isCreatingCaptcha || window.hasCaptchaRendered) {
return;
}
window.isCreatingCaptcha = true;
try {
var submitButton = document.getElementById('submit_button');
var formContainer = submitButton.closest('form') || submitButton.closest('.wFormContainer');
var faCaptcha = null;
if (formContainer) {
faCaptcha = formContainer.querySelector('#google-captcha');
}
// Also check if captcha was appended to body as fallback (look for FA-specific structure)
if (!faCaptcha) {
var bodyCaptchas = document.querySelectorAll('body > #google-captcha');
for (var i = 0; i < bodyCaptchas.length; i++) {
// Verify it's a FormAssembly captcha by checking for specific structure
if (bodyCaptchas[i].querySelector('.captcha .oneField .g-recaptcha')) {
faCaptcha = bodyCaptchas[i];
break;
}
}
}
if (faCaptcha) {
if (faCaptcha.parentNode) {
faCaptcha.parentNode.removeChild(faCaptcha);
}
}
// Now create a new captcha container
var captchaContainer = document.createElement('div');
captchaContainer.id = 'google-captcha';
var captchaDiv = document.createElement('div');
captchaDiv.className = 'captcha';
var oneFieldDiv = document.createElement('div');
oneFieldDiv.className = 'oneField';
var recaptchaElement = document.createElement('div');
recaptchaElement.id = 'g-recaptcha-render-div';
recaptchaElement.className = 'g-recaptcha';
var errorDiv = document.createElement('div');
errorDiv.className = 'g-captcha-error';
var helpDiv = document.createElement('div');
helpDiv.className = 'captchaHelp';
helpDiv.innerHTML = 'reCAPTCHA helps prevent automated form spam.
';
var disabledDiv = document.createElement('div');
disabledDiv.id = 'disabled-explanation';
disabledDiv.className = 'captchaHelp';
disabledDiv.style.display = 'block';
disabledDiv.innerHTML = 'The submit button will be disabled until you complete the CAPTCHA.';
oneFieldDiv.appendChild(recaptchaElement);
oneFieldDiv.appendChild(errorDiv);
oneFieldDiv.appendChild(document.createElement('br'));
captchaDiv.appendChild(oneFieldDiv);
captchaDiv.appendChild(helpDiv);
captchaDiv.appendChild(disabledDiv);
captchaContainer.appendChild(document.createElement('br'));
captchaContainer.appendChild(captchaDiv);
if (submitButton && submitButton.parentNode) {
submitButton.parentNode.insertBefore(captchaContainer, submitButton);
} else {
// Fallback: append to body if submit button not found.
document.body.appendChild(captchaContainer);
}
} finally {
window.isCreatingCaptcha = false;
}
grecaptcha.enterprise.render('g-recaptcha-render-div', {
'sitekey': '6LfMg_EaAAAAAMhDNLMlgqDChzmtYHlx1yU2y7GI',
'theme': 'light',
'size': 'normal',
'callback': 'enableSubmitButton',
'expired-callback': 'disableSubmitButton'
});
window.hasCaptchaRendered = true;
var oldRecaptchaCheck = parseInt('1');
if (oldRecaptchaCheck === -1) {
var standardCaptcha = document.getElementById("tfa_captcha_text");
standardCaptcha = standardCaptcha.parentNode.parentNode.parentNode;
standardCaptcha.parentNode.removeChild(standardCaptcha);
}
if (!wFORMS.instances['paging']) {
document.getElementById("g-recaptcha-render-div").parentNode.parentNode.parentNode.style.display = "block";
//document.getElementById("g-recaptcha-render-div").parentNode.parentNode.parentNode.removeAttribute("hidden");
}
document.getElementById("g-recaptcha-render-div").getAttributeNode('id').value = 'tfa_captcha_text';
var captchaError = '';
if (captchaError == '1') {
var errMsgText = 'The CAPTCHA was not completed successfully.';
var errMsgDiv = document.createElement('div');
errMsgDiv.id = "tfa_captcha_text-E";
errMsgDiv.className = "err errMsg";
errMsgDiv.innerText = errMsgText;
var loc = document.querySelector('.g-captcha-error');
loc.insertBefore(errMsgDiv, loc.childNodes[0]);
/* See wFORMS.behaviors.paging.applyTo for origin of this code */
if (wFORMS.instances['paging']) {
var b = wFORMS.instances['paging'][0];
var pp = base2.DOM.Element.querySelector(document, wFORMS.behaviors.paging.CAPTCHA_ERROR);
if (pp) {
var lastPage = 1;
for (var i = 1; i < 100; i++) {
if (b.behavior.isLastPageIndex(i)) {
lastPage = i;
break;
}
}
b.jumpTo(lastPage);
}
}
}
}
}
document.addEventListener("DOMContentLoaded", function() {
var warning = document.getElementById("javascript-warning");
if (warning != null) {
warning.parentNode.removeChild(warning);
}
var oldRecaptchaCheck = parseInt('1');
if (oldRecaptchaCheck !== -1) {
var explanation = document.getElementById('disabled-explanation');
var submitButton = document.getElementById('submit_button');
if (submitButton != null) {
submitButton.disabled = true;
if (explanation != null) {
explanation.style.display = 'block';
}
}
}
});
document.addEventListener("FA__DOMContentLoaded", function(){
const FORM_TIME_START = Math.floor((new Date).getTime()/1000);
let formElement = document.getElementById("tfa_0");
if (null === formElement) {
formElement = document.getElementById("0");
}
let appendJsTimerElement = function(){
let formTimeDiff = Math.floor((new Date).getTime()/1000) - FORM_TIME_START;
let cumulatedTimeElement = document.getElementById("tfa_dbCumulatedTime");
if (null !== cumulatedTimeElement) {
let cumulatedTime = parseInt(cumulatedTimeElement.value);
if (null !== cumulatedTime && cumulatedTime > 0) {
formTimeDiff += cumulatedTime;
}
}
let jsTimeInput = document.createElement("input");
jsTimeInput.setAttribute("type", "hidden");
jsTimeInput.setAttribute("value", formTimeDiff.toString());
jsTimeInput.setAttribute("name", "tfa_dbElapsedJsTime");
jsTimeInput.setAttribute("id", "tfa_dbElapsedJsTime");
jsTimeInput.setAttribute("autocomplete", "off");
if (null !== formElement) {
formElement.appendChild(jsTimeInput);
}
};
if (null !== formElement) {
if(formElement.addEventListener){
formElement.addEventListener('submit', appendJsTimerElement, false);
} else if(formElement.attachEvent){
formElement.attachEvent('onsubmit', appendJsTimerElement);
}
}
});
if(wFORMS.behaviors.prefill) wFORMS.behaviors.prefill.skip = true;
var FAoldJQ;
if (typeof $ != 'undefined' && $.noConflict) FAoldJQ = $.noConflict(true);
var FA$ = $.noConflict(true);
if (FAoldJQ) $ = FAoldJQ;
#tfa_431,
*[id^="tfa_431["] {
width: 200px !important;
}
#tfa_431-D,
*[id^="tfa_431["][class~="field-container-D"] {
width: auto !important;
}
#tfa_2226,
*[id^="tfa_2226["] {
width: 300px !important;
}
#tfa_2226-D,
*[id^="tfa_2226["][class~="field-container-D"] {
width: auto !important;
}
#tfa_282,
*[id^="tfa_282["] {
width: 628px !important;
}
#tfa_282-D,
*[id^="tfa_282["][class~="field-container-D"] {
width: auto !important;
}
#tfa_346-L,
label[id^="tfa_346["] {
width: 263px !important;
min-width: 0px;
}
#tfa_359,
*[id^="tfa_359["] {
width: 243px !important;
}
#tfa_359-D,
*[id^="tfa_359["][class~="field-container-D"] {
width: auto !important;
}
#tfa_444-L,
label[id^="tfa_444["] {
width: 103px !important;
min-width: 0px;
}
#tfa_342,
*[id^="tfa_342["] {
width: 263px !important;
}
#tfa_342-D,
*[id^="tfa_342["][class~="field-container-D"] {
width: auto !important;
}
#tfa_425,
*[id^="tfa_425["] {
width: 603px !important;
}
#tfa_425-D,
*[id^="tfa_425["][class~="field-container-D"] {
width: auto !important;
}
#tfa_425-L,
label[id^="tfa_425["] {
width: 243px !important;
min-width: 0px;
}
#tfa_272,
*[id^="tfa_272["] {
width: 175px !important;
}
#tfa_272-D,
*[id^="tfa_272["][class~="field-container-D"] {
width: auto !important;
}
#tfa_272-L,
label[id^="tfa_272["] {
width: 150px !important;
min-width: 0px;
}
#tfa_292,
*[id^="tfa_292["] {
width: 175px !important;
}
#tfa_292-D,
*[id^="tfa_292["][class~="field-container-D"] {
width: auto !important;
}
#tfa_292-L,
label[id^="tfa_292["] {
width: 150px !important;
min-width: 0px;
}
#tfa_366,
*[id^="tfa_366["] {
width: 600px !important;
}
#tfa_366-D,
*[id^="tfa_366["][class~="field-container-D"] {
width: auto !important;
}
#tfa_1,
*[id^="tfa_1["] {
width: 200px !important;
}
#tfa_1-D,
*[id^="tfa_1["][class~="field-container-D"] {
width: auto !important;
}
#tfa_2,
*[id^="tfa_2["] {
width: 350px !important;
}
#tfa_2-D,
*[id^="tfa_2["][class~="field-container-D"] {
width: auto !important;
}
#tfa_327,
*[id^="tfa_327["] {
width: 350px !important;
}
#tfa_327-D,
*[id^="tfa_327["][class~="field-container-D"] {
width: auto !important;
}
#tfa_4,
*[id^="tfa_4["] {
width: 200px !important;
}
#tfa_4-D,
*[id^="tfa_4["][class~="field-container-D"] {
width: auto !important;
}
#tfa_10,
*[id^="tfa_10["] {
width: 350px !important;
}
#tfa_10-D,
*[id^="tfa_10["][class~="field-container-D"] {
width: auto !important;
}
#tfa_5,
*[id^="tfa_5["] {
width: 350px !important;
}
#tfa_5-D,
*[id^="tfa_5["][class~="field-container-D"] {
width: auto !important;
}
#tfa_6,
*[id^="tfa_6["] {
width: 200px !important;
}
#tfa_6-D,
*[id^="tfa_6["][class~="field-container-D"] {
width: auto !important;
}
#tfa_7,
*[id^="tfa_7["] {
width: 350px !important;
}
#tfa_7-D,
*[id^="tfa_7["][class~="field-container-D"] {
width: auto !important;
}
#tfa_8,
*[id^="tfa_8["] {
width: 100px !important;
}
#tfa_8-D,
*[id^="tfa_8["][class~="field-container-D"] {
width: auto !important;
}
#tfa_2218-L,
label[id^="tfa_2218["] {
width: 310px !important;
min-width: 0px;
}
#tfa_282,
*[id^="tfa_282["] {
height: 97px !important
}
#tfa_282-D,
*[id^="tfa_282["][class~="field-container-D"] {
height: auto !important;
}
#tfa_282-L,
label[id^="tfa_282["],
*[id^="tfa_282["][id$="-L"] {
height: auto !important;
}
#tfa_425,
*[id^="tfa_425["] {
height: 81px !important
}
#tfa_425-D,
*[id^="tfa_425["][class~="field-container-D"] {
height: auto !important;
}
#tfa_425-L,
label[id^="tfa_425["],
*[id^="tfa_425["][id$="-L"] {
height: auto !important;
}
#tfa_366,
*[id^="tfa_366["] {
height: 75px !important
}
#tfa_366-D,
*[id^="tfa_366["][class~="field-container-D"] {
height: auto !important;
}
#tfa_366-L,
label[id^="tfa_366["],
*[id^="tfa_366["][id$="-L"] {
height: auto !important;
}