//
//- Hoja de estilos Cotobal
//
//- Mod: JAC 1/dic/2009
//

verNum=0;
sRutaHojas="/hojas/";
sRutaArbol="../arbol/";
//******************************
//***                        ***
//***   ARBOLES              ***
//***                        ***
//******************************
//============= fArbCab ====================
function fArbCab() {
  document.writeln("<HTML><HEAD>");
  document.writeln("<TITLE>Arboles Genealogicos</TITLE>");
  document.writeln("<LINK rel='stylesheet' type='text/css' href='../estilo.css'>");
  document.writeln("<base target='_top'>");
  document.writeln("</HEAD>");
  document.writeln("<BODY leftmargin='0' topmargin='0' marginwidth='1' marginheight='0'>");
  document.writeln("<CENTER>");
};

//============= fArbTitulo ====================
function fArbTitulo(arbol,nombre,id,arbolreducido,identificadores) {
  document.writeln("<TABLE class='TablaColor' BORDER='3' WIDTH='530' fBGCOLOR=#FFFFD0>");
  document.writeln("<TR><th valign='bottom' width='120'><A HREF='http://www.cotobal.com' TARGET='_top'>");
  document.writeln("<IMG SRC='../img/esccoto_s.gif' BORDER=0></A></Th>");
  document.writeln("<Th nowrap>");
  if (identificadores)
	document.writeln(fIdentificador(id));
  if (arbolreducido)
	document.writeln("<h1>Mega-Arbol: <b>" + nombre + "</b>");
  else
	document.writeln("<h1>Arbol: <b>" + nombre + "</b>");
  document.writeln("</Th></TR>");
  document.writeln("<tr><td colspan=2>Pulsa en los cuadros amarillos para acceder a las fichas familiares ");
  if (!arbolreducido)
	document.writeln("o en las flechas verdes para 'navegar' hacia otros árboles:");
  document.writeln("</td></tr>");
  document.writeln("<tr><td colspan=2 align='center'><IMG SRC='" + arbol + ".gif' BORDER=0 USEMAP='#mapa' align='center'><MAP NAME='mapa'>");

};

//******************************
//***                        ***
//***   LISTAS               ***
//***                        ***
//******************************
//============= fLisCab ====================
function fLisCab() {
  document.writeln("<HTML><HEAD>");
  document.writeln("<TITLE>Relación de Personas</TITLE>");


  //document.writeln("<BASE href=''>");


//  document.writeln("<LINK rel='stylesheet' type='text/css' href='../estilo.css'>");
//  document.writeln("<style> <!--");
//  document.writeln("a:link {color: #000000;text-decoration:none;} ");
//  document.writeln("a:visited {color: #000000;text-decoration:none;} ");
//  document.writeln("--> </style>");

  document.writeln("<base target='_top'>");
  document.writeln("</HEAD>");
  document.writeln("<BODY leftmargin='0' topmargin='0' marginwidth='1' marginheight='0'>");
};

function fLisTitulo(personas,titulo,tipolista) {
  document.writeln("<A NAME='TOP'> ");
  document.writeln("<h2>Relación de Personas</h2>");
  document.writeln("<H3>" + personas + " " + titulo + "</H3>");
  document.writeln("<hr>");

  if (tipolista == "fo")
	document.writeln("Pulsa en la fotografía");
  else
	document.writeln("Pulsa en el punto azul <IMG SRC='img/ad.gif' BORDER=0>");

  document.writeln(" de una persona para acceder a su ficha familiar.</FONT><BR><BR>");
};
function fLisLetras(hojaLista) {
  document.writeln("<CENTER>");
  document.writeln("<TABLE BORDER=0><TD>");
  document.writeln("<A HREF='" + hojaLista + "#A' target='_self'><IMG SRC='../img/a.gif' ALT=' A ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#B' target='_self'><IMG SRC='../img/b.gif' ALT=' B ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#C' target='_self'><IMG SRC='../img/c.gif' ALT=' C ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#D' target='_self'><IMG SRC='../img/d.gif' ALT=' D ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#E' target='_self'><IMG SRC='../img/e.gif' ALT=' E ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#F' target='_self'><IMG SRC='../img/f.gif' ALT=' F ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#G' target='_self'><IMG SRC='../img/g.gif' ALT=' G ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#H' target='_self'><IMG SRC='../img/h.gif' ALT=' H ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#I' target='_self'><IMG SRC='../img/i.gif' ALT=' I ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#J' target='_self'><IMG SRC='../img/j.gif' ALT=' J ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#K' target='_self'><IMG SRC='../img/k.gif' ALT=' K ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#L' target='_self'><IMG SRC='../img/l.gif' ALT=' L ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#M' target='_self'><IMG SRC='../img/m.gif' ALT=' M ' BORDER=0></A>");
  document.writeln("</TD></TR><TR><TD>");
  document.writeln("<A HREF='" + hojaLista + "#N' target='_self'><IMG SRC='../img/n.gif' ALT=' N ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#NN' target='_self'><IMG SRC='../img/nn.gif' ALT=' Ñ ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#O' target='_self'><IMG SRC='../img/o.gif' ALT=' O ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#P' target='_self'><IMG SRC='../img/p.gif' ALT=' P ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#Q' target='_self'><IMG SRC='../img/q.gif' ALT=' Q ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#R' target='_self'><IMG SRC='../img/r.gif' ALT=' R ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#S' target='_self'><IMG SRC='../img/s.gif' ALT=' S ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#T' target='_self'><IMG SRC='../img/t.gif' ALT=' T ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#U' target='_self'><IMG SRC='../img/u.gif' ALT=' U ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#V' target='_self'><IMG SRC='../img/v.gif' ALT=' V ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#X' target='_self'><IMG SRC='../img/x.gif' ALT=' X ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#Y' target='_self'><IMG SRC='../img/y.gif' ALT=' Y ' BORDER=0></A>");
  document.writeln("<A HREF='" + hojaLista + "#Z' target='_self'><IMG SRC='../img/z.gif' ALT=' Z ' BORDER=0></A>");
  document.writeln("</TD></TR></TABLE></CENTER>");
};

