'#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 bodyString As String

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

    On Error GoTo ReportError
    
    webex.Trace("Entering PageHd.mmbas", 2 )
    bodyString = ""
    If webex.GetParameter("Strings.Show.Header") = True Then
        If Not webex.ParameterExists("Cached.Header") Then ' not cached yet
            bodyString = webex.ReadFile("PageHd.htm")
            ' Process all commands and parameters
            ProcessString webex, bodyString
            webex.SetParameter("Cached.Header", bodyString) ' save for next time
        Else
            bodyString = webex.GetParameter("Cached.Header") ' else read cached info
        End If
    End If
    ' Write out the result
    webex.PushString(bodyString)

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

    Exit Sub
 
ReportError:
    ProcessError(webex)
    Exit Sub
 
End Sub
