%if;(evar.t = "T")%doctype_transitional;%else;%doctype;%end;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <!-- $Id: anctree.txt,v 5.8 2007/01/19 01:53:16 ddr Exp $ -->
  <!-- Copyright (c) 1998-2007 INRIA -->
  <!-- Modified mickroue(a)yahoo.fr 20130624 templ=templm -->
  %let;l_v0;%if;(evar.v > max_anc_level)%max_anc_level;%else;%evar.v;%end;%in;
  %let;l_v;%if;(bvar.max_anc_tree = "")%l_v0;%elseif;(bvar.max_anc_tree > l_v0)%l_v0;%else;%bvar.max_anc_tree;%end;%in;
  <title>%nn;
    %if;(evar.t = "A")[*male line/female line]0%nn;
    %elseif;(evar.t = "C")[*male line/female line]1%nn;
    %else[*tree]%end;
    %if;(evar.t = "A" or evar.t = "C"):%sp;
      %if;(public_name != "")%public_name;%else;%first_name;%end;
      %if;(qualifier != "") %qualifier;%end; %surname;
    %end;
  </title>
  <meta name="robots" content="none"%/>
  <meta name="format-detection" content="telephone=no"%/>
  <meta http-equiv="Content-Type" content="text/html; charset=%charset;"%/>
  <meta http-equiv="Content-Style-Type" content="text/css"%/>
  <link rel="shortcut icon" href="%image_prefix;/favicon_gwd.png"%/>
  %include.css;
  %base_header;
</head>

%define;symbol(xx)
  <span %if;(xx.has_sosa)class="color_sosa"%end;
  >        %if;(xx.has_siblings)&diams;%elseif;(xx.has_parents)&loz;%else;|%end;        </span>
%end;

%define;a_tree_line()
  %if;(not is_first)
    <tr>
    %foreach;cell;
      %if;(not is_first)
        <td colspan="1" align="center"><tt>&nbsp;</tt></td>
      %end;
      <td colspan="%cell.colspan;" align="center">%nn;
        %if;(cell.is_empty or cell.is_top)<tt>&nbsp;</tt>%else;|%end;
      </td>
    %end;
    </tr>
  %end;
  <tr>
  %foreach;cell;
    %if;(not is_first)
      <td colspan="1" align="center"><tt>&nbsp;</tt></td>
    %end;
    <td colspan="%cell.colspan;" align="center">%nn;
    %if;(cell.is_empty)<tt>&nbsp;</tt>%nn;
    %else;
      %if;(evar.bd != "" and evar.bd > 0 or evar.color != "")%nl;
        <table style="border:solid %evar.bd;px; inherit;"><tr>
        <td align="center"%nn;
         %if;(evar.color != "") class="%evar.color;"%end;>%nn;
      %end;
      %if;(evar.cgl = "on")%cell.person;
      %else;
        <a href="%prefix;%cell.person.access;">%cell.person;</a>%nn;
      %end;
      %cell.person.title;%cell.person.dates;
      %if;(evar.bd != "" and evar.bd > 0 or evar.color != "")
        </td>
        </tr></table>
      %end;
      %if;(evar.image = "on" and cell.person.has_image)
        <br%/>
        <table border="0" align="center"><tr align="left">
        <td>%nn;
        %if;(evar.cgl != "on")<a href="%cell.person.image_html_url;">%end;
        <img%sp;
        src="%cell.person.image_url;"%cell.person.image_small_size;%sp;
         border="0" alt="[image/images]0"%/>%nn;
        %if;(evar.cgl != "on")</a>%end;</td>%nl;
        </tr></table>
      %end;
    %end;
    </td>
  %end;
  </tr>
  %if;(not is_last)
    <tr>
    %foreach;cell;
      %if;(not is_first)
        <td colspan="1" align="center">%nn;
        %if;cell.is_right;
          %if;(evar.marriage = "on" and cell.family.marriage_date.year != "")
            <i style="font-size:80%%">%nn;
            &amp;%cell.family.marriage_date.year;</i>
          %else;<tt>&nbsp;</tt>%end;
        %else;<tt>&nbsp;</tt>%end;
        </td>
      %end;
      <td colspan="%cell.colspan;" align="center">%nn;
      %if;cell.is_empty;<tt>&nbsp;</tt>%nn;
      %elseif;(evar.cgl = "on")%apply;symbol("cell.person")%nn;
      %else;
        <a style="text-decoration:none;" title="[tree]" href="%prefix_no_iz;%cell.person.access;;%nn;
        %foreach;env_binding;
          %if;(env.key = "" or env.key = "p" or env.key = "n" or env.key = "oc" or env.key = "i" or env.key = "templ")
          %else;%env.key;=%env.val.decoded;;%nn;
          %end;
        %end;">%apply;symbol("cell.person")</a>%nn;
      %end;
      </td>
    %end;
    </tr>
    <tr>
    %foreach;cell;
      %if;(not is_first)
        <td colspan="1" align="center">%nn;
        %if;(cell.is_right)<hr class="full"%/>%nn;
        %else;<tt>&nbsp;</tt>%end;
        </td>
      %end;
      <td colspan="%cell.colspan;" align="%nn;
         %if;cell.is_left;%right;
         %elseif;cell.is_right;%left;
         %else;center%end;">%nn;
      %if;cell.is_empty;<tt>&nbsp;</tt>%nn;
      %elseif;cell.is_left;<hr class="%right;"%/>%nn;
      %elseif;cell.is_right;<hr class="%left;"%/>%nn;
      %else;|%end;
      </td>
    %end;
    </tr>
  %end;
%end;

