";
        } else {
          // Si es Facebook
          var iframe = "
" +
            "              " +
            "            
'"
        }
      }
      $(" .embed-responsive a.link_youtube").ntg_link_video();
      $('#myModal').find('.modal-body').append(iframe);
      $('#myModal').modal('show');
      $('#myModal').on('hidden.bs.modal', function (e) {
        $('#myModal').find('.modal-body').empty();
      })
    }
  });
  // Agregar link eidox a miga de pan
  var title_size = $("#breadcrumb-title").length;
  if (title_size) {
    var title_content = $("#breadcrumb-title .titulo").html();
    $(".breadcrumb span:nth-child(2)").append(" / " + title_content);
  }
  //agregar enlace a zona privada en el menú principal
  var enlace = '
';
  $('header').append(enlace);
  // link nueva ventana para red colaborativa
  $("#navbarSupportedContent .recuadro span.pvid-156939 a").attr("target", "blank");
  //Agregar estilos para texto destacado para el articulo completo
  if ($(".articuloCompleto").length > 0) {
    $(".articuloCompleto strong").each(function () {
      $this = $(this);
      if ($this.text() == "nuevo" || $this.text() == "NUEVO") {
        $this.wrap("
");
      }
    });
  }
  // Agregar recuadros de ranking en el home
  /* $("#ranking-total .ranking .recuadro").each(function () {
    var texto, icono, circuito, clases, nivel;
    $this = $(this);
    // agregar icono y circuito según el nivel de cada escuderia
    texto = "
" + $this.find(".nivel > span > span").text() + "";
    clases = $this.find(".nivel > span > a").attr("class").split(" ");
    nivel = clases[3].substring(5);
    switch (nivel) {
      case "209183": // Intermedio
        icono = "

";
        circuito = "

";
        break;
      case "209184": // Avanzado
        icono = "

";
        circuito = "

";
        break;
      default: //Amateur
        icono = "

";
        circuito = "

";
        break;
    }
    $this.children(".nivel").empty();
    $this.children(".nivel").html(icono + texto);
    $this.append("
" + circuito + "
");
    $this.find(".pn-number").append(" pts");
    $this.find(".r-participante a").contents().unwrap();
    $this.find(".r-escuderia a").attr("target", "_blank");
  }); */
  if ($("#circuitos").length > 0) {
    console.log("entra");
    $("#circuitos .fases-retos .recuadro:first-child").append("
" + $("#fechas-retos .recuadro:first-child .descripcion").text() + "
");
    $("#circuitos .fases-retos .recuadro:nth-child(2)").append("
" + $("#fechas-retos .recuadro:nth-child(2) .descripcion").text() + "
");
    $("#circuitos .fases-retos .recuadro:nth-child(3)").append("
" + $("#fechas-retos .recuadro:nth-child(3) .descripcion").text() + "
");
  }
  if($("#MaxVel20_pa_rankingacordeon_1_0").length > 0 ){
      $("#MaxVel20_pa_rankingacordeon_1 .panel-title a > a").contents().unwrap();
      $("#MaxVel20_pa_rankingacordeon_2 .panel-title a > a").contents().unwrap();
      $("#MaxVel20_pa_rankingacordeon_1_0 .recuadro .circuito img").prop("src","propertyvalues-179498_circuito.png");
      $("#MaxVel20_pa_rankingacordeon_2_0 .recuadro .circuito img").prop("src","propertyvalues-179498_circuito.png");
  }
  // Cambiar el título de los turbo booster por 'Retos turbo booster' pvid= 396021
  $("#retosTurbo2 .titulo").text("Retos Turbo Booster");
  // agregar icono nivel y circuito a ranking
  if($("#ranking-total").length > 0 ){
    $( "#ranking-total .recuadro" ).prepend( '
' );
    $( "#ranking-total .recuadro" ).append( '
' );
    $(".r-participante a").contents().unwrap();
    $(".r-escuderia a").attr("target", "_blank");
    $("#MaxVel20_pa_rankingacordeon_1 .panel-title a").attr("aria-expanded", "true");
    $("#MaxVel20_pa_rankingacordeon_2 .panel-title a").attr("aria-expanded", "true");
    $("#MaxVel20_pa_rankingacordeon_1 .panel-title a").removeClass("collapsed");
    $("#MaxVel20_pa_rankingacordeon_2 .panel-title a").removeClass("collapsed");
    $("#MaxVel20_pa_rankingacordeon_1_0").addClass("collapse show");
    $("#MaxVel20_pa_rankingacordeon_2_0").addClass("collapse show");
}
});
//Menú fijo al scroll
var menu = $('header.navbar-static');
var origOffsetY = menu.offset().top;
function scroll_menu() {
  if ($(window).scrollTop() >= origOffsetY) {
    $('header.navbar-static').addClass('navbar-fixed');
  } else {
    $('header.navbar-static').removeClass('navbar-fixed');
  }
}
document.onscroll = scroll_menu;
// fin menú fijo
					-->