%( <!-- Begin inc_mickroue2 20130518 --> %)
%( <!-- display linked pages : Images --> %)

  %define;display_images_him_her(xx, yy, zz, hhim, hher)
    %if;(has_linked_page.xxyy and spouse.has_linked_page.xxyy)
      %if;(evar.image = "on" and (bvar.no_image_for_visitor != "yes" or friend or wizard))
        <li class="image_sheet">
          <a onclick="window.open(this.href); return false;" class="image" href="%prefix;m=IMH;s=%hhim.first_name_key_val;_%hhim.surname_key_val;_%hhim.occ;_%hher.first_name_key_val;_%hher.surname_key_val;_%hher.occ;_xxyy.%bvar.var_img_ext;">
            <img src="%prefix;m=IM;s=%hhim.first_name_key_val;_%hhim.surname_key_val;_%hhim.occ;_%hher.first_name_key_val;_%hher.surname_key_val;_%hher.occ;_xxyy.%bvar.var_img_ext;" alt="[*image/images]0"%/>%nn;
          </a>
          %if;(nb_families > 1)&amp;%marriage_date.year;<br%/>%end;
          %linked_page.xxyy;
          <br%/>
        </li>
      %else;
        <li>
          %if;(nb_families > 1)&amp;%marriage_date.year; - %end;
          %linked_page.xxyy;
          %if;(not cancel_links)
            %sp;-%sp;
            <a onclick="window.open(this.href); return false;"
             href="%prefix;m=IMH;s=%hhim.first_name_key_val;_%hhim.surname_key_val;_%hhim.occ;_%hher.first_name_key_val;_%hher.surname_key_val;_%hher.occ;_xxyy.%bvar.var_img_ext;">
              [*see]
            </a>
          %end;
        </li>
      %end;
    %end;
    %if;(wizard and not cancel_links)
      %incr_count;
      %apply;add_in_sorted_list%with;
        %expr(1000 + count)%and;
        %if;("yy" = "A")&amp;%marriage_date.year;%end;%and;
        %if;(bvar.var_text != "")
          <a href="%prefix;m=MOD_NOTES;f=images:xxyy;base=%base.name;;text=%[%[%hhim.first_name_key;/%hhim.surname_key;/%hhim.occ;/%bvar.var_text; %]%] x %[%[%hher.first_name_key;/%hher.surname_key;/%hher.occ;/%bvar.var_text; %]%];file=%hhim.first_name_key_val;_%hhim.surname_key_val;_%hhim.occ;_%hher.first_name_key_val;_%hher.surname_key_val;_%hher.occ;_xxyy" title="images:xxyy">%apply;v_linked_page("xxyy")</a>
        %else;
         <a href="%prefix;m=MOD_NOTES;f=images:xxyy;base=%base.name;;text=*%zz_date.year;&nbsp;:&nbsp;%[%[%hhim.first_name_key;/%hhim.surname_key;/%hhim.occ;/%hhim;%]%] x %[%[%hher.first_name_key;/%hher.surname_key;/%hher.occ;/%hher;%]%];file=%hhim.first_name_key_val;_%hhim.surname_key_val;_%hhim.occ;_%hher.first_name_key_val;_%hher.surname_key_val;_%hher.occ;_xxyy" title="images:xxyy">%apply;v_linked_page("xxyy")</a>
        %end;
      %end;
    %end;
  %end;

  %define;display_images_person(xx, yy, zz)
    %if;(has_linked_page.xxyy)
      %if;(evar.image = "on" and (bvar.no_image_for_visitor != "yes" or friend or wizard))
        <li class="image_sheet">
            <a onclick="window.open(this.href); return false;" class="image"
             href="%prefix;m=IMH;s=%first_name_key_val;_%surname_key_val;_%occ;_xxyy.%bvar.var_img_ext;">
              <img src="%prefix;m=IM;s=%first_name_key_val;_%surname_key_val;_%occ;_xxyy.%bvar.var_img_ext;"
               alt="[*image/images]0"%/>
            </a>
            <br%/>
          %linked_page.xxyy;
        </li>
      %else;
        <li>
          %linked_page.xxyy;
          %if;(not cancel_links)
            %sp;-%sp;
            <a onclick="window.open(this.href); return false;" 
             href="%prefix;m=IMH;s=%first_name_key_val;_%surname_key_val;_%occ;_xxyy.%bvar.var_img_ext;">
             [*see]0</a>
          %end;
        </li>
      %end;
    %end;
    %if;(wizard and not cancel_links)
      %incr_count;
      %apply;add_in_sorted_list%with;
        %expr(1000 + count)%and;
        %if;("yy" = "A")
          %if;("xx" = "BIRTH")&deg;%zz_date.year;%end;
          %if;("xx" = "DEATH")
            %death_symbol;
            %zz_date.year;
          %end;
          %if;("zz" = "other")- - -%end;
        %end;%and;
        %if;(bvar.var_text != "")
          <a href="%prefix;m=MOD_NOTES;f=images:xxyy;base=%base.name;;text=%[%[%first_name_key;/%surname_key;/%occ;/%bvar.var_text;%]%];file=%first_name_key_val;_%surname_key_val;_%occ;_xxyy;" title="images:xxyy">%apply;v_linked_page("xxyy")</a>
        %elseif;("xx" = "OTHER")
          <a href="%prefix;m=MOD_NOTES;f=images:xxyy;base=%base.name;;text=*&nbsp;%[%[%first_name_key;/%surname_key;/%occ;/%self;%]%];file=%first_name_key_val;_%surname_key_val;_%occ;_xxyy;" title="images:xxyy">%apply;v_linked_page("xxyy")</a>
        %else;
          <a href="%prefix;m=MOD_NOTES;f=images:xxyy;base=%base.name;;text=*%zz_date.year;&nbsp;:&nbsp;%[%[%first_name_key;/%surname_key;/%occ;/%self;%]%];file=%first_name_key_val;_%surname_key_val;_%occ;_xxyy;" title="images:xxyy">%apply;v_linked_page("xxyy")</a>
        %end;
      %end;
    %end;
  %end;

  %define;display_images_marriage(xx, yy, zz)
    %if;(is_male)
       %apply;display_images_him_her("xx","yy","zz","self","spouse")
    %else;
       %apply;display_images_him_her("xx","yy","zz","spouse","self")
    %end;
  %end;

  %define;display_images(xx, yy, zz, curlev, maxlev)
    %if;(curlev < maxlev)
      %if;("xx" = "MARRIAGE")
        %if;(has_linked_page.xxyy and spouse.has_linked_page.xxyy or wizard)
          %apply;display_images_marriage("xx", "yy", "zz")  
        %end;
      %elseif;(has_linked_page.xxyy or wizard)
        %apply;display_images_person("xx", "yy", "zz")
      %end;
      %apply;display_images%with;
        xx%and;
        %apply;letter(curlev + 2)%and;
        zz%and;
        %expr(curlev + 1)%and;
        %maxlev;
      %end;
    %end;
  %end;

  %define;v_linked_page(gwf)
    %if;(bvar.var_t_gwf = "")
      gwf%nn;
    %else;
      %bvar.var_t_gwf;%nn;
    %end;
  %end;

