%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 -->
  <!-- Modified mickroue(a)yahoo.fr 20130710 templ=templm -->
  %let;l_v0;%if;(evar.v != "")%if;(evar.v > max_anc_level)%max_anc_level;%else;%evar.v;%end;%else;1%end;%in;
  %let;l_v;%if;(bvar.max_anc_level = "")%l_v0;%elseif;(bvar.max_anc_level > l_v0)%l_v0;%else;%bvar.max_anc_level;%end;%in;
  <title>%nn;
    %if;(evar.t = "D")
      [*ancestors] … [up to] …%nn;
    %elseif;(evar.t = "N" and evar.only = "on")
      [*generation/generations]0 %l_v;
    %else;
      %apply;a_of_b%with;
        %if;(evar.t = "M")[*missing ancestors]%else;[*ancestors]%end;
      %and;
        %if;(public_name != "")%public_name;%else;%first_name;%end;
        %if;(qualifier != "") %qualifier;%end;
        %sp;%surname;
      %end;
    %end;
  </title>
  <meta http-equiv="Content-Type" content="text/html; charset=%charset;"%/>
  <meta http-equiv="Content-Style-Type" content="text/css"%/>
  <meta name="robots" content="none"%/>
  <meta name="format-detection" content="telephone=no"%/>
  <link rel="shortcut icon" href="%image_prefix;/favicon_gwd.png"%/>
  %include.css;
  %base_header;
</head>

%( <!-- Begin define (used in ancsosa.txt, deslist.txt)--> %)
%let;birth_symbol;%if;(bvar.birth_symbol != "")%bvar.birth_symbol;%else;&deg;%end;%in;
%let;death_symbol;%if;(bvar.death_symbol != "")%bvar.death_symbol;%else;&dagger;%end;%in;

%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;
  %if;are_divorced;… [divorced]%divorce_date;%nn;
  %elseif;are_separated;… [separated]%nn;
  %end;
%end;

%define;married(xx)
  %if;(evar.sd = "on")
    %apply;link_marriage("xx")%nn;
    %if;are_divorced;… [divorced]%divorce_date;%nn;
    %elseif;are_separated;… [separated]%nn;
    %end;
  %else;
    %apply;married_to%with
      %xx.is_male;
    %and;
      %if;(on_marriage_date != "") %on_marriage_date;%end;
      %if;(marriage_place != "") [in (place)] %marriage_place;%end;
    %end;
  %end;
%end;

%define;link1(xx,yy,fff)
  <strong>%nn;
  %if;(cancel_links or xx.is_restricted)
    <a id="ifff" href="">%yy;</a>%nn;
  %else;
    <a id="ifff" href="%prefix;%xx.access;">%yy;</a>%nn;
  %end;
  </strong>%nn;
%end;

%define;link2(xx,yy)
  %if;(cancel_links or xx.is_restricted)%yy;
  %else;
    <a href="%prefix;%xx.access;">%yy;</a>
  %end;
  %xx.title;%xx.dates;
  %if;(xx.sosa_in_list != "" and evar.only != "on" and level != 2)
    %sp;(&rArr;
    <strong>
      <a href="#i%xx.sosa_in_list;" title="[see] %xx.sosa_in_list;">%xx.sosa_in_list;</a>%nn;
    </strong>.)%nn;
  %end;
%end;

