
''<script language="VBScript" type="text/vbscript"  src="xx.js" ></script>
''<body oncontextmenu=window.event.returnValue=false>


On Error Resume Next
dim zhmu,zimu
dim obj1,obj2 
dim obj3,obj4
dim gd
dim ysh,zys       ''/////延时
''//////////////////////////////////////////
dim mleft
dim mtop
dim mzh
dim mgd
dim dleft
dim dtop
dim mcds

sub lje(obj) 
 On Error Resume Next

dim s,lz ,i
s=obj.id
if left(s,1)="t" then
    for i=1 to  ubound(m,2)
       if m(0,i)=mid(s,2) THEN
	      if m(4,i) <>"" then window.location=m(4,i)
	      zhmu=""
          L2.style.visibility="hidden"
          L2.innerHTML=""
		  exit sub
	   end if
	next
end if 

lz=""
if left(s,2)="mu" or left(s,2)="mz"  then lz=mid(s,3)
if left(s,3)="zcd" then lz=mid(s,4)
if lz="" then exit sub
s=left(lz,len(lz)-2)
lz=right(lz,2)

for i=1 to  ubound(m,2)
   if m(0,i)=zhmu & s & "-" & lz THEN
	  
	  if m(4,i) <>"" then window.location=m(4,i)
	  zhmu=""
      L2.style.visibility="hidden"
      L2.innerHTML=""
	  exit sub
   end if
next



end sub


sub cdd(obj,jin)                    ''//菜单入口
On Error Resume Next
  
  dim i
  dim s
  if left(obj.id,1)="t" then     ''//主菜单
	  s=mid(obj.id,2)
	  i=clng(s)
	  if jin then                  ''//进入 
          obj.src=m(3,i)
	
		  
		  set obj3=obj
		  if ysh<>0 then cleartimeout(ysh)
		  
		  if zhmu=mid(obj.id,2) then exit sub
		  ysh=settimeout("call zcdd1(obj3)",300)
		  
       else
	      if ysh<>0 then cleartimeout(ysh)
          obj.src=m(2,i)
		  ysh=0
       end if
	   
   end if
   
   if left(obj.id,2)="mu" then     ''//子菜单
	  i=len(mid(obj.id,3))
	  if jin then                  ''//进入 
	      dim tch
		  tch=false
          IF obj.style.background = "#0066ff" then tch=true

		  ''//初始化
		  ''//////////////////////////////////////////////调整本级菜单颜色
		  dim o
		  dim a,b,c
          for each o in document.all                   
             if o.id="zm" & trim(cstr(i/2)) then
			    b= o.offsetleft
			    c=o.offsetwidth 
			    a=o.offsettop+obj.offsettop
				
			 end if
			 
			 if left(o.id,2)="mu" then

			     if len(mid(o.id,3))= i then
				    IF o.style.background = "#0066ff" then
					   o.style.background = "#DCDCD8"
					   cdwz o,false
					end if 
				 end if
			 end if    
          next
		  ''///////////////////////
		  obj.style.background = "#0066FF"
		  cdwz obj,true
		  
		  ''///////////////////////////////////////////////调整上级菜单颜色
		  i=len(mid(obj.id,3))
		  s=mid(obj.id,3)
		  while i>2
		    i=i-2
			s=left(s,i)  
			  for each o in document.all                   
				 if left(o.id,2)="mu" then
	
					 if len(mid(o.id,3))= i then
						IF o.style.background = "#0066ff" then
						   o.style.background = "#DCDCD8"
						   cdwz o,false
						end if 
					 end if
				 
					 if mid(o.id,3)=s then
						o.style.background = "#0066FF"
						cdwz o,true
					 end if
				 end if    
			  next
		  wend   ''///////////////////////
		  if zys<>0 then
		     cleartimeout(zys)
		     zys=0
		  end if	 
		   ''///////////////////////////////////////////////延时zys
		   i=len(mid(obj.id,3))
		  if clng(m(0,0)) <= i/2 then exit sub
		  
		  set obj4=obj
		  s="xshzcd " & clng(a) & "," & clng(b) & "," & clng(c)
		  zys=settimeout(s,200)
			  
       ''//else
	       ''//if zys<>0 then cleartimeout(zys)
		   ''//zys=0                                     ''//出去
          
       end if
	   
   end if
   
   

end sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''

sub xshzcd(a,b,c)                            ''//显示后级子菜单	  
''''''''''''''''''''''''''''''''''''''''''''''''////////////////////////////////////
On Error Resume Next
zys=0
dim zs,zs1,i1,i,i2   ''//最大字数
dim wz,s         
dim cd1()                ''//菜单文字项目
dim lj()
Redim cd1(0)
Redim lj(0)
dim zcd1()                ''//子菜单
Redim zcd1(0)
zcd1(0)=false
zs=0

i=len(mid(obj4.id,3))      ''//子菜单

dim o,o1,o2
for each o in document.all                    ''    all  images
 if o.id="zm" & trim(cstr(i/2+1)) then
	 set o1=o
 end if
 if o.id="yy" & trim(cstr(i/2+1)) then
	 set o2=o
 end if
			 
next                                   ''//o1,o2 下级菜单框及阴影



if o1.style.visibility="" then
	if a=o1.offsettop then exit sub                ''// 下级菜单已显示
end if	  
	  
s=mid(obj4.id,3)	  
	  

o1.style.visibility="hidden"
o2.style.visibility="hidden"
o1.filters.alpha.opacity=0
o2.filters.alpha.opacity=0

for i=i/2+2 to clng(m(0,0))
	for each o in document.all                    ''    all  images
	 if o.id="zm" & trim(cstr(i)) then
		 o.style.visibility="hidden"
		 o.filters.alpha.opacity=0
	 end if
	 if o.id="yy" & trim(cstr(i)) then
		 o.style.visibility="hidden"
		 o.filters.alpha.opacity=0
	 end if
				 
	next 

next                                  ''// 清除下级菜单

for i=1 to ubound(m,2)
 if left(m(0,i),3+len(s))=zhmu & s & "-" then
	 
	 i1=clng(right(m(0,i),2))
	 if i1>ubound(cd1) then
		 ReDim Preserve cd1(i1)
		 ReDim Preserve lj(i1)
	     ReDim Preserve zcd1(i1)
	 end if
	 cd1(i1)=m(1,i)                ''//菜单文字项目 
	 if m(4,i)<>"" then lj(i1)=true
	 
	        ''//子菜单
	 for i2=1 to ubound(m,2)
		 if left(m(0,i2),5+len(s))=zhmu & s  & right(m(0,i),2) & "-" then
			zcd1(0)=true
			zcd1(i1)=true
		 end if
	 next         
	 wz = m(1,i)
	 zs1=0
	 for i1=1 to len(wz)
		if mid(wz,i1,1)> "~" then
		   zs1=zs1+2
		else
		   zs1=zs1+1
		end if
	 next
	 if zs1>zs then zs=zs1
 end if
next 

                                ''//产生菜单文字项目cd1( n)、 最大字数 zs 

zs= zs * 8 + 5                              ''//文字宽度
dim zkd
zkd=0 
if zcd1(0) then zkd=18 

i1=ubound(cd1)


