<%
Class Cms_Tpl
    Public s_html
    Private s_path, s_file
    Private i_isCache
    Private s_m, s_ms, s_me, s_ss, s_se, s_es, s_ee

    '构造函数开始

    Public Sub Class_Initialize()
        Easp.Use "fso"
        s_html = ""
        s_path = ""
        i_isCache = 1
        s_m = "[*]"
        getMaskSE s_m
        s_ss = "{"& SysLable &":"
        s_se = "}"
        s_es = "{/"& SysLable &":"
        s_ee = "}"
    End Sub

    '析构函数开始

    Private Sub Class_Terminate()
    End Sub

    '设置标签格式

    Public Property Let TagMask(ByVal m)
        s_m = m
        getMaskSE s_m
    End Property

    '设置模板文件路径

    Public Property Let Path(ByVal m)
        If Right(m, 1)<>"/" Then m = m & "/"
        s_path = m
    End Property

    '设置模板文件名

    Public Property Let File(ByVal m)
        s_file = m
        Call Load(s_file)
    End Property

    '载入模板文件

    Public Sub Load(ByVal f)
		s_html = LoadInc(s_path & f, "")
    End Sub

    '得到标签开始和结束标记

    Private Sub getMaskSE(ByVal m)
        s_ms = Easp.RegEncode(Easp.CLeft(m, "*"))
        s_me = Easp.RegEncode(Easp.CRight(m, "*"))
    End Sub

    '得到HTML源码

    Public Function GetHtmlCoode()
        GetHtmlCoode = GetCharHtml(ReHtmlCode(ExecuteIf(s_html)))
    End Function

    '得到HTML源码

    Public Function GetHtml()
        GetHtml = GetCharHtml(ReSysInfo(ReHtmlCode(ExecuteIf(s_html))))
    End Function

    '设置HTML源码

    Public Property Let SetHtml(ByVal m)
        s_html = m
    End Property

    '输出HTML源码

    Public Sub Show()
        Easp.W GetHtml()
    End Sub

    '创建HTML文件

    Public Property Let SaveAs(ByVal p)
        Create p
    End Property

    '创建HTML文件

    Public Sub Create(ByVal FilePath)
        Easp.Fso.CreateFile FilePath, GetHtml()
    End Sub

    '替换函数标签

    Public Property Let funcTag(tagname, tagvalue)
        s_html = Replace(s_html, tagname, tagvalue & "", 1, -1, 1)
    End Property

    '替换块标签

    Public Property Let blockTag(tagname, tagvalue)
        s_html = Replace(s_html, tagname, tagvalue & "", 1, -1, 1)
    End Property

    '替换html里面的一个记录集的块标签

    Public Function Assign(ByVal html, ByVal s, ByVal v)
        Dim i
        Select Case TypeName(v)
            Case "Recordset"
                If Easp.Has(v) Then
                    For i = 0 To v.Fields.Count - 1
                        blockTagd html, LCase(s & "." & v.Fields(i).Name), v.Fields(i).Value
                    Next
                End If
        End Select
        Assign = html
    End Function

    '替换html里面的一个记录集的块标签

    Public Function AssignTag(ByVal s, ByVal e, ByVal v)
        Dim i
        Select Case TypeName(v)
            Case "Recordset"
                If Easp.Has(v) Then
                    For i = 0 To v.Fields.Count - 1
                        blockTag(s & LCase(v.Fields(i).Name) & e) = v.Fields(i).Value
                    Next
                End If
        End Select
    End Function

    '替换html里面的一个记录集的块标签

    Public Sub dLableFields(ByVal s, ByVal e, ByVal v)
        Dim i
        Select Case TypeName(v)
            Case "Recordset"
                If Easp.Has(v) Then
                    For i = 0 To v.Fields.Count - 1
                        d(s & LCase(v.Fields(i).Name) & e) = v.Fields(i).Value
                    Next
                End If
        End Select
    End Sub

    '替换html里面的一个记录集的块标签

    Public Sub dFields(ByVal v)
        Dim i
        Select Case TypeName(v)
            Case "Recordset"
                If Easp.Has(v) Then

                    For i = 0 To v.Fields.Count - 1
                        d(LCase(v.Fields(i).Name)) = v.Fields(i).Value
                    Next
                End If
        End Select
    End Sub

    Private Function ReSysInfo(ByVal strHtml)
        Dim strHtmlCode, strHead, strBody
        strHtmlCode = strHtml
        strHead = "<head>"& vbCrLf &"<!-- published at "& Easp.DateTime(Now(), "yyyy-mm-dd hh:ii:ss") &" from by system -->"
        strBody = "<!--" & vbCrLf
        strBody = strBody & "为了支持新派工作室的发展,请您保留该注释信息,该注释信息不影响您的网站."& vbCrLf
        strBody = strBody & "本站基于：张家界CMS企业管理系统构造 v" & SysVersion & " Update Time:" & SysDateTime & vbCrLf
        strBody = strBody & "张家界CMS:http://www.zjjcms.com"& vbCrLf
        strBody = strBody & "联系电话:15874423636"& vbCrLf
        strBody = strBody & "联系ＱＱ:41526283"& vbCrLf
        strBody = strBody & "我们对支持新派工作室发展的朋友表示真心的感谢!新派因您更精彩!"& vbCrLf
        strBody = strBody & "-->"& vbCrLf &"</body>"
        strHtmlCode = Replace(strHtmlCode, "<head>", strHead)
        strHtmlCode = Replace(strHtmlCode, "</body>", strBody)
        ReSysInfo = strHtmlCode
    End Function

    Private Function ReHtmlCode(ByVal strHtml)
        Dim Pattern, labels, label, ReturnHtml
        Pattern = "{"& SysLable &":htmlcode([\s\S]*?)}([\s\S]*?){/"& SysLable &":htmlcode}"
        Set labels = Easp.RegMatch(strHtml, Pattern)
        If labels.Count > 0 Then
            For Each label In labels
                Dim ClearHtml, TagArrLen, TagArrLeftLen, TagArrRightLen, TagHtml
                ClearHtml = CmsFun.ChkNumEric(attr(label.SubMatches(0), "clearhtml"))
                TagArrLen = attr(label.SubMatches(0), "len")
                TagArrLeftLen = CmsFun.ChkNumEric(attr(label.SubMatches(0), "l"))
                TagArrRightLen = CmsFun.ChkNumEric(attr(label.SubMatches(0), "r"))
                TagHtml = Trim(label.SubMatches(1) & "")
                If ClearHtml = 1 Then
                    TagHtml = Easp.RegReplace(TagHtml, "<[^>]*>|[\n\t\r|]|(\s+|&nbsp;|　)+", "")
                    TagHtml = Replace(TagHtml, "&lt;" , "<")
                    TagHtml = Replace(TagHtml, "&gt;" , ">")
                    TagHtml = Easp.RegReplace(TagHtml, "<[^>]*>", "")
                End If
                If Not Easp.IsN(TagArrLen) Then
                    TagHtml = Replace(TagHtml & "", vbCrLf, "")
                    TagHtml = Easp.CutStr(TagHtml, TagArrLen)
                End If
                If TagArrLeftLen > 0 Then
                    TagHtml = Replace(TagHtml & "", vbCrLf, "")
                    TagHtml = Left(TagHtml, Len(TagHtml) - TagArrLeftLen)
                End If
                If TagArrRightLen > 0 Then
                    TagHtml = Replace(TagHtml & "", vbCrLf, "")
                    TagHtml = Right(TagHtml, Len(TagHtml) - TagArrRightLen)
                End If
                strHtml = Replace(strHtml, label.Value, TagHtml & "", 1, -1, 1)
            Next
            ReturnHtml = strHtml
        Else
            ReturnHtml = strHtml
        End If
        ReHtmlCode = ReturnHtml
    End Function

    '替换文本标签或函数标签

    Public Property Let d(tagname, tagvalue)
        Dim Pattern, label, labels, Match, Matchs, Name, Val, svalue, spVal
        Pattern = s_ms & "[ ]*" & tagname & "\b[\w\W]*?" & s_me
        Set labels = Easp.RegMatch(s_html, Pattern)
        '遍历标签
        For Each label In labels
            Set Matchs = Easp.RegMatch(label, "((\w+)=(['""])(.+?)\3)|((\w+)=([^\s]+))")
            If Matchs.Count = 0 Then
                s_html = Replace(s_html, label, tagvalue & "")
            Else
                '遍历属性
                For Each Match In Matchs
                    Name = Easp.CLeft(Match, "=")
                    Val = Easp.RegReplace(Match, "\w+=(['""]?)(.+?)\1", "$2")
                    If Easp.IsN(tagvalue) Then
                        s_html = Replace(s_html, label, tagvalue & "", 1, -1, 1)
                    Else
                        Select Case LCase(Name)
                            Case "datetime", "d"
                                If Easp.Has(Val) Then
                                    svalue = Easp.DateTime(tagvalue, Val)
                                    s_html = Replace(s_html, label, svalue & "", 1, -1, 1)
                                End If
                            Case "len"
                                If Easp.Has(Val) Then
                                    svalue = tagvalue
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>|[\n\t\r|]|(\s+|&nbsp;|　)+", "")
                                    svalue = Replace(svalue, "&lt;" , "<")
                                    svalue = Replace(svalue, "&gt;" , ">")
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>", "")
                                    svalue = Easp.CutStr(svalue, Val)
                                    s_html = Replace(s_html, label, svalue & "", 1, -1, 1)
                                End If
                            Case "replace"
                                If Easp.Has(Val) Then
                                    If InStr(Val, "|") > 0 Then
                                        spVal = Split(Val, "|")
                                        If Easp.IsN(spVal(1)) Then
                                            svalue = Replace(tagvalue, ",", Val)
                                        Else
                                            svalue = Replace(tagvalue, spVal(0), spVal(1))
                                        End If
                                    Else
                                        svalue = Replace(tagvalue, ",", Val)
                                    End If
                                    s_html = Replace(s_html, label, svalue & "", 1, -1, 1)
                                End If
                            Case "return"
                                Select Case LCase(Val)
                                Case "urlencode"
                                    svalue = Server.URLEncode(tagvalue)
                                    s_html = Replace(s_html, label, svalue & "", 1, -1, 1)
                                Case "htmlencode"
                                    svalue = Server.HTMLEncode(tagvalue)
                                    s_html = Replace(s_html, label, svalue & "", 1, -1, 1)
                                Case "htmldecode"
                                    svalue = tagvalue
                                    svalue = Replace(svalue, "&" , Chr(38))
                                    svalue = Replace(svalue, """", Chr(34))
                                    svalue = Replace(svalue, "<" , Chr(60))
                                    svalue = Replace(svalue, ">" , Chr(62))
                                    svalue = Replace(svalue, " " , Chr(32))
                                    svalue = Easp.HtmlDecode(svalue)
                                    s_html = Replace(s_html, label, svalue & "", 1, -1, 1)
                                Case "clearhtml", "removehtml"'清除html格式
                                    svalue = tagvalue
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>", "")
                                    svalue = Replace(svalue, "&lt;" , "<")
                                    svalue = Replace(svalue, "&gt;" , ">")
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>", "")
                                    svalue = Easp.HtmlFilter(svalue)
                                    s_html = Replace(s_html, label, svalue & "", 1, -1, 1)
                                Case "clearspace"
                                    svalue = tagvalue
                                    svalue = Easp.RegReplace(svalue, "[\n\t\r|]|(\s+|&nbsp;|　)+", "")
                                    s_html = Replace(s_html, label, svalue & "", 1, -1, 1)
                                Case "clearformat"'清除所有格式
                                    svalue = tagvalue
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>|[\n\t\r|]|(\s+|&nbsp;|　)+", "")
                                    svalue = Replace(svalue, "&lt;" , "<")
                                    svalue = Replace(svalue, "&gt;" , ">")
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>", "")
                                    s_html = Replace(s_html, label, svalue & "", 1, -1, 1)
                            End Select
                            Case Else
                                s_html = Replace(s_html, label, tagvalue & "", 1, -1, 1)
                        End Select
                    End If
                Next
            End If
        Next
    End Property

    '替换块内的文本标签或函数标签

    Public Function blockTagd(html, tagname, tagvalue)
        Dim Pattern, reval, label, labels, Match, Matchs, Name, Val, svalue, spVal
        Pattern = s_ms & "[ ]*" & tagname & "\b[\w\W]*?" & s_me
        Set labels = Easp.RegMatch(html, Pattern)
        '遍历标签
        For Each label In labels
            Set Matchs = Easp.RegMatch(label, "((\w+)=(['""])(.+?)\3)|((\w+)=([^\s]+))")
            If Matchs.Count = 0 Then
                html = Replace(html, label, tagvalue & "")
            Else
                '遍历属性
                For Each Match In Matchs
                    Name = Easp.CLeft(Match, "=")
                    Val = Easp.RegReplace(Match, "\w+=(['""]?)(.+?)\1", "$2")
                    If Easp.IsN(tagvalue) Then
                        html = Replace(html, label, tagvalue & "", 1, -1, 1)
                    Else
                        Select Case LCase(Name)
                            Case "datetime", "d"
                                If Easp.Has(Val) Then
                                    svalue = Easp.DateTime(tagvalue, Val)
                                    html = Replace(html, label, svalue & "", 1, -1, 1)
                                End If
                            Case "len"
                                If Easp.Has(Val) Then
                                    svalue = tagvalue
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>|[\n\t\r|]|(\s+|&nbsp;|　)+", "")
                                    svalue = Replace(svalue, "&lt;" , "<")
                                    svalue = Replace(svalue, "&gt;" , ">")
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>", "")
                                    svalue = Easp.CutStr(svalue, Val)
                                    html = Replace(html, label, svalue & "", 1, -1, 1)
                                End If
                            Case "replace"
                                If Easp.Has(Val) Then
                                    If InStr(Val, "|") > 0 Then
                                        spVal = Split(Val, "|")
                                        If Easp.IsN(spVal(1)) Then
                                            svalue = Replace(tagvalue, ",", Val)
                                        Else
                                            svalue = Replace(tagvalue, spVal(0), spVal(1))
                                        End If
                                    Else
                                        svalue = Replace(tagvalue, ",", Val)
                                    End If
                                    html = Replace(html, label, svalue & "", 1, -1, 1)
                                End If
                            Case "return"
                                Select Case LCase(Val)
                                Case "urlencode"
                                    svalue = Server.URLEncode(tagvalue)
                                    html = Replace(html, label, svalue & "", 1, -1, 1)
                                Case "htmlencode"
                                    svalue = Server.HTMLEncode(tagvalue)
                                    html = Replace(html, label, svalue & "", 1, -1, 1)
                                Case "htmldecode"
                                    svalue = tagvalue
                                    svalue = Replace(svalue, "&" , Chr(38))
                                    svalue = Replace(svalue, """", Chr(34))
                                    svalue = Replace(svalue, "<" , Chr(60))
                                    svalue = Replace(svalue, ">" , Chr(62))
                                    svalue = Replace(svalue, " " , Chr(32))
                                    svalue = Easp.HtmlDecode(svalue)
                                    html = Replace(html, label, svalue & "", 1, -1, 1)
                                Case "clearhtml", "removehtml"'清除html格式
                                    svalue = tagvalue
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>", "")
                                    svalue = Replace(svalue, "&lt;" , "<")
                                    svalue = Replace(svalue, "&gt;" , ">")
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>", "")
                                    svalue = Easp.HtmlFilter(svalue)
                                    html = Replace(html, label, svalue & "", 1, -1, 1)
                                Case "clearspace"
                                    svalue = tagvalue
                                    svalue = Easp.RegReplace(svalue, "[\n\t\r|]|(\s+|&nbsp;|　)+", "")
                                    html = Replace(html, label, svalue & "", 1, -1, 1)
                                Case "clearformat"'清除所有格式
                                    svalue = tagvalue
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>|[\n\t\r|]|(\s+|&nbsp;|　)+", "")
                                    svalue = Replace(svalue, "&lt;" , "<")
                                    svalue = Replace(svalue, "&gt;" , ">")
                                    svalue = Easp.RegReplace(svalue, "<[^>]*>", "")
                                    html = Replace(html, label, svalue & "", 1, -1, 1)
                            End Select
                            Case Else
                                html = Replace(html, label, tagvalue & "", 1, -1, 1)
                        End Select
                    End If
                Next
            End If
        Next
    End Function

    Private Function ExecuteIf(ByVal strHtml)
        Dim Matchs, html
        html = strHtml
        Set Matchs = Easp.RegMatch(html, "\{if:([\s\S]+?)\}")
        If Matchs.Count > 0 Then
            html = Easp.RegReplace(html, "\{if:([\s\S]+?)\}", "<"&"%If $1 Then%"&">")
            html = Easp.RegReplace(html, "\{(?:elseif|ef)\s+([^}]*?)?\}", "<"&"%ElseIf $1 Then%"&">")
            html = Easp.RegReplace(html, "\{(?:else\s+if)\s+([^}]*?)?\}", "<"&"%Else If $1 Then%"&">")
            html = Easp.RegReplace(html, "\{else\s*\}", "<"&"%Else%"&">")
            html = Easp.RegReplace(html, "\{/if\}", "<"&"%End If%"&">")
        End If
        Set Matchs = Easp.RegMatch(html, "\<"&"%([\s\S]*?)%"&"\>")
        If Matchs.Count > 0 Then
            Dim tempHtml, i, aspHtml
            tempHtml = expSplit(html, "\<"&"%([\s\S]*?)%"&"\>")
            aspHtml = "Dim str" & vbCrLf
            aspHtml = aspHtml & "str = """"" & vbCrLf
            For i = 0 To UBound(tempHtml)
                tempHtml(i) = Replace(Replace(tempHtml(i), "<"&"%", "&lt;%"), "%"&">", "%&gt;")
                aspHtml = aspHtml & "str = str & tempHtml("& i &")" & vbCrLf
                If i <= (Matchs.Count - 1) Then
                    aspHtml = aspHtml & Matchs(i).SubMatches(0) & vbCrLf
                End If
            Next
            Execute(aspHtml)
            html = Str
        End If
        Set Matchs = Nothing
        ExecuteIf = html
    End Function

    Private Function expSplit(ByVal a, ByVal b)
        Dim Match, SplitStr, Sp
        SplitStr = a
        Sp = "#zjjcms.com@"
        For Each Match in Easp.RegMatch(a, b)
            SplitStr = Replace(SplitStr , Match.Value , Sp , 1, -1, 0)
        Next
        expSplit = Split( SplitStr, Sp)
    End Function

    '得到函数标签集合

    Public Function getFuncs(tagname)
        Dim Pattern
        Pattern = s_ms & "[ ]*"& tagname &"\b[\w\W]*?" & s_me
        Set getFuncs = Easp.RegMatch(s_html, Pattern)
    End Function

    '得到块标签集合

    Public Function getBlocks(tagname)
        Dim Pattern
        Pattern = "("& s_ss &"[ ]*"& tagname &"\b[\w\W]*?"& s_se &")([\w\W]*?)"& s_es &"[ \n\r]*"& tagname &"[ ]*" & s_ee
        Set getBlocks = Easp.RegMatch(s_html, Pattern)
    End Function

    '得到函数或块标签的属性值

    Public Function attr(tag, attrname)
        Dim Pattern, reval, m
        Pattern = "[ \n\r]+"& attrname &"[ ]*=[ ]*\"&Chr(34)&"([^\f\n\r\t\v\"&Chr(34)&"]*?)\"&Chr(34)
        Set m = Easp.RegMatch(tag, Pattern)
        If m.Count > 0 Then
            reval = m(0).SubMatches(0)
        End If
        attr = reval
    End Function

    '得到函数或块标签的属性值-------------------------

    Public Function GetAttr(ByVal tagname, ByVal attrname)
        Dim Pattern, LableName, tag, tags, m, Matchs, label, Val
        Pattern = "[ \n\r]+([\w\W])[ ]*=[ ]*\"&Chr(34)&"([^\f\n\r\t\v\"&Chr(34)&"]*?)\"&Chr(34)
        Set tags = getFuncs(tagname)
        For Each tag In tags
            Val = GetAttrVal(tag, tagname & "." & attrname)
        Next
        GetAttr = Val
    End Function

    Public Function GetAttrVal(ByVal StrContent, ByVal sTag)
        Dim tagName, tagAttr, m, m1, k, k1
        tagName = Easp.CLeft(sTag, ".")
        tagAttr = Easp.CRight(sTag, ".")
        Set m = Easp.RegMatch(StrContent, "\{([^\s]+)\s+([^\}]+)\}")
        For Each k in m
            If tagName = k.Submatches(0) Then
                Set m1 = Easp.RegMatch(k.Submatches(1), "\b([^=\s]+)\s*=\s*""([^""]*)""")
                For Each k1 in m1
                    If tagAttr = k1.Submatches(0) Then
                        sTag = k1.Submatches(1)
                        Exit For
                    End If
                Next
                Set m1 = Nothing
                Exit For
            End If
        Next
        Set m = Nothing
        GetAttrVal = sTag
    End Function

    '载入模板文件并将无限级include模板载入

    Private Function LoadInc(ByVal f, ByVal p)
        Dim h, pa, rule, inc, Match, incFile, incStr
        pa = Easp.IIf(Left(f, 1) = "/", "", p)
        'h = Easp.Read( pa & f )
        h = Easp.GetInclude( pa & f )
        rule = "\{include\s*(?:\()?['""]\s*(.*?)['""](?:\))?\}"
        If Easp.Test(h, rule) Then
            If Easp.isN(p) Then
                If InStr(f, "/")>0 Then p = Left(f, InstrRev(f, "/"))
            Else
                If InStr(f, "/")>0 Then p = pa & Left(f, InstrRev(f, "/"))
            End If
            Set inc = Easp.regMatch(h, rule)
            For Each Match In inc
                incFile = Match.SubMatches(0)
                incStr = LoadInc(s_path & incFile, p)
                h = Replace(h, Match, incStr)
            Next
            Set inc = Nothing
        End If
        LoadInc = h
    End Function

    Private Function GetCharHtml(ByVal strHtml)
        If Not Easp.IsN(strHtml) Then
            Dim strTemp, MatchLink, EachLink, MatchScript, EachScript, NowTemp, RandTemp
            NowTemp = Easp.DateTime(Now(), "yyyymmddhhiiss")
            RandTemp = LCase(Easp.RandStr(12))
            strTemp = Easp.RegReplace(Easp.RegReplace(Easp.RegReplace(strHtml, "\t", " "), " *\r?\n *", ""), " {2,}", " ")
            Set MatchLink = Easp.RegMatch(strTemp, "<link[^>]*href=""([^"">]+)""[^>]+>")
            If CmsFun.ChkNumEric(MatchLink.Count) > 0 Then
                For Each EachLink in MatchLink
                    If InStr(LCase(EachLink.Submatches(0)), ".css") > 0 Then
                        Dim DateTimeLink, CssMsgTemp
                        CssMsgTemp = Easp.IIf(InStr(EachLink.Submatches(0), "?") > 0, EachLink.Submatches(0) & "&", EachLink.Submatches(0) & "?")
                        DateTimeLink = CssMsgTemp & RandTemp & "="& NowTemp
                        strTemp = Replace(strTemp, EachLink.Submatches(0), DateTimeLink)
                    End If
                Next
            End If
            Set EachLink = Nothing
            Set MatchScript = Easp.RegMatch(strTemp, "(?:<script.*?src\s*=\s*\"")(.*?)(?:\"".*?</script>)")
            If CmsFun.ChkNumEric(MatchScript.Count) > 0 Then
                For Each EachScript in MatchScript
                    If InStr(LCase(EachScript.Submatches(0)), ".js") > 0 Then
                        Dim DateTimeTemp, JsMsgTemp
                        JsMsgTemp = Easp.IIf(InStr(EachScript.Submatches(0), "?") > 0, EachScript.Submatches(0) & "&", EachScript.Submatches(0) & "?")
                        DateTimeTemp = JsMsgTemp & RandTemp & "="& NowTemp
                        strTemp = Replace(strTemp, EachScript.Submatches(0), DateTimeTemp)
                    End If
                Next
            End If
            Set MatchScript = Nothing
            GetCharHtml = strTemp
        Else
            GetCharHtml = ""
        End If
    End Function

End Class
%>