function show_copyright()
{
  abrir('copyright.php','Copyright',300,170,0)
}

// JavaScript Document
/*var timer = null

function cambiaColor(id,colorLocal)
{
  if (document.getElementById(id))document.getElementById(id).style.color = colorLocal;
}

function cambiaClase(id,clase)
{
  if (document.getElementById(id))document.getElementById(id).style = clase;
}

function paginaActiva(numeroPaginas, paginaActiva)
{
  for (i=1;i<=numeroPaginas;i++)
  {
    cambiaClase('clase_pagina_'+i,'otrasPaginas');
  }
  cambiaClase('clase_pagina_'+paginaActiva,'paginaSeleccionada');
}

function muestraMenu(capa)
{
  document.getElementById('capa_links').style.display = 'none';
  document.getElementById('capa_categorias').style.display = 'none';
  document.getElementById('capa_' + capa).style.display = 'block';
  //para poner la opcion categorias o link encendida
  document.getElementById('capa_' + capa).src = 'm_' + capa + '2.gif';
  document.getElementById('menuSuperior').style.visibility = 'visible';
  timer = window.setTimeout("ocultaMenu()",5000);
}

function ocultaMenu(capa)
{
  document.getElementById('menuSuperior').style.visibility = 'hidden';
  window.clearTimeout(timer);
}

function cambiaImagenA(id,src)
{
  if (document.getElementById(id))document.getElementById(id).src = src;
}
*/

function abrir(htmlfile, nombre, wndWidth, wndHeight,bars) {
  	var popWnd; //Objeto ventana de popup
    	var maxWidth = screen.width-10;
    	var maxHeight = screen.height-56;

    	//Preprocesado de parámetros
    	if (wndHeight==0) wndHeight = maxHeight;
    	if (wndWidth==0) wndWidth = maxWidth;

    	//Calculo de la posición para centrar la ventana
    	var posX = maxWidth/2 - wndWidth/2;
    	var posY = maxHeight/2 - wndHeight/2;

    	if (popWnd) popWnd.close();
   	popWnd = open( htmlfile, nombre, 'resizable=1,toolbar=0,scrollbars='+ bars +'location=0,directories=0,status=0,menubar=0,width='+wndWidth+',height='+wndHeight+',screenX=0,screenY=0,left='+posX+',top='+posY);

    	//this.blur();
    	popWnd.focus();
}

function abrirPersona(idpersona)
{
  abrir('detalle_persona.php?idpersona=' + idpersona,'persona',700,180,0)
}

function irADesdePopUp(donde)
{
  self.close();
  opener.document.location=donde;
}

function selectAllCheckBox(formName, checkBoxName, checkBoxControlerId)
{

  var selected = document.getElementById(checkBoxControlerId).checked;
  var f = document.forms[formName];
	if(!selected){
		for (i = 0; i < f.elements.length; i++){
			if(f.elements[i].name == checkBoxName){
				f.elements[i].checked = false;
			}
		}
	} else {
		for (i = 0; i < f.elements.length; i++){
			if(f.elements[i].name == checkBoxName){
				f.elements[i].checked = true;
			}
		}
	}
	/*var entrada="";
	for (i = 0; i < f.elements.length; i++){
	entrada += "\n" +  f.elements[i].name;
	}
	alert(entrada);*/
}
