document.addEventListener('DOMContentLoaded', function () { const params = new URLSearchParams(window.location.search); const googleData = JSON.parse(localStorage.getItem('google')) || {}; params.forEach((value, key) => { googleData[key] = value; }); if (!googleData.utm_source) { googleData.utm_source = 'organic'; } localStorage.setItem('google', JSON.stringify(googleData)); console.log('Google Data Atualizado:', googleData); const newParams = Object.entries(googleData) .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`) .join('&'); const baseUrl = window.location.origin + window.location.pathname; const newUrl = `${baseUrl}?${newParams}`; if (window.location.href !== newUrl) { window.history.replaceState(null, '', newUrl); } }); if ($(window).width() < 992) { $('.item-menu.is_sub').on('click', function () { $(this).toggleClass('active'); }); }else{ $('.item-menu.is_sub').on('mouseenter', function () { $(this).addClass('active'); }); $('.item-menu.is_sub').on('mouseleave', function () { $(this).removeClass('active'); }); } function validarCPF(cpf) { cpf = cpf.replace(/\D/g, ''); if (cpf.length !== 11 || /^(\d)\1{10}$/.test(cpf)) return false; let soma = 0, resto; for (let i = 1; i <= 9; i++) soma += parseInt(cpf[i - 1]) * (11 - i); resto = (soma * 10) % 11; if (resto === 10 || resto === 11) resto = 0; if (resto !== parseInt(cpf[9])) return false; soma = 0; for (let i = 1; i <= 10; i++) soma += parseInt(cpf[i - 1]) * (12 - i); resto = (soma * 10) % 11; if (resto === 10 || resto === 11) resto = 0; return resto === parseInt(cpf[10]); } function validarEmail(email) { const regexEmail = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/; return regexEmail.test(email); } function validarNome(nome) { const palavras = nome.split(/\s+/); return palavras.length >= 2; } jQuery(function($){ $('.custom-select').each(function () { var name = $(this).attr('id'); var $this = $(this), numberOfOptions = $(this).children('option').length; $this.wrap('
'); $this.after('
'); var $styledSelect = $this.next('div.styledSelect'); $styledSelect.text($this.children('option').eq(0).text()); var $list = $('