 /* esta funcion la uso para mostrar el menu de galerias en la seccion galerias */
 var indicegalvisible=0;

 function mostrarIndiceGal(n) {
  //en firefox no hace falta porque reconoce css div:hover, pero ie6 no
  //if ( $(this).is(":hidden") )
  if ( !indicegalvisible) { $("#indicegalerias").stop(true,true).show("slow"); indicegalvisible=1; } 
  else { $("#indicegalerias").stop(true,true).hide("slow"); indicegalvisible=0; }
  return;
 }



 function obtenerGaleria(n) {
  //dada una cadena vergaleria.php?gal=numgal[&pagina=...] devuelve numgal

  if ( n.indexOf("?",0) < 0 ) return false; //no es una cadena del tipo deseado, la devuelve tal cual

  var x=n.split("?");
  x=x[1].split("&");
  x=x[0].split("=");

  return x[1];
 }

 function cambiacolor(e,est)
  {
    if (est==1) c="#ff0000";
    else c=""; // c="#000000"; 

    e.style.borderColor=c;
  }

$(document).ready(function(){

        //cambio el enlace del boton galeria de la cabecera para que me lleve al slide 
        $("#galeriafotos").attr("href","galerias.htm");  //seccion=slide


        //cambio los enlaces al slide seccion=galerias para cada album
        $("#enlaceIndiceGalerias").click(function(e){ e.stopPropagation(); e.preventDefault(); mostrarIndiceGal(); });

        var enlaces = $(".enlaceagaleria"); 
        if (enlaces) {
          jQuery.each(enlaces, function() {
              ngal=obtenerGaleria($(this).attr("href")); 
              if (ngal) { 
                 $(this).attr("href","galeria_" + ngal + ".htm");
              }
          }); //enlaces
        }

        //cambio los enlaces externos para que llamen al contador ajax al hacer clic sobre ellos
        $(".enlaceexterno").click(function(e){ 
           $.ajax({
             type: 'GET',
             url: 'm_contadores/micontador_ajax.php',
             data: 'url=' + $(this).attr('href') + '&tipo=4',
           })
        }); //enlaceexterno

        //cambio los enlaces internos para que llamen al contador ajax al hacer clic sobre ellos
        $(".enlaceinterno").click(function(e){ 
           $.ajax({
             type: 'GET',
             url: 'm_contadores/micontador_ajax.php',
             data: 'url=' + $(this).attr('title') + '&tipo=3',
           })
        }); //sec_enlaces

 
      }); //ready
