<?xml version="1.0" encoding="UTF-8"?>
<Report>
	<!-- $Id$ -->
	<Title><var var="i18n::translate('Family Group Report')" /></Title>
	<Description>Prints a PAF style family group record</Description>
	<!-- User inputs for the report -->
	<Input name="famid" lookup="FAM" type="text" default=""><var var="i18n::translate('Enter Family ID')" /></Input>
	<Input name="sources" type="checkbox" default="1"><var var="i18n::translate('Show sources?')" /></Input>
	<Input name="notes" type="checkbox" default="1"><var var="i18n::translate('Show notes?')" /></Input>
	<Input name="photos" type="checkbox" default="0"><var var="i18n::translate('Show photos?')" /></Input>
	<Input name="blanks" type="checkbox" default="0"><var var="i18n::translate('Print basic events when blank?')" /></Input>
	<Input name="pageSize" type="select" default="A4" options="letter=>i18n::translate_c('paper size','Letter')|A3=>i18n::translate_c('paper size', 'A3')|A4=>i18n::translate_c('paper size','A4')|legal=>i18n::translate_c('paper size','Legal')"><var var="i18n::translate('Page size')" /></Input>
	<Input name="fonts" type="select" default="dejavusans" options="arialunicid0=>i18n::translate_c('font name', 'Arial')|dejavusans=>i18n::translate_c('font name', 'DejaVu')|helvetica=>i18n::translate_c('font name', 'Helvetica')"><var var="i18n::translate('Font')"/></Input>
	<Input name="colors" type="checkbox" default="1"><var var="i18n::translate('Use colors')"/></Input>
	<Input name="showplace" type="checkbox" default="1"><var var="i18n::translate('Print')"/> "<var var="i18n::translate('Place')" />"?</Input>

	<!-- Header -->
	<Style name="header" font="$fonts" size="18" />
	<!-- Generated by style - required style name by the generator -->
	<Style name="genby" font="$fonts" size="8" />
	<!-- Links to sources - required style name by the generator -->
	<Style name="footnotenum" font="$fonts" size="6" />
	<!-- Source text - FootnoteTexts - required style name by the generator -->
	<Style name="footnote" font="$fonts" size="8" />
	<!-- Page numbers text -->
	<Style name="pagenum" font="$fonts" size="8" />
	<!-- Page Header text -->
	<Style name="pageheader" font="$fonts" size="14"/>
	<!-- Individual names in text boxes -->
	<Style name="name" font="$fonts" size="10" style="b"/>
	<!-- Standard text -->
	<Style name="text" font="$fonts" size="9" />
	<!-- Facts text -->
	<Style name="fact" font="$fonts" size="8"/>
	<!-- Date -->
	<Style name="date" font="$fonts" size="8"/>

	<!-- if the option to show blanks is selected then ignore the MARR, BIRT etc facts that are printed with the blanks -->
	<if condition="$blanks==1">
		<SetVar name="ignore" value="CHAN,NAME,SEX,SOUR,NOTE,OBJE,FAMC,FAMS,TITL,CHIL,HUSB,WIFE,MARR,BIRT,CHR,DEAT,BURI,_UID,_WT_OBJE_SORT" />
	</if>
	<if condition="$blanks!=1">
		<SetVar name="ignore" value="CHAN,NAME,SEX,SOUR,NOTE,OBJE,FAMC,FAMS,TITL,CHIL,HUSB,WIFE,_UID,_WT_OBJE_SORT" />
	</if>
	<!-- Setup colors -->
	<!-- Section title background color -->
	<SetVar name="sectionbox_bgcolor" value="#AAAAAA"/>
	<SetVar name="malebox_bgcolor" value=""/>
	<SetVar name="femalebox_bgcolor" value=""/>
	<SetVar name="unknowngenderbox_bgcolor" value=""/>
	<SetVar name="factbox_bgcolor" value=""/>
	<SetVar name="tcolor" value=""/>
	<!-- Use colors -->
	<if condition="$colors==1">
		<!-- Section title background color -->
		<SetVar name="sectionbox_bgcolor" value="#9CA3D4"/>
		<!-- Male background color -->
		<SetVar name="malebox_bgcolor" value="#D6E0EA"/>
		<!-- Female background color -->
		<SetVar name="femalebox_bgcolor" value="#E9DAF1"/>
		<!-- Unknown gender -->
		<SetVar name="unknowngenderbox_bgcolor" value="#FFFFFF"/>
		<!-- Fact boxes -->
		<SetVar name="factbox_bgcolor" value="#D1D9FF"/>
		<!-- Text color - black -->
		<SetVar name="tcolor" value="#000000"/>
	</if>

	<!-- space height -->
	<SetVar name="sheight" value="15"/>

	<!-- set the default widths -->
	<SetVar name="width" value="0" />
	<SetVar name="width1" value="0" />
	<SetVar name="width2" value="0" />
	<SetVar name="dwidth" value="185" />
	<SetVar name="pwidth" value="436" />
	<!-- reset the widths if the photos are shown -->
	<if condition="$photos==1">
		<SetVar name="width" value="433" />
		<SetVar name="width1" value="418" />
		<SetVar name="width2" value="233" />
	</if>
	<!-- New Page for Sources controller if SOUR exist -->
	<SetVar name="source_exist" value="0"/>

	<!-- start of main report document -->
	<Doc pageSize="$pageSize">
		<SetVar name="husbid" value="@HUSB" />
		<SetVar name="wifeid" value="@WIFE" />

		<Header>
			<Cell align="center" newline="1" style="header"><var var="i18n::translate('Family Group Report')" /></Cell>
			<Cell align="rightrtl" newline="1" style="pagenum"><var var="i18n::translate('Page')" /> <PageNum /> <var var="i18n::translate('of')" /> <TotalPages /></Cell>
		</Header>

		<Body>
			<Gedcom id="$famid">
				<!-- Print the Family name with Level 1 sources -->
				<TextBox newline="1">
					<Text style="pageheader"><var var="i18n::translate('Family')" /> <GetPersonName id=""/> </Text>
					<if condition="$sources==1">
						<RepeatTag tag="SOUR">
							<Footnote>
								<Gedcom id="@SOUR">
									<GedcomValue tag="TITL" />
								</Gedcom>
								<if condition="@PAGE!=''">: </if>
								<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
							</Footnote>
							<SetVar name="source_exist" value="1"/>
						</RepeatTag>
					</if>
				</TextBox>

				<!-- Show all family images -->
				<if condition="$photos==1">
					<!-- This is an image not a text, so don't use text padding
					Reset also the last height after all the images has been printed
					set pagecheck to 0, the image function check is too
					and "trick" the X-position back to the margin with a newline -->
					<TextBox left="$pwidth" newline="1" pagecheck="0" padding="0" reseth="1" width="80">
						<RepeatTag tag="OBJE">
							<Image file="@FILE" width="80" ln="N"/>
						</RepeatTag>
					</TextBox>
				</if>

				<!-- Print the husband -->
				<Gedcom id="@HUSB">
					<!-- print the name and any level 1 sources -->
					<TextBox bgcolor="$malebox_bgcolor" border="1" width="$width" newline="1">
						<Text color="$tcolor" style="text"><var var="i18n::translate('Husband')" />  </Text>
						<Text color="$tcolor" style="name"><GetPersonName id="" /> </Text>
						<if condition="$sources==1">
							<RepeatTag tag="SOUR">
								<Footnote>
									<Gedcom id="@SOUR">
										<GedcomValue tag="TITL" />
									</Gedcom>
									<if condition="@PAGE!=''">: </if>
									<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
								</Footnote>
								<SetVar name="source_exist" value="1"/>
							</RepeatTag>
						</if>
					</TextBox>

					<!-- print the birth and christening if the blanks are on -->
					<if condition="$blanks==1">
						<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Birth')" />  </Text>
							<Text color="$tcolor" style="text"><GedcomValue tag="BIRT:DATE" /> </Text>
							<if condition="$sources==1">
								<RepeatTag tag="BIRT:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
						</TextBox>
						<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
							<if condition="$showplace==1">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
							</if>
							<Text color="$tcolor" style="text"><GedcomValue tag="BIRT:PLAC" /></Text>
						</TextBox>

						<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Christening')" />  </Text>
							<Text color="$tcolor" style="text"><GedcomValue tag="CHR:DATE" /> </Text>
							<if condition="$sources==1">
								<RepeatTag tag="CHR:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
						</TextBox>
						<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
							<if condition="$showplace==1">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
							</if>
							<Text color="$tcolor" style="text"><GedcomValue tag="CHR:PLAC" /></Text>
						</TextBox>
					</if>

					<!-- print all of the other facts -->
					<Facts ignore="$ignore">
						<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
							<Text color="$tcolor" style="fact"><var var="@fact" />  </Text>
							<Text color="$tcolor" style="text"><GedcomValue tag="@fact:DATE" /> </Text>
							<if condition="$sources==1">
								<RepeatTag tag="@fact:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
						</TextBox>
						<if condition="@desc!=''">
							<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
								<Text color="$tcolor" style="text">
									<GedcomValue tag="@desc" /> <GedcomValue tag="@fact:PLAC" /> <GedcomValue tag="@fact:TEMP" />
								</Text>
							</TextBox>
						</if>
						<if condition="@desc==''">
							<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
								<if condition="$showplace==1">
									<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
								</if>
								<Text color="$tcolor" style="text">
									<GedcomValue tag="@fact:PLAC" /> <GedcomValue tag="@fact:TEMP" />
								</Text>
							</TextBox>
						</if>
					</Facts>
					
					<!-- put the death and burial info if blanks are on -->
					<if condition="$blanks==1">
						<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Death')" />  </Text>
							<Text color="$tcolor" style="text"><GedcomValue tag="DEAT:DATE" /> </Text>
							<if condition="$sources==1">
								<RepeatTag tag="DEAT:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
						</TextBox>
						<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
							<if condition="$showplace==1">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
							</if>
							<Text color="$tcolor" style="text"><GedcomValue tag="DEAT:PLAC" /></Text>
						</TextBox>

						<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Burial')" />  </Text>
							<Text color="$tcolor" style="text"><GedcomValue tag="BURI:DATE" /> </Text>
							<if condition="$sources==1">
								<RepeatTag tag="BURI:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
						</TextBox>
						<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
							<if condition="$showplace==1">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
							</if>
							<Text color="$tcolor" style="text"><GedcomValue tag="BURI:PLAC" /></Text>
						</TextBox>
					</if>

					<Gedcom id="$famid">
						<!-- put the marriage info if blanks are on -->
						<if condition="$blanks==1">
							<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Marriage')" />  </Text>
								<Text color="$tcolor" style="text"><GedcomValue tag="MARR:DATE" /> </Text>
								<if condition="$sources==1">
									<RepeatTag tag="MARR:SOUR">
										<Footnote>
											<Gedcom id="@SOUR">
												<GedcomValue tag="TITL" />
											</Gedcom>
											<if condition="@PAGE!=''">: </if>
											<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
										</Footnote>
										<SetVar name="source_exist" value="1"/>
									</RepeatTag>
								</if>
							</TextBox>
							<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
								<if condition="$showplace==1">
									<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
								</if>
								<Text color="$tcolor" style="text"><GedcomValue tag="MARR:PLAC" /></Text>
							</TextBox>
						</if>

						<!-- print all of the other family facts -->
						<Facts ignore="$ignore">
							<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
								<Text color="$tcolor" style="fact"><var var="@fact" />  </Text>
								<Text color="$tcolor" style="text"><GedcomValue tag="@fact:DATE" /> </Text>
								<if condition="$sources==1">
									<RepeatTag tag="@fact:SOUR">
										<Footnote>
											<Gedcom id="@SOUR">
												<GedcomValue tag="TITL" />
											</Gedcom>
											<if condition="@PAGE!=''">: </if>
											<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
										</Footnote>
										<SetVar name="source_exist" value="1"/>
									</RepeatTag>
								</if>
							</TextBox>
							<if condition="@desc!=''">
								<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
									<Text color="$tcolor" style="text">
										<GedcomValue tag="@desc" /> <GedcomValue tag="@fact:PLAC" /> <GedcomValue tag="@fact:TEMP" />
									</Text>
								</TextBox>
							</if>
							<if condition="@desc==''">
								<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
									<if condition="$showplace==1">
										<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
									</if>
									<Text color="$tcolor" style="text">
										<GedcomValue tag="@fact:PLAC" /> <GedcomValue tag="@fact:TEMP" />
									</Text>
								</TextBox>
							</if>
						</Facts>
					</Gedcom>

					<!-- print the father and mother of the main husband -->
					<Gedcom id="@FAMC">
						<TextBox bgcolor="$malebox_bgcolor" border="1" left="15" width="$width1" newline="1">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Father')" />  </Text>
							<Text color="$tcolor" style="name"><GetPersonName id="@HUSB" /></Text>
							<Gedcom id="@HUSB">
								<Text color="$tcolor" style="text"> (<varLetter var="BIRT" />: <GedcomValue tag="BIRT:DATE" /> - <varLetter var="DEAT" />: <GedcomValue tag="DEAT:DATE" />)</Text>
							</Gedcom>
						</TextBox>
						<TextBox bgcolor="$femalebox_bgcolor" border="1" left="15" width="$width1" newline="1">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Mother')" />  </Text>
							<Text color="$tcolor" style="name"><GetPersonName id="@WIFE" /></Text>
							<Gedcom id="@WIFE">
								<Text color="$tcolor" style="text"> (<varLetter var="BIRT" />: <GedcomValue tag="BIRT:DATE" /> - <varLetter var="DEAT" />: <GedcomValue tag="DEAT:DATE" />)</Text>
							</Gedcom>
						</TextBox>
					</Gedcom>
					<!-- print any notes for the husband -->
					<if condition="$notes==1">
						<RepeatTag tag="NOTE">
							<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$width1" newline="1">
								<Text color="$tcolor" style="name"><var var="i18n::translate('Note')" />  </Text>
								<Text color="$tcolor" style="text"><GedcomValue tag="NOTE" /></Text>
							</TextBox>
						</RepeatTag>
					</if>
					<TextBox height="$sheight" newline="1"/>
				</Gedcom>
				<!-- end of main husband -->

				<!-- Print the wife -->
				<Gedcom id="@WIFE">
					<!-- print the name and sources -->
					<TextBox bgcolor="$femalebox_bgcolor" border="1" width="$width" newline="1">
						<Text color="$tcolor" style="text"><var var="i18n::translate('Wife')" />  </Text>
						<Text color="$tcolor" style="name"><GetPersonName id="" /> </Text>
						<if condition="$sources==1">
							<RepeatTag tag="SOUR">
								<Footnote>
									<Gedcom id="@SOUR">
										<GedcomValue tag="TITL" />
									</Gedcom>
									<if condition="@PAGE!=''">: </if>
									<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
								</Footnote>
								<SetVar name="source_exist" value="1"/>
							</RepeatTag>
						</if>
					</TextBox>

					<!-- print the birth and christening with blanks on -->
					<if condition="$blanks==1">
						<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Birth')" />  </Text>
							<Text color="$tcolor" style="text"><GedcomValue tag="BIRT:DATE" /> </Text>
							<if condition="$sources==1">
								<RepeatTag tag="BIRT:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
						</TextBox>
						<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
							<if condition="$showplace==1">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
							</if>
							<Text color="$tcolor" style="text"><GedcomValue tag="BIRT:PLAC" /></Text>
						</TextBox>

						<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Christening')" />  </Text>
							<Text color="$tcolor" style="text"><GedcomValue tag="CHR:DATE" /> </Text>
							<if condition="$sources==1">
								<RepeatTag tag="CHR:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
						</TextBox>
						<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
							<if condition="$showplace==1">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
							</if>
							<Text color="$tcolor" style="text"><GedcomValue tag="CHR:PLAC" /></Text>
						</TextBox>
					</if>
					<!-- print all of the other facts -->
					<Facts ignore="$ignore">
						<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
							<Text color="$tcolor" style="fact"><var var="@fact" />  </Text>
							<Text color="$tcolor" style="text"><GedcomValue tag="@fact:DATE" /> </Text>
							<if condition="$sources==1">
								<RepeatTag tag="@fact:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
						</TextBox>
						<if condition="@desc!=''">
							<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
								<Text color="$tcolor" style="text">
									<GedcomValue tag="@desc" /> <GedcomValue tag="@fact:PLAC" /> <GedcomValue tag="@fact:TEMP" />
								</Text>
							</TextBox>
						</if>
						<if condition="@desc==''">
							<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
								<if condition="$showplace==1">
									<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
								</if>
								<Text color="$tcolor" style="text">
									<GedcomValue tag="@fact:PLAC" /> <GedcomValue tag="@fact:TEMP" />
								</Text>
							</TextBox>
						</if>
					</Facts>

					<!-- print the death and burial with blanks on -->
					<if condition="$blanks==1">
						<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Death')" />  </Text>
							<Text color="$tcolor" style="text"><GedcomValue tag="DEAT:DATE" /> </Text>
							<if condition="$sources==1">
								<RepeatTag tag="DEAT:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
						</TextBox>
						<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
							<if condition="$showplace==1">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
							</if>
							<Text color="$tcolor" style="text"><GedcomValue tag="DEAT:PLAC" /></Text>
						</TextBox>

						<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Burial')" />  </Text>
							<Text color="$tcolor" style="text"><GedcomValue tag="BURI:DATE" /> </Text>
							<if condition="$sources==1">
								<RepeatTag tag="BURI:SOUR">
									<Footnote>
										<Gedcom id="@SOUR">
											<GedcomValue tag="TITL" />
										</Gedcom>
										<if condition="@PAGE!=''">: </if>
										<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
									</Footnote>
									<SetVar name="source_exist" value="1"/>
								</RepeatTag>
							</if>
						</TextBox>
						<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
							<if condition="$showplace==1">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
							</if>
							<Text color="$tcolor" style="text"><GedcomValue tag="BURI:PLAC" /></Text>
						</TextBox>
					</if>

					<!-- print the wife's parents -->
					<Gedcom id="@FAMC">
						<TextBox bgcolor="$malebox_bgcolor" border="1" left="15" width="$width1" newline="1">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Father')" />  </Text>
							<Text color="$tcolor" style="name"><GetPersonName id="@HUSB" /></Text>
							<Gedcom id="@HUSB">
								<Text color="$tcolor" style="text"> (<varLetter var="BIRT" />: <GedcomValue tag="BIRT:DATE" /> - <varLetter var="DEAT" />: <GedcomValue tag="DEAT:DATE" />)</Text>
							</Gedcom>
						</TextBox>
						<TextBox bgcolor="$femalebox_bgcolor" border="1" left="15" width="$width1" newline="1">
							<Text color="$tcolor" style="fact"><var var="i18n::translate('Mother')" />  </Text>
							<Text color="$tcolor" style="name"><GetPersonName id="@WIFE" /></Text>
							<Gedcom id="@WIFE">
								<Text color="$tcolor" style="text"> (<varLetter var="BIRT" />: <GedcomValue tag="BIRT:DATE" /> - <varLetter var="DEAT" />: <GedcomValue tag="DEAT:DATE" />)</Text>
							</Gedcom>
						</TextBox>
					</Gedcom>
					
					<!-- print the wife's notes -->
					<if condition="$notes==1">
						<RepeatTag tag="NOTE">
							<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$width1" newline="1">
								<Text color="$tcolor" style="name"><var var="i18n::translate('Note')" />  </Text>
								<Text color="$tcolor" style="text"><GedcomValue tag="NOTE" /></Text>
							</TextBox>
						</RepeatTag>
					</if>
					<TextBox height="$sheight" newline="1"/>
				</Gedcom>
				<!-- end of main wife -->

				<!-- print the children box in gray or color -->
				<TextBox border="1" width="$width" newline="1" bgcolor="$sectionbox_bgcolor">
					<Text color="$tcolor" style="text">
						<var var="i18n::translate('Children')" />  <var var="i18n::translate('List each child in order of birth.')" />
					</Text>
				</TextBox>

				<!-- find and print all of the children in the family -->
				<RepeatTag tag="CHIL">
					<Gedcom id="@CHIL">
						<!-- Print the male child's name -->
						<if condition="@SEX=='M'">
							<TextBox bgcolor="$malebox_bgcolor" border="1" left="15" newline="1" width="$width1">
								<Text color="$tcolor" style="text"><var var="i18n::translate('Son')"/>  </Text>
								<Text color="$tcolor" style="name"><GetPersonName id="" /> </Text>
								<if condition="$sources==1">
									<RepeatTag tag="SOUR">
										<Footnote>
											<Gedcom id="@SOUR">
												<GedcomValue tag="TITL" />
											</Gedcom>
											<if condition="@PAGE!=''">: </if>
											<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
										</Footnote>
										<SetVar name="source_exist" value="1"/>
									</RepeatTag>
								</if>
							</TextBox>
						</if>
						<!-- Print the female child's name -->
						<if condition="@SEX=='F'">
							<TextBox bgcolor="$femalebox_bgcolor" border="1" left="15" newline="1" width="$width1">
								<Text color="$tcolor" style="text"><var var="i18n::translate('Daughter')"/>  </Text>
								<Text color="$tcolor" style="name"><GetPersonName id="" /> </Text>
								<if condition="$sources==1">
									<RepeatTag tag="SOUR">
										<Footnote>
											<Gedcom id="@SOUR">
												<GedcomValue tag="TITL" />
											</Gedcom>
											<if condition="@PAGE!=''">: </if>
											<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
										</Footnote>
										<SetVar name="source_exist" value="1"/>
									</RepeatTag>
								</if>
							</TextBox>
						</if>
						<!-- Print the unknown gender child's name -->
						<if condition="(@SEX=='U') or (@SEX=='')">
							<TextBox bgcolor="$unknowngenderbox_bgcolor" border="1" left="15" newline="1" width="$width1">
								<Text color="$tcolor" style="text"><var var="i18n::translate('Gender')"/> <var var="i18n::translate_c('unknown gender', 'Unknown')"/>  </Text>
								<Text color="$tcolor" style="name"><GetPersonName id="" /> </Text>
								<if condition="$sources==1">
									<RepeatTag tag="SOUR">
										<Footnote>
											<Gedcom id="@SOUR">
												<GedcomValue tag="TITL" />
											</Gedcom>
											<if condition="@PAGE!=''">: </if>
											<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
										</Footnote>
										<SetVar name="source_exist" value="1"/>
									</RepeatTag>
								</if>
							</TextBox>
						</if>

						<!-- print the birth and christenting when blanks are on -->
						<if condition="$blanks==1">
							<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Birth')" />  </Text>
								<Text color="$tcolor" style="text"><GedcomValue tag="BIRT:DATE" /> </Text>
								<if condition="$sources==1">
									<RepeatTag tag="BIRT:SOUR">
										<Footnote>
											<Gedcom id="@SOUR">
												<GedcomValue tag="TITL" />
											</Gedcom>
											<if condition="@PAGE!=''">: </if>
											<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
										</Footnote>
										<SetVar name="source_exist" value="1"/>
									</RepeatTag>
								</if>
							</TextBox>
							<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
								<if condition="$showplace==1">
									<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
								</if>
								<Text color="$tcolor" style="text"><GedcomValue tag="BIRT:PLAC" /></Text>
							</TextBox>

							<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Christening')" />  </Text>
								<Text color="$tcolor" style="text"><GedcomValue tag="CHR:DATE" /> </Text>
								<if condition="$sources==1">
									<RepeatTag tag="CHR:SOUR">
										<Footnote>
											<Gedcom id="@SOUR">
												<GedcomValue tag="TITL" />
											</Gedcom>
											<if condition="@PAGE!=''">: </if>
											<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
										</Footnote>
										<SetVar name="source_exist" value="1"/>
									</RepeatTag>
								</if>
							</TextBox>
							<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
								<if condition="$showplace==1">
									<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
								</if>
								<Text color="$tcolor" style="text"><GedcomValue tag="CHR:PLAC" /></Text>
							</TextBox>
						</if>

						<!-- print the rest of the facts -->
						<Facts ignore="$ignore">
							<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
								<Text color="$tcolor" style="fact"><var var="@fact" />  </Text>
								<Text color="$tcolor" style="text"><GedcomValue tag="@fact:DATE" /> </Text>
								<if condition="$sources==1">
									<RepeatTag tag="@fact:SOUR">
										<Footnote>
											<Gedcom id="@SOUR">
												<GedcomValue tag="TITL" />
											</Gedcom>
											<if condition="@PAGE!=''">: </if>
											<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
										</Footnote>
										<SetVar name="source_exist" value="1"/>
									</RepeatTag>
								</if>
							</TextBox>
							<if condition="@desc!=''">
								<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
									<if condition="@_PGVS!=''">
										<Text color="$tcolor" style="name"><GetPersonName id="@_PGVS" />  </Text>
									</if>
									<Text color="$tcolor" style="text">
										<GedcomValue tag="@desc" /> <GedcomValue tag="@fact:PLAC" />
									</Text>
								</TextBox>
							</if>
							<if condition="@desc==''">
								<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
									<if condition="@_PGVS!=''">
										<Text color="$tcolor" style="name"><GetPersonName id="@_PGVS" />  </Text>
									</if>
									<if condition="$showplace==1">
										<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
									</if>
									<Text color="$tcolor" style="text">
										<GedcomValue tag="@fact:PLAC" /> <GedcomValue tag="@fact:TEMP" />
									</Text>
								</TextBox>
							</if>
						</Facts>

						<!-- print the death and burial with blanks on -->
						<if condition="$blanks==1">
							<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Death')" />  </Text>
								<Text color="$tcolor" style="text"><GedcomValue tag="DEAT:DATE" /> </Text>
								<if condition="$sources==1">
									<RepeatTag tag="DEAT:SOUR">
										<Footnote>
											<Gedcom id="@SOUR">
												<GedcomValue tag="TITL" />
											</Gedcom>
											<if condition="@PAGE!=''">: </if>
											<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
										</Footnote>
										<SetVar name="source_exist" value="1"/>
									</RepeatTag>
								</if>
							</TextBox>
							<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
								<if condition="$showplace==1">
									<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
								</if>
								<Text color="$tcolor" style="text"><GedcomValue tag="DEAT:PLAC" /></Text>
							</TextBox>

							<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$dwidth">
								<Text color="$tcolor" style="fact"><var var="i18n::translate('Burial')" />  </Text>
								<Text color="$tcolor" style="text"><GedcomValue tag="BURI:DATE" /> </Text>
								<if condition="$sources==1">
									<RepeatTag tag="BURI:SOUR">
										<Footnote>
											<Gedcom id="@SOUR">
												<GedcomValue tag="TITL" />
											</Gedcom>
											<if condition="@PAGE!=''">: </if>
											<GedcomValue tag="SOUR:PAGE"/> <GedcomValue tag="SOUR:DATA:TEXT"/>
										</Footnote>
										<SetVar name="source_exist" value="1"/>
									</RepeatTag>
								</if>
							</TextBox>
							<TextBox bgcolor="$factbox_bgcolor" border="1" width="$width2" newline="1">
								<if condition="$showplace==1">
									<Text color="$tcolor" style="fact"><var var="i18n::translate('Place')" />  </Text>
								</if>
								<Text color="$tcolor" style="text"><GedcomValue tag="BURI:PLAC" /></Text>
							</TextBox>
						</if>

						<!-- set the $spid variable so that we know who this person is and can print the correct spouse later -->
						<SetVar name="spid" value="@ID" />
						<RepeatTag tag="FAMS">
							<!-- get this child's family as spouse -->
							<Gedcom id="@FAMS">
								<if condition="$spid==@HUSB">
									<TextBox bgcolor="$femalebox_bgcolor" border="1" left="15" width="$width1" newline="1">
										<Text color="$tcolor" style="fact"><var var="i18n::translate('Wife')" />  </Text>
										<Text color="$tcolor" style="name"><GetPersonName id="@WIFE" /></Text>
										<Gedcom id="@WIFE">
											<Text color="$tcolor" style="text"> (<varLetter var="BIRT" />: <GedcomValue tag="BIRT:DATE" /> - <varLetter var="DEAT" />: <GedcomValue tag="DEAT:DATE" />)</Text>
										</Gedcom>
									</TextBox>
								</if>
								<if condition="$spid==@WIFE">
									<TextBox bgcolor="$malebox_bgcolor" border="1" left="15" width="$width1" newline="1">
										<Text color="$tcolor" style="fact"><var var="i18n::translate('Husband')" />  </Text>
										<Text color="$tcolor" style="name"><GetPersonName id="@HUSB" /></Text>
										<Gedcom id="@HUSB">
											<Text color="$tcolor" style="text"> (<varLetter var="BIRT" />: <GedcomValue tag="BIRT:DATE" /> - <varLetter var="DEAT" />: <GedcomValue tag="DEAT:DATE" />)</Text>
										</Gedcom>
									</TextBox>
								</if>
							</Gedcom>
						</RepeatTag>
						
						<!-- print any notes for the child -->
						<if condition="$notes==1">
							<RepeatTag tag="NOTE">
								<TextBox bgcolor="$factbox_bgcolor" border="1" left="15" width="$width1" newline="1">
									<Text color="$tcolor" style="name"><var var="i18n::translate('Note')" />  </Text>
									<Text color="$tcolor" style="text"><GedcomValue tag="NOTE" /></Text>
								</TextBox>
							</RepeatTag>
						</if>
					</Gedcom>
					<!-- end of child gedcom -->
					<TextBox height="$sheight" newline="1"/>
				</RepeatTag>
				<!-- end of children repeat -->
			</Gedcom>
			<!-- end of main family gedcom -->

			<!-- if the sources were on, print the source citations as footnotes -->
			<if condition="($sources==1) and ($source_exist==1)">
				<TextBox newline="1" width="$width">
					<Text style="pageheader"><br /><var var="i18n::translate('Sources')" /><br /><br /></Text>
					<FootnoteTexts />
				</TextBox>
			</if>
		</Body>
		<Footer>
			<Cell align="rightrtl" newline="1" style="date"><Now /></Cell>
		</Footer>
	</Doc>
</Report>