%define;male_line(xx, nn)
  %if;(nn > 0)
    %if;(xx.has_parents)%apply;male_line("xx.father", nn - 1)%end;
    <a href="%prefix;%xx.access">%xx;</a>%xx.title;%xx.dates;
    %if;("xx" != "self")<br%/>|<br%/>%end;
  %end;%nl;
%end;

%define;female_line(xx, nn)
  %if;(nn > 0)
    %if;(xx.has_parents)%apply;female_line("xx.mother", nn - 1)%end;
    <a href="%prefix;%xx.access">%xx;</a>%xx.title;%xx.dates;
    %if;("xx" != "self")<br%/>|<br%/>%end;
  %end;%nl;
%end;

%define;tree(xx)
  <table summary="tree" border="%border;" cellspacing="0" cellpadding="0" width="100%%">
  %foreach;ancestor_tree_line(xx)
    %apply;a_tree_line()
  %end;
  </table>
%end;

<body%body_prop; id="anctree">
%message_to_wizard;

%if;not cancel_links;
  %if;(evar.t = "T")
    <div class="menu">
      <span>
        <a title="[tree] (Y)" accesskey="Y" href="%prefix_no_iz;%nn;
          %foreach;env_binding;
            %if;(env.key = "m")m=D;%nn;
            %elseif;(env.key = "templ")
            %else;%env.key;=%env.val.decoded;;%nn;
            %end;
          %end;">[*tree] &darr;&darr;&darr;</a>
      </span>
    </div>
  %end;
  <div class="menu2">
    %let;l_on;onclick="this.focus()" onkeydown="if (event.keyCode == 13) javascript:document.tools.submit();"%in;
    <form id="tools" name="tools" style="display:inline" method="get" action="%action;">
      %hidden;
      <input type="hidden" name="m" value="A"%/>
      %if;(evar.p != "" or evar.n != "" or evar.oc != "")
        <input type="hidden" name="p" value="%evar.p;"%/>
        <input type="hidden" name="n" value="%evar.n;"%/>
        <input type="hidden" name="oc" value="%evar.oc;"%/>
      %end;
      %if;(evar.i != "")
        <input type="hidden" name="i" value="%evar.i;"%/>
      %end;
      <div><a href="#">[*tools]</a>
      <div class="s_menu">
        %if;(evar.t = "T")
          <a href="%prefix;m=A;t=T;v=%l_v;;%access;;dag=on;notab=on" accesskey="/" 
             title="[display by slices/slice width/overlap/total width]0 (/)"
             >[*display by slices/slice width/overlap/total width]0</a>
        %end;
        <fieldset>
          <label><input type="checkbox" name="cgl" value="on" %l_on;
                 %if;(evar.cgl = "on") checked="checked"%end;%/>[cancel GeneWeb links]</label>
          %if;(bvar.no_image_for_visitor != "yes" or friend or wizard)
            <label><input type="checkbox" name="image" value="on" %l_on;
                   %if;(evar.image = "on") checked="checked"%end;%/>[image/images]1</label>
          %end;
        </fieldset>
        <fieldset>
          <legend>
            <label><input type="radio" name="t" value="T" %l_on;
                   %if;(evar.t = "T") checked="checked"%end;%/>[*tree]</label>
          </legend>
          <label><input type="radio" name="t" value="A" %l_on;
                 %if;(evar.t = "A") checked="checked"%end;%/>[male line/female line]0</label>
          <label><input type="radio" name="t" value="C" %l_on;
                 %if;(evar.t = "C") checked="checked"%end;%/>[male line/female line]1</label>
          <label><input type="checkbox" name="marriage" value="on" %l_on;
                 %if;(evar.marriage = "on") checked="checked"%end;%/>[marriage/marriages]0</label>
          <label><input type="checkbox" name="dag" value="on" %l_on;
                 %if;(evar.dag = "on") checked="checked"%end;%/>dag=on</label>
          <label>[border]<input name="bd" size="1" maxlength="2" style="width:1em;" value="%evar.bd;" %/></label>
          <table summary="colors" cellspacing="0" cellpadding="0">
            <tr>
              <td align="%left;">[color] </td>
              <td align="%left;">
                <input type="radio" name="color" value=""
                  %if;(evar.color="") checked="checked"%end;%/></td>
              %for;i;1;7;
                %let;bgi;bg%i;%in;
                <td class="%bgi;"><input type="radio" name="color" value="%bgi;" %l_on;
                                  %if;(evar.color=bgi) checked="checked"%end;%/></td>
              %end;
            </tr>
          </table>
        </fieldset>
        <fieldset><legend>[*generation/generations]0</legend>
          <div class="v">
            %let;l_emaxv;%if;(bvar.max_anc_tree = "")7%else;%bvar.max_anc_tree;%end;%in;
            %let;l_maxv;%expr(l_emaxv + 1)%in;
            %for;i;2;l_maxv;
              <label>%i;<br%/>
                <input type="radio" name="v" value="%i;" %l_on;%if;(l_v = i) checked="checked"%end;%/>
              </label>
            %end;
          </div>
        </fieldset>
        <div class="ok"><input type="submit" value="ok"%/></div>
      </div>
      </div>
    </form>
    <a href="%prefix;" title="[visualize/show/hide/summary]3">^^</a>
  </div>
%end;

%if;(evar.t = "T")
  %apply;tree(l_v)
%elseif;(evar.t = "A")
  <div style="text-align: center">%apply;male_line("self",l_v)</div>
%elseif;(evar.t = "C")
  <div style="text-align: center">%apply;female_line("self",l_v)</div>
%end;
  %base_trailer;
  %copyright;
</body>
</html>
