%doctype;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <!-- $Id: ancsosa.txt,v 5.15 2007-07-25 13:15:19 ddr Exp $ -->
  <!-- Copyright (c) 1998-2007 INRIA -->
  <title>%nn;
    %if;(evar.t = "D")
      [*ancestors] ... [up to] ...%nn;
    %elseif;(evar.t = "N" and evar.only = "on")
      [*generation/generations]0 %evar.v;
    %else;
      %apply;a_of_b%with;
        %if;(evar.t = "M")
          %if;(evar.evt = "on")[*missing events]%else;[*missing ancestors]%end;
        %else;[*ancestors]
        %end;
      %and;
        %if;(public_name != "")%public_name;%else;%first_name;%end;
        %if;(qualifier != "") %qualifier;%end;
        %sp;%surname;
      %end;
    %end;
  </title>
  <meta name="robots" content="none"%/>
  <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>
<body%body_prop;>
%message_to_wizard;

<h1>%nn;
  %apply;a_of_b%with;
    %if;(evar.t = "M")
      %if;(evar.evt = "on")[*missing events]%else;[*missing ancestors]%end;
    %else;[*ancestors]
    %end;
  %and;
    %if;(public_name != "")%public_name;%else;%first_name;%end;
    %if;(qualifier != "") <em>%qualifier;</em>%end;
    %sp;%surname;
    %if;(alias != "") <em>(%alias;)</em>%end;
  %end;
  %if;(evar.t = "D") [up to] %pvar.1;%end;
</h1>

%if;(evar.cgl != "on")
  <table style="float:%right;"><tr><td>
    %if;(referer != "")
      <a href="%referer;"><img
       src="%image_prefix;/left.png"%wid_hei;left.png; 
       alt="&lt;&lt;" title="&lt;&lt;"%/></a>
    %end;
    <a href="%prefix;"><img%sp;
    src="%image_prefix;/up.png"%wid_hei;up.png; 
    alt="^^" title="^^"%/></a>
  </td></tr></table>
%end;

%let;central_index;%index;%in;

%define;tothegen(xx)
  [*to the %s generation:::xx]%nn;
%end;

%define;thegen(xx)
  [*the %s generation:::xx]%nn;
%end;

%define;togena(xx)
  %if;(xx = 1)[*specify::generation/generations]0%nn;
  %elseif;(xx = 2)[*to the parents]%nn;
  %elseif;(xx = 3)[*to the grandparents]%nn;
  %elseif;(xx = 4)[*to the great-grandparents]%nn;
  %else;
    %apply;tothegen%with;
      %apply;nth([nth (generation)], xx)
    %end;
  %end;
%end;

%define;tothegen(xx)
  [*to the %s generation:::xx]%nn;
%end;

%define;thegen(xx)
  [*the %s generation:::xx]%nn;
%end;

%define;togen(xx)
  %if;(xx = 1)[*specify::generation/generations]0%nn;
  %elseif;(xx = 2)[*to the parents]%nn;
  %elseif;(xx = 3)[*to the grandparents]%nn;
  %elseif;(xx = 4)[*to the great-grandparents]%nn;
  %else;
    %apply;tothegen%with;
      %apply;nth([nth (generation)], xx)
    %end;
  %end;
%end;

%define;gen(xx)
  %if;(evar.xx = 1)[*specify::generation/generations]0%nn;
  %elseif;(evar.xx = 2)[*the parents]%nn;
  %elseif;(evar.xx = 3)[*the grandparents]%nn;
  %elseif;(evar.xx = 4)[*the great-grandparents]%nn;
  %else;
    %apply;thegen%with;
      %apply;nth([nth (generation)], evar.xx)
    %end;
  %end;
%end;

%define;image_MF(xx,wi_he)
  %if;(xx != "x x")
    %if;xx.is_male;
      <img width="wi_he" height="wi_he" src="%image_prefix;/male.png"%sp;
           style="border: none" alt="[M/F]0"%/>%nn;
    %elseif;xx.is_female;
      <img width="wi_he" height="wi_he" src="%image_prefix;/female.png"%sp;
           style="border: none" alt="[M/F]1"%/>%nn;
    %else;
      <img width="wi_he" height="wi_he" src="%image_prefix;/sexunknown.png" 
           style="border: none" alt="?" title="?"%/>%nn;
    %end;
    %sp;
  %end;
%end;

%define;letter(xx)
  %apply;nth%with;
    /a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z
  %and;xx%end;
%end;

