dim menu001_ShowHideBool
dim menu001_Alpha
dim menu001_FontColor
dim menu001_oldSelecttid
dim menu001_borderSolid
dim menu001_backgroundColor



sub menu001_ShowMenu1(arrbound)
	dim x,y,e,s

	set e=eval("menu001_a_name_" & arrbound)
	x=e.offsetLeft
	y=e.offsetHeight
	do
		
		if e.nodeName<>"BODY" then
			set e=e.offsetParent
		else
			exit do
		end if
		x=x+e.offsetLeft
		y=y+e.offsetTop
	loop
	menu001_ShowMenuOver arrbound,x,y
end sub

sub menu001_ShowMenu2(arrbound)
	dim x,y,e,s

	set e=eval("menu001_a_name_" & arrbound)
	x=e.offsetLeft+e.offsetWidth+15
	y=e.offsetTop
	do
		
		if e.nodeName<>"BODY" then
			set e=e.offsetParent
		else
			exit do
		end if
		x=x+e.offsetLeft
		y=y+e.offsetTop
	loop
	menu001_ShowMenuOver arrbound,x,y
end sub

sub menu001_ShowMenuOver(arrbound,x,y)
	if urlStr(arrbound,21)=1 then
		menu001_hideAllShowParent arrbound
		exit sub
	end if

	j=0
	
	HTMLstr="<table border=0 cellpadding=0 style=""border-collapse: collapse ; background-color: " & menu001_backgroundColor & """ id=""Menu001_Div_table_" & arrbound & """>"
	HTMLstr=HTMLstr & "<tr><td width=10></td><td height=5></td><td width=5></td>"
	for i = 0 to ubound(urlStr)
		if urlStr(i,2)=urlStr(arrbound,1) then
			HTMLstr=HTMLstr & "<tr><td width=10></td><td height=2></td><td width=5></td>"
			if menu001_nextMnum(urlStr(i,1)) then
				HTMLstr=HTMLstr & "<tr><td width=10></td><td class=""img_an"" id=""menu001_a_name_" & i & """ onmouseover=""menu001_ShowMenu2(" & i & ")"" nowrap onclick=""menu001_clickMenu(" & i & ")""><font color=" & menu001_FontColor & ">" & urlStr(i,0) & "</font></td><td width=5></td><td width=10>"
				HTMLstr=HTMLstr & "<img border=0 src=images/m501.gif>"
				HTMLstr=HTMLstr & "</td></tr>"
			else
				HTMLstr=HTMLstr & "<tr><td width=10></td><td class=""img_an"" id=""menu001_a_name_" & i & """ onmouseover=""menu001_ShowMenu2(" & i & ")"" nowrap onclick=""menu001_clickMenu(" & i & ")""><font color=" & menu001_FontColor & ">" & urlStr(i,0) & "</font></td><td width=5></td><td width=10>"
				HTMLstr=HTMLstr & "</td></tr>"
			end if
			HTMLstr=HTMLstr & "<tr><td width=10></td><td height=2></td><td width=5></td>"
			j=j+1
		end if
	next
	HTMLstr=HTMLstr & "<tr><td width=10></td><td height=5></td><td width=5></td>"
	HTMLstr=HTMLstr & "</table>"

	if j=0 then HTMLstr=""

	dHTMLstr=dHTMLstr & "<div style=""position: absolute; left:0 ; top:0 ;width:200;height:0; z-index: 1; "" id=""Menu001_Div_m_" & arrbound & """>"
	dHTMLstr=dHTMLstr & "	<div style=""position: absolute; z-index: 8; left: 3; top: 6;width:200;background-color: #080808;filter:Alpha(opacity=30);"" id=""Menu001_Div_yy_" & arrbound & """></div>"
	dHTMLstr=dHTMLstr & "	<div style=""border:1px solid " & menu001_borderSolid & ";position: absolute; z-index: 99;left:0; top:0;width:200 "" id=""Menu001_Div_k_" & arrbound & """>" & HTMLstr & "</div>"
	dHTMLstr=dHTMLstr & "</div>"
	
	Menu001_Div1.insertAdjacentHTML "beforeEnd",dHTMLstr
	
	if j>0 then
		set e=eval("Menu001_Div_table_" & arrbound)
		w=e.offsetWidth
		h=e.offsetHeight


		set e=eval("Menu001_Div_m_" & arrbound)
		e.style.width=w
		e.style.height=h
		e.style.left=x-2
		e.style.top=y

		set e=eval("Menu001_Div_k_" & arrbound)
		e.style.width=w
		e.style.height=h

		set e=eval("Menu001_Div_yy_" & arrbound)
		e.style.width=w
		e.style.height=h
	else
		set e=eval("Menu001_Div_m_" & arrbound)
		e.style.width=0
		e.style.height=0

		set e=eval("Menu001_Div_yy_" & arrbound)
		e.style.width=0
		e.style.height=0

		set e=eval("Menu001_Div_k_" & arrbound)
		e.style.width=0
		e.style.height=0
		e.style.display="none"
	end if
	menu001_hideAllShowParent arrbound
	urlStr(arrbound,21)=1
end sub

sub menu001_hideAllShowParent(arrbound)
	for i = 0 to ubound(urlStr)
		if urlStr(i,21)=1 then
			set e=eval("Menu001_Div_m_" & i)
			e.style.display="none"
		end if
	next
	
	parentID=urlStr(arrbound,1)

	for i = 0 to ubound(urlStr)
		if urlStr(i,1)=parentID then
			parentID=urlStr(i,2)
			set e=eval("Menu001_Div_m_" & i)
			e.style.display=""
			i=-1
		end if
	next
end sub

sub menu001_hideAll()
	for i = 0 to ubound(urlStr)
		if urlStr(i,21)=1 then
			set e=eval("Menu001_Div_m_" & i)
			e.style.display="none"
		end if
	next
end sub

function menu001_nextMnum(tid)
	nmj = 0
	for nmi = 0 to ubound(urlStr)
		if int(tid)=int(urlStr(nmi,2)) then
			nmj = nmj + 1
		end if
	next
	menu001_nextMnum=nmj
end function


function menu001_clickMenu(index)
	if menu001_nextMnum(urlStr(index,1))=0 then location.href=urlStr(index,3)
end function



'------------- ÏÔÊ¾Ö÷²Ëµ¥
sub menu001_writeHTML()
	document.open
	document.writeln "<div style=""position: absolute; left:0 ; top:0 ;width:100%;height:0 ; z-index: 1;"" id=""Menu001_Div1""></div>"
	document.writeln "<table border=""0"" cellpadding=""0"" style=""border-collapse: collapse"">"
	document.writeln "	<tr>"
	wt=false
	for i = 0 to ubound(urlStr)
		if urlStr(i,2)=0 then
			if wt then document.writeln "<td width=20 align=center><font color=" & menu001_FontColor & ">|</font></td>"
			document.write "<td id=""menu001_a_name_" & i & """ onmouseover=""menu001_ShowMenu1(" & i & ")"" class=""img_an"" nowrap onclick=""menu001_clickMenu(" & i & ")"">"
			document.write "<font color=" & menu001_FontColor & ">" & urlStr(i,0) & "</font>"
			document.write "</td>"
			wt=true
		end if
	next

	document.writeln "	</tr>"
	document.writeln "</table>"
	document.close
end sub