//============= fLista====================
function fLisInicioLista() {
  document.writeln("<CENTER>");
  document.writeln("<TABLE BORDER=1 BGCOLOR=#FFFFF0><tr><td>");
};

//function fLisFinLista(fecha) {
//  document.writeln("</td></tr></TABLE>");
//};
function fLisFinLista() {
  document.writeln("</td></tr></TABLE>");
};

function fLisCambioLetra(hojaLista,letra) {
  document.writeln("</td></tr><th>");
  document.writeln("<a name='" + letra + "'>");
  document.writeln("<CENTER><a href='" + hojaLista + "#TOP'>");
  document.writeln("<IMG SRC='../img/top.gif' ALT='Subir' ALIGN=LEFT BORDER=0 WIDTH=13 HEIGHT=15></a>");
  document.writeln("<IMG SRC='../img/" + letra + ".gif' ALIGN=CENTER BORDER=0><br></CENTER>");
  document.writeln("<th><tr><td>");
};
function fLisPer(nombre,id,nac,familia,tipolista) {
  document.writeln("<A HREF='" + fNombreHojaFamilia(familia) + "' target='_top'>");
  if (tipolista == "fo")
	document.writeln("<IMG SRC='../fot/" + fNombreFoto(id) + "p.jpg' BORDER=1 WIDTH=55 HEIGHT=55 ALIGN=MIDDLE>");
  else
	document.writeln("<IMG SRC='../img/ad.gif' BORDER=0>");

  if (nac!="")
     nac=" (Nac.:" + nac + ")"
  document.writeln(" " + nombre + nac + "</A><br>");
};

function fLisPerBuscar(nombre,id,nac,familia,confotos,foto) {
  var t="";
  t = t + "<A HREF='" + fNombreHojaFamilia(familia) + "' target='_top'>\n";
  if (confotos) {
	if (!foto)
		foto = "nofotop2.gif"
	else
		foto = fNombreFoto(foto) + "p.jpg"
	t = t + "<IMG SRC='fot/" + foto + "' BORDER=1 WIDTH=55 HEIGHT=55 ALIGN=MIDDLE>";
  }
  else
	t = t + "<IMG SRC='img/ad.gif' BORDER=0>";

  if (nac!="")
     nac=" (Nac.:" + nac + ")"
  t = t + " " + nombre + nac + "</font></a><br>\n";

  return t;
};

//============= fLisPie====================
function fLisPie(fecha) {
  document.writeln("</td></tr></TABLE>");
  document.writeln("</CENTER>");
  document.writeln("<p class='Peq'>Fecha generación: " + fecha + "</p><hr>");
  document.writeln("<A HREF=\"javascript:history.back()\">");
  document.writeln("<IMG SRC='../img/volver.gif' BORDER=0></A>");
};

//******************************
//***                        ***
//***   FAMILIAS             ***
//***                        ***
//******************************
//============= fFamCab ====================
function fFamCab() {
  document.writeln("<HTML><HEAD>");
  document.writeln("<TITLE>Detalle de Familias</TITLE>");
  document.writeln("<LINK rel='stylesheet' type='text/css' href='../estilo.css'>");

  document.writeln("<base target='_top'>");
  document.writeln("</HEAD>");
  document.writeln("<BODY leftmargin='0' topmargin='0' marginwidth='1' marginheight='0'>");
  document.writeln("<CENTER>");
};

