%let;evar_v;%if;(evar.v > 0)%expr(evar.v-1)%end;%in;
%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 2012/05/09 geneweb-6.04 templ=templm -->
  <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")[*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"%/>
  <link rel="shortcut icon" href="%image_prefix;/favicon_gwd.png"%/>
  %include.css;
  %base_header;
</head>
%( <!-- Begin define --> %)

%( <!-- Begin define (used in ancsosa.txt, deslist.txt)--> %)
%define;married_to(is_male, date_place)
  %apply;link_mod_fam()
  %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;link_mod_fam()
    %if;(not cancel_links and wizard)
      <a target="blank" href="%prefix;m=MOD_FAM;i=%family.index;;ip=%index;;ins_ch=2" title="[*modify::family/families]0">
      &amp;%marriage_date.year;&nbsp;</a>
    %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;symbol(xx)
  %if;(wizard and not cancel_links)
     <a target="_blank" href="%prefix;m=MOD_IND;i=%xx.index;" title="[*modify::person/persons]0">%apply;symbol1("xx")</a>%nn;
  %elseif(evar.t="N")
    %apply;symbol1("xx")
  %end;
%end;

%define;link2(xx,yy)
  %if;(cancel_links or xx.is_restricted)%yy;
  %else;
    <a href="%prefix;%xx.access;">%yy;</a>%nn;
  %end;
  %apply;symbol("xx")
%end;

%define;somebody_long_info(xx)
  %if;xx.has_aliases;
    %foreach;xx.alias;, <em><strong>%alias;</strong></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_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>%nn;
  %end;
  %if;(evar.alias="on")
    <small>%nn;
    %if;xx.has_surnames_aliases;
      %foreach;xx.surname_alias;
        , <em>(%surname_alias;)</em>%nn;
      %end;
    %end;
    %if;xx.has_first_names_aliases;
      %foreach;xx.first_name_alias;
        , <em>(%first_name_alias;)</em>%nn;
      %end;
    %end;
    </small>%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.has_linked_pages and xx.has_linked_page.DEATH), %xx.linked_page.DEATH;%end;
  %if;xx.computable_death_age;%sp;
    ([age at death:] %xx.death_age;)%nn;
  %end;
%end;

%define;somebody_extra_info(xx)
  %if;xx.has_occupation;, <span class="highlight">%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")
        %apply;info2("relation_him")
      %end;
      %if;has_relation_her;
        %if;has_relation_him;, %end;
        %apply;link2("relation_her","relation_her")
        %apply;info2("relation_her")
      %end;
    %end;
    %foreach;xx.related;%nn;
       ; %related_type; :
       %apply;link2("related","related")
       %apply;info2("related")
    %end;
  %end;
%end;

%define;somebody(xx,yy)
  <strong>%apply;link2("xx","yy")</strong>%nn;
  %apply;somebody_long_info("xx")
  %apply;somebody_extra_info("xx")
%end;

%define;somebody_spouse_parent1(xx)
  <strong>%apply;link2("spouse.xx","spouse.xx")</strong>%nn;
  %apply;info2("spouse.xx")
%end;

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

%( <!-- end modified mickroue (used in ancsosa.txt, deslist.txt)--> %)

%define;info2(xx)
  %xx.title;%xx.dates;
  %if;(xx.sosa_in_list != ""),
    %if;(not cancel_links)
      <a href="#l_%xx.sosa_in_list;" title="[see] %xx.sosa_in_list;"><strong>{%xx.sosa_in_list;}</strong></a>%nn;
    %else;
      <strong>{%xx.sosa_in_list;}</strong>
    %end;
  %end;
%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(evar_v)
    %else;
      [*generation/generations]0 %evar_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;

%(
  Long display
%)

