' Write all the footnotes to the report
Sub WriteHtmlAllFootnotes(oSources, mash)
Dim collSources
Set collSources = Util.NewGenoCollection()
If Not Util.IsNothing(OSources) Then collSources.Add(oSources.ToGenoCollection)
If (g_collFootnotes.Count > 0) Or (collSources.Count > 0) Then
If Session("NestSourceRefs") Then
If mash then
Report.WriteLn "<div class='clearleft'><ul class='xT note'>"
Report.WriteFormattedLn " <li class='xT-o xT-h' onclick='xTclk(event,"""")'>Source", Dic.Plurial("SourceCitation", 1)
Report.WriteLn " <ul class='xT-n'>"
Report.WriteLn " <li class='xT-b xT-n'>"
Else
Report.WriteLn "<div class='clearleft'><ul class='xT'>"
Report.WriteFormattedLn " <li class='xT2-{} xT-h' onclick='xTclk(event,""2"")'>", Util.IfElse(g_fCollapseReferences, "c", "o")
Report.WriteFormattedLn "<a name='SourcesCitations'></a><h3 class='xT-i inline'>{&t}</h3><ul class='xT-h'><li>", Dic.Plurial("SourceCitation", 2)
Report.WriteLn "<div class='footnote clearleft'>"
End if
Else
Report.WriteLn "<div class='footnote clearleft'>"
End If
If (g_collFootnotes.Count > 0) Then
Dim iFootnote, oFootnote, strTitle, strSep, s
iFootnote = 0
For Each oFootnote In g_collFootnotes
iFootnote = iFootnote + 1
strTitle = StrPlainText(oFootnote, Util.FirstNonEmpty(oFootnote.Subtitle, oFootnote.Description, oFootnote.QuotedText, Dic("SourceInformation")))
If (strTitle <> "") Then
strTitle = Util.FormatString(" title='{}'", strTitle)
End If
Report.WriteFormattedBr "<sup><a name='{0}'></a>{0} </sup> <a href='source-{&t}.htm' onclick='showPopUpFrame("""");' target='popup' {}><i>{}</i></a>", iFootnote, oFootnote.ID, strTitle, JoinSourceCitationNames(oFootnote, StrFormatText(oFootnote, StrParseText(oFootnote.title, True)), true)
' remove referenced source from list
collSources.Remove(oFootnote)
Next
End If
If collSources.Count > 0 Then ' write details of remaining source/citations
If Not Session("NestSourceRefs") Then Report.WriteBr Dic.Plurial("SourceCitation" & Util.IfElse(g_collFootnotes.Count > 0, "_Other",""), collSources.Count)
strSep = ""
For Each oFootnote in collSources
strTitle = StrPlainText(oFootnote, Util.FirstNonEmpty(oFootnote.Subtitle, oFootnote.Description, oFootnote.QuotedText, Dic("SourceInformation")))
If (strTitle <> "") Then
strTitle = Util.FormatString(" title='{}'", strTitle)
End If
Report.WriteFormatted strSep & " <a href='source-{&t}.htm' onclick='showPopUpFrame("""");' target='popup' {}><i>{}</i></a>", oFootnote.ID, strTitle, JoinSourceCitationNames(oFootnote, StrFormatText(oFootnote, StrParseText(oFootnote.title, True)), true)
strSep = Util.IfElse(Session("NestSourceRefs"), "<br />", ",")
Next
End If
Report.WriteLn "</div>"
If Session("NestSourceRefs") Then
Report.WriteBr "</li/ul></li></ul></div>"
End If
g_collFootnotes.clear
End If
End Sub