$(function () { let duration = 9 * 60; let timer = duration, minutes, seconds; function Cronometro(display) { timer--; minutes = parseInt(timer / 60, 10); seconds = parseInt(timer % 60, 10); minutes = minutes < 10 ? "0" + minutes : minutes; seconds = seconds < 10 ? "0" + seconds : seconds; $(".timerCount").html(minutes + ":" + seconds); if (timer > 0) { setTimeout(function () { Cronometro(); }, 1000); } } Cronometro(); }) const debounce = (fn, delay) => { let timeOut; return function (...args) { if (timeOut) { clearTimeout(timeOut); } timeOut = setTimeout(function () { fn(...args); }, delay); } } function validaCPF(cpf) { cpf = cpf.replace('.', ''); cpf = cpf.replace('.', ''); cpf = cpf.replace('-', ''); erro = new String; if (cpf.length < 11) erro += "Sao necessarios 11 digitos para verificacao do CPF! \n\n"; var nonNumbers = /\D/; if (nonNumbers.test(cpf)) erro += "A verificacao de CPF suporta apenas numeros! \n\n"; if (cpf == "00000000000" || cpf == "11111111111" || cpf == "22222222222" || cpf == "33333333333" || cpf == "44444444444" || cpf == "55555555555" || cpf == "66666666666" || cpf == "77777777777" || cpf == "88888888888" || cpf == "99999999999") { erro += "Numero de CPF invalido!" } var a = []; var b = new Number; var c = 11; for (i = 0; i < 11; i++) { a[i] = cpf.charAt(i); if (i < 9) b += (a[i] * --c); } if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11 - x } b = 0; c = 11; for (y = 0; y < 10; y++) b += (a[y] * c--); if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11 - x; } status = a[9] + "" + a[10] if ((cpf.charAt(9) != a[9]) || (cpf.charAt(10) != a[10])) { erro += "Digito verificador com problema!"; } if (erro.length > 0) { return false; } return true; } function scrollPage(selector) { var target_offset = $(selector).offset(); var target_top = target_offset.top; $('html, body').animate({scrollTop: target_top}, 200); } function filter_var_email(e) { var filter = /^\s*[\w\-\+_]+(\.[\w\-\+_]+)*\@[\w\-\+_]+\.[\w\-\+_]+(\.[\w\-\+_]+)*\s*$/; return String(e).search(filter) != -1; }