%define;link_notes(xx,yy)
  %if;((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)))
    %incr_count;
    %sp;%[%if;(not cancel_links)<a id="l_notes_yy" href="#notes-yy">%nn;%end;
    %if;(evar.notes = "on" and (xx.has_notes or xx.has_linked_page.BNOTE))
      [*note/notes]0%sp;
      %apply;add_in_sorted_list(10000+count,"yy",xx.notes,"",xx.linked_page.BNOTE)
    %else;[*source/sources]0%sp;%nn;
      %apply;add_in_sorted_list(10000+count,"yy","","","")
    %end;
    %if;(evar.src = "on" and (xx.has_sources or xx.has_linked_page.BIBLIO))
      %if;(xx.has_linked_page.BIBLIO)
        %apply;add_in_sorted_list(10000+count,"yy","src_on","BIBLIO",xx.linked_page.BIBLIO)
      %end;
      %foreach;xx.source;
        %apply;add_in_sorted_list(10000+count,"yy","src_on",source_type,source)
      %end;
    %end;
    <strong>yy</strong>%if;(not cancel_links)</a>%end;%]
  %end;
%end;

%define;long_display_ancestor_personal()
  %apply;somebody("ancestor","ancestor").
  %apply;link_notes("ancestor",ancestor.anc_sosa.v)
%end;

%define;child_long_info(fff)
  <strong>%apply;link2("child","child_name")%nn;</strong>%nn;
  %if;(child.sosa_in_list != "")
    %if;(evar.only != "on")
      %child.dates;, 
      %if;(not cancel_links)
        <a href="#l_%child.sosa_in_list;" title="[see] %child.sosa_in_list;"><strong>{%child.sosa_in_list;}</strong></a>
      %else;
        <strong>{%child.sosa_in_list;}</strong>
      %end;
    %end;
  %else;
    %apply;somebody_long_info("child")
    %apply;somebody_extra_info("child")
    %apply;link_notes%with;
      child%nn;
    %and;
      %ancestor.anc_sosa.v;fff%apply;letter(child_cnt)
    %end;
    %if;(evar.spouse = "on")
      %foreach;child.family;
        <br%/>   
        %apply;married_to%with;
          %child.is_male;
        %and;
          %if;(on_marriage_date != "") %on_marriage_date;%end;
          %if;(marriage_place != ""), %marriage_place;%end;
        %end;%sp;
        <br%/>   
        %apply;somebody("spouse","spouse")%nn;
        %apply;link_notes%with;
          spouse%nn;
        %and;
          %ancestor.anc_sosa.v;fff%apply;letter(child_cnt)x%family_cnt;
        %end;
        %apply;somebody_spouse_parent()%nn;
      %end;
    %end;
  %end;
%end;

%define;marriage_info()
  %if;(evar.witn = "on" and has_witnesses)[witness/witnesses]1 :
    %foreach;witness;
      %if;(not is_first),%nl;%end;
      %apply;link2("witness","witness")
      %apply;info2("witness")
    %end;,%sp;
  %end;
  %if;(evar.comm = "on" and has_comment)(%comment;),%sp;%end;
%end;

%define;other_family(xx)
  %if;(evar.spouse = "on" and evar.siblings = "on" and ancestor.nb_families > 1)
    %foreach;ancestor.family;
      %if;(spouse.index != ancestor.spouse.index)
        <p>   
          %if;(not cancel_links)
            <a href="#l_%family.xx.sosa_in_list;"><strong>%family.xx.sosa_in_list;</strong></a>
          %else;
            <strong>%family.xx.sosa_in_list;</strong>
          %end;  
            -(X%family_cnt;) : 
        %apply;married_to%with;
          %ancestor.is_male;
        %and;
          %if;(on_marriage_date != "") %on_marriage_date;%end;
          %if;(marriage_place != ""), %marriage_place;%end;
        %end;%sp;
        <br%/>   
        %apply;somebody("spouse","spouse")%nn;
        %apply;link_notes%with;
          spouse%nn;
        %and;
          %ancestor.anc_sosa.v;x%family_cnt;
        %end;
        %apply;somebody_spouse_parent()%nn;
        <br%/>   %apply;marriage_info()
        %if;(nb_children > 0)
          [having as children] :</p>%sp;
          <ol style="list-style-type:lower-latin">
          %foreach;child;
            <li class=%nn;
            %if;(has_sosa)"border_sosa"%nn;
            %else;"border_family_%has_families; border_sex_%sex;"%end;>
            %apply;child_long_info%with;x%family_cnt;%end;%nn;
            </li>
          %end;
          </ol>
        %else;
          </p>
        %end;
      %end;
    %end;
  %end;
