const IDIOMAS_PREFERIDOS = ["es-MX", "es-US", "es-ES", "es_US", "es_ES"]; var habilitarLupa=false; Ext.onReady(inicializar); function inicializar() { if(!isSurface()) { oE('aTabletas'); oE('aTabletas2'); } habilitarLupa=gE('mostrarLupa').value=='1'; var arrDimensiones=obtenerDimensionesNavegador(); if(window.location.href!=window.parent.location.href) { obtenerVentanaPadre(window,location.href); } if(gE('totalPublicaciones').value!='0') { $('#carousel').infiniteCarousel ( { imagePath:'../Scripts/infiniteCarousel/images/', autoPilot :true } ); } if(habilitarLupa) { showLupa(); } cargaVocesTTL(); if(gE('altoContraste').value=='0') { new Ext.Button ( { icon:'../principalPortal/imagesSIUGJ/lupaBarra.png', width:40, height:40, cls:'btnSIUGJCancel', id:'btnGuardarForm', renderTo:'btn1', handler:function() { habilitarLupaSitio(); } } ) new Ext.Button ( { icon:'../principalPortal/imagesSIUGJ/brilloContraste.png', width:40, height:40, cls:'btnSIUGJCancel', id:'btnGuardarForm', renderTo:'btn2', handler:function() { cambiarContraste(); } } ) new Ext.Button ( { icon:'../principalPortal/imagesSIUGJ/altavoz.png', cls:'btnSIUGJCancel', width:40, height:40, id:'btnGuardarForm', renderTo:'btn3', handler:function() { getSelectedText(); } } ) } else { new Ext.Button ( { icon:'../principalPortal/imagesSIUGJ/lupaBarra_0.png', width:36, height:36, cls:'btnSIUGJ', id:'btnGuardarForm', renderTo:'btn1', handler:function() { habilitarLupaSitio(); } } ) new Ext.Button ( { icon:'../principalPortal/imagesSIUGJ/brilloContraste_0.png', width:36, height:36, cls:'btnSIUGJ', id:'btnGuardarForm', renderTo:'btn2', handler:function() { cambiarContraste(); } } ) new Ext.Button ( { icon:'../principalPortal/imagesSIUGJ/altavoz_0.png', cls:'btnSIUGJ', width:36, height:36, id:'btnGuardarForm', renderTo:'btn3', handler:function() { getSelectedText(); } } ) } new Ext.Panel ( { renderTo:'panelInicial3', layout:'absolute', width:700, border:false, height:450, defaultType: 'label', items: [ { x:10, y:10, cls:'letraSubTituloSeccion', html:'Ingresa el número de registro patronal del centro de trabajo:' }, { x:10, y:60, cls:'SIUGJ_Etiqueta', html:'Registro Patronal:' }, { x:330, y:55, xtype:'textfield', width:300, id:'txtNumeroPatronal', cls:'SIUGJ_Control', }, { x:10, y:110, cls:'letraSubTituloSeccion', html:'Ingresa con e.firma (FIEL) del centro de trabajo:' }, { x:10, y:160, cls:'SIUGJ_Etiqueta', html:'Archivo de certificado digital (*.cer):' }, { x:330, y:160, html:'' }, { x:10, y:200, cls:'SIUGJ_Etiqueta', html:'Archivo de llave privada (*.key):' }, { x:330, y:200, html:'' }, { x:10, y:240, cls:'SIUGJ_Etiqueta', html:'Contraseña de llave privada:' }, { x:330, y:235, width:250, cls:'SIUGJ_Control', id:'txtPassword', xtype:'textfield', inputType:'password' }, { x:200, y:290, cls:'SIUGJ_Etiqueta', html:'' }, { x:300, y:350, xtype:'button', width:140, height:40, cls:'btnSIUGJCancel', text:'Ingresar', handler: function() { enviarDatosFiel(); } } ] } ) new Ext.Panel ( { renderTo:'panelInicial2', layout:'absolute', width:700, border:false, height:350, defaultType: 'label', items: [ { x:10, y:10, cls:'letraSubTituloSeccion', html:'Ingresa con e.firma (FIEL) del centro de trabajo:' }, { x:10, y:60, cls:'SIUGJ_Etiqueta', html:'Archivo de certificado digital (*.cer):' }, { x:330, y:60, html:'' }, { x:10, y:100, cls:'SIUGJ_Etiqueta', html:'Archivo de llave privada (*.key):' }, { x:330, y:100, html:'' }, { x:10, y:140, cls:'SIUGJ_Etiqueta', html:'Contraseña de llave privada:' }, { x:330, y:135, width:250, cls:'SIUGJ_Control', id:'txtPassword2', xtype:'textfield', inputType:'password' }, { x:200, y:190, cls:'SIUGJ_Etiqueta', html:'' }, { x:300, y:250, xtype:'button', width:140, height:40, cls:'btnSIUGJCancel', text:'Ingresar', handler: function() { enviarDatosFiel2(); } } ] } ) new Ext.Panel ( { renderTo:'panelInicial1', layout:'absolute', width:700, border:false, height:220, defaultType: 'label', items: [ { x:10, y:10, cls:'letraTituloSeccion', html:'Ingresa el número de registro patronal del centro de trabajo:' }, { x:10, y:60, cls:'SIUGJ_Etiqueta', html:'Registro Patronal:' }, { x:330, y:55, xtype:'textfield', width:300, id:'txtNumeroPatronal1', cls:'SIUGJ_Control', }, { x:300, y:120, xtype:'button', width:140, height:40, cls:'btnSIUGJCancel', text:'Ingresar', handler: function() { enviarDatosFiel(); } } ] } ) } var idLupa; function showLupa() { mE('magnify_glass'); $(".magnify").jfMagnify(); idLupa=setInterval(function(){refrescarMagnify();},2000); window.scrollTo(0, 0); } function ocultaLupa() { oE('magnify_glass'); clearInterval(idLupa); $(".magnify").data("jfMagnify").destroy(); } function refrescarMagnify() { $(".magnify").data("jfMagnify").updateZone(); } var vocesDisponibles=[]; var vozDefault=null; function cargaVocesTTL() { if (!'speechSynthesis' in window) return alert("Lo siento, tu navegador no soporta esta tecnología"); const cargarVoces = () => { if (vocesDisponibles.length > 0) { return; } vocesDisponibles = speechSynthesis.getVoices(); var a; var encontrado=false; var x; for(a=0;a'+arrResp[0]); } } obtenerDatosWebV2('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=8&d='+d+'&l='+l+'&p='+p,true); } function ocultarError(evt) { oE('lblErr1'); oE('lblErr2'); console.log(evt); var key= evt.which; if(Ext.isIE) key=evt.keyCode; if(key==13) { autenticar(); return; } if(event.target.id=='') { gE(event.target.name).value=event.target.value+String.fromCharCode(key); } } function mostrarPantallaRegistro() { var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.url='../modulosEspeciales_SGJ/registroUsuario.php'; abrirVentanaFancy(obj); } function mostrarPantallaRecuperar() { var form = new Ext.form.FormPanel( { baseCls: 'x-plain', layout:'absolute', defaultType: 'label', items: [ { x:10, y:10, xtype:'label', html:'Ingrese la dirección de correo electrónico con la cual se registró: *' }, { x:10, y:50, xtype:'label', html:'Correo Electrónico: *' }, { x:200, y:45, xtype:'textfield', width:320, height:45, cls:'controlSIUGJ', id:'email' }, { xtype:'button', x:550, y:45, height:30, width:140, id:'btnAceptar', disabled:false, text:'Recuperar', cls:'btnSIUGJ', width:160, handler:function() { recuperarDatosAcceso(); } } ] } ); var ventanaAM = new Ext.Window( { id:'vRecuperar', title: 'Recuperar Contraseña', width: 800, height:210, cls:'msgHistorialSIUGJ', layout: 'fit', plain:true, closable:false, modal:true, bodyStyle:'padding:5px;', buttonAlign:'center', items: form, listeners : { show : { buffer : 10, fn : function() { gEx('email').focus(false,500); } } }, buttons: [ { text: 'Cancelar', cls:'btnSIUGJ', width:160, handler:function() { ventanaAM.close(); } } ] } ); ventanaAM.show(); /*var obj={}; obj.ancho='100%'; obj.alto='90%'; obj.url='../modulosEspeciales_SGJ/recuperarDatosAcceso.php'; abrirVentanaFancy(obj);*/ } function mostrarPantallaSoporte() { mostrarVentanaDuda(); } function mostrarVentana2FA(iU,pR) { var form = new Ext.form.FormPanel( { baseCls: 'x-plain', layout:'absolute', defaultType: 'label', items: [ { x:10, y:10, html:'Ingrese el Código de Acceso:' }, { x:180, y:5, id:'txtCodigoAcceso', xtype:'textfield', width:110 }, { x:90, y:40, html:'Reenviar Código de Acceso' } ] } ); var ventanaAM = new Ext.Window( { title: 'Código de Acceso', width: 350, height:140, layout: 'fit', plain:true, modal:true, bodyStyle:'padding:5px;', buttonAlign:'center', items: form, listeners : { show : { buffer : 10, fn : function() { gEx('txtCodigoAcceso').focus(false,500); } } }, buttons: [ { text: 'Aceptar', handler: function() { if(gEx('txtCodigoAcceso').getValue()=='') { function resp() { gEx('txtCodigoAcceso').focus(); } msgBox('Debe ingresar el Código de Acceso',resp) return; } function funcAjax(peticion_http) { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { if( arrResp[1] =='0') { function resp2() { gEx('txtCodigoAcceso').focus(); } msgBox('El Código de Acceso ingresado es Incorrecto',resp2) return; } else { location.href=(pR); ventanaAM.close(); } } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWebV2('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=13&cA='+bE(gEx('txtCodigoAcceso').getValue())+'&iU='+bE(iU),true); } }, { text: 'Cancelar', handler:function() { ventanaAM.close(); } } ] } ); ventanaAM.show(); } function reenviarCodigoAcceso(iU) { function funcAjax(peticion_http) { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { msgBox('El Código de Acceso ha sido Enviado de Nuevo'); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWebV2('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=12&iU='+iU,true); } function mostrarPantallaRegistroIndex() { var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.params=[['cPagina','sFrm=true']]; obj.url='../modulosEspeciales_SIUGJ/registroUsuario.php'; abrirVentanaFancy(obj); } function mostrarPantallaInicio() { var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.params=[['cPagina','sFrm=true']]; obj.url='../principalPortal/portalInicio.php'; abrirVentanaFancy(obj); } function mostrarPantallaValidarDocumento() { var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.params=[['cPagina','sFrm=true']]; obj.url='../gestorDocumental/validaDocumentos.php'; abrirVentanaFancy(obj); } function mostrarPantallaAudiencias() { var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.params=[['cPagina','sFrm=true']]; obj.url='../reportes/tblReporteSalasCalendario.php'; abrirVentanaFancy(obj); } function mostrarPantallaRemates() { var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.params=[['cPagina','sFrm=true']]; obj.url='../modulosEspeciales_SIUGJ/tblBienes.php'; abrirVentanaFancy(obj); } function recuperarDatosAcceso() { var mail=gEx('email'); if(!validarCorreo(mail.getValue())) { function resp1() { gEx('email').focus(); } msgBox('La dirección de correo electrónico ingresada no es válida',resp1); return; } function funcAjax(peticion_http) { var resp=peticion_http.responseText; arrResp=resp.split('|'); switch(arrResp[0]) { case '1': function resp3() { gEx('vRecuperar').close(); } msgBox('Sus datos de acceso han sido enviados a la cuenta de correo electrónico registrada',resp3); return; break; /*case '2': function resp2() { gEx('email').focus(); } msgBox('La dirección de correo electrónico ingresada no se encuentra registrada en el sistema',resp2); return; break;*/ default: msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); break; } } obtenerDatosWebV2('../modulosEspeciales_SGJ/paginasFunciones/funcionesModulosEspeciales_SGJ.php',funcAjax, 'POST','funcion=7&mail='+mail.getValue(),true); } function habilitarLupaSitio() { gE('mostrarLupa').value=(gE('mostrarLupa').value=='1'?'0':'1'); function funcAjax(peticion_http) { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { if(gE('mostrarLupa').value=='0') ocultaLupa(); else showLupa(); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWebV2('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=15&tipoValor=1&valor='+gE('mostrarLupa').value,true); } function cambiarContraste() { function funcAjax(peticion_http) { var resp=peticion_http.responseText; arrResp=resp.split('|'); if(arrResp[0]=='1') { location.reload(); } else { msgBox('No se ha podido realizar la operación debido al siguiente problema:'+'
'+arrResp[0]); } } obtenerDatosWebV2('../paginasFunciones/funciones.php',funcAjax, 'POST','funcion=15&tipoValor=2&valor='+(gE('altoContraste').value=='1'?'0':'1'),true); } function enviarDatosFiel() { gE('divMsgErr').innerHTML=''; if(gEx('txtNumeroPatronal').getValue()=='') { function resp1() { gEx('txtNumeroPatronal').focus(); } msgBox('Debe ingresar el número de registro patronal',resp1); return; } if(gE('fileCer').value=='') { function resp1Cer() { gE('fileCer').focus(); } msgBox('Debe ingresar el archivo de certificado digital (*.cer)',resp1Cer); return; } if(gE('fileKey').value=='') { function resp2Cer() { gE('fileKey').focus(); } msgBox('Debe ingresar el archivo de llave privada (*.key)',resp2Cer); return; } if(gEx('txtPassword').getValue().trim()=='') { function resp3Cer() { gEx('txtPassword').focus(); } msgBox('Debe ingresar la contraseña de llave privada',resp3Cer); return; } var formData = new FormData(); formData.append('passwd',AES_Encrypt(gEx('txtPassword').getValue())); formData.append('fCer',gE('fileCer').files[0]); formData.append('fKey',gE('fileKey').files[0]); formData.append('noRegistroPatronal',gEx('txtNumeroPatronal').getValue()); mostrarMensajeProcesando('Verificando e.Firma, ésta operación puede tardar unos minutos...'); $.ajax ({ url: "../modulosEspeciales_FONACOT/paginasFunciones/procesarDocumentoFiel.php", data: formData, processData: false, contentType: false, type: 'POST', success: function(data) { ocultarMensajeProcesando(); var oResp=eval('['+data+']')[0]; if(oResp.resultado=='1') { if(oResp.error=='1') { function resp4() { gEx('txtPassword').focus(); } msgBox('Error: '+oResp.msgErr,resp4); return; } else { gE('fileCer').value=''; gE('fileKey').value=''; gEx('txtPassword').setValue(''); gEx('txtNumeroPatronal').setValue(''); var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.modal=true; obj.url='../modulosEspeciales_FONACOT/tAfiliacion.php'; obj.params=[['idRegistroProceso',oResp.idRegistro]]; abrirVentanaFancySuperior(obj); } } else { msgBox('No se ha podido llevar a cabo la operación debido al siguiente problema:

'+oResp.mensaje); } } }); } function enviarDatosFiel2() { gE('divMsgErr').innerHTML=''; if(gE('fileCer2').value=='') { function resp1Cer() { gE('fileCer2').focus(); } msgBox('Debe ingresar el archivo de certificado digital (*.cer)',resp1Cer); return; } if(gE('fileKey2').value=='') { function resp2Cer() { gE('fileKey2').focus(); } msgBox('Debe ingresar el archivo de llave privada (*.key)',resp2Cer); return; } if(gEx('txtPassword2').getValue().trim()=='') { function resp3Cer() { gEx('txtPassword2').focus(); } msgBox('Debe ingresar la contraseña de llave privada',resp3Cer); return; } var formData = new FormData(); formData.append('passwd',AES_Encrypt(gEx('txtPassword2').getValue())); formData.append('fCer',gE('fileCer2').files[0]); formData.append('fKey',gE('fileKey2').files[0]); formData.append('noRegistroPatronal',''); mostrarMensajeProcesando('Verificando e.Firma, ésta operación puede tardar unos minutos...'); $.ajax ({ url: "../modulosEspeciales_FONACOT/paginasFunciones/procesarDocumentoFiel.php", data: formData, processData: false, contentType: false, type: 'POST', success: function(data) { ocultarMensajeProcesando(); var oResp=eval('['+data+']')[0]; if(oResp.resultado=='1') { if(oResp.error=='1') { function resp4() { gEx('txtPassword2').focus(); } msgBox('Error: '+oResp.msgErr,resp4); return; } else { gE('fileCer2').value=''; gE('fileKey2').value=''; gEx('txtPassword2').setValue(''); var obj={}; obj.ancho='100%'; obj.alto='100%'; obj.modal=true; obj.url='../modulosEspeciales_FONACOT/tAfiliacion.php'; obj.params=[['idRegistroProceso',oResp.idRegistro]]; abrirVentanaFancySuperior(obj); } } else { msgBox('No se ha podido llevar a cabo la operación debido al siguiente problema:

'+oResp.mensaje); } } }); } function mostrarPantallaRegistroAfiliacion() { oE('tblBanner'); mE('tblAfiliacion'); } function opcionSel(radio) { var arrDatos=radio.id.split('_'); oE('div_1'); oE('div_2'); oE('div_3'); mE('div_'+arrDatos[1]); switch(arrDatos[1]) { case '1': gEx('txtNumeroPatronal1').focus(); break; case '2': gEx('txtPassword2').focus(); break; case '3': gEx('txtNumeroPatronal').focus(); break; } }