Sub document_onmouseover()
Set tSurElement=window.event.srcElement
If Left(tSurElement.id,10)="MenuL1Item" Then
If tSurElement.tagName="TD" Then
tSurElement.className="cssTable_cL" & Right(tSurElement.className,2)
For Each tLink in tSurElement.all.tags("A")
tLink.className="cssTable_cL" & Right(tLink.className,2)
Next
ElseIf tSurElement.tagName="A" Then
tSurElement.parentElement.className="cssTable_cL" & Right(tSurElement.parentElement.className,2)
tSurElement.className="cssTable_cL" & Right(tSurElement.className,2)
End If
End If
End Sub
Sub document_onmouseout()
Set tSurElement=window.event.srcElement
If Left(tSurElement.id,10)="MenuL1Item" Then
If tSurElement.tagName="TD" Then
tSurElement.className="cssTable_cH" & Right(tSurElement.className,2)
For Each tLink in tSurElement.all.tags("A")
tLink.className="cssTable_cH" & Right(tLink.className,2)
Next
ElseIf tSurElement.tagName="A" Then
tSurElement.parentElement.className="cssTable_cH" & Right(tSurElement.parentElement.className,2)
tSurElement.className="cssTable_cH" & Right(tSurElement.className,2)
End If
End If
End Sub
Sub document_onclick() '激励解释器
tCommand=Chr(13) & Chr(10) & tCommand & "ClickEvent:" & Time & ":" & Timer & Chr(13) & Chr(10)
Set tSurElement=window.event.srcElement
tSurElementName=tSurElement.id
tMenuButton_Click=(pubMenuButton.outerHTML = tSurElement.outerHTML)
tMenuL1_ON=(tMenuButton_Click and Not pubMenuVisibie)
tMenuL1_OFF=(tMenuButton_Click Or Not Left(tSurElementName,4)="Menu") and pubMenuVisibie
If tMenuButton_Click Then
tCommand=tCommand & "MenuButton_Click" & Chr(13) & Chr(10)
End If
If tMenuL1_ON Then
MenuContPosition pubMenuCont,pubMenuButton.offsetTop,pubMenuButton.offsetLeft+pubMenuButton.offsetWidth
MenuTableMake pubMenuCont,pubMenuItems,pubMenuURLs
pubMenuVisibie=-1
tCommand=tCommand & "MenuL1_ON" & Chr(13) & Chr(10)
ElseIf tMenuL1_OFF Then
pubMenuVisibie=0
tCommand=tCommand & "MenuL1_OFF" & Chr(13) & Chr(10)
End If
'idVW2.innerText= tCommand & Chr(13) & Chr(10)
MenuContSetEnabled pubMenuCont,pubMenuVisibie
End Sub
Dim pubObjectDocument_Default
Dim pubObjectDocument_MenuButtom
Dim pubObjectDocument_MenuL1
Dim pubObjectDocument_MenuL2
Dim pubObjectDocument_MenuL3
Set pubObjectDocument_Default=window.document
Set pubObjectDocument_MenuButtom=pubObjectDocument_Default
Set pubObjectDocument_MenuL1=pubObjectDocument_Default
Set pubObjectDocument_MenuL2=pubObjectDocument_Default
Set pubObjectDocument_MenuL3=pubObjectDocument_Default
Function MenuContSetEnabled(pCont,pBool)
'根据一个Bool值开启或隐藏一个菜单容器。
If pBool Then
tVisibility="visible"
Else
tVisibility="hidden"
End If
pCont.style.Visibility=tVisibility
End Function
Function MenuContGetEnabled(pCont,pBool)
'根据一个Bool值开启或隐藏一个菜单容器。
End Function
Function MenuContPosition(pCont,pTop,pLeft)
'定位菜单容器。
pCont.style.top=pTop
pCont.style.left=pLeft
End Function
Function MenuContMake(pDocument)
'创建容器。
Set tOutElement=pDocument.createElement("DIV")
tOutElement.style.visibility="hidden"
tOutElement.style.position="absolute"
tOutElement.style.top="0"
tOutElement.style.left="0"
pDocument.body.insertAdjacentElement "afterBegin",tOutElement
Set MenuContMake=tOutElement
End Function
Function MenuTableMake(pMenuCont,pMenuItems(),pMenuURLs())
tLoopOn=LBound(pMenuItems):tLoopEnd=UBound(pMenuItems)
Set tTBODYElement=pubObjectDocument_Default.createElement("TBODY")
Set tTABLEElement=pubObjectDocument_Default.createElement("TABLE")
tTABLEElement.border="0"
tTABLEElement.cellpadding="0"
tTABLEElement.cellspacing="1"
For tLoop=tLoopOn To tLoopEnd
Set tLinkElement=pubObjectDocument_Default.createElement("A")
tLinkElement.className="cssTable_cH0" & CStr((tLoop Mod 7)+1)
tLinkElement.id="MenuL1Item_A" & tLoop
tLinkElement.Href=pMenuURLs(tLoop)
tLinkElement.innerText=pMenuItems(tLoop)
Set tTDElement=pubObjectDocument_Default.createElement("TD")
tTDElement.className="cssTable_cH0" & CStr((tLoop Mod 7)+1)
tTDElement.id="MenuL1Item_TD" & tLoop
tTDElement.insertAdjacentElement "beforeEnd",tLinkElement
tTDElement.width="100"
tTDElement.align="center"
Set tTRElement=pubObjectDocument_Default.createElement("TR")
tTRElement.id="MenuL1ItemTR_" & tLoop
tTRElement.insertAdjacentElement "beforeEnd",tTDElement
tTBODYElement.insertAdjacentElement "beforeEnd",tTRElement
Next
tTABLEElement.insertAdjacentElement "beforeEnd",tTBODYElement
pMenuCont.innerHTML=tTABLEElement.outerHTML
End Function