%( Template mac_util v 7.00b 2014/10/17 09:00:00 ddr/dd %)

%define;nav_with_sosa_ref(xxx)
  [*navigation with %t as Sosa reference:::xxx]%nn;
%end;

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

%define;display_sosa(xx)
  %if;(bvar.display_sosa="" or bvar.display_sosa="yes")
    %if;xx.has_sosa;
      %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;
%end;

%define;image_MF(xx,wi_he)
  %if;(wizard and not cancel_links and not xx.is_restricted)
    <a href="%prefix;m=MOD_IND;i=%xx.index;">%end;
  %if;xx.is_male;
    <img src="%image_prefix;/male.png" title="[M/F]0"%sp;
  %elseif;xx.is_female;
    <img src="%image_prefix;/female.png" title="[M/F]1"%sp;
  %else;
    <img src="%image_prefix;/sexunknown.png" title="?"%sp;
  %end;
         width="wi_he" height="wi_he" style="border: none" alt=""%/>%nn;
  %if;(wizard and not cancel_links and not xx.is_restricted)</a>%end;
  %sp;
%end;

%define;li_SD(xx)
  <li class="%if;xx.has_parents;goway%else;noway%end;">%nn;
%end;

%define;li_SDC(xx)
  %if;xx.has_families;
    %reset_count;
    %foreach;family;
      %if;(nb_children>0)%incr_count;%end;
    %end;
  %end;
  <li class="%if;xx.has_families;%if;(count!=0)desc%else;nodesc%end;%else;nospou%end;">%nn;
%end;

%define;display_arrows()
  %if;not cancel_links;
    <table style="float: %right;" border="%border;"><tr><td>
      %if;has_referer;
        <a href="%referer;"><img style="border-width: thin" alt="" title="&lt;&lt;"%sp;%nn;
          src="%image_prefix;/left.png"%wid_hei;left.png;%/></a>
      %end;
      <a href="%prefix;"><img style="border-width: thin" alt="" title="^^"%sp;
        src="%image_prefix;/up.png"%wid_hei;up.png;%/></a>
      <a href="%url;cgl=on" target="_blank"><img style="border-width: thin"%sp;
        src="%image_prefix;/right.png"%wid_hei;right.png; alt="" title="[cancel GeneWeb links]"%/></a>
    </td></tr></table>
  %end;
%end;

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