%define;living_interval_dates(xxx, yyy)
  %if;(evar.after != "" and evar.before != "")
    ,%sp;[living between %s and %s:::xxx:yyy]
  %elseif;(evar.before != "")
    ,%sp;[living before %s:::yyy]
  %elseif;(evar.after != "")
    ,%sp;[living after %s:::xxx]
  %else; %( On n'affiche rien %)
  %end;
%end;

%define;ancestor_missing_birth(xx)
  %if;(xx.has_birth_date or xx.has_birth_place)
    %if;xx.has_birth_date; %xx.slash_birth_date;%end;
    %if;xx.has_birth_place; - %xx.birth_place;%end;
  %elseif;(xx.has_baptism_date or xx.has_baptism_place)
    %if;xx.has_baptism_date; %xx.slash_baptism_date;%end;
    %if;xx.has_baptism_place; - %xx.baptism_place;%end;
  %else;
    &nbsp;
  %end;
%end;

%define;ancestor_missing_death(xx)
  %if;xx.is_dead;
    %if;xx.has_death_date; %xx.slash_death_date;%end;
    %if;xx.has_death_place; - %xx.death_place;%end;
  %elseif;xx.is_buried;
    %if;xx.has_burial_date; %xx.slash_burial_date;%end;
    %if;xx.has_burial_place; - %xx.burial_place;%end;
  %elseif;xx.is_cremated;
    %if;xx.has_cremation_date; %xx.slash_cremation_date;%end;
    %if;xx.has_cremation_place; - %xx.cremation_place;%end;
  %else;
    &nbsp;
  %end;
%end;

%define;display_missing_ancestor_info(xx)
  %if;(evar.birth = "on")
    <td>%apply;ancestor_missing_birth("xx")</td>
  %end;
  %if;(evar.death = "on")
    <td>%apply;ancestor_missing_death("xx")</td>
  %end;
  %if;(evar.spouse = "on")
    <td>
      %if;xx.has_families;
        %if;(not xx.has_parents and xx.first_name != "?" and xx.surname != "?")
          %foreach;xx.family;
            %if;(spouse.first_name != "?" and spouse.surname != "?")
              %if;(family_cnt > 1),%sp;%end;
              %apply;image_MF("spouse", "11")
              %apply;link(spouse.access, spouse)
            %end;
          %end;
        %end;
      %end;
    </td>
  %end;
%end;

%define;somebody_long_info(xx)
  %if;xx.has_aliases;
    %foreach;xx.alias;, [alias] <em>%alias;</em>%end;
  %end;
  %if;(("xx" = "ancestor" or xx.sosa_in_list = "") and xx.has_nobility_titles)
    <em>%nn;
    %foreach;xx.nobility_title;, %nobility_title;%end;
    </em>%nn;
  %end;
  %if;(xx.has_birth_date or xx.has_birth_place)
    , %if;xx.is_male;[born]0%elseif;xx.is_female;[born]1%else;[born]2%end;
    %if;xx.has_birth_date; %xx.on_birth_date;%end;
    %if;xx.has_birth_place;, %xx.birth_place;%end;
  %end;
  %if;(xx.has_baptism_date or xx.has_baptism_place)
    , %if;xx.is_male;[baptized]0%elseif;xx.is_female;[baptized]1%nn;
    %else;[baptized]2%end;
    %if;xx.has_baptism_date; %xx.on_baptism_date;%end;
    %if;xx.has_baptism_place;, %xx.baptism_place;%end;
  %end;
  %if;xx.is_dead;, %xx.died;
    %if;(xx.has_death_date) %xx.on_death_date;%end;
    %if;(xx.has_death_place), %xx.death_place;%end;
  %end;
  %if;xx.is_buried;,
    %if;xx.is_male;[buried]0%else;[buried]1%end;
    %if;xx.has_burial_date; %xx.on_burial_date;%end;
    %if;xx.has_burial_place;, %xx.burial_place;%end;%nl;
  %end;
  %if;xx.is_cremated;,
    %if;xx.is_male;[cremated]0%else;[cremated]1%end;
    %if;xx.has_cremation_date; %xx.on_cremation_date;%end;
    %if;xx.has_cremation_place;, %xx.cremation_place;%end;%nl;
  %end;
  %if;xx.computable_death_age;%sp;
    ([age at death:] %xx.death_age;)%nn;
  %end;
%end;

%define;link(aa, xx)
  %if;(evar.cgl = "on")xx%else;<a href="%prefix;aa">xx</a>%end;
%end;

%define;link2(xx)
  %if;(evar.cgl = "on")%xx;%else;<a href="%prefix;%xx.access;">%xx;</a>%end;
  %xx.title;%xx.dates;
%end;

%define;my_link(aa, xx, rr)	
  %if;(evar.cgl = "on" or rr)xx%else;<a href="%prefix;aa">xx</a>%end;	
%end;

%define;somebody_extra_info(xx)
  %if;xx.has_occupation;, %xx.occupation;%end;
  %if;(evar.rel = "on" and xx.has_relations)
    %foreach;xx.relation;%nl;
      (%relation_type;:
      %if;has_relation_him;
        %apply;link2(relation_him.var)
        %if;(relation_him.sosa_in_list != ""),
          [see] <a href="#%relation_him.sosa_in_list;">%nn;
          %relation_him.sosa_in_list;</a>%nn;
        %end;
      %end;
      %if;has_relation_her;
        %if;has_relation_him;,%nl;%end;
        %apply;link2(relation_her.var)
        %if;(relation_her.sosa_in_list != ""),
          [see] <a href="#%relation_her.sosa_in_list;">%nn;
          %relation_her.sosa_in_list;</a>%nn;
        %end;
      %end;)%nn;
    %end;
    %foreach;xx.related;%nl;
      (%related_type;:
       %apply;link2(related.var)
       %if;(related.sosa_in_list != ""),
         [see] <a href="#%related.sosa_in_list;">%nn;
         %related.sosa_in_list;</a>%nn;
       %end;)%nn;
    %end;
  %end;
%end;

%define;somebody(xx)
  <b>%apply;my_link(xx.access, xx, xx.is_restricted)</b>%nn;
  %apply;somebody_long_info("xx")
  %apply;somebody_extra_info("xx")
%end;

%define;somebody_spouse_parent(xx)
  <b>%apply;my_link(spouse.xx.access, spouse.xx, spouse.is_restricted)</b>%nn;
  %if;spouse.xx.has_nobility_titles;,
    <a href="%prefix;m=TT;sm=S;t=%spouse.xx.nobility_title.ident_key;
    ;p=%spouse.xx.nobility_title.place_key;">%nn;
      <em>%spouse.xx.nobility_title;</em></a>%nn;
  %end;
  %spouse.xx.dates;
  %if;(spouse.xx.sosa_in_list != "")%sp;
    ([see] <a href="#%spouse.xx.sosa_in_list;"><b>%spouse.xx.sosa_in_list;
    </b></a>)%nn;
  %end;
%end;

%define;image_sosa(xxx,yyy)
  <img src="%image_prefix;/sosa.png" style="border: none" alt="sosa" title="[direct ancestor of %s:::xxx], [*Sosa] yyy"%/>%nn;
%end;

%define;display_sosa(xx)
  %if;(xx.has_sosa and bvar.display_sosa="yes")
    %if;not cancel_links;<a href="%prefix;%xx.sosa_link;">%end;
    %apply;image_sosa%with;%sosa_ref.first_name_key_strip;%sp;
    %sosa_ref.surname_key_strip;
    %and;%xx.sosa;%end;
    %if;not cancel_links;</a>%end;%sp;
  %end;
%end;

%define;short_display_person(xx)
  %apply;display_sosa("xx")
  %if;(xx.index=central_index)<b>%xx;</b>%else;
    %if;(cancel_links or xx.is_restricted)%xx;
    %else;<a href="%prefix;%xx.access;">%xx;</a>%end;
  %end;
  %xx.title;%xx.dates;
%end;


%define;married_to(is_male, date_place)
  %if;("is_male" = 1)
    %if;are_married;[married%t to:::date_place]0%nn;
    %elseif;are_not_married;[relationship%t to:::date_place]0%nn;
    %elseif;are_engaged;[engaged%t to:::date_place]0%nn;
    %elseif;is_no_sexes_check;[relationship%t to:::date_place]0%nn;
    %elseif;is_no_mention;date_place [with]%nn;
    %end;
  %else;
    %if;are_married;[married%t to:::date_place]1%nn;
    %elseif;are_not_married;[relationship%t to:::date_place]1%nn;
    %elseif;are_engaged;[engaged%t to:::date_place]1%nn;
    %elseif;is_no_sexes_check;[relationship%t to:::date_place]1%nn;
    %elseif;is_no_mention;date_place [with]%nn;
    %end;
  %end;
%end;

%(
  Long display
%)

%define;child_notes(spec)
  %if;(child.sosa_in_list = "" and
       (evar.src = "on" and child.has_sources or
        evar.notes = "on" and child.has_notes))
    <dt><a href="#%ancestor.anc_sosa.v;" name="notes-%ancestor.anc_sosa.v;
    %if;("spec" != "")-spec%end;
    %apply;letter(child_cnt)"><b>%ancestor.anc_sosa;
    %if;("spec" != "")-spec%end;
    %apply;letter(child_cnt)</b></a>:</dt>
    <dd>
    %if;(evar.notes = "on" and child.has_notes)
      <table><tr><td>%child.notes;</td></tr></table>
      <br%/>
    %end;
    %if;(evar.src = "on" and child.has_sources)
      <em style="font-size:80%%">[*source/sources]1:<br%/>
      %foreach;child.source;
        - %source_type;: %source;<br%/>
      %end;
      </em>
      <br%/>
    %end;
    </dd>
  %end;
%end;

%define;long_display_notes()
  <h3>
    %if;(evar.notes = "on")[*note/notes]1%else;[*source/sources]1%end;
    <a name="ns">&nbsp;</a>
  </h3>
  <dl>
  %foreach;ancestor_level;
    %if;(evar.v != "" and level <= evar.v
         and (evar.only != "on" or level = evar.v))
      %foreach;ancestor;
        %if;((evar.src = "on" and ancestor.has_sources or
              evar.notes = "on" and ancestor.has_notes)
             and ancestor.same = "")
          <dt><b><a href="#%ancestor.anc_sosa.v;
          " name="notes-%ancestor.anc_sosa.v;
          ">%ancestor.anc_sosa;</a></b>:</dt>
          <dd>
          %if;(evar.notes = "on" and ancestor.has_notes)
            <table><tr><td>%ancestor.notes;</td></tr></table>
            <br%/>
          %end;
          %if;(evar.src = "on" and ancestor.has_sources)
            <em style="font-size:80%%">[*source/sources]1:<br%/>
            %foreach;ancestor.source;
              - %source_type;: %source;<br%/>
            %end;
            </em>
            <br%/>
          %end;
          </dd>
        %end;
        %if;(evar.siblings = "on" and
	     ancestor.is_female and ancestor.same = "")
          %( siblings %)
          %if;(ancestor.index != self.index)
            %foreach;ancestor.family;
              %if;(family.index = ancestor.family.index)
                %foreach;child;
                  %apply;child_notes("")
                %end;
              %end;
            %end;
            %( father's other families %)
            %foreach;ancestor.spouse.family;
              %if;(spouse.index != ancestor.index)
                %foreach;child;
                  %apply;child_notes(family_cnt)
                %end;
              %end;
            %end;
            %( mother's other families %)
            %foreach;ancestor.family;
              %if;(spouse.index != ancestor.spouse.index)
                %foreach;child;
                  %apply;child_notes(family_cnt)
                %end;
              %end;
            %end;
          %end;
        %end;
      %end;
    %end;
  %end;
  </dl>
%end;

%define;long_display_ancestor_personal()
  %apply;somebody("ancestor").
  %if;(evar.only != "on" and ancestor.father_sosa != "")
    [*parents]:%sp;
    <b><a href="#%ancestor.father_sosa;">%ancestor.father_sosa;</a></b>%sp;
    [and]%sp;
    <b><a href="#%ancestor.mother_sosa;">%ancestor.mother_sosa;</a></b>.
  %end;
  %if;(evar.siblings = "on")
    %foreach;ancestor.family;
      %if;(ancestor.index = index or family.index != ancestor.family.index)
        %apply;capitalize%with;
          %apply;married_to%with;
            %ancestor.is_male;
          %and;
            %if;(ancestor.index != index) (%family_cnt;)%end;
            %if;(on_marriage_date != "") %on_marriage_date;%end;
            %if;(marriage_place != ""), %marriage_place;, %end;
          %end;%sp;
        %end;
        %apply;somebody("spouse")%nn;
        %if;spouse.has_parents;,%sp;
          %apply;a_of_b%with;
            %if;spouse.is_male;[son/daughter/child]0
            %else;[son/daughter/child]1%end;
          %and;
            %apply;somebody_spouse_parent("father") [and]
            %apply;somebody_spouse_parent("mother")
          %end;
        %end;.
      %end;
    %end;
  %end;
  %if;((evar.notes = "on" and ancestor.has_notes and evar.inline = "on") or (evar.src = "on" and ancestor.has_sources and evar.inline = "on"))
    <p class="asc_notes_src_inline">
      %if;(evar.notes = "on" and ancestor.has_notes)
        [*note/notes]0 : %apply;clean_html_tags(ancestor.notes)
        <br%/>
      %end;
      %if;(evar.src = "on" and ancestor.has_sources)
        <em>
          [*source/sources]1 :
          %foreach;ancestor.source;
            %source_type;: %apply;clean_html_tags(source)
            %if;(not is_last),%sp;%end;
          %end;
        </em>
      %end;
    </p>
  %end;
  %if;((evar.notes = "on" and ancestor.has_notes or evar.src = "on" and ancestor.has_sources) and evar.inline != "on")
    %if;(evar.notes = "on")%[[*note/notes]0%sp;
    %else;%[[*source/sources]1%sp;
    %end;
    <b><a href="#notes-%ancestor.anc_sosa.v;">%ancestor.anc_sosa;</a></b>%].
  %end;
%end;

%define;child_long_info(spec)
  <b>%apply;my_link(child.access, child.child_name, child.is_restricted)%nn;</b>%nn;
  %apply;somebody_long_info("child")
  %if;(child.sosa_in_list != "").
    %if;(evar.only != "on")[*see]%sp;
      <a href="#%child.sosa_in_list;"><b>%child.sosa_in_list;</b></a>.
    %end;
  %else;
    %apply;somebody_extra_info("child").
    %foreach;child.family;
      %if;(evar.inline= "on" and ((child.has_notes and evar.notes = "on") or (child.has_sources and evar.src = "on")))
        <br%/>
      %end; 
      %apply;capitalize%with;
        %apply;married_to%with;
          %child.is_male;
        %and;
          %if;(on_marriage_date != "") %on_marriage_date;%end;
          %if;(marriage_place != ""), %marriage_place;, %end;
        %end;%sp;
      %end;
      %apply;somebody("spouse")%nn;
      %if;spouse.has_parents;,%sp;
        %apply;a_of_b%with;
          %if;spouse.is_male;[son/daughter/child]0
          %else;[son/daughter/child]1%end;
        %and;
          %apply;somebody_spouse_parent("father") [and]
          %apply;somebody_spouse_parent("mother")
        %end;
      %end;.
      %if;are_divorced;[*divorced]0%divorce_date;.%nl;
      %elseif;are_separated;[*separated]0.%nl;
      %end;
    %end;
    %if;((evar.notes = "on" and child.has_notes and evar.inline = "on") or (evar.src = "on" and child.has_sources and evar.inline = "on"))
      <p class="asc_notes_src_inline">
        %if;(evar.notes = "on" and child.has_notes)
          [*note/notes]0 : %apply;clean_html_tags(child.notes)
          <br%/>
        %end;
        %if;(evar.src = "on" and child.has_sources)
          <em>
            [*source/sources]1 :
            %foreach;child.source;
              %source_type;: %apply;clean_html_tags(source)
              %if;(not is_last),%sp;%end;
            %end;
          </em>
        %end;
      </p>
    %end;
    %if;((evar.notes = "on" and child.has_notes or evar.src = "on" and child.has_sources) and evar.inline != "on")
      %if;(evar.notes = "on")%[[*note/notes]0%sp;
      %else;%[[*source/sources]1%sp;
      %end;
      <b>
        <a href="#notes-%ancestor.anc_sosa.v;%if;("spec" != "")-spec%end;%apply;letter(child_cnt)">
          %ancestor.anc_sosa;%if;("spec" != "")-spec%end;%apply;letter(child_cnt)
        </a>
      </b>%].
    %end;
  %end;
%end;

%define;long_display_ancestor_families()
  %if;ancestor.is_male;
    ...
    %foreach;ancestor.family;
      %if;(family.index = ancestor.family.index)
        %apply;married_to%with
          %ancestor.is_male;
        %and;
          %if;(on_marriage_date != "") %on_marriage_date;%end;
          %if;(marriage_place != ""), %marriage_place;, %end;
        %end;...
      %end;
    %end;
  %else;
    %foreach;ancestor.family;
      %if;(family.index = ancestor.family.index)
        ...
        %if;(evar.witn = "on" and has_witnesses)([witness/witnesses]1:
          %foreach;witness;
            %if;(not is_first),%nl;%end;
            %apply;link2(witness.var)
          %end;),
        %end;
        %if;(evar.comm = "on" and has_comment)(%comment;)%nl;%end;
        <i>[having as children]:</i>
        <p>
          <ol style="list-style-type:lower-latin">
          %foreach;child;
            %if;(evar.siblings = "on" or child.sosa_in_list != "")
              <li>%apply;child_long_info("")</li>
            %end;
          %end;
          </ol>
        </p>
      %end;
    %end;
    %if;(evar.siblings = "on")
      %( father's other children %)
      %foreach;ancestor.spouse.family;
        %if;(spouse.index != ancestor.index and nb_children > 0)
          <i>... [having as children]%sp;</i>
          <a href="#%family.father.sosa_in_list;
          "><b>%family.father.sosa_in_list;
          </b></a>-(X%family_cnt;):
          <p><ol style="list-style-type:lower-latin">
          %foreach;child;
            <li>%apply;child_long_info(family_cnt)</li>
          %end;
          </ol></p>
        %end;
      %end;
      %( mother's other children %)
      %foreach;ancestor.family;
        %if;(spouse.index != ancestor.spouse.index and nb_children > 0)
          <i>... [having as children]%sp;</i>
          <a href="#%family.mother.sosa_in_list;
          "><b>%family.mother.sosa_in_list;
          </b></a>-(X%family_cnt;):
          <p><ol style="list-style-type:lower-latin">
          %foreach;child;
            <li>%apply;child_long_info(family_cnt)</li>
          %end;
          </ol></p>
        %end;
      %end;
    %end;
  %end;
%end;

%define;dates_in_interval(xx)
  %if;(evar.after != "" and
       (xx.birth_date.year = "" and
        xx.baptism_date.year = "" and
        xx.death_date.year = "" and
        xx.burial_date.year = "" and
        xx.cremated_date.year = "" or
        xx.birth_date.year != "" and
        xx.birth_date.year < evar.after or
        xx.baptism_date.year != "" and
        xx.baptism_date.year < evar.after or
        xx.death_date.year != "" and
        xx.death_date.year < evar.after or
        xx.burial_date.year != "" and
        xx.burial_date.year < evar.after or
        xx.cremated_date.year != "" and
        xx.cremated_date.year < evar.after) or
       evar.before != "" and
       (xx.birth_date.year = "" and
        xx.baptism_date.year = "" and
        xx.death_date.year = "" and
        xx.burial_date.year = "" and
        xx.cremated_date.year = "" or
        xx.birth_date.year != "" and
        xx.birth_date.year > evar.before or
        xx.baptism_date.year != "" and
        xx.baptism_date.year > evar.before or
        xx.death_date.year != "" and
        xx.death_date.year > evar.before or
        xx.burial_date.year != "" and
        xx.burial_date.year > evar.before or
        xx.cremated_date.year != "" and
        xx.cremated_date.year > evar.before))false%nn;
  %else;true%end;
%end;

%(
   Display ascend in table
%)

%define;table_header()
  %reset_count;
  <th>[*Sosa]</th>
  %incr_count;
  <th>[*person/persons]0</th>
  %incr_count;
  %if;(evar.birth = "on")
    <th>[*date of birth]</th>
    %incr_count;
  %end;
  %if;(evar.birth_place = "on")
    <th>[*where born]</th>
    %incr_count;
  %end;
  %if;(evar.marr = "on")
    <th>[*spouse/spouses]1</th>
    %incr_count;
  %end;
  %if;(evar.marr_date = "on")
    <th>[*date of marriage]</th>
    %incr_count;
  %end;
  %if;(evar.marr_place = "on")
    <th>[*where married]</th>
    %incr_count;
  %end;
  %if;(evar.child = "on")
    <th>[*nb children]</th>
    %incr_count;
  %end;
  %if;(evar.death = "on")
    <th>[*date of death]</th>
    %incr_count;
  %end;
  %if;(evar.death_place = "on")
    <th>[*where dead]</th>
    %incr_count;
  %end;
  %if;(evar.death_age = "on")
    <th>[*age at death]</th>
    %incr_count;
  %end;
  %if;(evar.occu = "on")
    <th>[*occupation/occupations]1</th>
    %incr_count;
  %end;
%end;

%define;table_row()
  %lazy_force;
  %if;(ancestor.same = "")%incr_count;%end;
  <td %if;(ancestor.nb_families>1 and (evar.marr = "on" or evar.marr_date = "on" or evar.marr_place = "on"))rowspan="%ancestor.nb_families;"%end;>
    %if;(evar.sosab = 16)%ancestor.anc_sosa.hexa;
    %elseif;(evar.sosab = 8)%ancestor.anc_sosa.octal;
    %else;%ancestor.anc_sosa;%end;
  </td>
  <td %if;(ancestor.nb_families>1 and (evar.marr = "on" or evar.marr_date = "on" or evar.marr_place = "on"))rowspan="%ancestor.nb_families;"%end;>
    %apply;image_MF("ancestor", "11")
    %apply;link%with;%ancestor.access;%and;
      %ancestor;
    %end
    %ancestor.title;
    %if;(ancestor.same != "" and evar.repeat = "on")
      %sp;→
      %if(evar.sosab = 16)%ancestor.same.hexa;
      %elseif(evar.sosab = 8)%ancestor.same.octal;
      %else;%ancestor.same;%end;
    %end;
  </td>
  %if;(evar.birth = "on")
    <td %if;(ancestor.nb_families>1 and (evar.marr = "on" or evar.marr_date = "on" or evar.marr_place = "on"))rowspan="%ancestor.nb_families;"%end;>
      %if;ancestor.has_birth_date;
        %ancestor.slash_birth_date;
      %elseif;ancestor.has_baptism_date;
        %ancestor.slash_baptism_date;
      %else;
        &nbsp;
      %end;
    </td>
  %end;
  %if;(evar.birth_place = "on")
    <td %if;(ancestor.nb_families>1 and (evar.marr = "on" or evar.marr_date = "on" or evar.marr_place = "on"))rowspan="%ancestor.nb_families;"%end;>
      %if;ancestor.has_birth_date;
        %ancestor.birth_place;
      %elseif;ancestor.has_baptism_date;
        %ancestor.baptism_place;
      %else;
        &nbsp;
      %end;
    </td>
  %end;
  %if;(evar.marr = "on")
    %if;(ancestor.nb_families = 0)
      <td>&nbsp;</td>
    %else;
      %foreach;ancestor.family;
        %if;(family_cnt = 1)
          <td %if;(ancestor.nb_families > 1) style="border-bottom:none" %end;>
            %apply;image_MF("spouse", "11")
            %apply;link%with;%spouse.access;%and;
              %spouse;
            %end;
          </td>
        %end;
      %end;
    %end;
  %end;
  %if;(evar.marr_date = "on")
    %if;(ancestor.nb_families = 0)
      <td>&nbsp;</td>
    %else;
    %foreach;ancestor.family;
      %if;(family_cnt = 1)
        <td %if;(ancestor.nb_families > 1) style="border-bottom:none" %end;>
          %if;(slash_marriage_date != "")
            %slash_marriage_date;
          %else;
            &nbsp;
          %end;
        </td>
      %end;
      %end;
    %end;
  %end;
  %if;(evar.marr_place = "on")
    %if;(ancestor.nb_families = 0)
      <td>&nbsp;</td>
    %else;
    %foreach;ancestor.family;
      %if;(family_cnt = 1)
        <td %if;(ancestor.nb_families>1) style="border-bottom:none" %end;>
          %if;(marriage_place != "")
            %marriage_place;
          %else;
            &nbsp;
          %end;
        </td>
      %end;
      %end;
    %end;
  %end;
  %if;(evar.child = "on")
    %if;(ancestor.nb_families = 0)
      <td>&nbsp;</td>
    %else;
      %if;(evar.marr = "on" or evar.marr_date = "on" or evar.marr_place = "on")
        %foreach;ancestor.family;
          %if;(family_cnt = 1)
            <td align="center" %if;(ancestor.nb_families > 1) style="border-bottom:none" %end;>
              %nb_children;
            </td>
          %end;
        %end;
      %else;
        <td>%ancestor.nb_children;</td>
      %end;
    %end;
  %end;
  %if;(evar.death = "on")
    <td %if;(ancestor.nb_families>1 and (evar.marr = "on" or evar.marr_date = "on" or evar.marr_place = "on"))rowspan="%ancestor.nb_families;"%end;>
      %if;ancestor.has_death_date;
        %ancestor.slash_death_date;
      %elseif;ancestor.has_burial_date;
        %ancestor.slash_burial_date;
      %else;
        &nbsp;
      %end;
    </td>
  %end;
  %if;(evar.death_place = "on")
    <td %if;(ancestor.nb_families>1 and (evar.marr = "on" or evar.marr_date = "on" or evar.marr_place = "on"))rowspan="%ancestor.nb_families;"%end;>
      %if;ancestor.has_death_date;
        %ancestor.death_place;
      %elseif;ancestor.has_burial_date;
        %ancestor.burial_place;
      %else;
        &nbsp;
      %end;
    </td>
  %end
  %if;(evar.death_age = "on")
    <td %if;(ancestor.nb_families>1 and (evar.marr = "on" or evar.marr_date = "on" or evar.marr_place = "on"))rowspan="%ancestor.nb_families;"%end;>
      %ancestor.death_age;
    </td>
  %end;
  %if;(evar.occu = "on")
    <td %if;(ancestor.nb_families>1 and (evar.marr = "on" or evar.marr_date = "on" or evar.marr_place = "on"))rowspan="%ancestor.nb_families;"%end;>
      %if;(ancestor.has_occupation)
        %ancestor.occupation
      %else;
        &nbsp;
      %end;
    </td>
  %end;
%end;

%define;table_family()
  %if;(evar.marr = "on" or evar.marr_date = "on" or evar.marr_place = "on")
    %foreach;ancestor.family;
      %if;(family_cnt != 1)
        <tr>
          %if;(evar.marr = "on")
            <td style="border-top:none; %if;(ancestor.nb_families != family_cnt) border-bottom:none %end;">
              %apply;image_MF("spouse", "11")
              %apply;link%with;%spouse.access;%and;
                %spouse;
              %end;
            </td>
          %end;
          %if;(evar.marr_date = "on")
            <td style="border-top:none; %if;(ancestor.nb_families != family_cnt) border-bottom:none %end;">
              %if;(slash_marriage_date != "")
                %slash_marriage_date;
              %else;
                &nbsp;
              %end;
            </td>
          %end;
          %if;(evar.marr_place = "on")
            <td style="border-top:none; %if;(ancestor.nb_families != family_cnt) border-bottom:none %end;">
              %if;(marriage_place != "")
                %marriage_place;
              %else;
                &nbsp;
              %end;
            </td>
          %end;
          %if;(evar.child = "on")
            <td align="center" style="border-top:none; %if;(ancestor.nb_families != family_cnt) border-bottom:none %end;">
              %nb_children;
            </td>
          %end;
        </tr>
      %end;
    %end;
  %end;
%end;


%(
   Main
%)

%if;(evar.t = "P")
  %include.perso_short;
%elseif;((evar.v = "" and evar.t != "D") or evar.v <= 1)
  [*specify::generation/generations]0.
%else;
  %if;(evar.t = "N" and evar.only = "on")
    %( short display; only the selected generation %)
    %reset_count;
    <ul>
      %foreach;ancestor_level2;
        %if;(evar.v != "" and level = evar.v)
          <li>%nl;<b>%apply;gen("v")</b>%nl;
            <ul>%nl;
              %foreach;ancestor;
                <li>%sp;
                  %if;(ancestor.interval != "")%ancestor.interval;
                  %else;
                    %if;(ancestor.same = "")%incr_count;%end;
                    %ancestor.anc_sosa;%sp;
                    %if;(ancestor.same != "")=&gt;%else;-%end;%sp;
                    %apply;link%with;%ancestor.access;%and;
                      %if;(ancestor.same != "")%ancestor.same;
                      %else;%ancestor;%end;
                    %end;
                    %if;(ancestor.same = "")%ancestor.title;%ancestor.dates;%end;
                  %end;
                </li>%nl;
              %end;
            </ul>
          </li>
        %end;
      %end;
    </ul>
    <p>[*total]: %count; [[person/persons]1@(c)]</p>
  
  %elseif;(evar.t = "N")
    %( short display %)
    %let;nb_gen;%apply;min(evar.v, max_anc_level)%in;
    <p>%apply;togen(nb_gen).</p>
    %reset_count;
    <ul>
      %foreach;ancestor_level(nb_gen)
        %apply;lazy_print%with;
          <li>%nl;<b>[*generation/generations]0 %level;</b>%nl;
          <ul>%nl;
        %end;
        %foreach;ancestor;
          %lazy_force;
          %if;(ancestor.same = "")%incr_count;%end;
          <li class="%if;ancestor.has_parents;goway%else;noway%end;">%nn;
            %if;(evar.sosab = 16)%ancestor.anc_sosa.hexa;
            %elseif;(evar.sosab = 8)%ancestor.anc_sosa.octal;
            %else;%ancestor.anc_sosa;
            %end;%sp;
            %if;(ancestor.same != "")=&gt;%else;-%end;%sp;
            %apply;link%with;%ancestor.access;%and;
               %if;(ancestor.same != "")%nn;
                 %if(evar.sosab = 16)%ancestor.same.hexa;
                 %elseif(evar.sosab = 8)%ancestor.same.octal;
                 %else;%ancestor.same;
                 %end;
               %else;%ancestor;
               %end;
            %end;
            %if;(ancestor.same = "")%ancestor.title;%ancestor.dates;%end;
          </li>%nl;
        %end;
        %if;lazy_printed;
          </ul>
          </li>
        %end;
      %end;
    </ul>
    <p>[*total]: %count; [[person/persons]1@(c)]</p>
  
  %elseif;(evar.t = "M" and evar.evt = "on")
    %include.miss_evt;

  %elseif;(evar.t = "M" and evar.al = "on")
    %( missing ancestors alphabetically %)
    %let;nb_gen;%apply;min(evar.v, max_anc_level)%in;
    <p>
      %apply;togen(nb_gen)
      %apply;living_interval_dates(evar.after, evar.before).
    </p>
    <div class="not_printable" style="margin-bottom:25px;">
      <table class="display_search">
        <tr>
          <td><b>[*sort by/generation/alphabetic order]0</b></td>
          <td><img src="%image_prefix;/picto_branch.png"%/></td>
          <td>
            <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;t=%evar.t;&amp;v=%evar.v;&amp;birth=%evar.birth;&amp;death=%evar.death;&amp;spouse=%evar.spouse;&amp;al=">
              [sort by/generation/alphabetic order]1
            </a>
          </td>
          <td><img src="%image_prefix;/picto_alphabetic_order.png"%/></td>
          <td>[sort by/generation/alphabetic order]2</td>
        </tr>
      </table>
    </div>

    %empty_sorted_list;
    %reset_count;
    %foreach;ancestor_level(nb_gen)
      %foreach;ancestor;
        %if;(ancestor.same = "")
          %if;(ancestor.first_name != "?" and ancestor.surname != "?" and (not ancestor.has_parents or (ancestor.has_families and (ancestor.spouse.first_name = "?" and ancestor.spouse.surname = "?"))))
            %if;(dates_in_interval(ancestor.var) = "true")
              %incr_count;
              %apply;add_in_sorted_list%with
                %ancestor.surname_end;
                %and;%ancestor.first_name;
                %and;%ancestor.surname_begin;
                %and;%ancestor.access;
                %and;%apply;image_MF("ancestor", "11")
                %and;%ancestor.nobility_title;
                %and;%apply;ancestor_missing_birth("ancestor")
                %and;%apply;ancestor_missing_death("ancestor")
                %and;
                  %if;(not ancestor.has_parents)
                    x
                  %else;
                    &nbsp;
                  %end;
                %and;
                  %if;(ancestor.has_families and (ancestor.spouse.first_name = "?" and ancestor.spouse.surname = "?"))
                    x
                  %else;
                    &nbsp;
                  %end;
              %end;
            %end;
          %end;
        %end;
      %end;
    %end;
  
    %let;nb_ind;%count;%in;
    %reset_count;
    %if;(nb_ind > 100)
      <p>
        %foreach;sorted_list_item;
          %if;(initial(prev_item.1) != initial(item.1))
            <a href="#a_%apply;hexa(initial(item.1))">%apply;initial(item.1)</a>
          %end;
        %end;
      </p>
    %end;
  
    <ul class="missing_ancestors_sort">
      %if;(nb_ind <= 100)
        <li>%nn;
        <a name="a_%apply;hexa(initial(item.1))">%apply;initial(item.1)</a>
        <table class="missing_ancestors_table">
          <tr class="missing_ancestors_table_header">
            <th width="20%%">[*person/persons]0</th>
            %if;(evar.birth = "on") 
              <th %if;(evar.death = "on")width="30%%"%else;width="60%%"%end;>[*birth date and birth place]</th>
            %end;
            %if;(evar.death = "on")
              <th %if;(evar.birth = "on")width="30%%"%else;width="60%%"%end;>[*death date and death place]</th>
            %end;
            <th width="10%%">[*missing parents]</th>
            <th width="10%%">[*missing spouse]</th>
          </tr>
      %end;
      %foreach;sorted_list_item;
        %if;(initial(prev_item.1) != initial(item.1) and nb_ind > 100)
          <li>%nn;
          <a name="a_%apply;hexa(initial(item.1))">%apply;initial(item.1)</a>
          <table class="missing_ancestors_table">
            <tr class="missing_ancestors_table_header">
              <th width="20%%">[*person/persons]0</th>
              %if;(evar.birth = "on") 
                <th %if;(evar.death = "on")width="30%%"%else;width="60%%"%end;>[*birth date and birth place]</th>
              %end;
              %if;(evar.death = "on")
                <th %if;(evar.birth = "on")width="30%%"%else;width="60%%"%end;>[*death date and death place]</th>
              %end;
              <th width="10%%">[*missing parents]</th>
              <th width="10%%">[*missing spouse]</th>
            </tr>
        %end;
        <tr>
          <td> 
            %if;(evar.cgl = "on")
              %item.5;%item.1;%sp;%item.2;%item.3;
            %else;
              %item.5;<a href="%prefix;%item.4;">%item.1;%sp;%item.2;</a>%item.3;
            %end;
            %if;(item.6 != ""), <em>%item.6;</em>%end;
          </td>
          %if;(evar.birth = "on")
            <td>%item.7;</td>
          %end;
          %if;(evar.death = "on")
            <td>%item.8;</td>
          %end;
          <td align="center">
            %item.9;
            %if;(initial(item.9) = "x")%incr_count;%incr_count;%end;
          </td>
          <td align="center">
            %item.10;
            %if;(initial(item.10) = "x")%incr_count;%end;
          </td>
        </tr>
        %if;(initial(item.1) != initial(next_item.1) and nb_ind > 100)
          </table>
          </li>
        %end;
      %end;
      %if;(nb_ind <= 100)
        </table>
        </li>
      %end;
    </ul>
    <p style="clear:both;">[*total]: %count; [[person/persons]1@(c)]</p>
  
  %elseif;(evar.t = "M")
    %( missing ancestors by generation %)
    %let;nb_gen;%apply;min(evar.v, max_anc_level)%in;
    <p>
      %apply;togen(nb_gen)
      %apply;living_interval_dates(evar.after, evar.before)
    </p>
    <div class="not_printable" style="margin-bottom:25px;">
      <table class="display_search">
        <tr>
          <td><b>[*sort by/generation/alphabetic order]0</b></td>
          <td><img src="%image_prefix;/picto_branch.png"%/></td>
          <td>[sort by/generation/alphabetic order]1</td>
          <td><img src="%image_prefix;/picto_alphabetic_order.png"%/></td>
          <td>
            <a href="%prefix;&amp;m=A&amp;p=%first_name_key;&amp;n=%surname_key;&amp;oc=%evar.oc;&amp;t=%evar.t;&amp;v=%evar.v;&amp;birth=%evar.birth;&amp;death=%evar.death;&amp;spouse=%evar.spouse;&amp;al=on">
              [sort by/generation/alphabetic order]2
            </a>
          </td>
        </tr>
      </table>
    </div>

    %reset_count;
    <table class="missing_ancestors_table">
      <tr class="missing_ancestors_table_header">
        <th>[*missing sosa]</th>
        <th>[*missing parents]</th>
        <th>[*missing spouse]</th>
        <th>[*person/persons]0</th>
        %if;(evar.birth = "on") <th>[*birth date and birth place]</th> %incr_count; %end;
        %if;(evar.death = "on") <th>[*death date and death place]</th> %incr_count; %end;
        %if;(evar.spouse = "on") <th>[*spouse/spouses]1</th> %incr_count; %end;
      </tr>
      %let;nb_col;%expr(count + 4)%in;
      %reset_count;
      %foreach;ancestor_level(nb_gen)
        %apply;lazy_print%with;
          <tr>
            <th align="left" colspan="%nb_col;">[*generation/generations]0 %expr(level+1)</th>
          </tr>
        %end;
        %foreach;ancestor;
          %if;(ancestor.same = "")
            %if;(not ancestor.has_parents and ancestor.first_name != "?" and ancestor.surname != "?")
              %if;(dates_in_interval(ancestor.var) = "true")
                %incr_count;%incr_count;
                %lazy_force;
                <tr>
                  <td>
                    %expr(ancestor.anc_sosa.v * 2) - %expr(ancestor.anc_sosa.v * 2 + 1)
                  </td>
                  <td align="center"> x </td>
                  <td> &nbsp; </td>
                  <td>
                    %apply;image_MF("ancestor", "11")
                    %apply;link(ancestor.access, ancestor)
                    %ancestor.title;
                  </td>
                  %apply;display_missing_ancestor_info("ancestor")
                </tr>
              %end;
            %elseif;(ancestor.has_parents)
              %if;(ancestor.father.first_name = "?" and ancestor.father.surname = "?")
                %if;(dates_in_interval(ancestor.mother.var) = "true")
                  %incr_count;
                  %lazy_force;
                  <tr>
                    <td>
                      %expr(ancestor.anc_sosa.v * 2)
                    </td>
                    <td> &nbsp; </td>
                    <td align="center"> x </td>
                    <td>
                      %apply;image_MF("ancestor.mother", "11")
                      %apply;link(ancestor.mother.access, ancestor.mother)
                      %ancestor.mother.title;
                    </td>
                    %apply;display_missing_ancestor_info("ancestor.mother")
                  </tr>
                %end;
              %end;
              %if;(ancestor.mother.first_name = "?" and ancestor.mother.surname = "?")
                %if;(dates_in_interval(ancestor.father.var) = "true")
                  %incr_count;
                  %lazy_force;
                  <tr>
                    <td>
                      %expr(ancestor.anc_sosa.v * 2 + 1)
                    </td>
                    <td> &nbsp; </td>
                    <td align="center"> x </td>
                    <td>
                      %apply;image_MF("ancestor.father", "11")
                      %apply;link(ancestor.father.access, ancestor.father)
                      %ancestor.father.title;
                    </td>
                    %apply;display_missing_ancestor_info("ancestor.father")
                  </tr>
                %end;
              %end;
            %end;
          %end;
        %end;
      %end;
    </table>
    <p>[*total]: %count; [[person/persons]1@(c)]</p>

  %elseif;(evar.t = "G" and evar.only= "on")
    %( long display; only the selected generation %)
    %if;((evar.notes = "on" or evar.src = "on") and evar.inline != "on")
      <p class="not_printable"> 
        [*see]: <a href="#asc">[*ancestors]</a>%sp;%nn;
        %if;((evar.notes = "on" or evar.src = "on") and evar.inline != "on")
          | <a href="#ns">[*note/notes]1</a>
        %end;
      </p>
    %end;
    <h3>
      <em>%apply;gen("v").</em>
      <a name="asc">&nbsp;</a>
    </h3>
    %foreach;ancestor_level;
      %if;(evar.v != "" and level = evar.v)
        %foreach;ancestor;
          %if;(ancestor.same != "")
            <p>
              <b><a name="%ancestor.anc_sosa.v;">%ancestor.anc_sosa;</a></b>:
              [see] <b><a href="#%ancestor.same.v;">%ancestor.same;</a></b>.
            </p>
          %else;
            <p>
              <b><a name="%ancestor.anc_sosa.v;">%ancestor.anc_sosa;</a></b>
              %apply;long_display_ancestor_personal()
            </p>
            %if;(ancestor.index != self.index)
              <p>%apply;long_display_ancestor_families()</p>
            %end;
          %end;
        %end;
      %end;
    %end;
    %if;((evar.notes = "on" or evar.src = "on") and evar.inline != "on")
      <p><hr%/></p>
      <p>%apply;long_display_notes()</p>
    %end;
  
  %elseif;(evar.t = "G")
    %( long display %)
    %if;((evar.notes = "on" or evar.src = "on") and evar.inline != "on")
      <p class="not_printable"> 
        [*see]: <a href="#asc">[*ancestors]</a>%sp;%nn;
        %if;((evar.notes = "on" or evar.src = "on") and evar.inline != "on")
          | <a href="#ns">[*note/notes]1</a>
        %end;
      </p>
    %end;
    %let;nb_gen;%apply;min(evar.v, max_anc_level)%in;
    <p>
      %apply;togen(nb_gen).
      <a name="asc">&nbsp;</a>
    </p>
    %foreach;ancestor_level(nb_gen)
      <h3><em>[*generation/generations]0 %level;</em></h3>
      %foreach;ancestor;
        %if;(ancestor.same != "")
          <p>
            <b><a name="%ancestor.anc_sosa.v;">%ancestor.anc_sosa;</a></b>:
            [see] <b><a href="#%ancestor.same.v;">%ancestor.same;</a></b>.
          </p>
        %else;
          <p>
            <b><a name="%ancestor.anc_sosa.v;">%ancestor.anc_sosa;</a></b>
            %apply;long_display_ancestor_personal()
          </p>
          %if;(ancestor.index != self.index)
            <p>%apply;long_display_ancestor_families()</p>
          %end;
        %end;
      %end;
    %end;
    %if;((evar.notes = "on" or evar.src = "on") and evar.inline != "on")
      <p><hr%/></p>
      <p>%apply;long_display_notes()</p>
    %end;
  
  %elseif;(evar.t = "D")
    %( ancestors up to somebody %)
    %pvar.1.mark_descendants;
    <ul>
      %foreach;ancestor_level;
        %apply;lazy_print%with;
          <li>[*generation/generations]0 %level;%nl;
          <ul>
        %end;
        %if;(level <= evar.l + 1)
          %foreach;ancestor;
            %if;(ancestor.same = "" and ancestor.is_descendant)
              %lazy_force;
              <li>[Sosa] %ancestor.anc_sosa; -%sp;
                <a href="%prefix;%ancestor.access;">%ancestor;</a>%nn;
    	          %ancestor.title;%ancestor.dates;
              </li>
            %end;
          %end;
        %end;
        %if;lazy_printed;</ul>%nl;</li>%nl;%end;
      %end;
    </ul>
  
  %elseif;(evar.t = "Z" and evar.only = "on")
    <p>%apply;gen("v").</p>
    %reset_count;
    <table class="ascends_table">
      <tr class="ascends_table_header">%apply;table_header()</tr>
      %let;nb_col;%count;%in;
      %reset_count;
      %foreach;ancestor_level;
        %if;(evar.v != "" and level = evar.v)
          %if;(evar.gen = "on")
            <tr>
              <th align="left" colspan="%nb_col;">[*generation/generations]0 %level;</th>
            </tr>
          %end;
          %foreach;ancestor;
            <tr>
              %apply;table_row()
            </tr>
            %if;(ancestor.nb_families > 1)
              %apply;table_family()
            %end;
          %end;
        %end;
      %end;
    </table>
    <p>[*total]: %count; [[person/persons]1@(c)]</p>

  %elseif;(evar.t = "Z")
    %let;nb_gen;%apply;min(evar.v, max_anc_level)%in;
    <p>%apply;togen(nb_gen).</p>
    %reset_count;
    <table class="ascends_table">
      <tr class="ascends_table_header">%apply;table_header()</tr>
      %let;nb_col;%count;%in;
      %reset_count;
      %foreach;ancestor_level(nb_gen)
        %if;(evar.gen = "on")
          <tr>
            <th align="left" colspan="%nb_col;">[*generation/generations]0 %level;</th>
          </tr>
        %end;
        %foreach;ancestor;
          <tr>
            %apply;table_row()
          </tr>
          %if;(ancestor.nb_families > 1)
            %apply;table_family()
          %end;
        %end;
      %end;
    </table>
    <p>[*total]: %count; [[person/persons]1@(c)]</p>
  %end;
%end;

%base_trailer;
%copyright;
</body>
</html>
