1function construccion(){ 2 alert("En construcción"); 3} 4function filtro_cat(id){ 5 var atributos = $$("items_filtros").getElementsByTagName("input"); 6 var str = ""; 7 for(i=0;i<atributos.length;i++){ 8 9 if(atributos[i]){ 10 if(atributos[i].checked){ 11 str+=atributos[i].value+"-"; 12 //alert(atributos[i].value); 13 } 14 } 15 } 16 $$("filtros").value = str; 17} 18function filtrar(){ 19 var param= $$("filtros").value; 20 var palabra = $$("nombre_archivo").value; 21 var desde = $$("desde").value; 22 var hasta = $$("hasta").value; 23 24 if(desde!=""){ 25 desde = desde.replace(new RegExp('/','g'), "-"); 26 } 27 if(hasta!=""){ 28 hasta = hasta.replace(new RegExp('/','g'), "-"); 29 } 30 if(palabra!=""){ 31 palabra = palabra.replace(new RegExp('/','g'), "-"); 32 } 33 var url = "/documentos/"+escape(palabra)+"|"+escape(desde)+"|"+escape(hasta)+"|"+escape(param)+"/"; 34 window.location = url; 35} 36///////////////////////////////////////////////////////////////////////////////////////////////////////// 37/// UTIL //////////////////////////////////////////////////////////////////////////////////////////////// 38///////////////////////////////////////////////////////////////////////////////////////////////////////// 39 40function expandirIndice(id){ 41 var obj = $("#" + id); 42 if(obj.css("display")=="block"){ 43 obj.slideUp(); 44 }else{ 45 obj.slideDown(); 46 } 47} 48 49function expandir(id,back){ 50 var target = $('#' + id); 51 var back = $('#' + back); 52 if(target.css("display") == "none"){ 53 target.slideDown(); 54 back.css({'-webkit-transform' : 'rotate(-90deg)', 55 '-moz-transform' : 'rotate(-90deg)', 56 '-ms-transform' : 'rotate(-90deg)', 57 'transform' : 'rotate(-90deg)'}); 58 59 }else{ 60 target.slideUp(); 61 back.css({'-webkit-transform' : 'rotate(0deg)', 62 '-moz-transform' : 'rotate(0deg)', 63 '-ms-transform' : 'rotate(0deg)', 64 'transform' : 'rotate(0deg)'}); 65 } 66} 67function expandirUnicoItem(id,back,backClase,clase){ 68 var target = $('#' + id); 69 var back = $('#' + back); 70 var backClase = $("." + backClase); 71 var objClase = $("." + clase); 72 73 if(target.css("display") == "none"){ 74 objClase.slideUp(); 75 backClase.css({'-webkit-transform' : 'rotate(0deg)', 76 '-moz-transform' : 'rotate(0deg)', 77 '-ms-transform' : 'rotate(0deg)', 78 'transform' : 'rotate(0deg)'}); 79 target.slideDown(); 80 back.css({'-webkit-transform' : 'rotate(-90deg)', 81 '-moz-transform' : 'rotate(-90deg)', 82 '-ms-transform' : 'rotate(-90deg)', 83 'transform' : 'rotate(-90deg)'}); 84 85 }else{ 86 target.slideUp(); 87 back.css({'-webkit-transform' : 'rotate(0deg)', 88 '-moz-transform' : 'rotate(0deg)', 89 '-ms-transform' : 'rotate(0deg)', 90 'transform' : 'rotate(0deg)'}); 91 } 92} 93function acordeon(id){ 94 $id = $(id); 95 if ($id.css("display") === "none"){ 96 $id.slideDown(); 97 }else{ 98 $id.slideUp(); 99 } 100} 101function aparecer(id,efecto,estado,tiempo){ 102 if (!efecto) efecto = "fade"; 103 if (!estado) estado = "on"; 104 if (!tiempo) tiempo = 0; 105 106 $id = $(id); 107 if ($id.css("display") === "none" && estado === "on"){ 108 switch (efecto){ 109 case "fade": 110 $id.delay(tiempo).fadeIn(); 111 break; 112 case "slide": 113 $id.delay(tiempo).slideDown(); 114 break; 115 case "show": 116 $id.delay(tiempo).show(); 117 break; 118 } 119 }else{ 120 switch (efecto){ 121 case "fade": 122 $id.delay(tiempo).fadeOut(); 123 break; 124 case "slide": 125 $id.delay(tiempo).slideUp(); 126 break; 127 case "show": 128 $id.delay(tiempo).hide(); 129 break; 130 } 131 132 } 133} 134 135function aparecerUnico(id,clase){ 136 var obj = $("#" + id); 137 var objClase = $("." + clase); 138 if(obj.css("display")!="block"){ 139 objClase.slideUp(); 140 obj.slideDown(); 141 } 142} 143 144function filtrado(id,clase){ 145 var obj = $(id); 146 var objClase = $("." + clase); 147 objClase.hide(); 148 obj.show(); 149} 150 151function intercambioTexto(id,textoOriginal,textoCambio){ 152 id = $("#" + id); 153 154 if(id.html()==textoOriginal){ 155 id.html(textoCambio); 156 }else{ 157 id.html(textoOriginal); 158 } 159} 160 161 162 163 164// REDIRECCIONAR SELECT 165function listLink(t){ 166 var $url = t.val(); 167 $(location).attr('href',$url); 168 document.location = $url; 169} 170function enlace(id,target){ 171 if (!target) target="_self"; 172 var $url = id; 173 document.location = $url; 174} 175 176function activarToolsJQ(){ 177 $('.form_tool').each(function(){ 178 var img_ay=$(this).attr('id'); 179 $("img#"+img_ay).easyTooltip({ 180 useElement: img_ay+"_txt", 181 tooltipId: "tool_tip_jq" 182 }); 183 }); 184} 185function $$(id){ 186 return document.getElementById(id); 187} 188function paginar(url,id,url_a){ 189 window.location = url+id+url_a; 190} 191function esEmail(email) { 192 var str = email; 193 var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/; 194 if (!str.match(re)) { 195 return false; 196 } else { 197 return true; 198 } 199} 200function trim(str){ 201 return str.replace(/^\s*|\s*$/g,""); 202} 203function esVacio(texto,etiqueta){ 204 var error=""; 205 if(texto==""){ 206 error+= "- <b>"+et[etiqueta]+"</b> "+et["msg_form_es_requerido"]+".<br>"; 207 } 208 return error; 209} 210function aleatorio(inferior,superior){ 211 numPosibilidades = superior - inferior 212 aleat = Math.random() * numPosibilidades 213 aleat = Math.round(aleat) 214 return parseInt(inferior) + aleat 215} 216function abrirVentana(url,nombre,anchoV,altoV) { 217 var ancho=screen.width; 218 var alto=screen.height; 219 var pos = (ancho-anchoV)/2; 220 var vtn = window.open(url,nombre,'scrollbars=yes,width='+anchoV+',height='+altoV+',top=200,left='+pos); 221} 222function asterisco(campo){ 223 var cont = campo.length; 224 var aster = ""; 225 for(i=0;i<cont;i++){ aster+="*";} 226 return aster; 227} 228function abrirVentana2(url,target) { 229 if(!target){ 230 target="_top"; 231 } 232 window.open(url,target); 233} 234function irUrl(url,target) { 235 if(!target){ 236 target="_top"; 237 } 238 window.open(url,target); 239} 240function MM_openBrWindow(theURL,winName,features) { //v2.0 241 window.open(theURL,winName,features); 242} 243function getMensaje(mensaje){ 244 var msg_obj = document.getElementById("mensaje"); 245 var msg=""; 246 if(msg_obj){ 247 msg+="<div class=\"mensaje\">"+mensaje+"</div>"; 248 msg_obj.innerHTML = msg; 249 } 250} 251function getMensaje_2(id,texto,titulo,tipo,tam){
252 var msg = $$(id); 253 msg.style.display = "block"; 254 var txt = ""; 255 var tit = $$(id+"_titulo"); 256 if(titulo){ 257 txt+="<span class=\"titulo_16\"><strong>"+titulo+"</strong></span><br><br>"; 258 } 259 txt+=texto; 260 $$(id+"_texto").innerHTML = txt; 261} 262function validarTexto(id,cant){ 263 var permitidos = cant; 264 if(document.getElementById(id)){ 265 var str = document.getElementById(id).value.length; 266 var contenido = document.getElementById(id).value; 267 var contenido = contenido.substring(0,cant); 268 if(str>permitidos){ 269 document.getElementById(id).value = contenido; 270 }else{ 271 contenido = document.getElementById(id).value; 272 } 273 } 274} 275 276 277/////////////////////////////////////////////////////////////////////////////////////////// 278// AJAX /////////////////////////////////////////////////////////////////////////////////// 279/////////////////////////////////////////////////////////////////////////////////////////// 280 281function Ajax(){ 282 var xmlhttp=false; 283 try { 284 xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 285 } catch (e) { 286 try { 287 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 288 } catch (E) { 289 xmlhttp = false; 290 } 291 } 292 if (!xmlhttp && typeof XMLHttpRequest!='undefined') { 293 xmlhttp = new XMLHttpRequest(); 294 } 295 return xmlhttp; 296} 297 298//////////////////////////////////////////////////////////////////////////////////////////////// 299/// BUSCADORES ///////////////////////////////////////////////////////////////////////////////// 300//////////////////////////////////////////////////////////////////////////////////////////////// 301 302function set_buscar(event){ 303 304 var key = event.keyCode; 305 306 if(key==13){ 307 buscar(); 308 } 309} 310function buscar(){ 311 var criterio = "noticia"; 312 313 if($$("criteriod").checked){ 314 criterio = "documento"; 315 } 316 if($$("criterioj").checked){ 317 criterio = "jugador"; 318 } 319 var palabra = escape($$("claveb").value); 320 var url = "/home/"; 321 switch(criterio){ 322 case "noticia": 323 url="/buscar/"+palabra+"/"; 324 break; 325 case "documento": 326 url="/documentos/"+palabra+"|||/"; 327 break; 328 case "jugador": 329 url="/historico-jugadores/1/----"+palabra+"-0/"; 330 break; 331 } 332 333 document.location = url; 334} 335//////////////////////////////////////////////////////////////////////////////////////////////// 336/// SUSCRIPCION //////////////////////////////////////////////////////////////////////////////// 337//////////////////////////////////////////////////////////////////////////////////////////////// 338function suscripcion(){ 339 resetVtn(); 340 getPopUp("vtn","",430,410); 341 $$("vtn_titulo").innerHTML ="Suscripción"; 342 var ajax = Ajax(); 343 ajax.open("GET","/suscripcion.php?r="+Math.random(),true); 344 ajax.onreadystatechange = function(){ 345 if(ajax.readyState==4){ 346 $$("vtn_cargador").style.display = "none"; 347 $$("vtn_mostrar").style.display = "block"; 348 $$("vtn_mostrar").innerHTML = ajax.responseText; 349 } 350 } 351 ajax.send(null); 352} 353function enviarSuscripcionSimple(){ 354 var email = $$("sus_emial_ac").value; 355 // var nombre = $$("sus_nombre_ac").value; 356 var nombre = ""; 357 var er = ""; 358 // if(nombre==""){er+= "- Ingrese su <b>Nombre</b>.<br>";} 359 if(email==""){ 360 er+= "- Ingrese su <b>E-mail</b>.<br>"; 361 }else{ 362 if(!esEmail(email)){ 363 er+= "- Su <b>E-mail</b> debe ser una dirección de correo correcta.<br>"; 364 } 365 } 366 if(er!=""){ 367 $$("msg_simple").style.display = "block"; 368 $$("msg_simple").innerHTML = er; 369 }else{ 370 $$("msg_simple").style.display = "none"; 371 $$("msg_simple").innerHTML = ""; 372 // $$("sus_nombre_ac").value =""; 373 $$("sus_emial_ac").value =""; 374 resetVtn(); 375 getPopUp("vtn","",650,410); 376 $$("vtn_titulo").innerHTML ="Suscribite a nuestros NEWSLETTERS"; 377 $$("vtn_cargador").style.display = "block"; 378 $$("vtn_mostrar").style.display = "none"; 379 $$("vtn_mostrar").innerHTML=""; 380 $$("vtn_texto_cargador").innerHTML = "Enviando...aguarde."; 381 var ajax = Ajax(); 382 // var valores="enviar_suscripcion_simple=1&email="+email; 383 var valores="enviar_suscripcion_simple=1&nombre="+nombre+"&email="+email; 384 ajax.open("POST","/suscripcion.php?r="+Math.random(),true); 385 ajax.onreadystatechange = function(){ 386 if(ajax.readyState==4){ 387 $$("vtn_cargador").style.display = "none"; 388 $$("vtn_mostrar").style.display = "block"; 389 $$("vtn_mostrar").innerHTML="<div class=\"mensaje\">"+ajax.responseText+"</div>"; 390 } 391 } 392 ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 393 ajax.send(valores); 394 } 395} 396 397function enviarSuscripcion(){ 398 var nombre = $$("sus_nombre").value; 399 var email = $$("sus_email").value; 400 var codigo = $$("CodigoSus").value; 401 var er = ""; 402 if(nombre==""){er+= "- Ingrese su <b>Nombre</b>.<br>";} 403 if(email==""){er+= "- Ingrese su <b>E-mail</b>.<br>";} 404 else{
405 if(!esEmail(email)){ 406 er+= "- Su <b>E-mail</b> debe ser una dirección de correo correcta.<br>"; 407 } 408 } 409 if(codigo==""){er+="- Ingrese el <b>Código de Seguridad</b> que se visualiza en la imagen.<br/>";} 410 if(er!=""){ getMensaje_2("mensaje_ajax",er,"Ingreso incorrecto","error",300); 411 }else{ 412 $$("vtn_cargador").style.display = "block"; 413 $$("vtn_mostrar").style.display = "none"; 414 $$("vtn_mostrar").innerHTML=""; 415 $$("vtn_texto_cargador").innerHTML = "Enviando...aguarde."; 416 var ajax = Ajax(); 417 var valores="enviar_suscripcion=1&codigo="+codigo+"&nombre="+nombre+"&email="+email; 418 ajax.open("POST","/suscripcion.php?r="+Math.random(),true); 419 ajax.onreadystatechange = function(){ 420 if(ajax.readyState==4){ 421 $$("vtn_cargador").style.display = "none"; 422 $$("vtn_mostrar").style.display = "block"; 423 $$("vtn_mostrar").innerHTML=ajax.responseText; 424 } 425 } 426 ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 427 ajax.send(valores); 428 } 429} 430 431//////////////////////////////////////////////////////////////////////////////////////////////// 432/// CONTACTO /////////////////////////////////////////////////////////////////////////////////// 433//////////////////////////////////////////////////////////////////////////////////////////////// 434function contacto(codigo,aviso){ 435 if(!codigo){ 436 codigo = ""; 437 } 438 if(!aviso){ 439 aviso = ""; 440 } 441 resetVtn(); 442 getPopUp("vtn","",530,500); 443 if(codigo){ 444 $$("vtn_titulo").innerHTML = "Consultar"; 445 }else if(aviso){ 446 $$("vtn_titulo").innerHTML = "Contactar al autor de este aviso"; 447 }else{ 448 $$("vtn_titulo").innerHTML = "Contacto"; 449 } 450 var ajax = Ajax(); 451 ajax.open("GET","/contacto.php?r="+Math.random(),true); 452 ajax.onreadystatechange = function(){ 453 if(ajax.readyState==4){ 454 $$("vtn_cargador").style.display = "none"; 455 $$("vtn_mostrar").style.display = "block"; 456 $$("vtn_mostrar").innerHTML = ajax.responseText; 457 if(codigo!=""){ 458 var msg = "Deseo consultar sobre el artículo código: "+codigo+"."; 459 $$("contacto_mensaje").value = msg; 460 $$("contacto_tipo").value = "Consulta"; 461 $$("codigo_articulo").value = codigo; 462 } 463 if(aviso!=""){ 464 $$("id_aviso").value = aviso; 465 } 466 } 467 } 468 ajax.send(null); 469} 470function enviarContactoAmpliado(){ 471 472 var nombre = escape($$("contacto_nombre").value); 473 var email = $$("contacto_email").value; 474 var telefono = $$("contacto_telefono").value; 475 var mensaje = $$("contacto_mensaje").value; 476 var codigo = $$("g-recaptcha-response").value; 477 478 var er = ""; 479 if(nombre==""){er+="- Ingrese su <b>Nombre</b>.<br/>";} 480 if(email==""){er+= "- Ingrese su <b>E-mail</b>.<br/>"; 481 }else{ 482 if(!esEmail(email)){ 483 er+= "Su <b>E-mail</b> debe ser una dirección de correo correcta.<br/>"; 484 } 485 } 486 if(mensaje==""){er+="- Ingrese su <b>Mensaje</b>.<br/>";} 487 if(codigo==""){er+="- Marque NO soy un robot.<br/>";} 488 if(er!=""){ 489 $('html, body').animate({ 490 scrollTop: $("#top_msg").offset().top-125 491 }, 1000); 492 getMensaje_2("mensaje",er,"Ingreso incorrecto","error",200); //alert(er); 493 }else{ 494 document.contacto.submit(); 495 } 496} 497 498// POP UPS /////////////////////////////////////////////////////////////////////////////////////////////////// 499function resetVtn(){ 500 $$("vtn_cargador").style.display = "block"; 501 $$("vtn_cont_cerrar").style.display = "block"; 502 $$("vtn_cont_titulo").style.display = "block"; 503 $$("vtn_mostrar").innerHTML = ""; 504 $$("vtn_mostrar").style.display = "none"; 505 $$("vtn_texto_cargador").innerHTML = "Cargando..."; 506 $$("vtn_titulo").innerHTML = ""; 507} 508function deletePopUp(id){ 509 var inst = $('[data-remodal-id=' + id + ']').remodal(); 510 inst.close(); 511} 512function getPopUp(id,zindex,anchoPopUp,altoPopUp){ 513 var inst = $('[data-remodal-id=' + id + ']').remodal(); 514 $('[data-remodal-id=' + id + ']').css("max-width", anchoPopUp); 515 inst.open(); 516} 517 518/////////////////////////////////////////////////////////////////////////////////// 519// VENTANAS /////////////////////////////////////////////////////////////////////// 520/////////////////////////////////////////////////////////////////////////////////// 521function vtnCargador(texto){ 522 var carga="<div style=\"text-align:center;width:auto;margin:20px auto;\">"; 523 carga+="<img src=\"/imagenes/img_presentacion/cargador.gif\" width=\"15\" height=\"15\" align=\"top\"><br><br>"+texto+"</div>"; 524 return carga; 525} 526 527function generarCodigo(){ 528 var ajax = Ajax();
529 ajax.open("GET","/ajax_misc.php?generar_codigo=1",true); 530 ajax.onreadystatechange=function() { 531 if (ajax.readyState==4) { 532 document.getElementById("ajax_codigo").innerHTML = ajax.responseText 533 } 534 } 535 ajax.send(null); 536} 537 538/////////////////////////////////////////////////////////////////////////////////// 539// MENSJAE //////////////////////////////////////////////////////////////////////// 540/////////////////////////////////////////////////////////////////////////////////// 541 542function vtnMensaje(mensaje){ 543 var vtn = document.getElementById("ventana_mensaje"); 544 var msg = document.getElementById("msg_mensaje"); 545 if(vtn.style.visibility == "hidden"){; 546 vtn.style.display = "block"; 547 vtn.style.visibility = "visible"; 548 msg.className = "ventana_ajax_mensaje"; 549 msg.innerHTML = mensaje; 550 }else{ 551 vtn.style.display = "none"; 552 vtn.style.visibility = "hidden"; 553 msg.className = "ventana_ajax_mensaje_vacio"; 554 msg.innerHTML = ""; 555 } 556} 557 558 559function expandirUnico(id,clase){ 560 var obj = $("#" + id); 561 var objClase = $("." + clase); 562 if(obj.css("display")=="block"){ 563 obj.slideUp(); 564 }else{ 565 objClase.slideUp(); 566 obj.slideDown(); 567 } 568} 569 570//FUNCION PARA MOSTRAR EL MENU CATALOGO FIJO 571$(document).ready(function() { 572 fijarMenu(); 573 $( window ).resize(function() { 574 fijarMenu(); 575 }); 576}); 577 578function fijarMenu(){ 579 if($(".cabeZ").length > 0) { 580 var elemento = $('.cabeZ'); 581 // var altoMenu = elemento.parent().height(); 582 var showMenu = elemento.position().top; 583 584 $(window).scroll(function(){ 585 if ($(this).scrollTop() > showMenu && $(window).width()> 1024) { 586 elemento.addClass("fijar").fadeIn(100); 587 // elemento.parent().css("height",altoMenu); 588 // elemento.find("div.linea-lc").removeClass("linea_cabezal"); 589 } else { 590 elemento.removeClass("fijar").fadeIn(100); 591 // elemento.parent().css("height","auto"); 592 // elemento.find("div.linea-lc").addClass("linea_cabezal"); 593 } 594 }); 595 } 596} 597 598function afix(elemento,pie,ajuste,ajustePie,resp,modo){ 599 if(!ajuste){ajuste=0;} 600 if(!ajustePie){ajustePie=0;} 601 if(!resp){resp=0;} 602 if(!modo){modo="inf";} 603 elemento = $(elemento); 604 pie = $(pie); 605 var altoMenu = elemento.height(); 606 var showMenu = elemento.parent().position().top; 607 var anchoPadreMenu = elemento.parent().width(); 608 var positionPie = pie.position().top; 609 610 $(window).scroll(function(){ 611 if ($(this).scrollTop() > showMenu-ajuste && $(window).width()> resp) { 612 elemento.parent().css("height",altoMenu); 613 elemento.css("width",anchoPadreMenu); 614 elemento.addClass("fijar position-top z5").fadeIn(100); 615 elemento.css("margin-top",ajuste); 616 if(modo!="inf"){ 617 if ($(this).scrollTop() >= positionPie-altoMenu-ajuste) { 618 elemento.removeClass("fijar position-top z5"); 619 elemento.css("margin-top",positionPie-showMenu-altoMenu-ajustePie); 620 } 621 } 622 } else { 623 elemento.parent().css("height","auto"); 624 elemento.css("width","auto"); 625 elemento.removeClass("fijar position-top z5"); 626 elemento.css("margin-top",0); 627 } 628 }); 629} 630 631function afixClase(elemento,pie,ajuste,ajustePie,resp,modo){ 632 if(!ajuste){ajuste=0;} 633 if(!ajustePie){ajustePie=0;} 634 if(!resp){resp=0;} 635 if(!modo){modo="inf";} 636 elemento = $(elemento); 637 pie = $(pie); 638 var altoMenu = elemento.height(); 639 var showMenu = elemento.parent().position().top; 640 var anchoPadreMenu = elemento.parent().width(); 641 var positionPie = pie.position().top; 642 if(modo=="bot"){showMenu+=showMenu;} 643 644 $(window).scroll(function(){ 645 if ($(this).scrollTop() > showMenu-ajuste && $(window).width()> resp) { 646 elemento.parent().css("height",altoMenu); 647 elemento.css("width",anchoPadreMenu); 648 elemento.addClass("cont-fijo").fadeIn(100); 649 elemento.css("margin-top",ajuste); 650 if(modo!="inf"){ 651 if ($(this).scrollTop() >= positionPie-altoMenu-ajuste) { 652 elemento.removeClass("cont-fijo"); 653 elemento.css("margin-top",positionPie-showMenu-altoMenu-ajustePie); 654 } 655 } 656 } else { 657 elemento.parent().css("height","auto"); 658 elemento.css("width","auto"); 659 elemento.removeClass("cont-fijo"); 660 elemento.css("margin-top",0); 661 } 662 }); 663} 664 665// CAMBIA LA LISTA DE PRODUCTOS 666// clase1 - Clase controlador de LISTADO 667// clase2 - Clase controlador de CUADROS 668// id - CONTENEDOR a cambiar clase 669function cambiarClase(clase1,clase2,id){ 670 if(id.hasClass(clase1)){ 671 id.removeClass(clase1); 672 id.addClass(clase2); 673 } 674 verificarLista(id,$("#bloque"),$("#lista")); 675} 676// VERIFICA QUE MODO ESTA ACTIVO EN LA LISTA DE PRODUCTOS 677// id - Valida que clase tiene 678// btn1 - si CUADROS esta activo 679// btn2 - si LISTADO esta activo 680function verificarLista(id,btn1,btn2){ 681 if(id.hasClass("bloque")){ 682 btn1.addClass("activo"); 683 btn2.removeClass("activo"); 684 } 685 if(id.hasClass("lista")){ 686 btn2.addClass("activo"); 687 btn1.removeClass("activo"); 688 } 689} 690function switchClases(elemento,agregarClase,removerClase, estado) { 691 if(!estado) 692 estado=false; 693 if(estado == true){ 694 elemento.toggleClass( removerClase + " " + agregarClase, 1000, "easeInOutQuad"); 695 }else{ 696 elemento.switchClass( removerClase, agregarClase, 1000, "easeInOutQuad" ); 697 } 698} 699function agregoClaseUnico(id,elementos,clase) { 700 id = $(id); 701 elementos = $(elementos); 702 if(!id.hasClass(clase)){ 703 elementos.removeClass(clase); 704 id.addClass(clase); 705 } 706} 707 708function quitarAgregarClase($id,$clase,$estado) { 709 // console.log($estado); 710 if (typeof($estado) !== "undefined") $estado = true; 711 $id = $($id); 712 // console.log($estado); 713 if ($estado) 714 $id.addClass($clase); 715 else
716 $id.removeClass($clase); 717} 718 719function obtenerHash(){ 720 var URLhash = window.location.hash; 721 return URLhash.replace("#", ""); 722} 723 724// MENU TABS 725function verTab(id,clase,titulo){ 726 var obj = $("#" + id); 727 var objClase = $("." + clase); 728 if(obj.css("display")!="block"){ 729 objClase.hide(); 730 $(".titulo-tab").removeClass("activo"); 731 titulo.addClass("activo"); 732 obj.fadeIn(); 733 } 734} 735function scrollto(id,ajuste){ 736 if(!ajuste) 737 ajuste = -160; 738 739 $('html, body').animate({ 740 scrollTop: $(id).offset().top+ajuste 741 }, 1000); 742} 743function set_cant(id){ 744 var val = $$(id).value; 745 if(val!=""){ 746 if(isNaN(val)){ 747 $$(id).value = 1; 748 }else{ 749 if(val<=0){ 750 $$(id).value = 1; 751 } 752 } 753 } 754} 755function incrementers(actual,id){ 756 actual = $(actual); 757 var valorAnterior = $(id).val(); 758 if(valorAnterior==""){valorAnterior=1;} 759 if (actual.val() == "+") { 760 var valorActual = parseFloat(valorAnterior) + 1; 761 } else { 762 if (valorAnterior > 1) { 763 var valorActual = parseFloat(valorAnterior) - 1; 764 } else { 765 valorActual = 1; 766 } 767 } 768 $(id).val(valorActual); 769} 770function deschequearFiltrado(id){ 771 id = $("[data-id='" + id + "']"); 772 id.prop("checked", false); 773} 774 775function mostrarLateral(id,estado){ 776 id = $(id); 777 var ancho = id.outerWidth(); 778 if(estado){ 779 id.css("right",0); 780 }else{ 781 id.css("right",-ancho-100); 782 } 783} 784$(document).keyup(function(e) { 785 if($("#menu_lateral_fondo").css("display")!="none"){ 786 if (e.keyCode === 27) { 787 aparecer('#menu_lateral_fondo'); 788 mostrarLateral('#menu_lateral',false); 789 } 790 } 791}); 792function getMensajeConsulta(id,titulo,texto){ 793 if($$(id)){ 794 $$(id).style.display = "block"; 795 $$(id).innerHTML = texto; 796 } 797} 798function enfocarInput(id){ 799 $(id).focus(); 800} 801 802 803function encodeURLTwitter(clase) { 804 clase = $(clase); 805 var texto = clase.data('titulo'); 806 url = clase.attr('href'); 807 texto = encodeURIComponent(texto); 808 url = url.split('&text='); 809 var urlCompleta = url[0] + "&text=" + texto + url[1]; 810 clase.attr('href', urlCompleta); 811} 812 813function twitURL(clase){ 814 clase = $(clase); 815 if(clase.length > 0) { 816 clase.each(function() { 817 if ($( this ).attr("data-titulo")) { 818 encodeURLTwitter($( this )); 819 $( this ).removeAttr("data-titulo"); 820 } 821 }); 822 } 823} 824 825//////////////////////////////////////////// 826// NUEVOS AUF 827////////////////////////////////////////// 828function get_partidos_jugados(categoria,jugador,tipo,filtro){ 829 //alert(tipo); 830 if(tipo=="goles"){ 831 $$("filtrop").style.display="none"; 832 $$("estadisticas").style.display="none"; 833 if($$("todoslosGoles")){$$("todoslosGoles").style.display="inline-block";} 834 $$("todoslosPartidos").className = "opcion"; 835 }else if(tipo=="paises"){ 836 $$("filtrop").style.display="block"; 837 $$("estadisticas").style.display="none"; 838 if($$("todoslosGoles")){$$("todoslosGoles").style.display="none";} 839 $$("todoslosPartidos").className = "opcion"; 840 }else{ 841 $$("filtrop").style.display="block"; 842 $$("estadisticas").style.display="block"; 843 if($$("todoslosGoles")){$$("todoslosGoles").style.display="inline-block";} 844 $$("todoslosPartidos").className = "opcion activo"; 845 if($$("todoslosGoles")){$$("todoslosGoles").className = "opcion";} 846 } 847 if(tipo=="b"){ 848 $$("filtros_a1").style.display="none"; 849 $$("filtros_a2").style.display="none"; 850 $$("filtros_a3").style.display="block"; 851 $$("filtros_a4").style.display="inline-block"; 852 }else{ 853 $$("filtros_a1").style.display="block"; 854 $$("filtros_a2").style.display="inline-block"; 855 $$("filtros_a3").style.display="none"; 856 $$("filtros_a4").style.display="none"; 857 } 858 var ajax = Ajax(); 859 $$("cargador_partidos").style.display = "block"; 860 $$("partidos").style.display = "none"; 861 862 var valores = "categoria="+categoria+"&jugador="+jugador+"&tipo="+tipo+"&filtro="+filtro; 863 ajax.open("POST","/ajax_jugador_partidos.php?r="+Math.random(),true); 864 ajax.onreadystatechange = function(){ 865 if(ajax.readyState==4){ 866 $$("cargador_partidos").style.display = "none"; 867 $$("partidos").innerHTML = ajax.responseText; 868 $$("partidos").style.display = "block"; 869 if($$("cant_partidos_ajax")){ 870 $$("cant_partidos").innerHTML = $$("cant_partidos_ajax").innerHTML; 871 } 872 } 873 } 874 ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 875 ajax.send(valores); 876} 877function filtrar_partidos(cat){ 878 var fecha1 = $$("desde").value; 879 var fecha2 = $$("hasta").value; 880 var pais = $$("pais").value 881 var tipo = $$("tagsinput").value; 882 883 if(tipo!=""){ 884 tipo = tipo.replace(/,/gi,'_'); 885 } 886 887 if(fecha1!=""){ 888 fecha1 = fecha1.replace(/\//gi,'_'); 889 } 890 if(fecha2!=""){ 891 fecha2 = fecha2.replace(/\//gi,'_'); 892 } 893 var v = fecha1+"-"+fecha2+"-"+escape(tipo)+"-"+pais+"-0";
894 var url = "/historico-partidos/"+cat+"/"+v+"/"; 895 document.location= url; 896} 897function filtrar_torneos(cat){ 898 var tipo = $$("tipo").value; 899 var v = tipo 900 var url = "/historico-torneos/"+cat+"/"+v+"/"; 901 document.location= url; 902} 903function filtrar_jugadores(cat){ 904 905 var fecha1 = $$("desde").value; 906 var fecha2 = $$("hasta").value; 907 var tipo = $$("tagsinput").value; 908 var palabra = $$("nombre").value; 909 var rival = $$("rival").value; 910 911 if(fecha1!=""){ 912 fecha1 = fecha1.replace(/\//gi,'_'); 913 } 914 if(fecha2!=""){ 915 fecha2 = fecha2.replace(/\//gi,'_'); 916 } 917 if(tipo!=""){ 918 tipo = tipo.replace(/,/gi,'_'); 919 } 920 var v = "-"+fecha1+"-"+fecha2+"-"+escape(tipo)+"-"+escape(palabra)+"-0"+"-"+rival; 921 var url = "/historico-jugadores/"+cat+"/"+v+"/"; 922 document.location= url; 923} 924function filtrar_tecnicos(cat){ 925 var fecha1 = $$("desde").value; 926 var fecha2 = $$("hasta").value; 927 var tipo = $$("tagsinput").value; 928 var palabra = $$("nombre").value; 929 var rival = $$("rival").value; 930 if(fecha1!=""){ 931 fecha1 = fecha1.replace(/\//gi,'_'); 932 } 933 if(fecha2!=""){ 934 fecha2 = fecha2.replace(/\//gi,'_'); 935 } 936 if(tipo!=""){ 937 tipo = tipo.replace(/,/gi,'_'); 938 } 939 var v = "-"+fecha1+"-"+fecha2+"-"+escape(tipo)+"-"+escape(palabra)+"-0"+"-"+rival; 940 var url = "/historico-tecnicos/"+cat+"/"+v+"/"; 941 document.location= url; 942} 943function get_fixture(id){ 944 var ajax = Ajax(); 945 ajax.open("GET","/url.php?id=ajaxapp&id_fixture="+id+"&r="+Math.random(),true); 946 ajax.onreadystatechange = function(){ 947 if(ajax.readyState==4){ 948 //alert(ajax.responseText); 949 if(trim(ajax.responseText)!=""){ 950 $$("fixture_cont").innerHTML = ajax.responseText; 951 $$("fixtureid").style.display = "block"; 952 } 953 } 954 } 955 ajax.send(null); 956} 957function get_fixture_home(){ 958 959 if($$("fixturehomeid")){ 960 for(i=0;i<selecciones.length;i++){ 961 var sel = selecciones[i]; 962 var para = document.createElement("div"); 963 para.id = "sel"+sel; 964 $$("fixturehomeid"+sel).appendChild(para); 965 } 966 967 for(i=0;i<selecciones.length;i++){ 968 var sel = selecciones[i]; 969 get_fixture_home_item(sel); 970 } 971 } 972 973 if($$("fixturenoticiaid")){ 974 for(i=0;i<selecciones.length;i++){ 975 var sel = selecciones[i]; 976 var para = document.createElement("div"); 977 para.id = "sel"+sel; 978 $$("fixturenoticiaid").appendChild(para); 979 } 980 981 for(i=0;i<selecciones.length;i++){ 982 var sel = selecciones[i]; 983 get_fixture_home_item(sel); 984 } 985 } 986} 987 988 989function get_fixture_home_item(id){ 990 if($$("fixturehomeid")){ 991 var ajax = Ajax(); 992 ajax.open("GET","/url.php?id=ajaxapp&id_fixture_home="+id+"&r="+Math.random(),true); 993 ajax.onreadystatechange = function(){ 994 if(ajax.readyState==4){ 995 996 $$("sel"+id).innerHTML = ajax.responseText; 997 iframeResponsiveNoticias(); 998 999 // SLIDERS 1000 var swiper = new Swiper('.slide-3col-simple', { 1001 grabCursor: true, 1002 autoplay: false, 1003 effect: 'slide', 1004 spaceBetween: 20, 1005 slidesPerView: 3, 1006 autoHeight: false, 1007 preloadImages: true, 1008 lazy: true, 1009 navigation: { 1010 nextEl: '.flecha-3col-next', 1011 prevEl: '.flecha-3col-prev', 1012 }, 1013 breakpoints: { 1014 780: { 1015 slidesPerView: 3, 1016 spaceBetween: 15 1017 }, 1018 580: { 1019 slidesPerView: 2, 1020 spaceBetween: 10 1021 }, 1022 480: { 1023 spaceBetween: 15, 1024 // centeredSlides: true, 1025 slidesPerView: 1.5 1026 } 1027 } 1028 }); 1029 1030 if($('.slider-fechas1-contenido_'+ id).length > 0) { 1031 // FECHA FIXTURE 1032 var fechaActualSeleccion = $('.slider-fechas1-contenido_'+ id).data('fecha'); 1033 // console.log("fechaActualSeleccion " + fechaActualSeleccion); 1034 // FECHA FIXTURE 1035 1036 // console.log('.slider-fechas1-contenido_'+ id); 1037 var fechaContenidox = new Swiper('.slider-fechas1-contenido_'+ id, { 1038 loop:true, 1039 observer: true, 1040 observeParents: true, 1041 touchRatio: 0.2, 1042 // initialSlide: fechaActualSeleccion, 1043 slideToClickedSlide: true, 1044 grabCursor: false, 1045 slidesPerView: "auto", 1046 watchSlidesVisibility: true, 1047 watchSlidesProgress: true, 1048 navigation: { 1049 nextEl: '.flecha-fecha-next', 1050 prevEl: '.flecha-fecha-prev', 1051 }, 1052 on: { 1053 slideChange: function () { 1054 // console.log("this.realIndex: " + this.realIndex); 1055 if($$("fixdescc_"+id+"_"+this.realIndex)){ 1056 var desc = $$("fixdescc_"+id+"_"+this.realIndex).innerHTML; 1057 var nombre= $$("fixnomc_"+id+"_"+this.realIndex).innerHTML; 1058 var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: ''); 1059 var url = full+"/pdfs/"+desc 1060 //$$("boton_descargac_"+id).href=url; 1061 $$("boton_descargac_"+id).href="javascript:imprimir_pantalla('FIXTURE','"+desc+"', '"+desc+"',800,
1061600);"; 1062 1063 if($$("boton_descargac_twitter_"+id)){ 1064 $$("boton_descargac_twitter_"+id).href= "https://twitter.com/intent/tweet?text=Descargar Fixture "+nombre+" - "+url; 1065 } 1066 if($$("boton_descargac_facebook_"+id)){ 1067 $$("boton_descargac_facebook_"+id).href="https://www.facebook.com/sharer/sharer.php?u="+url; 1068 } 1069 if($$("boton_descargac_wsa_"+id)){ 1070 $$("boton_descargac_wsa_"+id).href="https://wa.me/?text=Descargar Fixture "+nombre+" - "+url; 1071 } 1072 } 1073 }, 1074 transitionStart: function () { 1075 if($$("fixdescc_"+id+"_"+this.realIndex)){ 1076 var desc = $$("fixdescc_"+id+"_"+this.realIndex).innerHTML; 1077 var nombre= $$("fixnomc_"+id+"_"+this.realIndex).innerHTML; 1078 // console.log("existe fixdescc_"+id+"_"+this.realIndex); 1079 1080 var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: ''); 1081 var url = full+"/pdfs/"+desc 1082 //$$("boton_descargac_"+id).href=url; 1083 $$("boton_descargac_"+id).href="javascript:imprimir_pantalla('FIXTURE','"+desc+"', '"+desc+"',800,600);"; 1084 1085 if($$("boton_descargac_twitter_"+id)){ 1086 $$("boton_descargac_twitter_"+id).href= "https://twitter.com/intent/tweet?text=Descargar Fixture "+nombre+" - "+url; 1087 } 1088 if($$("boton_descargac_facebook_"+id)){ 1089 $$("boton_descargac_facebook_"+id).href="https://www.facebook.com/sharer/sharer.php?u="+url; 1090 } 1091 if($$("boton_descargac_wsa_"+id)){ 1092 $$("boton_descargac_wsa_"+id).href="https://wa.me/?text=Descargar Fixture "+nombre+" - "+url; 1093 } 1094 } 1095 }, 1096 }, 1097 }); 1098 1099 var idFechaActual1 = $(".slider-fechas1-contenido_" + id).data("fecha"); 1100 fechaContenidox.slideTo(idFechaActual1); 1101 } 1102 1103 var cantCalendario = parseInt($$("selcal"+id).innerHTML); 1104 1105 var calendarioTitulo = new Swiper('.slider_calendario_titulo'+id, { 1106 observer: true, 1107 observeParents: true, 1108 initialSlide: 2, 1109 autoplay: false, 1110 navigation: { 1111 nextEl: '.flecha-calendario-next', 1112 prevEl: '.flecha-calendario-prev', 1113 } 1114 }); 1115 var calendarioContenido = new Swiper('.slider_calendario_contenido'+id, { 1116 observer: true, 1117 observeParents: true, 1118 autoHeight: true, 1119 initialSlide: 2, 1120 autoplay: false, 1121 touchRatio: 0.2, 1122 slideToClickedSlide: true, 1123 grabCursor: false, 1124 slidesPerView: "auto", 1125 watchSlidesVisibility: true, 1126 watchSlidesProgress: true 1127 }); 1128 if(calendarioTitulo.controller){ 1129 calendarioTitulo.controller.control = calendarioContenido; 1130 } 1131 if(calendarioContenido.controller){ 1132 calendarioContenido.controller.control = calendarioTitulo; 1133 } 1134 $("#tab_calendario"+id).click(function (){ 1135 setTimeout(function(){ 1136 calendarioTitulo.slideTo(cantCalendario); 1137 calendarioContenido.slideTo(cantCalendario); 1138 }, 300); 1139 }); 1140 1141 // CUATRO VERTICAL 1142 var swiperVertical = new Swiper('.slide-vertical-4col', { 1143 slidesPerView: 4, 1144 spaceBetween: 0, 1145 direction: 'vertical', 1146 mousewheel: { 1147 invert: false, 1148 }, 1149 navigation: { 1150 nextEl: '.flecha-vertical-4col-next', 1151 prevEl: '.flecha-vertical-4col-prev', 1152 } 1153 }); 1154 1155 var swiper = new Swiper('.slide_simple_1col'+id, { 1156 grabCursor: true, 1157 effect: 'slide', 1158 spaceBetween: 0, 1159 slidesPerView: 1, 1160 autoHeight: false, 1161 preloadImages: true, 1162 lazy: true, 1163 navigation: { 1164 nextEl: '.flecha_simple_1col_next'+id, 1165 prevEl: '.flecha_simple_1col_prev'+id, 1166 }, 1167 }); 1168 1169 // TRES VERTICAL 1170 var swiperVertical3col = new Swiper('.slide_vertical_3col'+id, { 1171 slidesPerView: 3, 1172 spaceBetween: 0, 1173 direction: 'vertical', 1174 mousewheel: { 1175 invert: false, 1176 }, 1177 navigation: { 1178 nextEl: '.flecha_vertical_3col_next'+id, 1179 prevEl: '.flecha_vertical_3col_prev'+id, 1180 } 1181 }); 1182 1183 twitURL(".twitURL"); 1184 1185 function iframeResponsiveNoticias(clase) { 1186 1187 1188 if (!clase) 1189 clase = "video-container"; 1190 miId = "#noticias" + id + " iframe"; 1191 1192 1193 1194 // IFRAME RESPONSIVE 1195 if ($(miId).parent().attr('class') != clase) { 1196 $(miId).wrap("<div class='cont-video lol'><div class='" + clase + "'></div></div>"); 1197 if ($(miId).css("display") == "none") 1198 $(miId).parent().hide(); 1199 } 1200 } 1201 } 1202 } 1203 ajax.send(null); 1204 } 1205 1206 if($$("fixturenoticiaid")){ 1207 var ajax = Ajax(); 1208 ajax.open("GET","/url.php?id=ajaxapp&id_fixture_noticia="+id+"&r="+Math.random(),true); 1209 ajax.onreadystatechange = function(){ 1210 if(ajax.readyState==4){ 1211 $$("sel"+id).innerHTML = ajax.responseText; 1212 1213 // SLIDERS 1214 var swiperVertical = new Swiper('.slide-vertical-4col', { 1215 slidesPerView: 4, 1216 spaceBetween: 0, 1217 direction: 'vertical', 1218 mousewheel: { 1219 invert: false, 1220 }, 1221 navigation: { 1222 nextEl: '.flecha-vertical-4col-next', 1223 prevEl: '.flecha-vertical-4col-prev', 1224 } 1225 }); 1226 1227 var swiper = new Swiper('.slide-simple-1col', { 1228 grabCursor: true, 1229 effect: 'slide', 1230 spaceBetween: 0, 1231 slidesPerView: 1, 1232 autoHeight: false, 1233 preloadImages: true, 1234 lazy: true, 1235 navigation: { 1236 nextEl: '.flecha-simple-1col-next', 1237 prevEl: '.flecha-simple-1col-prev', 1238 }, 1239 }); 1240 1241 var swiperVertical = new Swiper('.slide-vertical-3col', { 1242 slidesPerView: 3, 1243 spaceBetween: 0, 1244 direction: 'vertical', 1245 mousewheel: { 1246 invert: false, 1247 }, 1248 navigation: { 1249 nextEl: '.flecha-vertical-3col-next', 1250 prevEl: '.flecha-vertical-3col-prev', 1251 } 1252 }); 1253 } 1254 } 1255 ajax.send(null); 1256 } 1257} 1258 1259 1260 1261 1262 1263function mover_calendario(id,cantCalendario){ 1264 1265 1266 var calendarioTitulo = new Swiper('.slider_calendario_titulo'+id, { 1267 observer: true, 1268 observeParents: true, 1269 initialSlide: 2, 1270 autoplay: false, 1271 navigation: { 1272 nextEl: '.flecha-calendario-next', 1273 prevEl: '.flecha-calendario-prev', 1274 } 1275 }); 1276 var calendarioContenido = new Swiper('.slider_calendario_contenido'+id, { 1277 observer: true, 1278 observeParents: true, 1279 autoHeight: true, 1280 initialSlide: 2, 1281 autoplay: false, 1282 touchRatio: 0.2, 1283 slideToClickedSlide: true, 1284 grabCursor: false, 1285 slidesPerView: "auto", 1286 watchSlidesVisibility: true, 1287 watchSlidesProgress: true 1288 }); 1289 if(calendarioTitulo.controller){ 1290 calendarioTitulo.controller.control = calendarioContenido; 1291 } 1292 if(calendarioContenido.controller){ 1293 calendarioContenido.controller.control = calendarioTitulo; 1294 } 1295 $("#tab_calendario"+id).click(function (){ 1296 setTimeout(function(){ 1297 calendarioTitulo.slideTo(cantCalendario); 1298 calendarioContenido.slideTo(cantCalendario); 1299 }, 300); 1300 }); 1301 1302 setTimeout(function(){ 1303 calendarioTitulo.slideTo(cantCalendario); 1304 calendarioContenido.slideTo(cantCalendario); 1305 }, 300); 1306} 1307 1308function get_tabla_anual(id1,id2){ 1309 1310 if($$("carga_anual") && $$("contenido_anual")){ 1311 $$("carga_anual").style.display="block"; 1312 $$("contenido_anual").style.display="none"; 1313 var ajax = Ajax(); 1314 ajax.open("GET","/url.php?id=ajaxapp&tabla_anual=1&id1="+id1+"&id2="+id2+"&r="+Math.random(),true); 1315 ajax.onreadystatechange = function(){ 1316 if(ajax.readyState==4){ 1317 $$("carga_anual").style.display="none"; 1318 $$("contenido_anual").innerHTML = ajax.responseText; 1319 $$("contenido_anual").style.display="block"; 1320 } 1321 } 1322 ajax.send(null); 1323 } 1324} 1325 1326function get_tabla_general_a(id1,id2){ 1327 if($$("carga_generala") && $$("contenido_generala")){ 1328 $$("carga_generala").style.display="block"; 1329 $$("contenido_generala").style.display="none"; 1330 var ajax = Ajax(); 1331 ajax.open("GET","/url.php?id=ajaxapp&tabla_generala=1&id1="+id1+"&id2="+id2+"&r="+Math.random(),true); 1332 ajax.onreadystatechange = function(){ 1333 if(ajax.readyState==4){ 1334 $$("carga_generala").style.display="none"; 1335 $$("contenido_generala").innerHTML = ajax.responseText; 1336 $$("contenido_generala").style.display="block"; 1337 } 1338 } 1339 ajax.send(null); 1340 } 1341} 1342function get_tabla_general_b(id1,id2){ 1343 if($$("carga_generalb") && $$("contenido_generalb")){ 1344 $$("carga_generalb").style.display="block"; 1345 $$("contenido_generalb").style.display="none"; 1346 var ajax = Ajax(); 1347 ajax.open("GET","/url.php?id=ajaxapp&tabla_generalb=1&id1="+id1+"&id2="+id2+"&r="+Math.random(),true); 1348 ajax.onreadystatechange = function(){ 1349 if(ajax.readyState==4){ 1350 $$("carga_generalb").style.display="none"; 1351 $$("contenido_generalb").innerHTML = ajax.responseText; 1352 $$("contenido_generalb").style.display="block"; 1353 } 1354 } 1355 ajax.send(null); 1356 } 1357} 1358function get_tabla_descenso(id1,id2){ 1359
1360 $$("carga_descenso").style.display="block"; 1361 $$("contenido_descenso").style.display="none"; 1362 var ajax = Ajax(); 1363 ajax.open("GET","/url.php?id=ajaxapp&tabla_descenso=1&id1="+id1+"&id2="+id2+"&r="+Math.random(),true); 1364 ajax.onreadystatechange = function(){ 1365 if(ajax.readyState==4){ 1366 $$("carga_descenso").style.display="none"; 1367 $$("contenido_descenso").innerHTML = ajax.responseText; 1368 $$("contenido_descenso").style.display="block"; 1369 } 1370 } 1371 ajax.send(null); 1372} 1373 1374// Clubes 1375 1376function get_fixtureclub_home(){ 1377 1378 if($$("fixtureclubhomeid")){ 1379 for(i=0;i<clubes.length;i++){ 1380 var sel = clubes[i]; 1381 var para = document.createElement("div"); 1382 para.id = "selc"+sel; 1383 $$("fixtureclubhomeid"+sel).appendChild(para); 1384 } 1385 1386 for(i=0;i<clubes.length;i++){ 1387 var sel = clubes[i]; 1388 get_fixtureclub_home_item(sel); 1389 } 1390 } 1391 1392 if($$("fixturenoticiaclubhomeid")){ 1393 for(i=0;i<clubes.length;i++){ 1394 var sel = clubes[i]; 1395 var para = document.createElement("div"); 1396 para.id = "selc"+sel; 1397 $$("fixturenoticiaclubhomeid").appendChild(para); 1398 } 1399 1400 for(i=0;i<clubes.length;i++){ 1401 var sel = clubes[i]; 1402 get_fixtureclub_home_item(sel); 1403 } 1404 } 1405} 1406 1407function get_fixtureclub_home_item(id){ 1408 1409 if($$("fixtureclubhomeid")){ 1410 var ajax = Ajax(); 1411 ajax.open("GET","/url.php?id=ajaxapp&id_fixtureclub_home="+id+"&r="+Math.random(),true); 1412 ajax.onreadystatechange = function(){ 1413 if(ajax.readyState==4){ 1414 1415 $$("selc"+id).innerHTML = ajax.responseText; 1416 1417 iframeResponsive(); 1418 1419 // SLIDERS 1420 var swiper = new Swiper('.slide-3col-simple', { 1421 grabCursor: true, 1422 autoplay: false, 1423 effect: 'slide', 1424 spaceBetween: 20, 1425 slidesPerView: 3, 1426 autoHeight: false, 1427 preloadImages: true, 1428 lazy: true, 1429 navigation: { 1430 nextEl: '.flecha-3col-next', 1431 prevEl: '.flecha-3col-prev', 1432 }, 1433 breakpoints: { 1434 780: { 1435 slidesPerView: 3, 1436 spaceBetween: 15 1437 }, 1438 580: { 1439 slidesPerView: 2, 1440 spaceBetween: 10 1441 }, 1442 480: { 1443 spaceBetween: 15, 1444 centeredSlides: false, 1445 slidesPerView: 1.5 1446 } 1447 } 1448 }); 1449 1450 1451 // CUATRO VERTICAL 1452 var swiperVertical = new Swiper('.slide-vertical-4col_' + id, { 1453 slidesPerView: 8, 1454 spaceBetween: 0, 1455 direction: 'vertical', 1456 mousewheel: { 1457 invert: false, 1458 }, 1459 navigation: { 1460 nextEl: '.flecha-vertical-4col-next_' + id, 1461 prevEl: '.flecha-vertical-4col-prev_' + id, 1462 } 1463 }); 1464 1465 1466 var swiper = new Swiper('.slide_simple_1col_'+id, { 1467 grabCursor: true, 1468 effect: 'slide', 1469 spaceBetween: 0, 1470 slidesPerView: 1, 1471 autoHeight: false, 1472 preloadImages: true, 1473 lazy: true, 1474 navigation: { 1475 nextEl: '.flecha_simple_1col_next'+id, 1476 prevEl: '.flecha_simple_1col_prev'+id, 1477 }, 1478 }); 1479 1480 // CINCO COLUMNAS + PUNTOS 1481 var swiper = new Swiper('.slide-5col-puntos', { 1482 grabCursor: true, 1483 autoplay: false, 1484 effect: 'slide', 1485 observer: true, 1486 observeParents: true, 1487 spaceBetween: 10, 1488 slidesPerView: 5, 1489 slidesPerGroup: 5, 1490 autoHeight: false, 1491 preloadImages: true, 1492 lazy: true, 1493 navigation: { 1494 nextEl: '.flecha-5col-next', 1495 prevEl: '.flecha-5col-prev', 1496 }, 1497 pagination: { 1498 el: '.pagination-5col', 1499 clickable: true, 1500 }, 1501 breakpoints: { 1502 1024: { 1503 pagination: false, 1504 slidesPerView: 4, 1505 spaceBetween: 15 1506 }, 1507 780: { 1508 slidesPerView: 3, 1509 spaceBetween: 15 1510 }, 1511 580: { 1512 slidesPerView: 2, 1513 spaceBetween: 10 1514 }, 1515 480: { 1516 spaceBetween: 15, 1517 slidesPerGroup: 1, 1518 centeredSlides: true, 1519 slidesPerView: 1.5 1520 } 1521 } 1522 }); 1523 1524 var idFechaActual = ($(".slider-fechas-contenido_" + id).data("fecha")-1); 1525 // FIXTURE FECHA - HOME CLUB 1526 var fechaContenido = new Swiper('.slider-fechas-contenido_' + id, { 1527 loop:true, 1528 observer: true, 1529 observeParents: true, 1530 touchRatio: 0.2, 1531 slideToClickedSlide: true, 1532 grabCursor: false, 1533 autoHeight: true, 1534 initialSlide: idFechaActual, 1535 slidesPerView: "auto", 1536 watchSlidesVisibility: true, 1537 watchSlidesProgress: true, 1538 navigation: { 1539 nextEl: '.flecha-fecha-next', 1540 prevEl: '.flecha-fecha-prev', 1541 }, 1542 on: { 1543 slideChange: function () { 1544 // console.log(this.realIndex); 1545 //alert(this.realIndex); 1546 if($$("fixdesc_"+id+"_"+this.realIndex)){ 1547 var desc = $$("fixdesc_"+id+"_"+this.realIndex).innerHTML; 1548 var nombre= $$("fixnom_"+id+"_"+this.realIndex).innerHTML; 1549 var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: ''); 1550 var url = full+"/pdfs/"+desc 1551 /*$$("boton_descarga_"+id).href=url; 1552 $$("boton_descarga_twitter_"+id).href= "https://twitter.com/intent/tweet?text=Descargar Fixture "+nombre+" - "+url; 1553 $$("boton_descarga_facebook_"+id).href="https://www.facebook.com/sharer/sharer.php?u="+url; 1554 $$("boton_descarga_wsa_"+id).href="https://wa.me/?text=Descargar Fixture "+nombre+" - "+url;*/ 1555 } 1556 }, 1557 transitionStart: function () { 1558 // console.log(this.realIndex); 1559 //alert(this.realIndex); 1560 if($$("fixdesc_"+id+"_"+this.realIndex)){ 1561 var desc = $$("fixdesc_"+id+"_"+this.realIndex).innerHTML; 1562 var nombre= $$("fixnom_"+id+"_"+this.realIndex).innerHTML; 1563 var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: ''); 1564 var url = full+"/pdfs/"+desc 1565 /*$$("boton_descarga_"+id).href=url; 1566 $$("boton_descarga_twitter_"+id).href= "https://twitter.com/intent/tweet?text=Descargar Fixture "+nombre+" - "+url; 1567 $$("boton_descarga_facebook_"+id).href="https://www.facebook.com/sharer/sharer.php?u="+url; 1568 $$("boton_descarga_wsa_"+id).href="https://wa.me/?text=Descargar Fixture "+nombre+" - "+url;*/ 1569 } 1570 }, 1571 }, 1572 });
1573 1574 twitURL(".twitURL"); 1575 1576 function iframeResponsive(clase) { 1577 if (!clase) 1578 clase = "video-container"; 1579 miId = "#noticiasclub" + id + " iframe"; 1580 // IFRAME RESPONSIVE 1581 if ($(miId).parent().attr('class') != clase) { 1582 $(miId).wrap("<div class='cont-video lol'><div class='" + clase + "'></div></div>"); 1583 if ($(miId).css("display") == "none") 1584 $(miId).parent().hide(); 1585 } 1586 } 1587 1588 if($(window).width() < 780){ 1589 var tabs = new Swiper('.tabs-container', { 1590 // init: false, 1591 grabCursor: false, 1592 autoplay: false, 1593 slidesPerView: "auto", 1594 freeMode: true 1595 }); 1596 }; 1597 1598 } 1599 } 1600 ajax.send(null); 1601 } 1602 1603 1604 if($$("fixturenoticiaclubhomeid")){ 1605 var ajax = Ajax(); 1606 ajax.open("GET","/url.php?id=ajaxapp&id_fixturenoticiaclub_home="+id+"&r="+Math.random(),true); 1607 ajax.onreadystatechange = function(){ 1608 if(ajax.readyState==4){ 1609 $$("selc"+id).innerHTML = ajax.responseText; 1610 1611 // CUATRO VERTICAL 1612 var swiperVertical = new Swiper('.slide-vertical-4col_' + id, { 1613 slidesPerView: 8, 1614 spaceBetween: 0, 1615 direction: 'vertical', 1616 mousewheel: { 1617 invert: false, 1618 }, 1619 navigation: { 1620 nextEl: '.flecha-vertical-4col-next_' + id, 1621 prevEl: '.flecha-vertical-4col-prev_' + id, 1622 } 1623 }); 1624 } 1625 } 1626 ajax.send(null); 1627 } 1628} 1629 1630$(document).ready(function(){ 1631 get_fixture_home(); 1632 get_fixtureclub_home(); 1633}); 1634 1635/////////////////////////////////////////////// 1636// CANVAS
1637/////////////////////////////////////////////// 1638 1639 1640$(document).ready(function(){ 1641 if($$("soporte-canvas")){ 1642 $$("soporte-canvas").style.display="none"; 1643 } 1644}); 1645 1646function imprimir_pantalla(titulo,id,nombre_archivo,ancho,alto){ 1647 1648 document.getElementById("soporte-canvas").style.display="block"; 1649 var iframe = document.getElementById("canvas-frame"); 1650 var ifrDocument = iframe.contentDocument || iframe.contentWindow.document; 1651 var selectElement = ifrDocument.getElementById("canvas-contexto"); 1652 var selectElementContenido = ifrDocument.getElementById("canvas-contexto-contenido"); 1653 var selectElementTitulo = ifrDocument.getElementById("canvas-titulo"); 1654 var element = $$(id); 1655 if(!ancho){ 1656 selectElement.style.width ="800px"; 1657 }else{ 1658 selectElement.style.width =ancho+"px"; 1659 } 1660 if(!alto){ 1661 selectElement.style.height ="760px"; 1662 }else{ 1663 selectElement.style.height =alto+"px"; 1664 } 1665 if(!ancho){ 1666 selectElementContenido.style.width ="760px"; 1667 }else{ 1668 selectElementContenido.style.width =(ancho-40)+"px"; 1669 } 1670 if(!alto){ 1671 selectElementContenido.style.height ="760px"; 1672 }else{ 1673 selectElementContenido.style.height =(alto-40)+"px"; 1674 } 1675 selectElementTitulo.innerHTML =titulo; 1676 selectElementContenido.innerHTML =element.innerHTML; 1677 //console.log(element.innerHTML); 1678 html2canvas(selectElement).then(function(canvas) { 1679 console.log(canvas); 1680 simulateDownloadImageClick(canvas.toDataURL(),nombre_archivo); 1681 }); 1682} 1683function simulateDownloadImageClick(uri, filename) { 1684 var link = document.createElement('a'); 1685 if (typeof link.download !== 'string') { 1686 window.open(uri); 1687 } else { 1688 link.href = uri; 1689 link.download = filename; 1690 accountForFirefox(clickLink, link); 1691 document.getElementById("soporte-canvas").style.display="none"; 1692 } 1693} 1694function accountForFirefox(click) { // wrapper function 1695 let link = arguments[1]; 1696 document.body.appendChild(link); 1697 click(link); 1698 document.body.removeChild(link); 1699} 1700function clickLink(link) { 1701 link.click(); 1702} 1703
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.