if i1 >0 then
  o1.style.visibility=""
  o1.style.height=0
  o1.style.width=zs+8+zkd
  o1.style.top=a
  i=L1.offsetwidth
  
  
  o1.style.left=b+c
  
  o2.style.visibility=""
  o2.style.top=a+3
  o2.style.height=0
  o2.style.width=zs+8+zkd
  o2.style.left=b+c+3
  
  
  a=b+c+zs+zkd+11
  if a >document.body.clientwidth then
	 i=b-(zs+11+zkd)
	 o1.style.left=i
	 o2.style.left=i+3
  end if
	s=mid(obj4.id,3)
			  
	nr=""
	for i=1 to ubound(cd1)
	  wz=trim(cstr(i))
	  if i<10 then wz="0" & wz
	  wz=s & wz
	  nr=nr & "<div id='mu" & wz & "'  style='position:absolute;"
	  if lj(i) then
		 nr=nr & "cursor:hand;"
	  else
		 nr=nr & "cursor:default;"
	  end if
	  nr=nr & "left:1; top:" & trim(cstr(26*(i-1)+i)) & "; width:" & trim(cstr(zs+5+zkd))
	  nr=nr & "px;height:26px; z-index:8;background-color:buttonface;layer-background-color:buttonface;'"
	  nr=nr & " onClick='VBScript:lje me' "
	  nr=nr & "onMouseOver = 'VBScript:cdd me,true ' "
	  nr=nr & "onMouseOut= 'VBScript:cdd me,false ' >"
	  nr=nr & "<div id='mz" & wz & "' style='position:absolute; left:4; top:4; width:" & trim(cstr(zs))
	  nr=nr & "; height:18px;z-index:2;'  onMouseUp='VBScript:lje me' >" & cd1(i) & "</div>"
	  if zcd1(i) then
		 nr=nr & "<div id='zcd" & wz & "' style='position:absolute; left:" & trim(cstr(zs+4))
		 nr=nr &  "px; top:4px; width:18; height:18px; z-index:3' onMouseUp='VBScript:lje me' >◆</div>"
	  end if
	  nr=nr & "</div>"
	  
	next
		  
	  o1.innerHTML=nr
	  
	  gd=27 * i1 +1
	  set obj1=o1
	  set obj2=o2
	  i=settimeout("xshcd ",200)
	end if


end sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''





sub cdwz(obj,jin)         ''//菜单文字
On Error Resume Next
''exit sub
dim s,s1,i,i1
if jin then
	s=obj.innerHTML
	if instr(s,"</FONT>") >0 then exit sub
	i=instr(s,">")
	s1=mid(s,i+1)
	s1=left(s1,len(s1)-6)
	''//msgbox s1
	''//<font color="#FFFFFF">第一层菜单1</font>
	obj.innerHTML= left(s,i) & "<font color='#FFFFFF'>" & s1 & "</FONT></div>"
else
    s=obj.innerHTML
	''//msgbox instr(s,"</FONT>")
	if instr(s,"</FONT>") <=0 then exit sub
	i=instr(s,">")
	i1=instr(i+1,s,">")
	s1=mid(s,i1+1)
	s1=left(s1,len(s1)-13)
	
	obj.innerHTML= left(s,i) & s1 & "</div>"
end if 

end sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''