<div>
  %empty_sorted_list;
  %let;focus_cnt;%count;%in;
  %reset_count;
  <ul class="list_no_style">
    %if;(bvar.var_n_BIRTH > 0)
      %if;(has_birth_date)
        %apply;display_images("BIRTH","A","birth",0,bvar.var_n_BIRTH)
      %elseif;(has_baptism_date)
        %apply;display_images("BIRTH","A","baptism",0,bvar.var_n_BIRTH)
      %end;
    %end;
    %if;(bvar.var_n_MARRIAGE > 0)
      %if;(has_families)
        %foreach;family
          %if;(on_marriage_date != "")
            %apply;display_images("MARRIAGE","A","marriage",0,bvar.var_n_MARRIAGE)
          %end;
        %end;
      %end;
    %end;
    %if;(bvar.var_n_DEATH > 0)
      %if;(has_death_date)
        %apply;display_images("DEATH","A","death",0,bvar.var_n_DEATH)
      %elseif;(has_burial_date)
        %apply;display_images("DEATH","A","burial",0,bvar.var_n_DEATH)
      %elseif;(has_cremation_date)
        %apply;display_images("DEATH","A","cremated",0,bvar.var_n_DEATH)
      %end;
    %end;
    %if;(bvar.var_n_OTHER > 0)
      %apply;display_images("OTHER","A","other",0,bvar.var_n_OTHER)
    %end;
  </ul>
  %apply;init_count(focus_cnt)
  %if;(wizard and not cancel_links)
    <div id="l_images" class="menu" style="margin-left: 2em; clear: both; position: relative;">
      %foreach;sorted_list_item;
        %if;(item.2 != "")
          <span><a href="#l_images" title="[add] [linked pages]">%item.2;</a>
          <span class="s_menu">
        %end;
        %item.3;
        %if;(next_item.2 != "")</span></span>%end;
      %end;
      </span></span>
    </div>
  %end;
</div>
%( <!-- End inc_mickroue2 --> %)