%define;somebody_long_info(xx)
  %if;xx.has_qualifiers;
    %apply;lazy_print(", ")
    %foreach;xx.qualifier;
      %if;not is_first;
        %if;(lazy_printed)/%end;
        %lazy_force;
        %qualifier;%nn;
      %end;
    %end;
  %end;
  %if;xx.has_aliases;
    %apply;lazy_print(", ")
    %foreach;xx.alias;
      %if;(lazy_printed)/%end;
      %lazy_force;
      <em><strong>%alias;</strong></em>%nn;
    %end;
  %end;
  %if;(("xx" = "ancestor" or xx.sosa_in_list = "") and xx.has_nobility_titles)
    <em>%foreach;xx.nobility_title;, %nobility_title;%end;</em>%nn;
  %end;
  %if;(xx.has_linked_pages and xx.has_linked_page.HEAD), %xx.linked_page.HEAD;%end;
  %if;(xx.has_public_name or xx.has_qualifiers), <em>(%xx.first_name; %xx.surname;)</em>%end;
  %if;(evar.alias="on")
    <small>%nn;
    %if;xx.has_first_names_aliases;
      %apply;lazy_print(", ")
      %foreach;xx.first_name_alias;
        %if;(lazy_printed)/%end;
        %lazy_force;
        %first_name_alias;%nn;
      %end;
    %end;
    %if;xx.has_surnames_aliases;
      %apply;lazy_print(", ")
      %foreach;xx.surname_alias;
        %if;(lazy_printed)/%end;
        %lazy_force;
        %surname_alias;%nn;
      %end;
    %end;
    </small>%nn;
  %end;
  %if;(xx.computable_age), %xx.age;%end;
  %if;(evar.sd = "on")
    , %apply;link_dates("xx")%nn;
  %else;
    %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; [in (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; [in (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) [in (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; [in (place)] %xx.burial_place;%end;
    %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; [in (place)] %xx.cremation_place;%end;
    %end;
  %end;
  %if;(xx.has_linked_pages and xx.has_linked_page.DEATH), %xx.linked_page.DEATH;%end;
  %if;(xx.computable_death_age)
    , [age at death:] %xx.death_age;%nn;
  %end;
%end;

%define;somebody_extra_info(xx)
  %if;xx.has_occupation;, <span class="highlight1">%xx.occupation;</span>%end;
  %if;(xx.has_linked_pages and xx.has_linked_page.OCCU), %xx.linked_page.OCCU;%end;
  %if;(evar.rel = "on" and xx.has_relations)
    %foreach;xx.relation;%nn;
       ; %relation_type; :
      %if;has_relation_him;
        %apply;link2("relation_him","relation_him")
      %end;
      %if;has_relation_her;
        %if;has_relation_him;, %end;
        %apply;link2("relation_her","relation_her")
      %end;
    %end;
    %foreach;xx.related;%nn;
      %if;(related_type != [foster son/foster daughter/foster child]0
         and related_type != [foster son/foster daughter/foster child]1
         and related_type != [foster son/foster daughter/foster child]2)
         ; %related_type; :
         %apply;link2("related","related")
      %end;
    %end;
  %end;
%end;

%define;somebody_spouse_parent()
  %if;(evar.parents = "on" and spouse.has_parents)
    <br%/>   <small>%nn;
    %apply;a_of_b%with;
      %if;(spouse.is_male)[son/daughter/child]0
      %else;[son/daughter/child]1%end;
    %and;
      %apply;link2("spouse.father","spouse.father") [and]
      %apply;link2("spouse.mother","spouse.mother")
    %end;
    </small>
  %end;
%end;

%define;link_dates(xx)
  %sp;
  %if;(wizard and not cancel_links)
    <a class="date" href="%prefix;m=MOD_IND;i=%xx.index;" title="[modify::person/persons]0"
       onclick="window.open(this.href); return false;">%nn;
      %apply;sure_dates("xx","birth","baptism","baptism","baptism",xx.has_linked_page.BIRTHA)
      %if;(xx.is_dead)
        %sp;%apply;sure_dates("xx","death","burial","cremated","cremation",xx.has_linked_page.DEATHA)
      %end;
    </a>%nn;
  %else;
    %apply;sure_dates("xx","birth","baptism","baptism","baptism",xx.has_linked_page.BIRTHA)%sp;
    %if;(xx.is_dead)
      %apply;sure_dates("xx","death","burial","cremated","cremation",xx.has_linked_page.DEATHA)
    %end;
  %end;
%end;

%define;link_marriage(xx)
  %if;(wizard and not cancel_links)
    <a class="date" href="%prefix;m=MOD_FAM;i=%family.index;;ip=%index;;ins_ch=2;"
      title="[modify::family/families]0" onclick="window.open(this.href); return false;">%nn;
      <span class="sure_dates%xx.has_linked_page.MARRIAGEA;%xx.spouse.has_linked_page.MARRIAGEA;
        %if;(marriage_date.prec != "" or on_marriage_date = "" or marriage_place = "") not_sure_dates%end;">&amp;</span>%nn;
      %slash_marriage_date; %marriage_place;
    </a>
  %else;
    <span class="sure_dates%xx.has_linked_page.MARRIAGEA;%xx.spouse.has_linked_page.MARRIAGEA;
      %if;(marriage_date.prec != "" or on_marriage_date = "" or marriage_place = "") not_sure_dates%end;">&amp;</span>%nn;
    %slash_marriage_date; %marriage_place;
  %end;
%end;

%define;sure_dates(xx,dd1,dd2,dd3,dd4,zz)
  %if;(xx.dd1_date.year != "")
    <tt class="sure_dates%zz;%if;(xx.dd1_date.prec !="") not_sure_dates%end;">%dd1_symbol;</tt>%xx.slash_dd1_date;
  %elseif;(xx.dd2_date.year != "")
    <tt class="sure_dates%zz;%if;(xx.dd2_date.prec !="") not_sure_dates%end;">%dd1_symbol;</tt>%xx.slash_dd2_date;
  %elseif;(xx.dd3_date.year != "")
    <tt class="sure_dates%zz;%if;(xx.dd3_date.prec !="") not_sure_dates%end;">%dd1_symbol;</tt>%xx.slash_dd3_date;
  %else;
    <tt class="not_sure_dates">%dd1_symbol;</tt>
  %end;
  %if;(xx.dd1_place != "")
    %sp;%xx.dd1_place;%nn;
  %elseif;(xx.dd2_place != "")
    %sp;%xx.dd2_place;%nn;
  %elseif;(xx.dd4_place != "")
    %sp;%xx.dd4_place;%nn;
  %end;
%end;

%define;somebody_notes(xx,yy)
  %if;(evar.inline = "on")
    %incr_count;
    %if;(evar.notes = "on")
      %if;(xx.has_notes or xx.has_linked_page.BNOTE)
        <div class="inot">
          %if;xx.has_linked_page.BNOTE;&gt;&gt; %xx.linked_page.BNOTE;%end;
          %if;xx.has_notes;%xx.notes;%end;
        </div>
      %end;
    %end;
    %if;(evar.src = "on")
      %if;(xx.has_sources or xx.has_linked_page.BIBLIO)
        <div class="isrc">
          %if;xx.has_linked_page.BIBLIO;&gt;&gt; %xx.linked_page.BIBLIO;%end;
          %if;(xx.has_sources)
            %foreach;xx.source
              <em>• %source_type; : </em>%source;%sp;
            %end;
          %end;
        </div>
      %end;
    %end;
  %elseif;((evar.notes = "on" and (xx.has_notes or xx.has_linked_page.BNOTE))
        or (evar.src = "on" and (xx.has_sources or xx.has_linked_page.BIBLIO)))
      <sup><a href="#nyy">yy</a></sup>%nn;
  %end;
%end;

%define;inline_comment()
  %incr_count;
  <div class="icom">%comment;</div>
%end;

%define;init_count(prev_count)
  %reset_count;
  %for;i;0;prev_count;
    %incr_count;
  %end;
%end;

%define;link_comment(z1)
  %if;(has_comment and evar.notes = "on" and evar.inline != "on")
    <sup><a id="iz1" href="#nz1">z1</a></sup>%nn;
  %end;
%end;

%define;bcomment(z1,z2)
  %if;(has_comment and evar.notes = "on")
    <dt><a id="nz2" href="#iz2">z2</a>. %z1; &amp;%marriage_date.year; %spouse;</dt>
    <dd>%comment;</dd>
  %end;
%end;

%define;bnotes(z1,z2)
  %if;((evar.notes = "on" and (z1.has_notes or z1.has_linked_page.BNOTE))
         or (evar.src = "on" and (z1.has_sources or z1.has_linked_page.BIBLIO)))
    <dt><a id="nz2" href="#iz2">z2</a>. %z1;%z1.dates;</dt>
    %if;(evar.notes = "on" and (z1.has_notes or z1.has_linked_page.BNOTE))
      %if;(z1.has_linked_page.BNOTE)<dd>&gt;&gt; %z1.linked_page.BNOTE;</dd>%end;
      %if;(z1.has_notes)<dd>%z1.notes;</dd>%end;
    %end;
    %if;(evar.src = "on" and (z1.has_sources or z1.has_linked_page.BIBLIO))
      %if;(z1.has_linked_page.BIBLIO)<dd class="xs">&gt;&gt; %z1.linked_page.BIBLIO;</dd>%end;
      %if;(z1.has_sources)
        %foreach;z1.source;
          <dd class="xs">• <em>%source_type; : </em>%source;</dd>
        %end;
      %end;
    %end;
  %end;
%end;

%define;image(xx)
  %if;(evar.image="on" and xx.has_image)
    <img class="image" src="%xx.image_url;" alt="[image/images]0" title="%xx;"%/>
  %end;
%end;
%( <!-- End define (used in ancsosa.txt, deslist.txt)--> %)
%( <!-- Begin define --> %)

%define;child_notes(fff)
  %if;(child.sosa_in_list != "" and evar.only != "on" and level != 2)
  %else;
    %apply;bnotes("child","fff")
    %if;(evar.spouse = "on")
      %foreach;child.family;
        %let;id_spouse;fffx%family_cnt%in;
        %let;id_fam;fff-%id_spouse;%in;
        %apply;bcomment("child",id_fam)
        %apply;bnotes("spouse",id_spouse)
      %end;
    %end;
  %end;
%end;

%define;sorted_notes()
  %if;(evar.notes = "on" or evar.src = "on")
    <hr%/>
    <h3>%if;(evar.notes = "on")[*note/notes]1
          %if;(evar.src = "on")[and] [source/sources]1%end;
        %else;[*source/sources]1%end;</h3>
    <dl>
      %foreach;ancestor_level(l_v)
        %if;(level != 1 and (evar.only != "on" or level = l_v))
          %foreach;ancestor;
            %if;(ancestor.same = "")
              %apply;bnotes("ancestor",ancestor.anc_sosa.v)
              %if;(ancestor.index != self.index)
                %if;(ancestor.is_male)
                  %apply;other_family_notes("father")
                  %foreach;ancestor.family;
                    %if;(family.index = ancestor.family.index)
                      %let;id_fam;%ancestor.anc_sosa.v;-%expr(ancestor.anc_sosa.v + 1)%in;
                      %apply;bcomment("ancestor",id_fam)
                    %end;
                  %end;
                %else;
                  %foreach;ancestor.family;
                    %if;(family.index = ancestor.family.index)
                      %foreach;child;
                        %let;id_child;%ancestor.anc_sosa.v;%apply;letter(child_cnt)%in;
                        %if;(evar.siblings = "on")
                          %apply;child_notes(id_child)
                        %elseif;(child.sosa_in_list != "")
                          %apply;child_notes(id_child)
                        %end;
                      %end;
                    %end;
                  %end;
                  %apply;other_family_notes("mother")
                %end;
              %end;
            %end;
          %end;
        %end;
      %end;
    </dl>
  %end;
%end;

%define;link_dates1(xx)
  %if;(wizard and not cancel_links)
    <a class="date p_%left;" href="%prefix;m=MOD_IND;i=%xx.index;" title="[modify::person/persons]0"
       onclick="window.open(this.href); return false;">%nn;
      %apply;sure_dates("xx","birth","baptism","baptism","baptism",xx.has_linked_page.BIRTHA)<br%/>
      %if;(xx.is_dead)
        %apply;sure_dates("xx","death","burial","cremated","cremation",xx.has_linked_page.DEATHA)
      %end;
    </a>%nn;
  %else;
    %apply;sure_dates("xx","birth","baptism","baptism","baptism",xx.has_linked_page.BIRTHA)<br%/>
    %if;(xx.is_dead)
      %apply;sure_dates("xx","death","burial","cremated","cremation",xx.has_linked_page.DEATHA)
    %end;
  %end;
%end;

%define;link_marriage1(xx)
  %if;(wizard and not cancel_links)
    <a class="date p_%left;" href="%prefix;m=MOD_FAM;i=%family.index;;ip=%index;;ins_ch=2;"
      title="[modify::family/families]0" onclick="window.open(this.href); return false;">%nn;
      <span class="sure_dates%xx.has_linked_page.MARRIAGEA;%xx.spouse.has_linked_page.MARRIAGEA;
        %if;(marriage_date.prec != "" or on_marriage_date = "" or marriage_place = "") not_sure_dates%end;">&amp;</span>%nn;
        %if;(nb_children > 1)%nb_children;<br%/>%end;
        %slash_marriage_date; %marriage_place;
    </a>
  %else;
    <span class="sure_dates%xx.has_linked_page.MARRIAGEA;%xx.spouse.has_linked_page.MARRIAGEA;
      %if;(marriage_date.prec != "" or on_marriage_date = "" or marriage_place = "") not_sure_dates%end;">&amp;</span>%nn;
    %slash_marriage_date; %marriage_place;
    <br%/>&amp;%nb_children;
  %end;
%end;

%define;symbol2(xx)
    %if;(xx.has_siblings)
      &diams;%nn;
    %elseif;(xx.has_parents)
      &loz;%nn;
    %else;
      -%nn;
    %end;
%end;

%define;symbol1(xx)
  %if;(xx.has_sosa)
    <span class="color_sosa">%apply;symbol2("xx")</span>%nn;
  %else;
    %apply;symbol2("xx")
  %end;
%end;

%define;see_sosa(xx)
  %xx.title;%xx.dates;
  %sp;(&rArr;
  <strong>
    <a href="#i%xx.sosa_in_list;" title="[see] %xx.sosa_in_list;">%xx.sosa_in_list;</a>%nn;
  </strong>.)%nn;
%end;

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

%define;tothegen(xx)
  [*to 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()
  <p>
    %if;(evar.only != "on")
      %apply;togen(l_v)
    %else;
      [*generation/generations]0 %l_v;
    %end;
  </p>
%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;long_display_ancestor_personal(fff)
  %apply;link1("ancestor","ancestor","fff")
  %apply;somebody_long_info("ancestor")
  %apply;somebody_extra_info("ancestor")
  %apply;somebody_notes("ancestor",ancestor.anc_sosa.v)
%end;

%define;child_long_info(fff)
  %apply;link1("child","child_name","fff")
  %if;(child.sosa_in_list != "" and evar.only != "on" and level != 2)
    %apply;see_sosa("child")
  %else;
    %apply;image("child")
    %apply;somebody_long_info("child")
    %apply;somebody_extra_info("child")
    %apply;somebody_notes("child","fff")
    %if;(evar.spouse = "on")
      %foreach;child.family;
        %let;id_spouse;fffx%family_cnt%in;
        %let;id_fam;fff-%id_spouse;%in;
        <div>   %nn;
          %apply;married("child")
          %apply;link_comment(id_fam)
          <br%/>   %nn;
          %apply;link1("spouse","spouse",id_spouse)
          %apply;somebody_long_info("spouse")
          %apply;somebody_extra_info("spouse")
          %apply;somebody_spouse_parent()
          %apply;somebody_notes("spouse",id_spouse)
        </div>
      %end;
    %end;
  %end;
%end;

%define;marriage_info()
  %if;(evar.rel = "on" and has_witnesses)
    <div>   [witness/witnesses]1 :
    %foreach;witness;
      %if;(not is_first),%nl;%end;
      %apply;link2("witness","witness")
    %end;
    </div>
  %end;
  %if;(has_comment and evar.notes = "on" and evar.inline = "on")
    %apply;inline_comment()
  %end;
%end;

%define;other_family(xx)
  %if;(evar.spouse = "on" and evar.siblings = "on" and ancestor.nb_families > 1)
    <div class="other_family">
    %foreach;ancestor.family;
      %if;(spouse.index != ancestor.spouse.index)
        %let;id_spouse;%ancestor.anc_sosa.v;x%family_cnt;%in;
        %let;id_fam;%ancestor.anc_sosa.v;-%id_spouse;%in;
        %let;txt;%ancestor; &amp;%marriage_date.year; %spouse;%in;
        <div>%apply;image("spouse")
             %nn;
            <a href="#i%family.xx.sosa_in_list;"><strong>%family.xx.sosa_in_list;</strong></a>
            -(X%family_cnt;) :
          %apply;married("ancestor")
          %apply;link_comment(id_fam)
        <br%/>   %nn;
          %apply;link1("spouse","spouse",id_spouse)
          %apply;somebody_long_info("spouse")
          %apply;somebody_extra_info("spouse")
          %apply;somebody_spouse_parent()
          %apply;somebody_notes("spouse",id_spouse)
        </div>
          %apply;marriage_info()
        %if;(nb_children > 0)
          <ol style="list-style-type:lower-latin">
          %foreach;child;
            %let;id_child;%ancestor.anc_sosa.v;x%family_cnt;%apply;letter(child_cnt)%in;
            <li class=%nn;
            %if;(has_sosa)"border_sosa"%nn;
            %else;"border_family_%has_families; border_sex_%sex;"%end;>
            %apply;child_long_info(id_child)%nn;
            </li>
          %end;
          </ol>
        %end;
      %end;
    %end;
    </div>
  %end;
%end;

%define;other_family_notes(xx)
  %if;(evar.spouse = "on" and evar.siblings = "on" and ancestor.nb_families > 1)
    %foreach;ancestor.family;
      %if;(spouse.index != ancestor.spouse.index)
        %let;id_spouse;%ancestor.anc_sosa.v;x%family_cnt;%in;
        %let;id_fam;%ancestor.anc_sosa.v;-%id_spouse;%in;
        %apply;bcomment("ancestor",id_fam)
        %apply;bnotes("spouse",id_spouse)
        %if;(nb_children > 0)
          %foreach;child;
            %let;id_child;%ancestor.anc_sosa.v;x%family_cnt;%apply;letter(child_cnt)%in;
            %if;(child.sosa_in_list != "" and evar.only != "on")
              $$$
            %else;
              %apply;bnotes("child",id_child)
            %end;
            %if;(evar.spouse = "on")
              %foreach;child.family;
                %let;id_spouse;%id_child;x%family_cnt%in;
                %let;id_fam;%id_child;-%id_spouse;%in;
                %apply;bcomment("child",id_fam)
                %apply;bnotes("spouse",id_spouse)
              %end;
            %end;
          %end;
        %end;
      %end;
    %end;
  %end;
%end;

%define;long_display_ancestor_families()
  %if;(ancestor.is_male)
    %apply;other_family("father")
    <p>   %nn;
    %foreach;ancestor.family;
      %if;(family.index = ancestor.family.index)
        %let;id_fam;%ancestor.anc_sosa.v;-%expr(ancestor.anc_sosa.v + 1)%in;
        %apply;married("ancestor")
        %if;(has_comment and evar.notes = "on" and evar.inline != "on")
          %apply;link_comment(id_fam)
        %end;
      %end;
    %end;
    </p>
  %else;
    %foreach;ancestor.family;
      %if;(family.index = ancestor.family.index)
        %apply;marriage_info()
        <ol style="list-style-type:lower-latin">
        %foreach;child;
          %let;id_child;%ancestor.anc_sosa.v;%apply;letter(child_cnt)%in;
          %if;(evar.siblings = "on")
            <li class=%nn;
            %if;(has_sosa)"border_sosa"%nn;
            %else;"border_family_%has_families; border_sex_%sex;"%nn;
            %end;>
            %apply;child_long_info(id_child)</li>
          %elseif;(child.sosa_in_list != "")
            <li>%apply;child_long_info(id_child)</li>
          %end;
        %end;
        </ol>
      %end;
    %end;
    %apply;other_family("mother")
  %end;
%end;

%define;date_place(xx,yy)
  %if;(yy.has_xx_date)
    ;%yy.on_xx_date;
    ;%yy.xx_place;
  %else;
    ;;%nn;
   %end;
%end;

%define;link_parents()
    <a %nn;%sp;
    %if;(evar.only != "on" and ancestor.father_sosa != "")
      href="#i%ancestor.father_sosa;" title="[father/mother]0 : %ancestor.father_sosa;"%nn;%sp;
    %elseif;(evar.cgl != "on" and wizard and not ancestor.has_parents and
      ancestor.first_name != "?" and ancestor.surname != "?")
      style="color: rgb(255,0,0);"%nn;%sp;
      onclick="window.open(this.href); return false;" href="%prefix;m=ADD_PAR;ip=%ancestor.index;" title="[add::parents]"%nn;%sp;
    %end;>
  <strong>%ancestor.anc_sosa;</strong></a>%nn;
%end;

%define;link_rel(xx)
  %if;(cancel_links)
    ==<br%/>xx
  %else;
    <a href="%prefix;em=R;ei=%ancestor.index;;m=NG;select=%index;;n=1;t=PN;et=A;spouse=on;image=on;" title="%ancestor; …[relationship]… %self;">==<br%/>xx</a>
  %end;
%end;

%define;nb_fam(xx)
  %if;(xx.same = "")
    %if;(not cancel_links)
      <a href="%prefix;m=A;t=D;i=%index;;i1=%ancestor.index;;l=%level;" title="^^">
    %end;
      %apply;symbol1("xx")
      %if;(xx.nb_families > 1)
        <br%/>%xx.nb_families;&amp;%xx.nb_children;
      %end;
    %if;(not cancel_links)
      </a>
    %end;
  %else;
    %apply;link_rel%with;
      %xx.same;
    %end;
  %end;
%end;

%define;male_line(xx)
    <td>
      %apply;link_parents()
      %apply;nb_fam("xx")
    </td>
    <td>
     %apply;image("xx")
     <div class="highlight">%apply;link(xx.access, xx)</div>
     %apply;info3("xx")
    </td>
    <td style="text-align:%left;">%apply;link_dates1("xx")</td>
%end;

%define;female_line(xx)
    <td style="text-align:%left;">%apply;link_dates1("xx")</td>
    <td>
     %apply;image("xx")
     <div class="highlight">%apply;link(xx.access, xx)</div>
     %apply;info3("xx")
    </td>
    <td>
      %apply;link_parents()
      %apply;nb_fam("xx")
    </td>
%end;

%define;info3(xx)
  %if;(xx.has_nobility_titles)
    <em>%xx.nobility_title;</em><br%/>
  %end;
  %if;(xx.has_occupation)
    <span class="highlight1">%xx.occupation;</span><br%/>
  %end;
  %if;xx.computable_age;
    [age] : %xx.age;<br%/>
  %end;
  %if;(xx.computable_death_age)
    %xx.death_age;<br%/>
  %end;
  %if;(xx.has_consanguinity and (bvar.show_consang != "no" or manitou))
    %xx.consanguinity;
  %end;
%end;

%define;sorted_list_birth(xx)
  %incr_count;
  %apply;add_in_sorted_list%with;
    %ancestor.xx_place;%and;
    %ancestor.xx_date.year;%and;
    %ancestor; <small class = "xs top">s%ancestor.anc_sosa;</small>%and;
    %birth_symbol;%ancestor.xx_date.prec;%and;
    %ancestor.on_xx_date;%and;
    %apply;a_of_b%with; 
      %if;(ancestor.is_male)[*son/daughter/child]0
      %elseif;(ancestor.is_female)[*son/daughter/child]1
      %else;[*son/daughter/child]2
      %end;
    %and;
      %if;(ancestor.has_parents)
          %ancestor.father; &amp; %ancestor.mother;
      %end;
    %end;
    %and;
    %ancestor.access;
  %end;
%end;

%define;sorted_list_death(xx)
  %incr_count;
  %apply;add_in_sorted_list%with;
    %ancestor.xx_place;%and;
    %ancestor.xx_date.year;%and;
    %ancestor; <small class = "xs top">s%ancestor.anc_sosa;</small>%and;
    %if;(bvar.death_symbol != "")%bvar.death_symbol;%else;&dagger;%end;%ancestor.xx_date.prec;%and;
    %ancestor.on_xx_date;%and;
    &amp; %ancestor.spouse;%and;
    %ancestor.access;
  %end;
%end;

%define;sorted_list_marriage()
  %incr_count;
  %apply;add_in_sorted_list%with;
    %marriage_place;%and;
    %marriage_date.year;%and;
    %ancestor; <small class = "xs top">s%ancestor.anc_sosa;</small>%and;
    &amp;%marriage_date.prec;%and;
    %on_marriage_date;%and;
    &amp; %spouse;%and;
    %ancestor.access;
  %end;
%end;

%define;M2b_b()
  %if;(not ancestor.has_linked_page.BIRTHA)
    %if;(ancestor.has_birth_date)
      %apply;sorted_list_birth("birth")
    %elseif;(ancestor.has_baptism_date)
      %apply;sorted_list_birth("baptism")
    %end;
  %end;
%end;

%define;M2m_m()
  %if;(ancestor.is_male and not ancestor.has_linked_page.MARRIAGEA)
    %foreach;ancestor.family
      %if;(marriage_date.year != "")
        %apply;sorted_list_marriage()
      %end;
    %end;
  %end;
%end;

%define;M2d_d()
  %if;(not ancestor.has_linked_page.DEATHA)
    %if;(ancestor.has_death_date)
      %apply;sorted_list_death("death")
    %elseif;(ancestor.has_burial_date)
      %apply;sorted_list_death("burial")
    %elseif;(ancestor.has_cremation_date)
      %apply;sorted_list_death("cremated")
    %end;
  %end;
%end;

%define;M3b_b()
  %if;(ancestor.birth_date.prec != "")
    %apply;sorted_list_birth("birth")
  %elseif;(ancestor.baptism_date.prec != "")
    %apply;sorted_list_birth("baptism")
  %elseif;(ancestor.on_birth_date = "" and ancestor.on_baptism_date = "")
    %if;(ancestor.has_birth_date)
      %apply;sorted_list_birth("birth")
    %elseif;(ancestor.has_baptism_date)
      %apply;sorted_list_birth("baptism")
    %else;
      %apply;sorted_list_birth("birth")
    %end;
  %end;
%end;

%define;M3m_m()
  %if;(ancestor.is_male)
    %foreach;ancestor.family
      %if;(marriage_date.prec != "" or on_marriage_date = "")
        %apply;sorted_list_marriage()
      %end;
    %end;
  %end;
%end;

%define;M3d_d()
  %if;(ancestor.is_dead)
    %if;(ancestor.death_date.prec != "")
      %apply;sorted_list_death("death")
    %elseif;(ancestor.burial_date.prec != "")
      %apply;sorted_list_death("burial")
    %elseif;(ancestor.on_death_date = "" and ancestor.burial_date.day = "")
      %if;(ancestor.has_death_date)
        %apply;sorted_list_death("death")
      %elseif;(ancestor.has_burial_date)
        %apply;sorted_list_death("burial")
      %else;
        %apply;sorted_list_death("death")
      %end;
    %end;
  %end;
%end;

%define;miss_b(xx,bb,mm,dd)
  %apply;xxb_bb()
%end;
%define;miss_m(xx,bb,mm,dd)
  %apply;xxm_mm()
%end;
%define;miss_d(xx,bb,mm,dd)
  %apply;xxd_dd()
%end;
%define;miss_bm(xx,bb,mm,dd)
  %apply;xxb_bb()
  %apply;xxm_mm()
%end;
%define;miss_bd(xx,bb,mm,dd)
  %apply;xxb_bb()
  %apply;xxd_dd()
%end;
%define;miss_md(xx,bb,mm,dd)
  %apply;xxm_mm()
  %apply;xxd_dd()
%end;
%define;miss_bmd(xx,bb,mm,dd)
  %apply;xxb_bb()
  %apply;xxm_mm()
  %apply;xxd_dd()
%end;

%define;miss1(xx,bb,mm,dd)
  %if;("bb" = "b" or "mm" = "m" or "dd" = "d")
    %apply;gen()
    %empty_sorted_list;
    %reset_count;
    %foreach;ancestor_level(l_v)
      %if;(level > 1 and (evar.only != "on" or level = l_v))
        %foreach;ancestor;
          %if;(ancestor.same = "")
            %apply;miss_bbmmdd("xx","bb","mm","dd")
          %end;
        %end;
      %end;
    %end;
  %end;
%end;

%define;miss2()
  %if;(count > 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>
  %foreach;sorted_list_item;
    <li>%nn;
      %if;(count > 100 and initial(prev_item.1) != initial(item.1))
        <a id="a_%apply;hexa(initial(item.1))">%apply;initial(item.1)</a>
        <ul><li>%nn;
      %end;
      %if;(prev_item.1 != item.1)
        %item.1;
        %if;(number_of_subitems > 1)%nl;
          <ul class="list_no_style"><li>%nn;
        %else;%sp;
        %end;
      %end;
      %item.4;%item.2; - <a href="%prefix;%item.7;">%item.3;</a> - %item.5; - %item.6;
    </li>
    %if;(prev_item.1 = item.1 and number_of_subitems = 1 and item.1 != "")
      </ul></li>
    %end;
    %if;(count > 100 and initial(item.1) != initial(next_item.1) and item.1 != "")
      </ul></li>
    %end;
  %end;
  </ul>
  <p>[*total] = %count;</p>
%end;

%define;same()
  %if;(ancestor.same != "")
    <li class="border_family_1 border_sex_%ancestor.sex;">%ancestor.anc_sosa; -
      <a href="%prefix;%ancestor.access;">%ancestor;</a> %ancestor.dates; == 
      <a href="%prefix;em=R;ei=%index;;i=%ancestor.index;;et=M;spouse=on" title="%ancestor; …[relationship]… %self;">
      %ancestor.same;
    </a>
    </li>
  %end;
%end;

%define;same_consang()
  %reset_count;
  <p class="highlight">[*display smallest sosa number relative to ancestor] + [*consanguinity]</p>
  <p>%apply;togen(l_v).</p>
  <ul>
  %foreach;ancestor_level(l_v)
    <li><span class="highlight">[*generation/generations]0 %level;</span>
      <ul class="list_no_style">
      %foreach;ancestor
        %if;(ancestor.same = "" and ancestor.has_consanguinity)
          %incr_count;
          <li class="border_family_1 border_sex_%ancestor.sex;">
            %ancestor.anc_sosa; -
            <a href="%prefix;%ancestor.access;">%ancestor;</a> %ancestor.dates; :
            <a href="%prefix;em=R;ei=%ancestor.mother.index;;m=NG;t=PN;select=%ancestor.father.index;;et=A;spouse=on;image=on"
               title="[relationship computing], [parents]">
               %ancestor.consanguinity;
            </a><br%/>
          </li>
        %end;
        %apply;same()
      %end;
      </ul>
    </li>
  %end;
  </ul>
  <p>[*total] = %evar.same; + %count; = %expr(evar.same + count)</p>
%end;

%define;same_same()
  %reset_count;
  <p class="highlight">[*display smallest sosa number relative to ancestor]</p>
  <p>%apply;togen(l_v).</p>
  <ul>
  %foreach;ancestor_level(l_v)
    <li><span class="highlight">[*generation/generations]0 %level;</span>
      <ul class="list_no_style">
        %foreach;ancestor
          %apply;same()
        %end;
      </ul>
    </li>
  %end;
  </ul>
  <p>[*total] = %evar.same;</p>
%end;
%( <!-- End define --> %)

%(   Main   %)
<body%body_prop; id="ancsosa">
%message_to_wizard;

<h1>%nn;
  %apply;a_of_b%with;
    %if;(evar.t = "M" and evar.miss = "M1")[*missing ancestors]%else;[*ancestors]%end;
  %and;
    %if;(not cancel_links)<a href="%prefix;%access;">%end;
      %if;(public_name != "")%public_name;%else;%first_name;%end;
      %if;(qualifier != "") <em>%qualifier;</em>%end;
      %sp;%surname;
      %if;(alias != "") <em>(%alias;)</em>%end;
    %if;(not cancel_links)</a>%end;
  %end;
  %sp;%dates;
  %if;(evar.t = "M")
    %if;(evar.miss="M2")
      <br%/>[*not found] : 
      %if;(evar.M2b="b") -%bvar.var_t_BIRTHA;%end;
      %if;(evar.M2m="m") -%bvar.var_t_MARRIAGEA;%end;
      %if;(evar.M2d="d") -%bvar.var_t_DEATHA;%end;
    %elseif;(evar.miss="M3")
      <br%/>[*date/dates]0 &lt;&gt; [exact] :
      %if;(evar.M3b="b") -[*birth]%end;
      %if;(evar.M3m="m") -[*marriage/marriages]0%end;
      %if;(evar.M3d="d") -[*death]%end;
    %end;
  %end;
  %if;(evar.t = "D")<br%/> [up to] %pvar.1; %pvar.1.dates;%end;
</h1>

%if;not cancel_links;
  <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;
      <input type="hidden" name="t" value="%evar.t;"%/>
      %if;(evar.lang != "")<input type="hidden" name="lang" value="%evar.lang;" %/>%end;
      <div><a href="#">[*tools]</a>
      <div class="s_menu">
        %if;(evar.t = "D" or evar.t = "G" or evar.t = "Z")
          %if;(evar.i1 != "")<input type="hidden" name="i1" value="%evar.i1;" %/>%end;
          %if;(evar.l != "")<input type="hidden" name="l" value="%evar.l;" %/>%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>
        %end;
        %if;(evar.t = "G")
          <fieldset><legend>[*long display]</legend>
            <label><input type="checkbox" name="siblings" value="on" %l_on;
                   %if;(evar.siblings = "on") checked="checked"%end;%/>[siblings]</label>
            <label><input type="checkbox" name="sd" value="on" %l_on;
                   %if;(evar.sd = "on") checked="checked"%end;%/>[date/dates]0 : 
                   %if;([ !dates order]0 = "ddmmyyyy")[year/month/day]2/[year/month/day]1/[year/month/day]0
                   %elseif;([ !dates order]0 = "mmddyyyy")[year/month/day]1/[year/month/day]2/[year/month/day]0
                   %else;[year/month/day]0/[year/month/day]1/[year/month/day]2
                   %end;
            </label>
            <label><input type="checkbox" name="alias" value="on" %l_on;
                   %if;(evar.alias = "on") checked="checked"%end;%/>[surname alias], [first name alias]</label>
            <label><input type="checkbox" name="spouse" value="on" %l_on;
                   %if;(evar.spouse = "on") checked="checked"%end;%/>[include spouses]</label>
            <label><input type="checkbox" name="parents" value="on" %l_on;
                   %if;(evar.parents = "on") checked="checked"%end;%/>[parents]</label>
            <label><input type="checkbox" name="rel" value="on" %l_on;
                   %if;(evar.rel = "on") checked="checked"%end;%/>[relation/relations]1</label>
            <label><input type="checkbox" name="notes" value="on" %l_on;
                   %if;(evar.notes = "on") checked="checked"%end;%/>[note/notes]1</label>
            <label><input type="checkbox" name="src" value="on" %l_on;
                   %if;(evar.src = "on") checked="checked"%end;%/>[source/sources]1</label>
            <label><input type="checkbox" name="inline" value="on" %l_on;
                   %if;(evar.inline = "on") checked="checked"%end;%/>[display notes/sources inline]</label>
          </fieldset>
        %end;
        %if;(evar.t = "M")
          <fieldset>
            <legend>
              <label><input type="radio" name="miss" value="M1" id="M1" %l_on;
                      %if;(evar.miss = "M1") checked="checked"%end;%/>[*missing ancestors]</label>
            </legend>
            <label><input type="checkbox" name="al" value="on" onchange="valid('M1')" %l_on;
                    %if;(evar.al = "on") checked="checked"%end;%/>[alphabetic order]</label>
            <label><input type="checkbox" name="ms" value="on" onchange="valid('M1')" %l_on;
                    %if;(evar.ms = "on") checked="checked"%end;%/>[first name/first names]1, [surname/surnames]1 = ??</label>
          </fieldset>
          %if;(bvar.var_img_ext != "")
            <fieldset>
              <legend>
                <label><input type="radio" name="miss" value="M2" id="M2" %l_on;
                        %if;(evar.miss = "M2") checked="checked"%end;%/>[*miscellaneous notes]</label>
              </legend>
              <label><input type="checkbox" name="M2b" value="b" onchange="valid('M2')" %l_on;
                      %if;(evar.M2b = "b") checked="checked"%end;%/>%bvar.var_t_BIRTHA;</label>
              <label><input type="checkbox" name="M2m" value="m" onchange="valid('M2')" %l_on;
                      %if;(evar.M2m = "m") checked="checked"%end;%/>%bvar.var_t_MARRIAGEA;</label>
              <label><input type="checkbox" name="M2d" value="d" onchange="valid('M2')" %l_on;
                      %if;(evar.M2d = "d") checked="checked"%end;%/>%bvar.var_t_DEATHA;</label>
            </fieldset>
          %end;
          <fieldset>
            <legend>
              <label><input type="radio" name="miss" value="M3" id="M3" %l_on;
                      %if;(evar.miss = "M3") checked="checked"%end;%/>[*date/dates]0 &lt;&gt; [exact]</label>
            </legend>
            <label><input type="checkbox" name="M3b" value="b" onchange="valid('M3')" %l_on;
                    %if;(evar.M3b = "b") checked="checked"%end;%/>[birth]</label>
            <label><input type="checkbox" name="M3m" value="m" onchange="valid('M3')" %l_on;
                    %if;(evar.M3m = "m") checked="checked"%end;%/>[marriage/marriages]0</label>
            <label><input type="checkbox" name="M3d" value="d" onchange="valid('M3')" %l_on;
                    %if;(evar.M3d = "d") checked="checked"%end;%/>[death]</label>
          </fieldset>
        %end;
        %if;(evar.t != "D")
          <fieldset><legend>[*generation/generations]0</legend>
          <div class="v">
            %let;l_bmaxv;%if;(bvar.max_anc_level = "")9%else;%bvar.max_anc_level;%end;%in;
            %let;l_emaxv;%if;(evar.maxv = "")%l_bmaxv;%elseif;(evar.maxv < l_bmaxv)%evar.maxv;%else;%l_bmaxv;%end;%in;
            %let;l_maxv;%expr(l_emaxv + 1)%in;
            <input type="hidden" name="maxv" value="%evar.maxv;"%/>
            %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>
          <label style="clear:both;"><input type="checkbox" name="only" value="on" %l_on;
                   %if;(evar.only = "on") checked="checked"%end;%/>[only the generation selected]</label>
          </fieldset>
        %end;
        <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 = "N" and evar.same != "")
  %(short display smallest sosa number relative to ancestor %)
  %if;(bvar.show_consang != "no" or manitou)
    %apply;same_consang()
  %else;
    %apply;same_same()
  %end;
%elseif;(evar.t = "Z")
  %( short display, table with occupation, death_age, consanguinity, dates, places %)
  %if;(evar.only != "on")
    <p>%apply;togen(l_v).</p>
  %end;
  %reset_count;
  <table summary="ancestors" class="short_display_table">
    <colgroup>
      <col width="10"%/>
      <col width="400"%/>
      <col width="400" align="%left;"%/>
      <col width="400" align="%left;"%/>
      <col width="400" align="%left;"%/>
      <col width="400"%/>
      <col width="10"%/>
    </colgroup>
  %foreach;ancestor_level(l_v)
    %if;(level > 1 and (evar.only != "on" or level = l_v))
      <tr><th colspan="7" >%nl;[*generation/generations]0 %level;%nl;</th></tr>
      %foreach;ancestor
          %incr_count;
          %if;(ancestor.is_male)
            <tr id="i%ancestor.anc_sosa.v;">
              %apply;male_line("ancestor")
              <td style="text-align:%left;">
              %if;(ancestor.same = "")
                %foreach;ancestor.family;
                  %if;(family.index = ancestor.family.index)
                    %apply;link_marriage1("ancestor")
                  %end;
                %end;
              %end;
              </td>
          %end;
          %if;(ancestor.is_female)
            %apply;female_line("ancestor")</tr>
          %end;
      %end;
    %end;
  %end;
  <tr><td colspan="9">[*total] : %count; [[person/persons]1@(c)]</td></tr>
  </table>
%elseif;(evar.t = "M" and evar.miss = "M1" and evar.al = "on")
  %( missing ancestors alphabetically %)
  %apply;gen()
  %empty_sorted_list;
  %reset_count;
  %foreach;ancestor_level(l_v)
    %if;(level > 1 and (evar.only != "on" or level = l_v))%nn;
      %foreach;ancestor;
        %if;(ancestor.same = "")
          %if;(not ancestor.has_parents and
               ancestor.first_name != "?" and ancestor.surname != "?")
            %incr_count;
            %apply;add_in_sorted_list(
              ancestor.surname_end, ancestor.first_name,
              ancestor.surname_begin, "0",
              ancestor.nobility_title, ancestor.access,
              ancestor.dates, [parents],
              ancestor.family.marriage_date.year,
              ancestor.spouse, ancestor.spouse.dates,
              ancestor.spouse.nobility_title)
          %elseif;(evar.ms = "on" and ancestor.has_parents)
            %if;(ancestor.father.first_name = "?" and
                 ancestor.father.surname = "?")
              %incr_count;
              %apply;add_in_sorted_list(
                ancestor.mother.surname_end, ancestor.mother.first_name,
                ancestor.mother.surname_begin, "1",
                ancestor.mother.nobility_title, ancestor.mother.access,
                ancestor.mother.dates, [husband/wife]0)
            %end;
            %if;(ancestor.mother.first_name = "?" and
                 ancestor.mother.surname = "?")
              %incr_count;
              %apply;add_in_sorted_list(
                ancestor.father.surname_end, ancestor.father.first_name,
                ancestor.father.surname_begin, "1",
                ancestor.father.nobility_title, ancestor.father.access,
                ancestor.father.dates, [husband/wife]1)
            %end;
          %end;
        %end;
      %end;
    %end;
  %end;
  %if;(count > 100)
    %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;
  %end;
  %if;(evar.ms != "on")
    <p>
    %apply;a_of_b([*parents], "…")
    </p>
  %end;
  <ul>
  %foreach;sorted_list_item;
    <li>%nn;
    %if;(count > 100 and initial(prev_item.1) != initial(item.1))
      <a id="a_%apply;hexa(initial(item.1))">%apply;initial(item.1)</a>
      <ul>
        <li>%nn;
    %end;
    %if;(prev_item.1 != item.1)
      %item.1;
      %if;(number_of_subitems > 1)%nl;
        <ul>
          <li>%nn;
      %end;
    %end;
    %sp;<a href="%prefix;%item.6;">%item.2;</a>%item.3;
    %if;(item.5 != ""), <em>%item.5;</em>%end;%item.7;
    %if;(evar.ms != "on")
      %if;(item.10 != "? ?")
        %nl;&amp;%nn;
        %if;(item.9 != "")<span style="font-size:70%%">%item.9;</span>%end;
        %sp;%item.10;%item.11;
        %if;(item.12 != ""), <em>%item.12;</em>%end;
      %end;
    %else; =&gt; %item.8;%end;
    </li>
    %if;(prev_item.1 = item.1 and number_of_subitems = 1)
      </ul>
      </li>
    %end;
    %if;(count > 100 and initial(item.1) != initial(next_item.1))
      </ul>
      </li>
    %end;
  %end;
  </ul>
  <p>[*total] = %count;</p>
%elseif;(evar.t = "M" and evar.miss = "M1")
  %( missing ancestors in ancestors order %)
  %if;(evar.only != "on")
    <p>%apply;togen(l_v)</p>
  %end;
  %if;(evar.ms != "on")
    <p>%apply;a_of_b([*parents], "…")</p>
  %end;
  <ul>
  %reset_count;
  %foreach;ancestor_level(l_v)
    %if;(level > 1 and (evar.only != "on" or level = l_v))%nn;
      %apply;lazy_print%with;
        <li>%nl;[*generation/generations]0 %level;%nl;
        <ul>%nl;
      %end;
      %foreach;ancestor;
        %if;(ancestor.same = "")
          %if;(not ancestor.has_parents 
               and ancestor.first_name != "?" and ancestor.surname != "?")
            %incr_count;
            %lazy_force;
            <li>%ancestor.anc_sosa.v; -
            %if;(evar.ms != "on")
              %apply;link(ancestor.access, ancestor)
            %else;
              %apply;a_of_b%with;[parents]%and;
                %apply;link(ancestor.access, ancestor)
              %end;
            %end;
            %ancestor.title; %ancestor.dates;
            </li>%nl;
          %elseif;(evar.ms = "on")
            %if;(ancestor.first_name = "?" or
                 ancestor.surname = "?")
              %incr_count;
              %lazy_force;
              <li>%ancestor.anc_sosa.v; -
                %apply;link(ancestor.access,"??")
              </li>%nl;
            %end;
          %end;
        %end;
      %end;
      %if;lazy_printed;</ul>%nl;</li>%nl;%end;
    %end;
  %end;
  </ul>
  <p>[*total] = %count;</p>
%elseif;(bvar.var_img_ext != "" and evar.t = "M" and evar.miss="M2")
  %( missing BIRTHA MARRIAGEA DEATHA %)
  %apply;miss1(evar.miss,evar.M2b,evar.M2m,evar.M2d)
  %apply;miss2()
%elseif;(evar.t = "M" and evar.miss="M3")
  %( date != exact %)
  %apply;miss1(evar.miss,evar.M3b,evar.M3m,evar.M3d)
  %apply;miss2()
%elseif;(evar.t = "G")
  %( long display %)
  %if;(evar.only != "on")
    <p>%apply;togen(l_v).</p>
  %end;
  %foreach;ancestor_level(l_v)
    %if;(level != 1 and (evar.only != "on" or level = l_v))
      <h3 class="generation">[*generation/generations]0 %level;</h3>
      %foreach;ancestor;
        %if;(ancestor.same = "")
          <div %if;(ancestor.is_male)class="ancestor_male"%end;>
            %apply;image("ancestor")
            %apply;link_parents()
            %nn;.%sp;
            %apply;long_display_ancestor_personal(ancestor.anc_sosa.v)
          </div>
          %if;(ancestor.index != self.index)
            %apply;long_display_ancestor_families()
          %end;
        %else;
          <p %if;(ancestor.is_male)class="ancestor_male"%end;>
            <strong><a href="#i%ancestor.same.v;" title="[see] %ancestor.same;">%ancestor.anc_sosa;</a></strong>.
            %if;(not cancel_links)
              <a href="%prefix;%ancestor.access;">%ancestor;</a>
              %ancestor.title;%ancestor.dates; (==
              <strong><a href="%prefix;em=R;ei=%index;;i=%ancestor.index;;et=M;spouse=on"
                 title="%ancestor; …[relationship]… %self;">%ancestor.same;</a></strong>.)
            %else;
              %ancestor; %ancestor.title;%ancestor.dates; (== <strong>%ancestor.same;</strong>.)
            %end;
          </p>
        %end;
      %end;
    %end;
  %end;
  %if;(evar.inline != "on")%apply;sorted_notes()%end;
%elseif;(evar.t = "D")
  %( ancestors up to somebody %)
  %pvar.1.mark_descendants;
  <table summary="ancestors up to somebody" class="short_display_table">
    <colgroup>
      <col width="10"%/>
      <col width="400"%/>
      <col width="400" align="%left;"%/>
      <col width="400" align="%left;"%/>
      <col width="400" align="%left;"%/>
      <col width="400"%/>
      <col width="10"%/>
    </colgroup>
  %foreach;ancestor_level;
    %apply;lazy_print%with;
      <tr><th colspan="7" >%nl;[*generation/generations]0 %level;%nl;</th></tr>
    %end;
    %if;(level <= evar.l + 1)
      %foreach;ancestor;
        %if;(level != 1 and ancestor.same = "" and (ancestor.is_descendant or ancestor.spouse.is_descendant))
          %lazy_force;
          %if;(ancestor.is_male)
            <tr id="i%ancestor.anc_sosa.v;">
              <td>
                %apply;link_parents()
                %apply;nb_fam("ancestor")
              </td>
              <td class="is_desc_%ancestor.is_descendant;%ancestor.sex;">
                %apply;image("ancestor")
                <div class="highlight">%apply;link(ancestor.access, ancestor)</div>
                %apply;info3("ancestor")
              </td>
              <td style="text-align:%left;">%apply;link_dates1("ancestor")</td>
              <td style="text-align:%left;">
                %foreach;ancestor.family;
                  %if;(family.index = ancestor.family.index)
                    %apply;link_marriage1("ancestor")
                  %end;
                %end;
              </td>
          %end;
          %if;(ancestor.is_female)
              <td style="text-align:%left;">%apply;link_dates1("ancestor")</td>
              <td class="is_desc_%ancestor.is_descendant;%ancestor.sex;">
               %apply;image("ancestor")
               <div class="highlight">%apply;link(ancestor.access, ancestor)</div>
               %apply;info3("ancestor")
              </td>
              <td>
                %apply;link_parents()
                %apply;nb_fam("ancestor")
              </td>
            </tr>
          %end;
        %end;
      %end;
    %end;
  %end;
  </table>
%end;
%base_trailer;
%copyright;
</body>
</html>