sub zcdd1(obj)                            ''//初始化子菜单
	 On Error Resume Next
	  
	  zhmu=mid(obj.id,2)
	  ysh=0
	  set obj3=Nothing
	 	  
	  dim i,s,nr

	  L2.innerHTML=""
	  
	  i=L1.offsettop+L1.offsetheight
	  
	  L2.style.top =i
	  L2.style.height =document.body.clientheight - i
	  L2.style.left = document.body.scrollleft                              
      L2.style.width =document.body.clientwidth
	  
	  nr=""
	  for i=1 to clng(m(0,0))
		  nr=nr & "<div id='zm" & trim(cstr(i))
		  nr=nr & "' style='position:absolute; left:-200px; top:29px; width:138px; height:137px; z-index:"
		  nr=nr & trim(cstr(i * 2+1))
		  nr=nr & ";background-color: #666666; layer-background-color: #666666; border: 1px none #000000;"
		  nr=nr & "filter:alpha(opacity=0);visibility: hidden;'"
		  nr=nr & ">  </div>"
	      nr=nr & "<div id='yy" & trim(cstr(i))
		  nr=nr & "' style='position:absolute; left:-200px; top:21px; width:137px; height:119px;"
		  nr=nr & " z-index:" & trim(cstr(i*2)) & "; background-color: #000000; layer-background-color:"
		  nr=nr & " #000000; border: 1px none #000000;filter:alpha(opacity=0);visibility: hidden;'></div>" 
  
	  
	  next 
	  
	  L2.innerHTML=nr
	  L2.style.visibility = ""
	  
	  
	  ''''''''''''''''''''''''''''''''''''''''''''''''////////////////////////////////////
	  
	  dim zs,zs1,i1,i2   ''//最大字数
	  dim wz         
	  dim cd1()                ''//菜单文字项目
	  Redim cd1(0)
	  dim zcd1()                ''//子菜单
	  dim lj() 
	  Redim zcd1(0)
	  Redim lj(0)
	  zcd1(0)=false
	  zs=0
	  for i=1 to ubound(m,2)
	     if left(m(0,i),3)=zhmu & "-" then
		     
			 i1=clng(right(m(0,i),2))
			 
			 if i1>ubound(cd1) then
				 ReDim Preserve cd1(i1)
				 ReDim Preserve lj(i1)
				 ReDim Preserve zcd1(i1)
			 end if
			 
			 cd1(i1)=m(1,i)                ''//菜单文字项目 
			 if m(4,i)<>"" then lj(i1)=true
			 
			        ''//子菜单
			 for i2=1 to ubound(m,2)
			     if left(m(0,i2),5)=zhmu & right(m(0,i),2) & "-" then
				    zcd1(0)=true
					zcd1(i1)=true
				 end if
			 next         
		     wz = m(1,i)
			 zs1=0
			 for i1=1 to len(wz)
			    if mid(wz,i1,1)> "~" then
				   zs1=zs1+2
				else
				   zs1=zs1+1
				end if
			 next
			 if zs1>zs then zs=zs1
		 end if
	  next                                   ''//产生菜单文字项目cd1( n)、 最大字数 zs 

	  zs= zs * 8 + 5                              ''//文字宽度
	  dim zkd
	  zkd=0 
	  if zcd1(0) then zkd=18 
	  
	  i1=ubound(cd1)
	  if i1 >0 then
	      
		  zm1.style.visibility ="" 
		  zm1.style.height=0
		  zm1.style.width=zs+8+zkd
		  zm1.style.top=2
		  
	      i=L1.offsetleft
		  i=i-document.body.scrollleft
		  if clng(zhmu)-1>0 then i=i +(clng(zhmu)-1)*t02.width + (t01.width - t02.width)
		  if i<2 then i=2
		  zm1.style.left=i
		  
		  yy1.style.visibility=""
		  yy1.style.top=5
		  yy1.style.height=0
		  yy1.style.width=zs+8+zkd
		  yy1.style.left=i+3
		  
		  if i+zs+zkd+11 > document.body.clientwidth then
		     i=document.body.clientwidth-(zs+11+zkd)
			 zm1.style.left=i
			 yy1.style.left=i+3
		  end if
		  
		  nr=""
		  for i=1 to ubound(cd1)
		      wz=trim(cstr(i))
			  if i<10 then wz="0" & wz
			  nr=nr & "<div id='mu" & wz & "'  style='position:absolute;"
			  if lj(i) then
			     nr=nr & "cursor:hand;"
			  else
			     nr=nr & "cursor:default;"
			  end if
			  nr=nr & "left:1; top:" & trim(cstr(26*(i-1)+i)) & "; width:" & trim(cstr(zs+5+zkd))
			  nr=nr & "px;height:26px; z-index:8; background-color:buttonface;layer-background-color:buttonface;'"
			  nr=nr & " onClick = 'VBScript:lje me '  onMouseOver = 'VBScript:cdd me,true ' "
			  nr=nr & "onMouseOut= 'VBScript:cdd me,false ' >"
			  nr=nr & "<div id='mz" & wz & "' style='position:absolute; left:4; top:4; width:" & trim(cstr(zs))
			  nr=nr & "; height:18px;z-index:2;'  onMouseUp = 'VBScript:lje me' >" & cd1(i) & "</div>"
			  if zcd1(i) then
			     nr=nr & "<div id='zcd" & wz & "' style='position:absolute; left:" & trim(cstr(zs+4))
				 nr=nr &  "px; top:4px; width:18; height:18px; z-index:3' onMouseUp='VBScript:lje me' >◆</div>"
			  end if
			  nr=nr & "</div>"
			  
			  ''//<div id="Layer2" style="position:absolute; left:188px; top:-26px; width:18; height:18px; z-index:3">◆</div>
		  next
		  
		  zm1.innerHTML=nr
		  
		  gd=27 * i1 +1
		  set obj1=zm1
		  set obj2=yy1
		  i=settimeout("xshcd ",100)
		  
	  end if


end sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sub xshcd()            ''//显示子菜单
On Error Resume Next
dim bu,i,hz
bu=15   ''gd/10

hz=obj1.offsetheight+bu

obj1.style.height=hz
obj2.style.height=hz
obj1.filters.alpha.opacity=clng(obj1.filters.alpha.opacity)+10
obj2.filters.alpha.opacity=clng(obj2.filters.alpha.opacity)+4

if obj1.offsetheight>=gd then
   obj1.style.height=gd
   obj2.style.height=gd
   obj1.filters.alpha.opacity = 100
   obj2.filters.alpha.opacity = 40
   
   exit sub
end if
i=settimeout("xshcd ",15)


end sub
''''''''''''''''''''''''''''''''''''''''''''''''''''





sub Ld() 
On Error Resume Next
dim kd,o
dim i,i1,wz
dim cd1()
ReDim cd1(0)
ReDim lj(0)
for i=1 to ubound(m,2)
 if len(m(0,i))=2 then
   i1=clng(m(0,i))
	 if i1>ubound(cd1) then
		 ReDim Preserve cd1(i1)
		 ReDim Preserve lj(i1)
	 end if
    cd1(i1)=m(2,i)                   ''//图片
    if m(4,i)<>"" then lj(i1)=true
 end if
next



document.write("<div id='L1' style='position:absolute; left:" & cstr(mleft) & "px; top:" & cstr(mtop) & "px;")
document.write(" width:10px;height:10px;filter:alpha(opacity=70); z-index:800'")
document.write(" onMouseOut='L1.filters.alpha.opacity= 70' onMouseOver='L1.filters.alpha.opacity=100 '> " )
mcds = ubound(cd1)
for i=1 to mcds
	wz=trim(cstr(i))
	if i<10 then wz="0" & wz
	document.write("<img src='" & cd1(i))
	document.write("' name='t" & wz & "'  id='t" & wz & "'" )
	if lj(i) then document.write(" style='cursor:hand' ")
	document.write(" onMouseOver = 'VBScript:cdd me,true ' onMouseOut= 'VBScript:cdd me,false '")
	document.write(" onClick='VBScript:lje me'>")
	for each o in document.images                  ''    all  images
		 if o.id="t" & wz  then
			kd=kd + o.width
		 end if
						 
	next         
next


document.write("</div>")
  
document.write("<div id='L2' style='position:absolute; left:92px; top:153px; width:275px; height:42px; ")
document.write("z-index:801; visibility: inherit;'> </div>")

''//msgbox t01.width
  

l1.style.width =  kd
l1.style.height= t01.height
dleft = -10
if mleft < 0 then zhuzh1 
if mgd then gund1
 
end sub


sub gund1
On Error Resume Next
dim xx,i
xx = settimeout("gund1",100)
if document.body.scrolltop = dtop then exit sub
zhmu=""
L2.style.visibility="hidden"
L2.innerHTML=""
dtop = document.body.scrolltop
i=mtop
if i<dtop then i=dtop
l1.style.top = i

end sub

sub zhuzh1()

dim xx
xx = settimeout("zhuzh1",300)
'if document.body.scrollleft = dleft then exit sub
'	zhmu=""
'    L2.style.visibility="hidden"
'    L2.innerHTML=""
	dleft = document.body.scrollleft
	if mzh=1 then
	   l1.style.left=dleft
	elseif mzh=2 then
	   if document.body.clientwidth > L1.offsetwidth then
		  l1.style.left= (document.body.clientwidth-L1.offsetwidth)/2  + document.body.scrollleft
		else
		  l1.style.left=dleft
		end if  
	else
	   if document.body.clientwidth > L1.offsetwidth then
		  l1.style.left= document.body.clientwidth-L1.offsetwidth + document.body.scrollleft
		else
		  l1.style.left=dleft
		end if  
	end if

end sub


sub Document_onclick()
   zhmu=""
   L2.style.visibility="hidden"
   L2.innerHTML=""
   window.event.cancelBubble=true
   
end sub


''///////////////////////////////////////////////////////////////////////
dim m(4,17)
m(0,0)="2"      ''////////菜单级数

m(0,1)="01"
m(2,1)="../images/m1.gif"
m(3,1)="../images/m11.gif"
m(4,1)="http://www.shlifeng.com.cn"

m(0,2)="02"
m(2,2)="../images/m2.gif"
m(3,2)="../images/m21.gif"
m(4,2)="http://www.shlifeng.com.cn/jieshao.htm"

m(0,3)="03"
m(2,3)="../images/m3.gif"
m(3,3)="../images/m31.gif"
m(4,3)="http://www.shlifeng.com.cn/products/index.asp"

m(0,4)="04"
m(2,4)="../images/m4.gif"
m(3,4)="../images/m41.gif"
m(4,4)="http://www.shlifeng.com.cn/order/index.asp"

m(0,5)="05"
m(2,5)="../images/m5.gif"
m(3,5)="../images/m51.gif"
m(4,5)="http://www.shlifeng.com.cn/contact/index.htm"

m(0,6)="06"
m(2,6)="../images/m6.gif"
m(3,6)="../images/m61.gif"
m(4,6)="../cdtx.htm"
m(4,6)="http://www.shlifeng.com.cn/gbook/index.asp"

m(0,7)="07"
m(2,7)="../images/m7.gif"
m(3,7)="../images/m71.gif"
m(4,7)="http://www.shlifeng.com.cn/e-version/intro.asp"



m(0,8)="03-01"
m(1,8)="硬质合金切削刀片"
m(4,8)="http://www.shlifeng.com.cn/products/skdp.asp"

m(0,9)="03-02"
m(1,9)="立方氮化硼、聚金金刚石刀片(PCBN&PCD Inserts)"
m(4,9)="http://www.shlifeng.com.cn/products/gd.asp?id=lf"

m(0,10)="03-03"
m(1,10)="陶瓷切削刀片"
m(4,10)="http://www.shlifeng.com.cn/products/tcdp.asp"

m(0,11)="03-04"
m(1,11)="SM系列硬质合金立铣刀"
'm(4,11)="../cdtx.htm"

m(0,12)="03-05"
m(1,12)="焊接刀片"
'm(4,12)="../cdtx.htm"

m(0,13)="03-06"
m(1,13)="机夹刀片"
'm(4,13)="http://www.shlifeng.com.cn/products/skdp.asp"

m(0,14)="03-07"
m(1,14)="数控刀杆"
m(4,14)="http://www.shlifeng.com.cn/products/skdg.asp"

m(0,15)="03-08"
m(1,15)="焊接车刀"
'm(4,15)="http://www.shlifeng.com.cn/products/skdp.asp"



m(0,16)="06-01"
m(1,16)="签写留言"
m(4,16)="http://www.shlifeng.com.cn/gbook/add.asp"

m(0,17)="06-02"
m(1,17)="查看留言"
m(4,17)="http://www.shlifeng.com.cn/gbook/index.asp"

mleft = -38
mtop=100
mzh=2    ''// 1 2 3  (mleft = -1)
mgd=true


call ld
  

