$(document).ready(function () { $('#mobileNav').sidenav({ preventScrolling: false, draggable: true, inDuration: 500, outDuration: 500 }); $('.tooltipped').tooltip({ delay: 50 }); $(".sidenav-overlay").addClass('hide-on-large-only'); $('.collapsible').collapsible(); $('#modalAviso, #modalCoberturaFalse, #callUsModal, #modalCoberturaTrue, #modalTerminosCondiciones, #modalCartaDerechos, #modalAceptaTerminosCondiciones, #modalNoLocationBrowser, #modalNoAllowedLocation, #modalUnavailablePosition, #modalGenericError, #modalDataSentSuccess').modal({ dismissible: true, preventScrolling: true }); $('#noxCarousel').slick({ arrows: true, swipe: true, draggable: true, autoplay: true, autoplaySpeed: 9000, accessibility: true, centerMode: true, centerPadding: '0px', fade: true, }); $('#mobileNoxCarousel').slick({ arrows: true, swipe: true, draggable: true, autoplay: true, autoplaySpeed: 9000, accessibility: true, centerMode: true, centerPadding: '0px', fade: true, }); }); var scene1 = document.getElementById('paralaxSlide1'); var scene2 = document.getElementById('paralaxSlide2'); var scene3 = document.getElementById('paralaxSlide3'); var parallax = new Parallax(scene1); var parallax = new Parallax(scene2); var parallax = new Parallax(scene3); var scene4 = document.getElementById('mobileParalaxSlide1'); var scene5 = document.getElementById('mobileParalaxSlide2'); var scene6 = document.getElementById('mobileParalaxSlide3'); var parallax = new Parallax(scene4); var parallax = new Parallax(scene5); var parallax = new Parallax(scene6); var showmodalGenericError = function () { $('#modalGenericError').modal('open'); }; var showmodalUnavailablePosition = function () { $('#modalNoUnavailablePosition').modal('open'); }; var showmodalNoAllowedLocation = function () { $('#modalNoAllowedLocation').modal('open'); }; var showmodalTerminosContacto = function () { $('#modalAceptaTerminosCondiciones').modal('open'); }; var showmodalNoLocationBrowser = function () { $('#modalNoLocationBrowser').modal('open'); }; var showCoberturaTrue = function () { $('#modalCoberturaTrue').modal('open'); }; var showCoberturaFalse = function () { $('#modalCoberturaFalse').modal('open'); }; var showModalRFC = function () { $('#modalRFC').modal(); }; var togglePassword = function (item1, item2, event) { var pswInput = $('#' + item1); var viewPswBtn = $("." + item2); if (pswInput.attr("type") === "password") { pswInput.attr("type", "text"); viewPswBtn.removeClass('fa-eye'); viewPswBtn.addClass('fa-eye-slash'); } else { pswInput.attr("type", "password"); viewPswBtn.addClass('fa-eye'); viewPswBtn.removeClass('fa-eye-slash'); } event.preventDefault(); }; function rfcValido(rfc, aceptarGenerico = true) { const re = /^([A-ZÑ&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:-?)?([A-Z\d]{2})([A\d])$/; var validado = rfc.match(re); if (!validado) return false; const digitoVerificador = validado.pop(), rfcSinDigito = validado.slice(1).join(''), len = rfcSinDigito.length, diccionario = "0123456789ABCDEFGHIJKLMN&OPQRSTUVWXYZ Ñ", indice = len + 1; var suma, digitoEsperado; if (len == 12) suma = 0 else suma = 481; for (var i = 0; i < len; i++) suma += diccionario.indexOf(rfcSinDigito.charAt(i)) * (indice - i); digitoEsperado = 11 - suma % 11; if (digitoEsperado == 11) digitoEsperado = 0; else if (digitoEsperado == 10) digitoEsperado = "A"; if ((digitoVerificador != digitoEsperado) && (!aceptarGenerico || rfcSinDigito + digitoVerificador != "XAXX010101000")) return false; else if (!aceptarGenerico && rfcSinDigito + digitoVerificador == "XEXX010101000") return false; return rfcSinDigito + digitoVerificador; }; function validarInput(input) { var rfc = input.value.trim().toUpperCase(), resultado = document.getElementById("resultado"), valido; var rfcCorrecto = rfcValido(rfc); if (rfcCorrecto) { valido = "RFC Válido"; resultado.classList.add("ok"); } else { valido = "RFC Inválido" resultado.classList.remove("ok"); } resultado.innerText = valido; } var nav4 = window.Event ? true : false; function aceptNum(evt) { var key = nav4 ? evt.which : evt.keyCode; return (key <= 13 || (key >= 48 && key <= 57)); }