//============= fFamTitulo ====================
function fFamTitulo(familia,id,matrimonio,identificadores) {
  document.writeln("<TABLE class='TablaColor' BORDER='3' WIDTH='530' fBGCOLOR=#FFFFD0>");
  document.writeln("<TR><Th ROWSPAN=2><A HREF='http://www.cotobal.com' TARGET='_top'>");
  document.writeln("<IMG SRC='../img/esccoto_s.gif' BORDER=0></A></Th>");
  document.writeln("<Th COLSPAN=3>");
  if (identificadores)
	document.writeln(fIdentificador(id));
  document.writeln("<h1>Familia: <b>" + familia + "</b>");
  if (verNum) document.writeln("<span class='idF'>[" + id + "]</span>");
  document.writeln("</Th></TR>");
  if (matrimonio==" - ")
	document.writeln("<TR><Th COLSPAN=3></Th>");
  else
	document.writeln("<TR><Th COLSPAN=3><small>Matrimonio/unión: " + matrimonio + "</small></Th>");
};

//============= fFamTituloFin ====================
function fFamTituloFin() {
  document.writeln("</TABLE>");
};

//============= fFamDon ====================
function fFamDon(padreMadre,id,nombre,padres,foto,atras,arbol,identificadores) {
  if (padreMadre=="P") don="Sr."
  else                 don="Sra.";

  document.writeln("<TR><TD WIDTH='10%' ROWSPAN=2></TD>");
  document.writeln("<TD WIDTH='70%' COLSPAN=2><h3><B>" + don + " " + nombre + "</B>");
  if (verNum) document.writeln("<span class='idP'>" + id + "</span>");
  document.writeln("</TD>");
  document.writeln("<TD WIDTH='20%' ROWSPAN=2 valign='top'>");

  //-------- Foto ---------
  fFoto(foto,nombre,55);

  //-------- Arbol ---------
  if ((arbol!=0)&&(arbol!=999)) {
    document.writeln("<A HREF='" + sRutaArbol + fNombreArbol(arbol) + "'>");
    document.writeln("<IMG SRC='../img/arbolp.gif' BORDER=0></a>");
    if (identificadores)
	document.writeln(fIdentificador(arbol));
  };

  document.writeln("</TD></TR><TR>");
  document.writeln("<TD WIDTH='20%' ALIGN='RIGHT'>");

  //-------- Flecha Atras ---------
  if (atras!="0") {
      document.writeln("<A HREF='" + fNombreHojaFamilia(atras) + "' target='_top'>");
      document.writeln("<IMG SRC='../img/atras.gif' BORDER=0 WIDTH=26 HEIGHT=25 ALIGN=MIDDLE></A>");
      if (identificadores)
		document.writeln(fIdentificador(atras));
  };
  document.writeln("Hijo de:&nbsp;&nbsp;&nbsp;</TD><TD>" + padres + "</TD></TR>");

};

//============= fFamHijo ====================
function fFamHijo(id,numero,nombre,foto,nacim,fall,obs) {
  tamanoFoto=4;
  document.writeln("<TABLE BORDER='1' WIDTH='500' BGCOLOR=#FFFFF0>");
  document.writeln("<TR VALIGN='TOP'>");
  document.writeln("<TH WIDTH='10%' ROWSPAN=5>");
  document.writeln("<B>" + numero + "º HIJO</TH>");
  document.writeln("<TD CLASS='Zazul' COLSPAN=2>");
  document.writeln("<H4><B>" + nombre + "");
  if (verNum) document.writeln("<span class='idP'>" + id + "</span>");
  document.writeln("</TD>");

  if (nacim==" - ") tamanoFoto--;
  if (fall==" - ") tamanoFoto--;
  if (obs=="-") tamanoFoto--;

  document.writeln("<TD WIDTH='10%' ROWSPAN=" + tamanoFoto + ">");

  //-------- Foto ---------
  fFoto(foto,nombre,90);

  document.writeln("</TD></TR>");

  if (nacim!=" - ") {
    document.writeln("<TR><TD WIDTH='20%'>Nacimiento:</TD>");
    document.writeln("<TD>" + nacim + "</TD></TR>");
  };

  if (fall!=" - ") {
    document.writeln("<TR><TD>Fallecimiento:</TD>");
    document.writeln("<TD>" + fall + "</TD></TR>");
  };

  if (obs!="-") {
    document.writeln("<TR><TD>Observaciones:</TD>");
    document.writeln("<TD>" + obs + "</TD></TR>");
  };
};
//============= fFamHijoFin ====================
function fFamHijoFin() {
  document.writeln("</TABLE>");
};
//============= fFamMatrim ====================
function fFamMatrim(id,conyuge,paghijos,identificadores) {
  document.writeln("<TR>");
  document.writeln("<TD>Unido con:</TD>");
  document.writeln("<TD>" + conyuge);
  if (verNum) document.writeln("<span class='idF'>[" + id + "]</span>");
  document.writeln("</TD><TD>");

  document.writeln("<A HREF='" + fNombreHojaFamilia(paghijos) + "' target='_top'>");
  document.writeln("<IMG SRC='../img/adelante.gif' BORDER=0 WIDTH=26 HEIGHT=25 ALIGN=MIDDLE></A>");
  if (identificadores)
	document.writeln(fIdentificador(paghijos));

  if (verNum) document.writeln("<span class='idF'>[" + paghijos + "]</span>");
  document.writeln("</TD></TR>");
};

