Melhore seu desempenho em provas e concursos com dicas direto no seu email
© Mapas da Lulu 2023. Todos direitos reservados
© Mapas da Lulu – Todos os direitos reservados
" + detail + "
" + ""; pc_confirmation.style.display = 'block'; var mp = document.querySelector('input[name="mp"]'); mp.value = '0'; } else { form.querySelector('._form-content').style.display = 'inline'; pc_confirmation.style.display = 'none'; } var hideButton = document.getElementById('hideButton'); // Add event listener to the button hideButton.addEventListener('click', function() { var submitButton = document.querySelector('#_form_17_submit'); submitButton.disabled = false; submitButton.classList.remove('processing'); var mp = document.querySelector('input[name="mp"]'); mp.value = '1'; window.location.href = window.location.href; }); const vgoAlias = typeof visitorGlobalObjectAlias === 'undefined' ? 'vgo' : visitorGlobalObjectAlias; var visitorObject = window[vgoAlias]; if (email && typeof visitorObject !== 'undefined') { visitorObject('setEmail', email); visitorObject('update'); } else if (typeof(trackcmp_url) != 'undefined' && trackcmp_url) { // Site tracking URL to use after inline form submission. _load_script(trackcmp_url); } if (typeof window._form_callback !== 'undefined') window._form_callback(id); }; window._load_script = function(url, callback, isSubmit) { var head = document.querySelector('head'), script = document.createElement('script'), r = false; var submitButton = document.querySelector('#_form_17_submit'); script.charset = 'utf-8'; script.src = url; if (callback) { script.onload = script.onreadystatechange = function() { if (!r && (!this.readyState || this.readyState == 'complete')) { r = true; callback(); } }; } script.onerror = function() { if (isSubmit) { if (script.src.length > 10000) { _show_error("17", "Desculpe, seu envio falhou. Deixe suas respostas mais curtas e tente novamente."); } else { _show_error("17", "Desculpe, seu envio falhou. Tente novamente."); } submitButton.disabled = false; submitButton.classList.remove('processing'); } } head.appendChild(script); }; (function() { if (window.location.search.search("excludeform") !== -1) return false; var getCookie = function(name) { var match = document.cookie.match(new RegExp('(^|; )' + name + '=([^;]+)')); return match ? match[2] : null; } var setCookie = function(name, value) { var now = new Date(); var time = now.getTime(); var expireTime = time + 1000 * 60 * 60 * 24 * 365; now.setTime(expireTime); document.cookie = name + '=' + value + '; expires=' + now + ';path=/; Secure; SameSite=Lax;'; } var addEvent = function(element, event, func) { if (element.addEventListener) { element.addEventListener(event, func); } else { var oldFunc = element['on' + event]; element['on' + event] = function() { oldFunc.apply(this, arguments); func.apply(this, arguments); }; } } var _removed = false; var form_to_submit = document.getElementById('_form_17_'); var allInputs = form_to_submit.querySelectorAll('input, select, textarea'), tooltips = [], submitted = false; var getUrlParam = function(name) { if (name.toLowerCase() !== 'email') { var params = new URLSearchParams(window.location.search); return params.get(name) || false; } // email is a special case because a plus is valid in the email address var qString = window.location.search; if (!qString) { return false; } var parameters = qString.substr(1).split('&'); for (var i = 0; i < parameters.length; i++) { var parameter = parameters[i].split('='); if (parameter[0].toLowerCase() === 'email') { return parameter[1] === undefined ? true : decodeURIComponent(parameter[1]); } } return false; }; var acctDateFormat = "%d/%m/%Y"; var getNormalizedDate = function(date, acctFormat) { var decodedDate = decodeURIComponent(date); if (acctFormat && acctFormat.match(/(%d|%e).*%m/gi) !== null) { return decodedDate.replace(/(\d{2}).*(\d{2}).*(\d{4})/g, '$3-$2-$1'); } else if (Date.parse(decodedDate)) { var dateObj = new Date(decodedDate); var year = dateObj.getFullYear(); var month = dateObj.getMonth() + 1; var day = dateObj.getDate(); return `${year}-${month < 10 ? `0${month}` : month}-${day < 10 ? `0${day}` : day}`; } return false; }; var getNormalizedTime = function(time) { var hour, minutes; var decodedTime = decodeURIComponent(time); var timeParts = Array.from(decodedTime.matchAll(/(\d{1,2}):(\d{1,2})\W*([AaPp][Mm])?/gm))[0]; if (timeParts[3]) { // 12 hour format var isPM = timeParts[3].toLowerCase() === 'pm'; if (isPM) { hour = parseInt(timeParts[1]) === 12 ? '12' : `${parseInt(timeParts[1]) + 12}`; } else { hour = parseInt(timeParts[1]) === 12 ? '0' : timeParts[1]; } } else { // 24 hour format hour = timeParts[1]; } var normalizedHour = parseInt(hour) < 10 ? `0${parseInt(hour)}` : hour; var minutes = timeParts[2]; return `${normalizedHour}:${minutes}`; }; for (var i = 0; i < allInputs.length; i++) { var regexStr = "field\\[(\\d+)\\]"; var results = new RegExp(regexStr).exec(allInputs[i].name); if (results != undefined) { allInputs[i].dataset.name = allInputs[i].name.match(/\[time\]$/) ? `${window.cfields[results[1]]}_time` : window.cfields[results[1]]; } else { allInputs[i].dataset.name = allInputs[i].name; } var fieldVal = getUrlParam(allInputs[i].dataset.name); if (fieldVal) { if (allInputs[i].dataset.autofill === "false") { continue; } if (allInputs[i].type == "radio" || allInputs[i].type == "checkbox") { if (allInputs[i].value == fieldVal) { allInputs[i].checked = true; } } else if (allInputs[i].type == "date") { allInputs[i].value = getNormalizedDate(fieldVal, acctDateFormat); } else if (allInputs[i].type == "time") { allInputs[i].value = getNormalizedTime(fieldVal); } else { allInputs[i].value = fieldVal; } } } var remove_tooltips = function() { for (var i = 0; i < tooltips.length; i++) { tooltips[i].tip.parentNode.removeChild(tooltips[i].tip); } tooltips = []; }; var remove_tooltip = function(elem) { for (var i = 0; i < tooltips.length; i++) { if (tooltips[i].elem === elem) { tooltips[i].tip.parentNode.removeChild(tooltips[i].tip); tooltips.splice(i, 1); return; } } }; var create_tooltip = function(elem, text) { var tooltip = document.createElement('div'), arrow = document.createElement('div'), inner = document.createElement('div'), new_tooltip = {}; if (elem.type != 'radio' && elem.type != 'checkbox') { tooltip.className = '_error'; arrow.className = '_error-arrow'; inner.className = '_error-inner'; inner.innerHTML = text; tooltip.appendChild(arrow); tooltip.appendChild(inner); elem.parentNode.appendChild(tooltip); } else { tooltip.className = '_error-inner _no_arrow'; tooltip.innerHTML = text; elem.parentNode.insertBefore(tooltip, elem); new_tooltip.no_arrow = true; } new_tooltip.tip = tooltip; new_tooltip.elem = elem; tooltips.push(new_tooltip); return new_tooltip; }; var resize_tooltip = function(tooltip) { var rect = tooltip.elem.getBoundingClientRect(); var doc = document.documentElement, scrollPosition = rect.top - ((window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0)); if (scrollPosition < 40) { tooltip.tip.className = tooltip.tip.className.replace(/ ?(_above|_below) ?/g, '') + ' _below'; } else { tooltip.tip.className = tooltip.tip.className.replace(/ ?(_above|_below) ?/g, '') + ' _above'; } }; var resize_tooltips = function() { if (_removed) return; for (var i = 0; i < tooltips.length; i++) { if (!tooltips[i].no_arrow) resize_tooltip(tooltips[i]); } }; var validate_field = function(elem, remove) { var tooltip = null, value = elem.value, no_error = true; remove ? remove_tooltip(elem) : false; if (elem.type != 'checkbox') elem.className = elem.className.replace(/ ?_has_error ?/g, ''); if (elem.getAttribute('required') !== null) { if (elem.type == 'radio' || (elem.type == 'checkbox' && /any/.test(elem.className))) { var elems = form_to_submit.elements[elem.name]; if (!(elems instanceof NodeList || elems instanceof HTMLCollection) || elems.length <= 1) { no_error = elem.checked; } else { no_error = false; for (var i = 0; i < elems.length; i++) { if (elems[i].checked) no_error = true; } } if (!no_error) { tooltip = create_tooltip(elem, "Por favor, selecione uma opção."); } } else if (elem.type =='checkbox') { var elems = form_to_submit.elements[elem.name], found = false, err = []; no_error = true; for (var i = 0; i < elems.length; i++) { if (elems[i].getAttribute('required') === null) continue; if (!found && elems[i] !== elem) return true; found = true; elems[i].className = elems[i].className.replace(/ ?_has_error ?/g, ''); if (!elems[i].checked) { no_error = false; elems[i].className = elems[i].className + ' _has_error'; err.push("Marcar %s é necessário".replace("%s", elems[i].value)); } } if (!no_error) { tooltip = create_tooltip(elem, err.join('