PageSourceSearch

https://www.ipn.mx/assets/files/main/js/index.js

js ipn.mx collected 2026-10-01 09:13:33 UTC 41,067 bytes, 992 lines download raw bytes

1    //Historico de Gacetas y Suplemento
2    $(document).ready(function() { 
3        $( "#filtro-combo select" ).change(function() {
4          $("#filtro-combo").submit();
5        });
6    });
7    // Sticky on Scroll del menú principal
8    document.addEventListener("DOMContentLoaded", function(){
9        window.addEventListener('scroll', function() {
10            if (window.scrollY > 157) {
11                if(document.getElementById('menu_sticky')) {
12                    document.getElementById('menu_sticky').classList.add('fixed-top');
13                }
14                navbar_height = document.querySelector('.navbar').offsetHeight;
15                document.body.style.paddingTop = navbar_height + 'px';
16            } else {
17                if(document.getElementById('menu_sticky')) {
18                    document.getElementById('menu_sticky').classList.remove('fixed-top');
19                    document.body.style.paddingTop = '63';
20                }
21            }
22        });
23    });
24    
25
26    // Ajustes para menu manual cuando se tienen mas elemnetos con la propiedad sticky
27    document.addEventListener("DOMContentLoaded", function(){
28        window.addEventListener('scroll', function() {
29            if (window.scrollY > 157) {
30                let altoMenuGob = 62.8,altoMenuPrincipal= 0, altoTituloUnidad=0, altoMenuManual=0;
31                if(this.document.querySelector("#menu-principal")){
32                    altoMenuPrincipal = this.document.querySelector("#menu-principal").offsetHeight;
33                    this.document.querySelector("#menu-principal").setAttribute("style","top:" + altoMenuGob.toFixed(1)+"px");
34                }
35                if(this.document.querySelector("#tituloUnidad")){
36                    altoTituloUnidad = this.document.querySelector("#tituloUnidad").offsetHeight;
37                    let alto =altoMenuGob + altoMenuPrincipal;
38                    this.document.querySelector("#tituloUnidad").setAttribute("style","top:" + alto.toFixed(1)+"px");   
39                }
40                if(this.document.querySelector("#menuManual")){
41                    altoMenuManual = this.document.querySelector("#menuManual").offsetHeight;
42                    let altoManual = altoMenuGob + altoMenuPrincipal + altoTituloUnidad;
43                    this.document.querySelector("#menuManual").setAttribute("style","top:"+ altoManual.toFixed(1)+"px");   
44                }
45            }
46        });
47    });
48    
49    // Opciones de accesibilidad
50    $(".contraste").on("click", function(a) { 
51        $("body, .bg--blanco, .bg--patron-blanco, .bg--guinda, .bg--patron-guinda, .bg--gris, .bg--patron-gris, .bg--grisOscuro, .bg--grisMedio , .bg--patron-grisOscuro, .bg--grisAzulado, .oe-one-column, .oe-two-col, .dropdown-menu , .list-info ").toggleClass("bg--negro") 
52    });
53
54    $(".aumentaLetra").on("click", function(a) { $(".reduceLetra").removeClass("deshabiltar");
55        a = $("html"); var b = a.css("font-size");
56        16 < b.replace("px", "") ? $(".aumentaLetra").addClass("deshabiltar") : $(".aumentaLetra").removeClass("deshabiltar");
57        b = parseFloat(b, 10);
58        a.css("font-size", b + 2); return !1 
59    });
60
61    $(".reduceLetra").click(function() { $(".aumentaLetra").removeClass("deshabiltar"); var a = $("html"),
62        b = a.css("font-size");
63        16 > b.replace("px", "") ? $(".reduceLetra").addClass("deshabiltar") : $(".reduceLetra").removeClass("deshabiltar");
64        b = parseFloat(b, 10);
65        a.css("font-size", b - 2); return !1 
66    });
67
68    $(".resetLetra").click(function() { 
69        $("html").css("font-size", "16px");
70        $(".aumentaLetra").removeClass("deshabiltar");
71        $(".reduceLetra").removeClass("deshabiltar") 
72    });
73    
74    $(".resetLetra").click(function() { 
75        $("html").css("font-size", "16px");
76        $(".aumentaLetra").removeClass("deshabiltar");
77        $(".reduceLetra").removeClass("deshabiltar") 
78    });
79
80    // Botón de Radio IPN
81    var x = document.getElementById("ipnAudioRedes"); 
82    function playAudio() { 
83        x.play(); 
84        document.getElementById("reproducirRadio").style.display = "none";
85        document.getElementById("stopRadio").style.display = "block";
86    } 
87    function pauseAudio() { 
88        x.pause(); 
89        document.getElementById("stopRadio").style.display = "none";
90        document.getElementById("reproducirRadio").style.display = "block";
91    } 
92    //  Componente titulo de unidad
93    window.addEventListener('scroll', ()=>{
94        let tituloUnidad = document.querySelector("#tituloUnidad");
95        if(tituloUnidad != null){
96            if(window.scrollY == 0){
97                if(tituloUnidad.classList.contains("sticky-top")){
98                    tituloUnidad.classList.remove("sticky-top");
99                    tituloUnidad.classList.remove("titulo_unidad_fondo");
100                }
101            }
102            else{
103                tituloUnidad.classList.add("sticky-top");
104                if(window.scrollY > 328){
105                    tituloUnidad.classList.add("titulo_unidad_fondo");
106                }  
107            } 
108        }
109    });
110    
111    //SLIDER CENTRAL: Para agregar item del slider
112
113    let sliderCentralItem = document.querySelectorAll(".sliderIndicators");
114
115    if(sliderCentralItem != null){
116
117        for(s = 0; s < sliderCentralItem.length; s++){ 
118
119            let sliderCentralIndicators = sliderCentralItem[s].firstElementChild;
120
121            let items = sliderCentralItem[s].firstElementChild.nextElementSibling.children.length
122
123            for(i = 0; i < items; i++){ 
124                
125                let buttonIndicador = document.createElement("button");
126                    buttonIndicador.setAttribute("type","button");
127                    buttonIndicador.setAttribute("data-bs-target","#"+sliderCentralItem[s].id);
128                    buttonIndicador.setAttribute("data-bs-slide-to",i);
129                    buttonIndicador.setAttribute("aria-label","Slide " + (i+1));
130                    if(i == 0){
131                        buttonIndicador.setAttribute("class","active");
132                        buttonIndicador.setAttribute("aria-current","true");
133                    }
134                sliderCentralIndicators.append(buttonIndicador);
135            }
136        }
137    }
138
139$('.owl-3elementos').owlCarousel({
140    loop:true,
141    margin:20,
142    nav:true,
143    autoplay:true,
144    navText:['<span class="fa-stack"><i class="fa-solid fa-square-full fa-stack-2x"></i><i class="fas fa-chevron-left fa-stack-1x fa-inverse"></i></span>','<span class="fa-stack"><i class="fa-solid fa-square-full fa-stack-2x"></i><i class="fas fa-chevron-right fa-stack-1x fa-inverse"></i></span>'],
145    responsive:{
146        0:{
147            items:1
148        },
149        600:{
150            items:3
151        },
152        1000:{
153            items:3
154        }
155    }
156})
157$('.owl-4elementos').owlCarousel({
158    loop:true,
159    margin:20,
160    nav:true,
161    autoplay:true,
162    navText:['<span class="fa-stack"><i class="fa-solid fa-square-full fa-stack-2x"></i><i class="fas fa-chevron-left fa-stack-1x fa-inverse"></i></span>','<span class="fa-stack"><i class="fa-solid fa-square-full fa-stack-2x"></i><i class="fas fa-chevron-right fa-stack-1x fa-inverse"></i></span>'],
163    responsive:{
164        0:{
165            items:1
166        },
167        600:{
168            items:4
169        },
170        1000:{
171            items:4
172        }
173    }
174})
175// FORMULARIO BUZON
176$("#frmContactoBuzon").submit(function () {
177    event.preventDefault();
178    
179    const urlOrigen = window.location.href;
180    
181    const dominio = window.location.hostname;
182    
183    var a = {
184        nombre: $("#frmContactoBuzon #nombre").val(),
185        correo: $("#frmContactoBuzon #correo").val(),
186        perfil: $("#frmContactoBuzon #perfil").val(),
187        area: $("#frmContactoBuzon #area").val(),
188        mensaje: $("#frmContactoBuzon #mensaje").val(),
189        origen: urlOrigen,
190        dominio:dominio
191    };
192    
193    console.log(a);
194    
195     $.ajax({
196        type: "POST",
197        url: "//www.cpwi-buzon404.ipn.mx/Modx/buzon/mail-v2.php",
198        data: a,
199        success: function (response) {
200
201            if ($.trim(response) === "OK") {
202
203                $("#frmContactoBuzon .alert-success")
204                    .text("¡Gracias por contactarnos! Sus datos se enviaron correctamente. En breve, la dependencia correspondiente dará seguimiento a su solicitud.")
205                    .slideDown("slow", function () {
206
207                        setTimeout(function () {
208                            $("#frmContactoBuzon .alert-success").slideUp("slow");
209
210                            resetFrmContactoBuzon();
211
212                        }, 4500);
213                    });
214
215            } else {
216                $("#frmContactoBuzon .alert-danger")
217                    .text("Ocurrió un problema al enviar tu información. Inténtalo nuevamente.")
218                    .slideDown("slow");
219            }
220        },
221
222        error: function (xhr, status, error) {
223            
224            $("#frmContactoBuzon .alert-danger")
225                .text("Error en la comunicación con el servidor.")
226                .slideDown("slow");
227
228            console.log(xhr, status, error);
229        }
230
231    });
232    return false;
233});
234
235function resetFrmContactoBuzon(){
236    $("#frmContactoBuzon").find(".form-control").val("");
237    $("#perfil option[value='0']").prop("selected", true);
238    $("#area option[value='0']").prop("selected", true); 
239}
240
241// FORMULARIO COIL
242$("#formCoil").submit(function (event) {
243    event.preventDefault();
244
245    var a = {
246        nombre: $("#formCoil #nombreCompleto").val(),
247        correo: $("#formCoil #correoInstitucional").val(),
248        escuelaUnidad:  $("#formCoil #escuelaUnidad").val(),
249        asignatura:     $("#formCoil #asignaturaIPN").val(),
250        semestre:       $("#formCoil #semestre").val(),
251        descripcion:    $("#formCoil #descripcionAsignatura").val(),
252        ideas:          $("#formCoil #ideasCoil").val(),
253        destino:        $("#formCoil #destino").val()
254    };
255
256    console.log(a);
257
258    $.ajax({
259        type: "POST",
260        url: "//www.cpwi-buzon404.ipn.mx/Modx/coil/mail.php",
261        data: a,
262        success: function (response) {
263
264            if ($.trim(response) === "OK") {
265
266                $("#formCoil .alert-success")
267                    .text("¡Tu información se envió correctamente!")
268                    .slideDown("slow", function () {
269
270                        setTimeout(function () {
271                            $("#formCoil .alert-success").slideUp("slow");
272
273                            resetformCoil();
274
275                        }, 2500);
276                    });
277
278            } else {
279                $("#formCoil .alert-danger")
280                    .text("Ocurrió un problema al enviar tu información. Inténtalo nuevamente.")
281                    .slideDown("slow");
282            }
283        },
284
285        error: function (xhr, status, error) {
286            // Error de conexión o de servidor
287            $("#formCoil .alert-danger")
288                .text("Error en la comunicación con el servidor.")
289                .slideDown("slow");
290
291            console.log(xhr, status, error);
292        }
293    });
294
295    return false;
296});
297
298function resetformCoil(){
299    $("#formCoil").find(".form-control").val("");
300}
301// SUSCRIPCION GACETAS
302$("#frmSuscripcion").submit(function () {
303    event.preventDefault();
304    var a = {
305        nombre: $("#frmSuscripcion #nombre").val(),
306        correo: $("#frmSuscripcion #correo").val(),
307        perfil: $("#frmSuscripcion #perfil").val(),
308        destino: $("#frmSuscripcion #destino").val()
309    };
310    
311    console.log(a);
312
313    $.ajax({
314        type: "POST", url: "//www.cpwi-buzon404.ipn.mx/Modx/buzon/suscripcion.php", data: a, success: function () {
315            $("#frmSuscripcion .alert").slideDown("slow", function () {
316                setTimeout(function () {
317                    $(".alert").slideUp("slow");
318                    resetFrmSuscripcion();
319                },
320                    2500)
321            })
322        },
323        error: function (a, c, d) {
324            resetFrmSuscripcion();
325            console.log(a, c, d);
326        }
327    });
328    return !1
329});
330
331function resetFrmSuscripcion(){
332    $("#frmSuscripcion").find(".form-control").val("");
333    $("#perfil option[value='0']").prop("selected", true);
334}
335
336// FORMULARIO DOCTORADO
337$("#frmDoctorado").submit(function(){
338    console.log("Entre a la funcion");
339    event.preventDefault();
340    var a={
341            nombre:$("#frmDoctorado #nombre").val(),
342            apellidoPaterno:$("#frmDoctorado #apellidoPaterno").val(),
343            apellidoMaterno:$("#frmDoctorado #apellidoMaterno").val(),
344            correo:$("#frmDoctorado #correo").val(),
345            domicilio:$("#frmDoctorado #domicilio").val(),
346            telefonoFijo:$("#frmDoctorado #telefonoFijo").val(),
347            celular:$("#frmDoctorado #celular").val(),
348            nacimiento:$("#frmDoctorado #nacimiento").val(),
349            edad:$("#frmDoctorado #edad").val(),
350            lugar:$("#frmDoctorado #lugar").val(),
351            nacionalidad:$("#frmDoctorado #nacionalidad").val(),
352            optSexo:$("input:radio[name=optSexo]:checked").val(),
353            estadoCivil:$("#frmDoctorado #estadoCivil").val(),
354            docIdentificacion:$("#frmDoctorado #docIdentificacion").val(),
355            maestria:$("#frmDoctorado #maestria").val(),
356            institucionMaestria:$("#frmDoctorado #institucionMaestria").val(),
357            obtencionMaestria:$("#frmDoctorado #obtencionMaestria").val(),
358            especialidad:$("#frmDoctorado #especialidad").val(),
359            institucionEspecialidad:$("#frmDoctorado #institucionEspecialidad").val(),
360            obtencionEspecialidad:$("#frmDoctorado #obtencionEspecialidad").val(),
361            licenciatura:$("#frmDoctorado #licenciatura").val(),
362            institucionLicenciatura:$("#frmDoctorado #institucionLicenciatura").val(),
363            obtencionLicenciatura:$("#frmDoctorado #obtencionLicenciatura").val(),
364            idioma:$("#frmDoctorado #idioma").val(),
365            selectOpt1:$("#frmDoctorado #selectOpt1").val(),
366            selectOpt2:$("#frmDoctorado #selectOpt2").val(),
367            optTiempo:$("input:radio[name=optTiempo]:checked").val(),
368            optMedio:$("input:radio[name=optMedio]:checked").val(),
369            destino:$("#frmDoctorado #destino").val()
370        };
371        $.ajax({
372            type:"POST",
373            url:"https://www.cpwi-buzon404.ipn.mx/Modx/doctoradoISRM/mail_v2.php",
374            data:a,
375            success:function(){
376                $("#frmDoctorado #alertSucc").slideDown("slow",function(){
377                    $("#frmDoctorado #alertSucc").removeClass("d-none");
378                    setTimeout(function(){
379                        $("#frmDoctorado #alertSucc").slideUp("slow");        
380                        $("#frmDoctorado #alertSucc").addClass("d-none");
381                        resetFrmDoctorado();
382                    },2500)
383                });
384            },
385            error:function(a,c,d){
386                console.log(a, c, d);
387                resetFrmDoctorado();
388            }
389        });
390    return!1
391});
392function resetFrmDoctorado(){
393    $("#frmDoctorado").find(".form-control").val("");
394    $("#estadoCivil option[value='0']").prop("selected", true);
395    $("#selectOpt1 option[value='0']").prop("selected", true);
396    $("#selectOpt2 option[value='0']").prop("selected", true);
397    $("input[name=optTiempo][value='Tiempo Completo']").prop('checked', true);
398    $("input[name=optMedio][value='Cartel']").prop('checked', true);
399    $("input[name=optSexo][value='Hombre']").prop('checked', false);
400    $("input[name=optSexo][value='Mujer']").prop('checked', false);
401}
402// FORMULARIO QUEJAS DEFENSORIA
403$("#frmDefensoria").submit(function(){
404    console.log("Entre a la funcion");
405    event.preventDefault();
406    var a={
407            destino:$("#frmDefensoria #destino").val(),
408            asunto:$("#frmDefensoria #asunto").val(),
409            fecha:$("#frmDefensoria #fecha").val(),
410            nombre:$("#frmDefensoria #nombre").val(),
411            apellidoPaterno:$("#frmDefensoria #apellidoPaterno").val(),
412            apellidoMaterno:$("#frmDefensoria #apellidoMaterno").val(),
413            edad:$("#frmDefensoria #edad").val(),
414            email:$("#frmDefensoria #email").val(),
415            numEmpleado:$("#frmDefensoria #numEmpleado").val(),
416            perfil:$("#frmDefensoria #perfil").val(),
417            unidad:$("#frmDefensoria #unidad").val(),
418            mensaje:$("#frmDefensoria #mensaje").val()
419
420        };
421        $.ajax({
422            type:"POST",
423            url:"https://www.cpwi-buzon404.ipn.mx/Modx/defensoria/mail.php",
424            data:a,
425            success: function(response){
426                
427                if ($.trim(response) === "OK") {
428
429                    $("#frmDefensoria .alert-success")
430                        .text("Su queja ha sido recibida satisfactoriamente. Agradecemos que se haya comunicado con nosotros.")
431                        .slideDown("slow", function () {
432
433                        setTimeout(function () {
434                            $("#frmDefensoria .alert-success").slideUp("slow");
435
436                            resetFrmDefensoria();
437
438                        }, 4500);
439                    });
440
441                } else {
442                    $("#frmDefensoria .alert-danger")
443                    .text("Ocurrió un problema al enviar tu información. Inténtalo nuevamente.")
444                    .slideDown("slow");
445                }
446                
447            },
448            error:function(a,c,d){
449                console.log(a, c, d);
450                $("#frmDefensoria").find(".form-control").val("");
451            }
452        });
453    return!1
454});
455
456function resetFrmDefensoria(){
457    $("#frmDefensoria").find(".form-control").val("");
458    $("#perfil option[value='0']").prop("selected", true);
459}
460
461// FORMULARIO CONTACTO - MENU OPCIONES
462function sendInfo() {
463    console.log("entre e send info");
464    switch (selectInfo) {
465        case 1: 
466        case 3: 
467        case 4: 
468                if (revisar(selectInfo)) alert("Su mensaje ser\u00e1 enviado a la " + textoInfo + ", Unidad Responsable encargada del servicio"),
469                document.getElementById("form-registro").submit(), document.getElementById("form-registro").reset();
470                else return;
471            break;
472        case 2: 
473            alert("Te redireccionaremos  a la " + textoInfo + ", Unidad Responsable encargada del servicio");
474            document.getElementById("form-registro").reset();
475            document.getElementById("select1").selectedIndex ="0";
476            parent.document.location.href = url;
477            break;
478        default: alert("Selecciona una opci\u00f3n")
479    }
480    document.getElementById("blockD").style.display = "none";
481    document.getElementById("Coment").style.display = "none";
482    document.getElementById("send").style.display = "none"
483}
484function cargarSelect(a) {
485    var b = [[1, 1, "Servicio Social"], [1, 2, "Bolsa de trabajo para egresados"], [1, 3, "Movilidad Aca
485d\u00e9mica: Nacional e Internacional"], [1, 4, "Convenios de Colaboraci\u00f3n Acad\u00e9mica"], [1, 5, "Bolsa de trabajo"], [1, 6, "Orientaci\u00f3n juvenil"], [1, 7, "Gesti\u00f3n de tr\u00e1mites"], [1, 8, "Cambio de Modalidad escolarizada a Modalidad mixta"], [1, 9, "Seguimiento de tr\u00e1mite de t\u00edtulo, certifiado, carta de pasante y cedula profesional"], [1, 10, "Otro"], [2, 1, "Proceso de admisi\u00f3n"],
486    [2, 2, "Convocatorias"], [2, 3, "Educacion virtual"], [2, 4, "Dudas espec\u00edficas"], [3, 1, "Internacional"], [3, 2, "Registro de empresas para bolsa de trabajo"], [3, 3, "Empresas solicitantes de alumnos para Servicio Social"], [3, 4, "Informaci\u00f3n relacionada a comunicados"], [3, 5, "Registro de empresas para proveedores"], [3, 6, "Otro"], [4, 1, "Movilidad Acad\u00e9mica: Nacional e Internacional"], [4, 2, "A\u00f1o sab\u00e1tico"], [4, 3, "Otro"], [5, 1, "Prestaciones y servicios capital humano"], [5, 2, "Tr\u00e1mites capital humano"],
487    [5, 3, "Correo electr\u00f3nico"], [5, 4, "Otro"]];
488    if (0 == a) document.getElementById("select2").value = "0", document.getElementById("select2").disabled = !0, document.getElementById("blockD").style.display = "none", document.getElementById("Coment").style.display = "none", document.getElementById("send").style.display = "none";
489    else {
490        document.getElementById("select2").options.length = 0;
491        document.getElementById("blockD").style.display = "none";
492        document.getElementById("Coment").style.display = "none";
493        document.getElementById("send").style.display =
494            "none";
495        document.getElementById("select2").options[0] = new Option("Selecciona una opci\u00f3n", "0");
496        for (i = 0;
497            i < b.length;
498            i++)b[i][0] == a && (document.getElementById("select2").options[document.getElementById("select2").options.length] = new Option(b[i][2], b[i][1]));
499        document.getElementById("select2").disabled = !1
500    }
501}
502function seleccinado_select2(a) {
503    a = document.getElementById("select1");
504    a = a.options[a.selectedIndex].value;
505    var b = document.getElementById("select2");
506    b = b.options[b.selectedIndex].value;
507    document.getElementById("blockD").style.display = "none";
508    document.getElementById("Coment").style.display = "none";
509    document.getElementById("send").style.display = "none";
510    if (0 != b || 0 != a) {
511        if (1 == a) switch (!0) {
512            case 7 > b || 10 == b: document.getElementById("blockD").style.display = "block";
513                document.getElementById("Coment").style.display = "block";
514                document.getElementById("send").style.display = "block";
515                selectInfo = 1;
516                break;
517            case 7 <= b && 10 > b: document.getElementById("send").style.display = "block";
518                selectInfo = 2;
519                url = 9 == b ? "https://www.sicert.ipn.mx/" : "http://www.dae.ipn.mx/buzon/";
520                break;
521            default: alert("Selecciona una opci\u00f3n")
522        }
523        else if (2 == a) switch (!0) {
524            case 1 == b: document.getElementById("send").style.display = "block";
525                selectInfo = 2;
526                url = "https://www.admision.ipn.mx/portal/ingreso.html";
527                break;
528            case 2 == b: document.getElementById("send").style.display = "block";
529                selectInfo =
530                    2;
531                url = "https://www.admision.ipn.mx/";
532                break;
533            case 3 == b: document.getElementById("send").style.display = "block";
534                selectInfo = 2;
535                url = "http://www.ipn.mx/ofertaeducativa/Paginas/educacion-virtual.aspx";
536                break;
537            case 4 == b: document.getElementById("send").style.display = "block";
538                selectInfo = 2;
539                url = "http://www.dae.ipn.mx/buzon/";
540                break;
541            default: alert("Selecciona una opci\u00f3n")
542        }
543        else if (3 == a) switch (!0) {
544            case 4 > b || 6 == b: document.getElementById("blockD").style.display = "block";
545                document.getElementById("Coment").style.display =
546                    "block";
547                document.getElementById("send").style.display = "block";
548                selectInfo = 1;
549                break;
550            case 4 == b: document.getElementById("send").style.display = "block";
551                url = "http://www.ipn.mx";
552                selectInfo = 2;
553                break;
554            case 5 == b: document.getElementById("send").style.display = "block";
555                url = "http://www.sapbsi.ipn.mx/maximize.cfm";
556                selectInfo = 2;
557                break;
558            default: alert("Selecciona una opci\u00f3n")
559        }
560        else if (4 == a) switch (!0) {
561            case 1 == b || 3 == b: document.getElementById("blockD").style.display = "block";
562                document.getElementById("Coment").style.display =
563                    "block";
564                document.getElementById("send").style.display = "block";
565                selectInfo = 1;
566                break;
567            case 2 == b: document.getElementById("send").style.display = "block";
568                selectInfo = 2;
569                url = "https://sad.ipn.mx/";
570                break;
571            default: alert("Selecciona una opci\u00f3n")
572        }
573        else if (5 == a) switch (!0) {
574            case 2 > b: document.getElementById("blockD").style.display = "block";
575                document.getElementById("send").style.display = "block";
576                selectInfo = 4;
577                break;
578            case 2 <= b: document.getElementById("blockD").style.display = "block";
579                document.getElementById("Coment").style.display =
580                    "block";
581                document.getElementById("send").style.display = "block";
582                selectInfo = 1;
583                break;
584            default: alert("Selecciona una opci\u00f3n")
585        }
586        else alert("Selecciona una opci\u00f3n"), valor = 0;
587        if (1 == a) switch (console.log(b), !0) {
588            case 1 == b: case 2 == b: case 5 == b: textoInfo = "Direcci\u00f3n de Egresados y Servicio Social";
589                break;
590            case 3 == b: case 4 == b: textoInfo = "Coordinaci\u00f3n de Cooperaci\u00f3n acad\u00e9mica";
591                break;
592            case 9 == b: case 7 == b: case 8 == b: textoInfo = "Direcci\u00f3n de Administraci\u00f3n Escolar";
593                break;
594            case 6 == b: textoInfo =
595                "Direcci\u00f3n de Servicios Educativos";
596                break;
597            case 10 == b: textoInfo = "Direcci\u00f3n del Portal Web Institucional";
598                break;
599            default: alert("Selecciona una opci\u00f3n")
600        }
601        else if (2 == a) switch (!0) {
602            case 1 == b: case 2 == b: case 3 == b: case 4 == b: textoInfo = "Direcci\u00f3n de Administraci\u00f3n Escolar";
603                break;
604            default: alert("Selecciona una opci\u00f3n")
605        }
606        else if (3 == a) switch (!0) {
607            case 1 == b: textoInfo = "Coordinaci\u00f3n de Cooperaci\u00f3n acad\u00e9mica";
608                break;
609            case 2 == b: case 3 == b: textoInfo = "Direcci\u00f3n de Egresados y Servicio Social";
610                break;
611            case 4 == b: textoInfo = "IPN";
612                break;
613            case 5 == b: textoInfo = "Secretar\u00eda de Administraci\u00f3n del IPN";
614                break;
615            case 6 == b: textoInfo = "Direcci\u00f3n del Portal Web Institucional";
616                break;
617            default: alert("Selecciona una opci\u00f3n")
618        }
619        else if (4 == a) switch (!0) {
620            case 1 == b: textoInfo = "Coordinaci\u00f3n de Cooperaci\u00f3n acad\u00e9mica";
621                break;
622            case 2 == b: textoInfo = "Secretar\u00eda academica";
623                break;
624            case 3 == b: textoInfo = "Direcci\u00f3n del Portal Web Institucional";
625                break;
626            default: alert("Selecciona una opci\u00f3n")
627        }
628        else if (5 ==
629            a) switch (!0) {
630                case 1 == b: case 2 == b: textoInfo = "Direcci\u00f3n de Capital Humano";
631                    break;
632                case 3 == b: textoInfo = "Direcci\u00f3n de C\u00f3mputo y Comunicaciones";
633                    break;
634                case 4 == b: textoInfo = "Direcci\u00f3n del Portal Web Internacional";
635                    break;
636                default: alert("Selecciona una opci\u00f3n")
637            }
638        console.log(textoInfo)
639    }
640    else document.getElementById("blockD").style.display = "none", document.getElementById("Coment").style.display = "none", document.getElementById("send").style.display = "none"
641}
642function sendInfo() {
643    console.log("entre e send info");
644    switch (selectInfo) {
645        case 1: 
646        case 3: 
647        case 4: 
648                if (revisar(selectInfo)) alert("Su mensaje ser\u00e1 enviado a la " + textoInfo + ", Unidad Responsable encargada del servicio"),
649                document.getElementById("form-registro").submit(), document.getElementById("form-registro").reset();
650                else return;
651            break;
652        case 2: 
653            alert("Te redireccionaremos  a la " + textoInfo + ", Unidad Responsable encargada del servicio");
654            document.getElementById("form-registro").reset();
655            document.getElementById("select1").selectedIndex ="0";
656            parent.document.location.href = url;
657            break;
658        default: alert("Selecciona una opci\u00f3n")
659    }
660    document.getElementById("blockD").style.display = "none";
661    document.getElementById("Coment").style.display = "none";
662    document.getElementById("send").style.display = "none"
663}
664
665    
666//Efecto count para Numeraria  
667(function($) {
668    $.fn.countTo = function(options) {
669      return this.each(function() {
670        //-- Arrange
671        var FRAME_RATE = 60; // Predefine default frame rate to be 60fps
672        var $el = $(this);
673        var countFrom = parseInt($el.attr('data-count-from'));
674        var countTo = parseInt($el.attr('data-count-to'));
675        var countSpeed = $el.attr('data-count-speed'); // Number increment per second
676  
677        //-- Action
678        var rafId;
679        var increment;
680        var currentCount = countFrom;
681        var countAction = function() {              // Self looping local function via requestAnimationFrame
682          if(currentCount < countTo) {              // Perform number incremeant
683            $el.text(Math.floor(currentCount));     // Update HTML display
684            increment = countSpeed / FRAME_RATE;    // Calculate increment step
685            currentCount += increment;              // Increment counter
686            rafId = requestAnimationFrame(countAction);
687          } else {                                  // Terminate animation once it reaches the target count number
688            $el.text(countTo);                      // Set to the final value before everything stops
689            //cancelAnimationFrame(rafId);
690          }
691        };
692        rafId = requestAnimationFrame(countAction); // Initiates the looping function
693      });
694    };
695  }(jQuery));
696  $('.number-counter').countTo();
697  
698// SCRIPT PARA BUSCADOR GRATUITO DE GOOGLE
699function enviarBusqueda(){
700    var texto = document.getElementById("textoBusqueda").value;
701    // window.open("https://buscador.ipn.anteater.ai/search?q="+texto,'_blank');
702    var dominio = "ipn.mx"; // Reemplaza con el dominio que desees
703    var consulta = "site:" + dominio + " " + texto;
704    window.open("https://www.google.com/search?q=" + encodeURIComponent(consulta), '_blank');
705}
706
707// =====================  VIDEO FLOTANTE  =======================
708(function(){
709  const wrap = document.getElementById('dvw-wrap');
710  const preview = document.getElementById('dvw-preview');
711  const bubble = document.getElementById('dvw-bubble');
712  const vid = document.getElementById('dvw-video');
713  const soundHint = document.getElementById('dvw-soundHint');
714
715  const playBtn = document.getElementById('dvw-play');
716  const muteBtn = document.getElementById('dvw-mute');
717  const restartBtn = document.getElementById('dvw-restart');
718  const volRange = document.getElementById('dvw-range');
719
720  const minBtn = document.getElementById('dvw-minBtn');
721  const controls = document.getElementById('dvw-controls');
722
723  // ===== Persistencia =====
724  const MIN_KEY = 'dvw-min';      // '1' | '0'
725  const POSX_KEY = 'dvw-x';       // left px (viewport)
726  const POSY_KEY = 'dvw-y';       // top px  (viewport)
727
728  // ===== Utilidades de posicionamiento =====
729  const MARGIN = 12;
730
731  function clampToViewport(x, y, w, h){
732    const maxX = window.innerWidth  - w - 4;
733    const maxY = window.innerHeight - h - 4;
734    return {
735      x: Math.max(4, Math.min(maxX, x)),
736      y: Math.max(4, Math.min(maxY, y))
737    };
738  }
739
740  function snapToNearestCorner(x, y, w, h){
741    const corners = [
742      {x:MARGIN, y:MARGIN}, // TL
743      {x:window.innerWidth - w - MARGIN, y:MARGIN}, // TR
744      {x:window.innerWidth - w - MARGIN, y:window.innerHeight - h - MARGIN}, // BR
745      {x:MARGIN, y:window.innerHeight - h - MARGIN} // BL
746    ];
747    const cx = x + w/2, cy = y + h/2;
748    let best = corners[0], bestD = Infinity;
749    for(const c of corners){
750      const ccx = c.x + w/2, ccy = c.y + h/2;
751      const d = (ccx-cx)*(ccx-cx) + (ccy-cy)*(ccy-cy);
752      if(d < bestD){ bestD = d; best = c; }
753    }
754    return best;
755  }
756
757  function setDefaultBR(){
758    wrap.style.right = MARGIN + 'px';
759    wrap.style.bottom = MARGIN + 'px';
760    wrap.style.left = 'auto';
761    wrap.style.top = 'auto';
762    localStorage.removeItem(POSX_KEY);
763    localStorage.removeItem(POSY_KEY);
764  }
765
766  function applySavedPosition(){
767    const sx = localStorage.getItem(POSX_KEY);
768    const sy = localStorage.getItem(POSY_KEY);
769    if(sx===null || sy===null){ setDefaultBR(); return; }
770    const w = wrap.offsetWidth || 70, h = wrap.offsetHeight || 70;
771    const {x,y} = clampToViewport(parseInt(sx,10), parseInt(sy,10), w, h);
772    wrap.style.left = x + 'px';
773    wrap.style.top  = y + 'px';
774    wrap.style.right = 'auto';
775    wrap.style.bottom = 'auto';
776  }
777
778  // ===== Restaurar estado =====
779  if(localStorage.getItem(MIN_KEY)==='1') wrap.classList.add('min');
780  applySavedPosition();
781
782  // ===== Helpers de iconos Font Awesome =====
783  const icons = {
784    play: '<i class="fa-solid fa-play"></i>',
785    pause: '<i class="fa-solid fa-pause"></i>',
786    volHigh: '<i class="fa-solid fa-volume-high"></i>',
787    volX: '<i class="fa-solid fa-volume-xmark"></i>',
788    volLow: '<i class="fa-solid fa-volume-low"></i>',
789    restart: '<i class="fa-solid fa-rotate-right"></i>',
790    expand: '<i class="fa-solid fa-up-right-and-down-left-from-center"></i>', // expandir
791    compress: '<i class="fa-solid fa-down-left-and-up-right-to-center"></i>' // minimizar
792  };
793
794  // ===== UI =====
795  function syncUI(){
796    // play/pause
797    playBtn.innerHTML = vid.paused ? icons.play : icons.pause;
798
799    // mute/unmute
800    muteBtn.innerHTML = vid.muted ? icons.volX : icons.volHigh;
801
802    // botón de minimizar/expandir (según estado actual)
803    const isMin = wrap.classList.contains('min');
804    minBtn.innerHTML = isMin ? icons.expand : icons.compress;
805
806    // hint de sonido (solo si está silenciado y no en mini)
807    soundHint.classList.toggle('dvw-hidden', !vid.muted || isMin);
808
809    // controls visibles solo en expandido
810    controls.style.display = isMin ? 'none' : 'flex';
811
812    // ícono del bubble (play siempre)
813    bubble.innerHTML = icons.play;
814  }
815  syncUI();
816
817  // Auto-ocultar controles
818  let hideTimer;
819  function scheduleHide(){
820    if(wrap.classList.contains('min')) return;
821    controls.classList.remove('hide');
822    clearTimeout(hideTimer);
823    hideTimer = setTimeout(()=>
823controls.classList.add('hide'), 2500);
824  }
825  ['mousemove','touchstart'].forEach(ev=>wrap.addEventListener(ev, scheduleHide, {passive:true}));
826  scheduleHide();
827
828  // Controles básicos
829  playBtn.onclick = ()=>{ vid.paused ? vid.play() : vid.pause(); syncUI(); scheduleHide(); };
830  function toggleMute(){
831    vid.muted = !vid.muted;
832    if(!vid.paused && !vid.muted) vid.play().catch(()=>{});
833    syncUI(); scheduleHide();
834  }
835  muteBtn.onclick = toggleMute;  soundHint.onclick = toggleMute;
836
837  restartBtn.onclick = ()=>{ vid.currentTime = 0; vid.play(); syncUI(); scheduleHide(); };
838
839  volRange.oninput = e=>{
840    vid.volume = parseFloat(e.target.value);
841    if(vid.volume>0 && vid.muted){ vid.muted=false; }
842    syncUI(); scheduleHide();
843  };
844
845  vid.onclick = ()=>{ vid.paused ? vid.play() : vid.pause(); syncUI(); scheduleHide(); };
846  ['play','pause','volumechange','ended'].forEach(ev=>vid.addEventListener(ev,()=>syncUI()));
847
848  // Minimizar / Expandir
849  function toggleMin(force){
850    const next = typeof force==='boolean' ? force : !wrap.classList.contains('min');
851    wrap.classList.toggle('min', next);
852    localStorage.setItem(MIN_KEY, next ? '1':'0');
853    if(next){ preview.play().catch(()=>{}); } else { preview.pause(); scheduleHide(); }
854    syncUI();
855  }
856  minBtn.onclick = e=>{ e.stopPropagation(); toggleMin(); };
857  bubble.onclick = e=>{ e.stopPropagation(); toggleMin(false); };
858  bubble.ondblclick = e=>{ e.stopPropagation(); setDefaultBR(); }; // reset rápido
859
860  // Click en el contenedor cuando está minimizado => expandir
861  const dragState = { dragging:false, moved:false, startX:0, startY:0, baseLeft:0, baseTop:0 };
862  wrap.addEventListener('click', ()=>{
863    if(wrap.classList.contains('min') && !dragState.moved) toggleMin(false);
864  });
865  [bubble, wrap].forEach(el=>{
866    el.tabIndex=0;
867    el.onkeydown = ev=>{
868      if(!wrap.classList.contains('min')) return;
869      if(ev.key==='Enter'||ev.key===' '){ ev.preventDefault(); toggleMin(false); }
870    };
871  });
872
873  // Preview mini autoplay
874  preview.muted = true; preview.play().catch(()=>{});
875
876  // ===== DRAG & DROP en AMBOS modos + SNAP =====
877  function canStartDrag(e){
878    // En expandido, no empezar drag desde los controles (botones y range)
879    if(!wrap.classList.contains('min')){
880      if(e.target.closest('#dvw-controls')) return false;
881    }
882    return true;
883  }
884
885  function startDrag(clientX, clientY){
886    if(!canStartDrag(startDrag._event)) return;
887
888    dragState.dragging = true;
889    dragState.moved = false;
890
891    // trabajar siempre con left/top (viewport)
892    const rect = wrap.getBoundingClientRect();
893    dragState.baseLeft = rect.left;
894    dragState.baseTop  = rect.top;
895
896    wrap.style.left = dragState.baseLeft + 'px';
897    wrap.style.top  = dragState.baseTop  + 'px';
898    wrap.style.right = 'auto';
899    wrap.style.bottom = 'auto';
900
901    dragState.startX = clientX;
902    dragState.startY = clientY;
903
904    document.addEventListener('mousemove', onDragMove);
905    document.addEventListener('mouseup', endDrag);
906    document.addEventListener('touchmove', onDragMoveTouch, {passive:false});
907    document.addEventListener('touchend', endDrag);
908  }
909
910  function onDragMove(e){
911    if(!dragState.dragging) return;
912    e.preventDefault();
913    const dx = e.clientX - dragState.startX;
914    const dy = e.clientY - dragState.startY;
915    if(Math.abs(dx)+Math.abs(dy)>3) dragState.moved = true;
916
917    const w = wrap.offsetWidth, h = wrap.offsetHeight;
918    const nx = dragState.baseLeft + dx;
919    const ny = dragState.baseTop  + dy;
920    const clamped = clampToViewport(nx, ny, w, h);
921    wrap.style.left = clamped.x + 'px';
922    wrap.style.top  = clamped.y + 'px';
923  }
924
925  function onDragMoveTouch(e){
926    if(!dragState.dragging) return;
927    e.preventDefault();
928    const t = e.touches[0];
929    const dx = t.clientX - dragState.startX;
930    const dy = t.clientY - dragState.startY;
931    if(Math.abs(dx)+Math.abs(dy)>3) dragState.moved = true;
932
933    const w = wrap.offsetWidth, h = wrap.offsetHeight;
934    const nx = dragState.baseLeft + dx;
935    const ny = dragState.baseTop  + dy;
936    const clamped = clampToViewport(nx, ny, w, h);
937    wrap.style.left = clamped.x + 'px';
938    wrap.style.top  = clamped.y + 'px';
939  }
940
941  function endDrag(){
942    if(!dragState.dragging) return;
943    dragState.dragging = false;
944
945    // Posición actual (viewport)
946    const rect = wrap.getBoundingClientRect();
947    const w = wrap.offsetWidth, h = wrap.offsetHeight;
948
949    // Snap a esquina más cercana
950    const snapped = snapToNearestCorner(rect.left, rect.top, w, h);
951    wrap.style.left = snapped.x + 'px';
952    wrap.style.top  = snapped.y + 'px';
953
954    // Guardar
955    localStorage.setItem(POSX_KEY, Math.round(snapped.x));
956    localStorage.setItem(POSY_KEY, Math.round(snapped.y));
957
958    document.removeEventListener('mousemove', onDragMove);
959    document.removeEventListener('mouseup', endDrag);
960    document.removeEventListener('touchmove', onDragMoveTouch);
961    document.removeEventListener('touchend', endDrag);
962  }
963
964  // Iniciar drag (mouse/touch) — permitimos en ambos modos
965  wrap.addEventListener('mousedown', (e)=>{ startDrag._event = e; startDrag(e.clientX, e.clientY); });
966  wrap.addEventListener('touchstart', (e)=>{
967    startDrag._event = e;
968    const t = e.touches[0];
969    startDrag(t.clientX, t.clientY);
970  }, {passive:false});
971
972  // Evitar que un pequeño drag dispare el "expandir por click" en minimizado
973  wrap.addEventListener('click', (e)=>{
974    if(dragState.moved){ e.stopPropagation(); e.preventDefault(); dragState.moved=false; }
975  }, true);
976
977  // Mantener en pantalla si cambia el tamaño de la ventana y re-snapear
978  window.addEventListener('resize', ()=>{
979    const rect = wrap.getBoundingClientRect();
980    const w = wrap.offsetWidth, h = wrap.offsetHeight;
981    const clamped = clampToViewport(rect.left, rect.top, w, h);
982    const snapped = snapToNearestCorner(clamped.x, clamped.y, w, h);
983    wrap.style.left = snapped.x + 'px';
984    wrap.style.top  = snapped.y + 'px';
985    wrap.style.right = 'auto';
986    wrap.style.bottom = 'auto';
987    localStorage.setItem(POSX_KEY, Math.round(snapped.x));
988    localStorage.setItem(POSY_KEY, Math.round(snapped.y));
989  });
990})();
991
992    

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.