//============= fFamInstrucc ====================
function fFamInstrucc() {
  document.writeln("<BR><FONT SIZE=-1 FACE='Arial'>");
  document.writeln("Pulsa en las flechas doradas para \"navegar\" por las fichas (</B>");
  document.writeln("<IMG SRC='../img/atras.gif' BORDER=0 WIDTH=26 HEIGHT=25 ALIGN=MIDDLE>");
  document.writeln("para \"subir\" hacia los padres y abuelos; ");
  document.writeln("<IMG SRC='../img/adelante.gif' BORDER=0 WIDTH=26 HEIGHT=25 ALIGN=MIDDLE>");
  document.writeln("para \"bajar\" hacia los hijos y nietos), en ");
  document.writeln("<IMG SRC='../img/arbolp.gif' BORDER=0 WIDTH=36 HEIGHT=26 ALIGN=MIDDLE>");
  document.writeln("para acceder al árbol genealógico y en las fotografías para verlas en detalle.</FONT><BR>");

};

//============= fFamPie====================
function fFamPie(fecha) {
  document.writeln("</CENTER>");
  document.writeln("<p class='Peq'>Fecha generación: " + fecha + "</p><hr>");
  document.writeln("<A HREF=\"javascript:history.back()\">");
  document.writeln("<IMG SRC='../img/volver.gif' BORDER=0></A>");
  document.writeln("<A HREF='http://www.cotobal.com'>.</a>");
};

//============= fVerFoto ====================
function fVerFoto(Img,Nom) {
//alert("foto de "+Nom);
   open('../marco/marco.htm?img=' + Img + '&nom=' + Nom,'foto','width=396,height=446,scrollbars=no,toolbar=no,directories=no,menubar=no')
};


//============= fFoto ====================
function fFoto(id,nombre,tamano) {
  if (tamano<90)
     foto="../fot/nofotop2.gif";
  else
     foto="../fot/nofotop.gif";
  if (id==0)
    document.writeln("<IMG SRC='" + foto + "' BORDER=0 WIDTH=" + tamano + " HEIGHT=" + tamano + " >");
  else {
    document.writeln("<a href='javascript:void(null)'><IMG SRC='../fot/" + fNombreFoto(id) + "p.jpg' BORDER=1 WIDTH=" + tamano + " HEIGHT=" + tamano + " ");
    document.writeln(" onclick='fVerFoto(\"" + fNombreFoto(id) + "\",\"" + nombre + "\");' onmouseover='status=\"" + nombre + "\";' onMouseOut='status=\"\"';></A>");
  };
};

//============= Estilo ====================
function fEstilo() {
   document.writeln("<style TYPE='text/css'><!--");

   //document.writeln("H1{ font-family: ARIAL; color: rgb(128,0,128) }");

   document.writeln(".FTit{ font-family: ARIAL; color: rgb(153,51,51);  font-size: large }");
   //document.writeln("TD{ font-family: ARIAL; color: rgb(0,128,0);  font-size: smaller }");
   document.writeln("TD.azul{ font-family: ARIAL; color: rgb(0,0,255);}");

   document.writeln("--></style>");

};


//============= Atras ====================
function Atras() {
   history.back()
}
//================================================
        

//========== V A R I A S =========================================================

//============= fNombreHojaFamilia ====================
function fNombreHojaFamilia(familia) {
  familia=familia+"";
  lon=familia.length;
  //if (familia==0)
  //   return("javascript:void(null)");
  //else
     return(sRutaHojas + "f" + ("00000".substring(lon+1)) + familia + ".html");
};
//============= fNombreArbol ====================
function fNombreArbol(id) {
  id=id+"";
  lon=id.length;
  return("a" + ("00000".substring(lon+1)) + id + ".html#TOP");
};
//============= fNombreFoto ====================
function fNombreFoto(id) {
  //if (id==0)
  //	return("nofotop.gif");
  id=id+"";
  lon=id.length;
  return("p" + ("00000".substring(lon+1)) + id);
};
//============= fIdentificador ====================
function fIdentificador(id) {
  return("<font size=-2 color=black>[" + id + "]</font>");
};

