'#Reference {A3B5C45B-F842-44fc-A5E5-50CED69BA86E}#2.0#0#C:\Program Files\Mindjet\MindManager 6\Mm5WebExport.dll#Mm5webexport 2.0 Type Library
'#Uses "ParameterNames.mmbas"
'#Uses "GlobalUtilities.mmbas"

Option Explicit

Sub Main

    Dim addin As Mm5WebExportAddIn
    Dim webex As WebExport
    Dim aPage As Mm5WebExportLib.Page

    Set addin = WebExportHelper.WebExportAddIn
    Set webex = addin.ActiveWebExport

    Dim bodyString As String

    On Error GoTo ReportError

    webex.Trace("Entering Footer.mmbas", 2)

    If webex.GetParameter(TsShowFooter) Then
        bodyString = webex.ReadFile("Footer.htm")
        
        ' Insert the export date in the HTML export

		'for turning Last Updated on and off
		If webex.GetParameter(TsShowLastUpdated) Then
            bodyString = Replace(bodyString, "#LastUpdated#", webex.GetParameter(TsUserLastUpdatedText))
	        bodyString = Replace(bodyString, "#TheExportDate#", CStr(Date))
		Else
            bodyString = Replace(bodyString, "#LastUpdated#", "")
            bodyString = Replace(bodyString, "#TheExportDate#", "")
		End If

		'for turning top of page link on and off
		If webex.GetParameter(TsShowTop) Then
            bodyString = Replace(bodyString, "#TopText#", webex.GetParameter(TsLabelTop))
		Else
            bodyString = Replace(bodyString, "#TopText#", "")
		End If

        ' Process all commands and parameters
        ProcessString webex, bodyString

    End If

    ' Write out the result
    webex.PushString( bodyString )

    webex.Trace( "Exiting Footer.mmbas", 2 )

    Exit Sub

ReportError:
    ProcessError(webex)
    Exit Sub

End Sub
