// Funciones para tablas
function showHideTable(theRow,theImg) {
  if (document.getElementById(theRow+ "_" + 1).style.display == 'none') {
    document.getElementById(theImg).src='Temas/comun/img/table/collapse.gif';
           showTableRecursive(theRow);
  }
  else {
    document.getElementById(theImg).src='Temas/comun/img/table/expand.gif';
    hideTableRecursive(theRow);
  }
}

function hideTableRecursive(theRow) {
  var row, i = 1;
  while (row = document.getElementById(theRow + "_" + i)) {
    row.style.display = 'none';
    if (document.getElementById("img"+theRow + "_" + i))
      document.getElementById("img"+theRow + "_" + i).src='Temas/comun/img/table/expand.gif';

    idrow = theRow + "_" + i;
    i++;
    hideTableRecursive(idrow);
  }
}

function showTableRecursive(theRow) {
  var row, i = 1;
  while (row = document.getElementById(theRow + "_" + i)) {
    row.style.display = 'block'

    idrow = theRow + "_" + i;
    i++;
  }
}

function OcultarTabla() {

  if (document.all)
    for(i=1;document.getElementById("tr_" + i);i++) {
      var theRow = "tr_" + i;
      var theImg = "img" + theRow;
      if (document.getElementById(theImg))
        document.getElementById(theImg).src='Temas/comun/img/table/expand.gif';
      hideTableRecursive(theRow);
    }
}