%end;

%define;long_display_ancestor_families()
  %if;ancestor.is_male;
    <div class="other_family">%apply;other_family("father")</div>
    <p>   
    %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;
    </p>
  %else;
    %foreach;ancestor.family;
      %if;(family.index = ancestor.family.index)
        <p>   %apply;marriage_info()
           [having as children] :
        </p>
          <ol style="list-style-type:lower-latin">
          %foreach;child;
            %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("")</li>
            %elseif;(child.sosa_in_list != "")
              <li>%apply;child_long_info("")</li>
            %end;
          %end;
          </ol>
      %end;
    %end;
    <div class="other_family">%apply;other_family("mother")</div>
  %end;
%end;

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

%define;sosa_base(xx,yy)
  %if;(evar.sosab = 16)%xx.yy.hexa;
  %elseif;(evar.sosab = 8)%xx.yy.octal;
  %else;%xx.yy;
  %end;
%end;

%define;link_parents()
  %if;(not cancel_links)
    <a %nn;%sp;
    %if;(evar.only != "on" and ancestor.father_sosa != "")
      href="#l_%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;
      target="_blank" href="%prefix;m=ADD_PAR;ip=%ancestor.index;" title="[*add::parents]"%nn;%sp;
    %end;>
  %end;
  <strong>%apply;sosa_base("ancestor","anc_sosa")</strong>%nn;
  %if;(not cancel_links)</a>%end;
%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="[*relationship computing]">==<br%/>xx</a>
  %end;
%end;

%define;link_dates(xx)
  %if;(wizard and not cancel_links)
    <a href="%prefix;m=MOD_IND;i=%xx.index;" title="[*modify::person/persons]0" target="_blank">
    %if;(xx.has_birth_date or xx.has_baptism_date or xx.has_death_date or xx.has_burial_date or xx.has_cremation_date)
      %apply;sure_dates("xx","birth","baptism","baptism",xx.has_linked_page.BIRTHA)
      %apply;sure_dates("xx","death","burial","cremated",xx.has_linked_page.DEATHA)
    %else;-
    %end;
    </a>
  %elseif;(xx.has_birth_date or xx.has_baptism_date or xx.has_death_date or xx.has_burial_date or xx.has_cremation_date)
      %apply;sure_dates("xx","birth","baptism","baptism",xx.has_linked_page.BIRTHA)
      %apply;sure_dates("xx","death","burial","cremated",xx.has_linked_page.DEATHA)
  %end;
%end;

%define;link_marriage(xx)
  %if;(wizard and not cancel_links)
    <a href="%prefix;m=MOD_FAM;i=%family.index;;ip=%index;;ins_ch=2;"
     class="sure_dates%xx.has_linked_page.MARRIAGEA;%xx.spouse.has_linked_page.MARRIAGEA;"
     title="[*modify::family/families]0" target="_blank">
     <small>&amp;%nb_children;</small><br%/>
     %marriage_date.year;</a>
  %elseif;(on_marriage_date != "")
    <span class="sure_dates%xx.has_linked_page.MARRIAGEA;%xx.spouse.has_linked_page.MARRIAGEA;">
     <small>&amp;%nb_children;</small><br%/>
     %marriage_date.year;</span>
  %else;
    &amp;%nb_children;
  %end;
%end;

