%nn; %if;(evar_m="ADD_FAM" or evar_m="ADD_FAM_OK") [*add::family/families]0%nn; %elseif;(evar_m="ADD_PAR" or evar_m="ADD_PAR_OK")[*add::parents]0%nn; %elseif;(evar_m="MOD_FAM" or evar_m="MOD_FAM_OK") [*modify::family/families]0 # %evar_i; %elseif;(evar_m="MRG_DUP_FAM_Y_N" or evar_m="MRG_FAM" or evar_m="MRG_FAM_OK" or evar_m="MRG_MOD_FAM_OK") [*merge::family/families]1 # %evar_i; %end;

%include;css %include;hed %message_to_wizard;
%( do not use %include;perso_header %) %include_perso_header; %include;home %define;nav()
%end; %define;date(xlab,xvar,xdt) %let;day_input;pattern="(?:0?[1-9]|1[0-9]|2[0-9]|3[0-1])" size="2" maxlength="2"%in; %let;month_input;pattern="(?:0?[1-9]|1[0-2]|VD|BR|FM|NI|PL|VT|GE|FL|PR|ME|TH|FT|JC|vd|br|fm|ni|pl|vt|ge|fl|pr|me|th|ft|jc)" size="1" maxlength="2"%in; %let;year_input;pattern="[?><~/+-]?\d*/?" size="4" maxlength="8"%in;
xlab
%if;([!dates order]0="ddmmyy" or [!dates order]0="ddmmyyyy" or [!dates order]0="dmyyyy") [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;
[precision]0
[calendar/calendars]0
%if;([!dates order]0="ddmmyy" or [!dates order]0="ddmmyyyy" or [!dates order]0="dmyyyy") [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;
%end; %define;source(xvar,xx)
[*source/sources]0
%xx_src;
%end; %define;note(xvar,xx)
[*note/notes]0
%xx_note;
%end; %define;small_date(kind,xvar,xx,verbose) %let;day_input;pattern="(?:0?[1-9]|1[0-9]|2[0-9]|3[0-1])" size="2" maxlength="2"%in; %let;month_input;pattern="(?:0?[1-9]|1[0-2]|VD|BR|FM|NI|PL|VT|GE|FL|PR|ME|TH|FT|JC|vd|br|fm|ni|pl|vt|ge|fl|pr|me|th|ft|jc)" size="1" maxlength="2"%in; %let;year_input;pattern="[?><~/-+]?\d*/?" size="4" maxlength="8"%in;
[*kind]
%if;([!dates order]0="ddmmyy" or [!dates order]0="ddmmyyyy" or [!dates order]0="dmyyyy") [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;
[place]%nn;
%end; %define;birth(xvar,xx,verbose) %apply;small_date("birth","xvarb","xx","verbose") %end; %define;death(xvar,xx,verbose) %apply;small_date("death","xvard","xx","verbose") %end; %define;w_birth(xcnt, wcnt,xx,verbose) %apply;small_date("birth","excnt_witnwcnt_b","fwitness","verbose") %end; %define;w_death(xcnt, wcnt,xx,verbose) %apply;small_date("death","excnt_witnwcnt_d","fwitness","verbose") %end; %define;parent(xcnt,xx,psex)
[*first name/first names]0 (%if;(xx.first_name!="" or xx.surname!="")%apply;nth_c%with;[M/F]0[M/F]1N%and;psex%end; %else;%if;(xcnt=1)[M/F]0%else;[M/F]1%end;%end;)
[*number]
[*surname/surnames]0
%apply;birth("paxcnt","xx","true") %apply;death("paxcnt","xx","true")
[*occupation/occupations]0
%end; %define;insert_parent(xcnt)
[*insert]
[parents]0
%end; %define;selector_fevent(xcnt)
%end; %define;insert_fevent(xcnt)
[*insert]
[event/events]0/[event/events]1
%end; %define;insert_witness(xcnt, wcnt)
[*insert]
[witness/witness/witnesses]0/[witness/witness/witnesses]2
%end; %define;one_witness(xcnt, wcnt)

##### [*witness/witness/witnesses]0 wcnt

[*first name/first names]0
[*number]0
[*surname/surnames]0
%if;(fwitness.index!="-1") [*modify] %apply;nth%with;[nth]%and;%wcnt;%end; [witness/witness/witnesses]0 %end;
[*sex]
[M/F]0
?
[M/F]1
[*occupation/occupations]0
[*of course dead]
[*public]
%end; %define;one_fevent(xcnt, has_fevents)

##### [*event/events]0 xcnt

%apply;selector_fevent(xcnt)
[*place]
%apply;date([*date/dates]0, "e_datexcnt", "event_date")
[*note/notes]1
%event.e_note;
[*source/sources]0
%if;(event.e_src!="") %event.e_src; %else; %end;
%if;(has_fevents and has_fwitness) %foreach;fwitness;
%apply;one_witness(xcnt, wcnt) %if;is_last;%apply;insert_witness(xcnt, wcnt)%end;
%end; %else;
%apply;insert_witness(xcnt, "0")
%end;

%end; %define;card_header(xx,yy)

### [*yy]1

%end; %nn; %if;(evar_m="ADD_FAM" or evar_m="ADD_FAM_OK") [*add::family/families]0 %elseif;(evar_m="ADD_PAR" or evar_m="ADD_PAR_OK") [*add::parents] %foreach;child;%child.first_name;%if;(child.occ!="").%child.occ;%end; %child.surname;%end; %elseif;(evar_m="MOD_FAM" or evar_m="MOD_FAM_OK") [*modify::family/families]0 # %evar_i; %elseif;(evar_m="MRG_DUP_FAM_Y_N" or evar_m="MRG_FAM" or evar_m="MRG_FAM_OK" or evar_m="MRG_MOD_FAM_OK") [*merge::family/families]1 # %evar_i; %end; %let;l_on1s;onkeydown="if (event.keyCode == 13) if (!event.shiftKey) javascript:document.upd.submit()"%in;
%apply;nav()

%hidden; %if;(evar_ip!="")%nl;%end; %if;(evar_i!="")%nl;%end; %if;(evar_m="ADD_FAM" or evar_m="ADD_FAM_OK") %nl; %elseif;(evar_m="ADD_PAR" or evar_m="ADD_PAR_OK") %nl; %elseif;(evar_m="MOD_FAM" or evar_m="MOD_FAM_OK") %nl; %elseif;(evar_m="MRG_DUP_FAM_Y_N" or evar_m="MRG_FAM" or evar_m="MRG_FAM_OK" or evar_m="MRG_MOD_FAM_OK") %if;(evar_ini1!="" and evar_ini2!="") %end; %if;(evar.iexcl!="") %end; %if;(evar.fexcl!="") %end; %nl; %end;

%apply;card_header("parents","parents")
%foreach;parent; %let;os;%parent.sexes;%in; %if;(cnt!=1 and bvar.multi_parents="yes")

%end;
%apply;parent(cnt,"parent",parent.sex) %if;(bvar.multi_parents="yes")%apply;insert_parent(cnt)%end;
%if;(cnt=2)
[*no sexes check]
%end; %end;
%apply;card_header("events","event/events")
%if;has_fevents; %foreach;fevent; %apply;one_fevent(cnt, has_fevents) %if;is_last; %apply;insert_fevent(cnt) %end; %end; %else; %apply;one_fevent("1", has_fevents) %apply;insert_fevent("1") %end;
%define;insert_child(xcnt) [*insert]
[child/children]0/[child/children]1
%end; %define;invert_children(xcnt)
%expr(xcnt-1) xcnt
%end; %define;child(xcnt)

##### %apply;nth%with;[nth]%and;%cnt;%end; [*child/children]0

[*first name/first names]0
[*number]
[*surname/surnames]0
%if;(child.index!="-1") [*modify] %apply;nth%with;[nth]%and;%cnt;%end; [child/children]0 %end;
[*sex]
[M/F]0
?
[M/F]1
%apply;birth("chxcnt", "child", "true") %apply;death("chxcnt", "child", "true")
[*occupation/occupations]0
%end;
%apply;card_header("children","child/children")
%apply;insert_child("0") %foreach;child; %if;(cnt!=1) %apply;invert_children(cnt) %end;
%apply;child(cnt)

%apply;insert_child(cnt) %end;
%apply;card_header("sources","source/sources")
[[*person/persons]1]
%if;(evar_psrc!="")%evar_psrc;%else;%evar_dsrc;%end;
[*family/families]0
%if;(fsources!="") %fsources; %else; %end;
%if;(bvar.origin_file="on") %end;
%apply;card_header("comments","comment")
%include;toolbar
%comment;%sq;
%include;accent
%base_trailer; %include;copyr
%include;js %include;upd_js