$(document).ready(function(){      
  
  var chapterArray = [];
  var n = numChapters+1;
  for(var i=0; i<n; i++){
    chapterArray[i] = i;
  }  
	
  $.each(chapterArray, function(i, n){
	$("div.chapter_info_"+n).hide();
	
    $('a.link_'+n).toggle(
      function() { $('div.chapter_info_'+n).show('slow'); $(this).html('-'); },
      function() { $('div.chapter_info_'+n).hide('slow'); $(this).html('+'); }
    );
  })

$('a.showAllChapters').toggle(
    function() { 
		$.each(chapterArray, function(i, n){
		    $('div.chapter_info_'+n).show('slow'); $('a.link_'+n).html('-');
		  })
		$(this).html('Ocultar información de los capítulos');
	},
    function() { 
		$.each(chapterArray, function(i, n){
		    $('div.chapter_info_'+n).hide('slow'); $('a.link_'+n).html('+');
		  })
		$(this).html('Mostrar información de los capítulos');
	}
  );

});


function anentropia() {
	url = "html/anentropia.html";
	w = 500; 
	h = 220;
	miVentana = window.open( url, "popup", "width=" + w + ",height=" + h + ",top=" + ((screen.height/2)-(h/2)) + ",left=" + ((screen.width/2)-(w/2 )) + ",resizable=no,status=no,scrollbars=no" );
	if (miVentana) miVentana.focus();
}