%define;sure_dates(xx,dd1,dd2,dd3,zz)
  %if;(xx.dd1_date.year != "")
    <span class="sure_dates%zz;">%xx.dd1_date.year;</span>%nn;
  %elseif;(xx.dd2_date.year != "")
    <span class="sure_dates%zz;">%xx.dd2_date.year;</span>%nn;
  %elseif;(xx.dd3_date.year != "")
    <span class="sure_dates%zz;">%xx.dd3_date.year;</span>%nn;
  %else;
    -%nn;
  %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="[image/images]0"%/>
  %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;
      %apply;sosa_base("xx","same")
    %end;
  %end;
%end;

%define;male_line(xx)
    <td>%apply;link_parents()</td>
    <td>%apply;nb_fam("xx")</td>
    <td>
     %apply;image("xx")
     %apply;link(xx.access, xx)
     <em>%xx.nobility_title;</em>
    </td>
    <td>%apply;link_dates("xx")</td>
%end;

%define;female_line(xx)
    <td>%apply;link_dates("xx")</td>
    <td>
     %apply;image("xx")
     %apply;link(xx.access, xx)
     <em>%xx.nobility_title;</em>
    </td>
    <td>%apply;nb_fam("xx")</td>
    <td>%apply;link_parents()</td>
%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 = "bmd_sosa">s%ancestor.sosa;</small>%and;
    &deg;%and;
    %ancestor.on_xx_date;%and;
    [*parents] :
    %if;(ancestor.has_parents)
        %ancestor.father; &amp; %ancestor.mother;
    %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 = "bmd_sosa">s%ancestor.sosa;</small>%and;
    %if;(bvar.death_symbol != "")%bvar.death_symbol;%else;&dagger;%end;%and;
    %ancestor.on_xx_date;%and;
    &amp; %ancestor.spouse;%and;
    %ancestor.access;
  %end;
%end;
%( <!-- End define --> %)

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

<h1>%nn;
  %apply;a_of_b%with;
    %if;(evar.t = "M")[*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.b_l="on" or evar.m_l="on" or evar.d_l="on")
    <br%/>[*not found] : 
    %if;(evar.b_l="on") -%bvar.var_t_BIRTHA;%end;
    %if;(evar.m_l="on") -%bvar.var_t_MARRIAGEA;%end;
    %if;(evar.d_l="on") -%bvar.var_t_DEATHA;%end;
  %elseif;(evar.b_d="on" or evar.m_d="on" or evar.d_d="on")
    <br%/>[*date] &lt;&gt; [exact] :
    %if;(evar.b_d="on") -[*birth]%end;
    %if;(evar.m_d="on") -[*marriage/marriages]0%end;
    %if;(evar.d_d="on") -[*death]%end;
  %end;
  %if;(evar.t = "D")<br%/> [up to] %pvar.1; %pvar.1.dates;%end;
</h1>

%if;not cancel_links;
  <div class="menu2">
    %if;has_referer;
      <a href="%referer;" title="[back]">&lt;&lt;</a>
    %end;
      <a href="%prefix;" title="[visualize/show/hide/summary]3">^^</a>
  </div>
%end;