%define;gena(xx)
  %if;(xx = 1)[*specify::generation/generations]0%nn;
  %elseif;(xx = 2)[*the parents]%nn;
  %elseif;(xx = 3)[*the grandparents]%nn;
  %elseif;(xx = 4)[*the great-grandparents]%nn;
  %else;
    %apply;thegen%with;
      %apply;nth([nth (generation)], xx)
    %end;
  %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;tothegen(xx)
  [to 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;togend(xx)
  %if;(xx = 0)[specify::generation/generations]0%nn;
  %elseif;(xx = 1)[to the children]%nn;
  %elseif;(xx = 2)[to the grandchildren]%nn;
  %elseif;(xx = 3)[to the great-grandchildren]%nn;
  %else;
    %apply;tothegen%with;
      %apply;nth([nth (generation)], xx)
    %end;
  %end;
%end;

%define;very_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;
%end;

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

%define;short_display_person(xx)
  %apply;very_short_display_person("xx")
  %sp;%xx.title;%xx.dates;
  %if;xx.birthday; ([happy birthday to you!])%end;
%end;

%define;display_vertical(xx)
  %if;(xx.has_birth_date or xx.has_birth_place or
       xx.has_baptism_date or xx.has_baptism_place or
       xx.is_dead or xx.is_buried or xx.is_cremated or
       xx.has_event or
      (xx.has_consanguinity and bvar.show_consang!="no") or
       xx.has_occupation or xx.has_linked_page.OCCU !="")
    <ul>
      %if;(xx.index!=central_index)
        <li>
          %apply;image_MF("xx","13")
          %apply;display_sosa("xx")
          %if;(cancel_links or xx.is_restricted)%xx;
          %else;<a href="%prefix;%xx.access;">%xx;</a>%end;%sp;
        </li>%nl;
        %if;xx.has_nobility_titles;
          %foreach;xx.nobility_title;
            <li>%apply;capitalize(nobility_title)</li>%nl;
          %end;
        %end;
      %end;
      %if;xx.has_birth_date;
        <li>%apply;capitalize(nth([born],xx.sex)) %xx.on_birth_date;
        %if;xx.birthday; ([happy birthday to you!])%end;
        %if;xx.has_birth_place; - %xx.birth_place;%end;</li>%nl;
      %else;
        %if;xx.has_birth_place;
          <li>%apply;capitalize(nth([born],xx.sex)) - %xx.birth_place;</li>%nl;
        %end;
      %end;
      %if;xx.has_baptism_date;
        <li>%apply;capitalize(nth([baptized],xx.sex)) %xx.on_baptism_date;
        %if;xx.has_baptism_place; - %xx.baptism_place;%end;</li>%nl;
      %else;
        %if;xx.has_baptism_place;
          <li>%apply;capitalize(nth([baptized],xx.sex)) - %xx.baptism_place;</li>%nl;
        %end;
      %end;
      %if;xx.computable_age;
        <li>[*age] : %xx.age;</li>%nl;
      %end;
      %if;xx.has_event;
        %foreach;xx.event;
          %if;(event.name!=[birth] and
               event.name!=[baptism] and
               event.name!=[marriage event] and
               event.name!=[death] and
               event.name!=[burial])
              <li>%apply;capitalize(event.name) :%nn;
              %if;event.has_date; %event.date;%end;
              %if;event.has_place; - %event.place;%end;</li>%nl;
          %end;
        %end;
      %end;
      %if;xx.is_dead;
        <li>%apply;capitalize(xx.died)
        %if;xx.has_death_date; %xx.on_death_date;%end;
        %if;xx.has_death_place; - %xx.death_place;%end;
        %if;(xx.has_linked_page.DEATH !="") %xx.linked_page.DEATH;%end;
        %if;xx.computable_death_age;, [age at death:] %xx.death_age;%end;</li>%nl;
        %if;xx.is_buried;
          <li>%apply;capitalize(nth([buried],xx.sex))
          %if;xx.has_burial_date; %xx.on_burial_date;%end;
          %if;xx.has_burial_place; - %xx.burial_place;%end;</li>%nl;
        %end;
        %if;xx.is_cremated;
          <li>%apply;capitalize(nth([cremated],xx.sex))
          %if;xx.has_cremation_date; %xx.on_cremation_date;%end;
          %if;xx.has_cremation_place; - %xx.cremation_place;%end;</li>%nl;
        %end;
      %end;
      %if;xx.has_occupation;
        <li>%apply;capitalize(xx.occupation)</li>%nl;
      %end;
      %if;(xx.has_linked_page.OCCU)
        <li>%apply;capitalize(xx.linked_page.OCCU)</li>%nl;
      %end;
      %if;(xx.has_consanguinity and bvar.show_consang!="no")
        <li>[*consanguinity] : %xx.consanguinity;</li>%nl;
      %end;
    </ul>
  %else;&nbsp;%end;
%end;

%define;married_to(UP_lo, m_f, date_place)
  %if;(wizard and not cancel_links)
    <a href="%prefix;;m=MOD_FAM;i=%family.index;;ip=%index;">%nn;
      <img src="%image_prefix;/picto_molette.png"%sp;
           title="[modify::family/families]0 [with]%sp;
           %spouse.first_name;.%spouse.occ; %spouse.surname;"%sp;
           height="13" width="13" %/>%nn;
    </a>%sp;
  %end;
  %let;marr_text;
    %if;(m_f=1)
      %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;
    %else;
      %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;
    %end;
  %in;
  %if;("UP_lo"="UPPER")%apply;capitalize(marr_text)%else;%marr_text;%end;
%end;

%define;long_married(xx, UP_lo)
  %apply;married_to%with;UP_lo%and;%xx.sex%and;
    %if;(marriage_place="")
      %if;(on_marriage_date="")
      %else; <em>%on_marriage_date;
        %if;wedding_birthday; ([happy birthday to them!])%end;
        </em>%end;
    %else;
      %if;(on_marriage_date="")<em>, %marriage_place;, </em>
      %else; <em>%on_marriage_date;
        %if;wedding_birthday; ([happy birthday to them!])%end;
        , %marriage_place, </em>%end;
    %end;
  %end;
%end;