$(document).ready(function (){
  
   /*
   $("#jugadora").hide()
        
  $(".content .subnav a").click(function(){
    $(".content .subnav li.btn_actual").removeClass("btn_actual");
    clase_seleccionada = $(this).attr("href");
    $(".cont_historia:visible").hide();       
    capa_mostrar = "." + clase_seleccionada;
    $(capa_mostrar).show();
    $(this).parent().addClass("btn_actual");
    return false;   
  });
  
      
  $(".content .pr_uno .ficha_ultimo").show();
  
  $(".content .pr_uno .menu_coli a").click(function(){        
    $(".content .pr_uno .menu_coli li.activo").removeClass("activo");
    clase_seleccionada = $(this).attr("href");        
    $(".content .pr_uno .cont_cold:visible").hide();        
    capa_mostrar = "." + clase_seleccionada;
    $(capa_mostrar).show();
    $(this).parent().addClass("activo");
    return false;   
  });


  // RESULTADOS: > subnavegación por cuadro masculino y femenino
  $(".subnav a").click(function () {
    $(".subnav li").removeClass("btn_actual");
    $(".masculino, .femenino").hide();
    $("#jugador, #jugadora").hide()
    capa_mostrar = $(this).attr("href");
    if(capa_mostrar.indexOF("masculino") != 0)
      $("#jugador").show()
    else
      $("#jugadora").show()
    $("." + capa_mostrar).show();
    $(this).parent().addClass("btn_actual");
    return false;     
  });
  */

  // RESULTADOS > resaltar jugador dentro del cuadro del torneo
  $(".cont_pest select").change(function () {
    $(".rondas p").removeClass('marcado');
     var jugador = $(".cont_pest select option:selected").attr("value");
     $("#" + jugador).addClass('marcado');
     $("." + jugador).addClass('marcado');
     ancla(jugador)
  });
  
  $(".cont_pest select").change(function () {
    $(".rondas p").removeClass('marcado');
     var jugadora = $(".cont_pest select option:selected").attr("value");
     $("#" + jugadora).addClass('marcado');
     $("." + jugadora).addClass('marcado');
     ancla(jugadora)
  });

	 /* Combos */
    $("#select-partidos").change(function () {
        location.href = $(this).attr("value");
    })


}); 

function ancla(nombre_ancla){
  window.location='#'+nombre_ancla;
}