%if;(evar.t = "N")
  %( short display, table with marriage date %)
  %if;(evar.only != "on")
    <p>
      %apply;togen(evar_v).
    </p>
  %end;
  %reset_count;
  <table summary="ancestors" class="short_display_table">
  %foreach;ancestor_level(evar_v)
    %if;(level > 1 and (evar.only != "on" or level = evar_v))
      <tr><th colspan="9" >%nl;[*generation/generations]0 %level;%nl;</th></tr>
      %foreach;ancestor
          %incr_count;
          %if;(ancestor.is_male)
            <tr id="l_%ancestor.anc_sosa.v;">
              %apply;male_line("ancestor")
              <td>
              %if;(ancestor.same = "")
                %foreach;ancestor.family;
                    %if;(family.index = ancestor.family.index)
                       %apply;link_marriage("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.al = "on")
  %( missing ancestors alphabetically %)
  %apply;gen()
  %empty_sorted_list;
  %reset_count;
  %foreach;ancestor_level(evar_v)
    %if;(level > 1 and (evar.only != "on" or level = evar_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.b_d = "on" or evar.m_d = "on" or evar.d_d ="on" or evar.b_l = "on" or evar.m_l = "on" or evar.d_l ="on" ))
  %( missing BIRTHA MARRIAGEA DEATHA or date.prec = not sure %)
  %apply;gen()
  %empty_sorted_list;
  %reset_count;
  %foreach;ancestor_level(evar_v)
    %if;(level > 1 and (evar.only != "on" or level = evar_v))
      %foreach;ancestor;
        %if;(ancestor.same = "")
          %if;((evar.b_d = "on" or evar.b_l = "on")
               and (ancestor.has_birth_date or ancestor.has_baptism_date) 
               and not ancestor.has_linked_page.BIRTHA)
            %if;(ancestor.has_birth_date)
              %let;prec;%expr(ancestor.birth_date.year + 0)%in;
              %if;(prec = "" or evar.b_l = "on")
                %apply;sorted_list_birth("birth")
              %end;
            %elseif;(ancestor.has_baptism_date)
              %let;prec;%expr(ancestor.baptism_date.year + 0)%in;
              %if;(prec = "" or evar.b_l = "on")
                %apply;sorted_list_birth("baptism")
              %end;
            %end;
          %elseif;((evar.b_d = "on" or evar.b_l = "on")
                   and not ancestor.has_birth_date
                   and not ancestor.has_baptism_date)
            %apply;sorted_list_birth("birth")
          %end;
          %if;((evar.d_d = "on" or evar.d_l = "on") 
               and (ancestor.has_death_date
                    or ancestor.has_burial_date 
                    or ancestor.has_cremation_date)
               and not ancestor.has_linked_page.DEATHA)
            %if;(ancestor.has_death_date)
              %let;prec;%expr(ancestor.death_date.year + 0)%in;
              %if;(prec = "" or evar.d_l = "on")
                %apply;sorted_list_death("death")
              %end;
            %elseif;(ancestor.has_burial_date)
              %let;prec;%expr(ancestor.burial_date.year + 0)%in;
              %if;(prec = "" or evar.d_l = "on")
                %apply;sorted_list_death("burial")
              %end;
            %elseif;(ancestor.has_cremation_date)
              %let;prec;%expr(ancestor.cremated_date.year + 0)%in;
              %if;(prec = "" or evar.d_l = "on")
                %apply;sorted_list_death("cremated")
              %end;
            %end;
          %elseif;(ancestor.is_dead 
                   and (evar.d_d = "on" or evar.d_l = "on")
                   and not ancestor.has_death_date 
                   and not ancestor.has_burial_date 
                   and not ancestor.has_cremation_date)
            %apply;sorted_list_death("death")
          %end;
          %if;((evar.m_d = "on" or evar.m_l = "on")
               and ancestor.is_male
               and not ancestor.has_linked_page.MARRIAGEA)
            %foreach;ancestor.family
              %let;prec;%expr(marriage_date.year + 0)%in;
              %if;(prec = "" or evar.m_l = "on" or marriage_date.year = "")
                %incr_count;
                %apply;add_in_sorted_list%with;
                  %marriage_place;%and;
                  %marriage_date.year;%and;
                  %ancestor; <small class = "bmd_sosa">s%ancestor.sosa;</small>%and;
                  &amp;%and;
                  %on_marriage_date;%and;
                  &amp; %spouse;%and;
                  %ancestor.access;
                %end;
              %end;
            %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;
  <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)
      </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")
  %( missing ancestors in ancestors order %)
  %if;(evar.only != "on")
    <p>
      %apply;togen(evar_v)
    </p>
  %end;
  %if;(evar.ms != "on")
    <p>
      %apply;a_of_b([*parents], "…")
    </p>
  %end;
  <ul>
  %reset_count;
  %foreach;ancestor_level(evar_v)
    %if;(level > 1 and (evar.only != "on" or level = evar_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;(evar.t = "G")
  %( long display %)
  %if;(evar.only != "on")
    <p>
    %apply;togen(evar_v).
    </p>
  %end;
  %empty_sorted_list;
  %reset_count;
  %foreach;ancestor_level(evar_v)
    %if;(evar.only != "on" or level = evar_v)
      <h3><em>[*generation/generations]0 %level;</em></h3>
      %foreach;ancestor;
        %if;(ancestor.same != "")
          <p id="l_%ancestor.anc_sosa.v;">
            %if;(not cancel_links)
              <a><strong>%ancestor.anc_sosa;</strong></a>
              : <a href="#l_%ancestor.same.v;" title="[see] %ancestor.same;"><strong>{%ancestor.same;}</strong></a>
            %else;
              <strong>%ancestor.anc_sosa;</strong> : <strong>{%ancestor.same;}</strong>
            %end;
          </p>
        %else;
          <p id="l_%ancestor.anc_sosa.v;">
          %apply;link_parents()
          %nn;.%sp;
          %apply;long_display_ancestor_personal()
          </p>
          %if;(ancestor.index != self.index)
            %apply;long_display_ancestor_families()
          %end;
        %end;
      %end;
    %end;
  %end;
  %if;(evar.notes = "on" or evar.src = "on")
    <hr%/>
    <h3>%if;(evar.notes = "on")[*note/notes]1%else;[*source/sources]1%end;</h3>
    <dl class = "notes_src">
      %foreach;sorted_list_item;
        %if;(item.3 != "src_on")
          <dt><strong>%nn;
            %if;(cancel_links)
              %item.2 :
            %else;
              <a id="notes-%item.2;" href="#l_notes_%item.2;">%nn;
                %item.2; :%nn;
              </a>
            %end;
          </strong></dt>
          %if;(item.5 != "")<dd>&gt;&gt; %item.5;</dd>%end;
          %if;(item.3 != "")<dd>%item.3;</dd>%end;
          %if;(evar.notes = "on" and evar.src = "on" and next_item.3 = "src_on")
            <dt><em>[*source/sources]1 :</em></dt>
          %end;
        %elseif;(item.4 = "BIBLIO")
          <dd><em>&gt;&gt; %item.5;</em></dd>
        %else;
          <dd><em> - %item.4; : %item.5;</em></dd>
        %end;
      %end;
    </dl>
  %end;
%elseif;(evar.t = "D")
  %( ancestors up to somebody %)
  %pvar.1.mark_descendants;
  <table summary="ancestors up to somebody" class="short_display_table">
  %foreach;ancestor_level
    %apply;lazy_print%with;
      <tr><th colspan="9" >%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="l_%ancestor.anc_sosa.v;">
              <td>%apply;link_parents()</td>
              <td>%apply;nb_fam("ancestor")</td>
              <td class="is_desc_%ancestor.is_descendant;%ancestor.sex;">
               %apply;image("ancestor")
               %apply;link(ancestor.access, ancestor)
               <em>%ancestor.nobility_title;</em>
              </td>
              <td>%apply;link_dates("ancestor")</td>
              <td>
                %foreach;ancestor.family;
                  %if;(family.index = ancestor.family.index)
                    %apply;link_marriage("ancestor")
                  %end;
                %end;
              </td>
          %end;
          %if;(ancestor.is_female)              
              <td>%apply;link_dates("ancestor")</td>
              <td class="is_desc_%ancestor.is_descendant;%ancestor.sex;">
               %apply;image("ancestor")
               %apply;link(ancestor.access, ancestor)
               <em>%ancestor.nobility_title;</em>
              </td>
              <td>%apply;nb_fam("ancestor")</td>
              <td>%apply;link_parents()</td>
              </tr>
          %end;
        %end;
      %end;
    %end;
  %end;
  </table>
%end;
%base_trailer;
%copyright;
</body>
</html>
