BsTopMenu.js
Upload User: ahxunteng
Upload Date: 2022-05-16
Package Size: 1606k
Code Size: 10k
Development Platform:

VBScript

  1. //菜单
  2. var menuOffX=0 //菜单距连接文字最左端距离
  3. var menuOffY=20 //菜单距连接文字顶端距离
  4. var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
  5. var ns6=document.getElementById&&!document.all
  6. function ShowMenu(e,vmenu,mod){
  7. which=vmenu
  8. menuobj=document.getElementById("popmenu")
  9. menuobj.thestyle=menuobj.style
  10. menuobj.innerHTML=which
  11. menuobj.contentwidth=menuobj.offsetWidth
  12. eventX=e.clientX
  13. eventY=e.clientY
  14. var rightedge=document.body.clientWidth-eventX
  15. var bottomedge=document.body.clientHeight-eventY
  16. if (rightedge<menuobj.contentwidth)
  17. menuobj.thestyle.left=document.body.scrollLeft+eventX-menuobj.contentwidth+menuOffX
  18. else
  19. menuobj.thestyle.left=ie4? ie_x(event.srcElement)+menuOffX : ns6? window.pageXOffset+eventX : eventX
  20. if (bottomedge<menuobj.contentheight&&mod!=0)
  21. menuobj.thestyle.top=document.body.scrollTop+eventY-menuobj.contentheight-event.offsetY+menuOffY-23
  22. else
  23. menuobj.thestyle.top=ie4? ie_y(event.srcElement)+menuOffY : ns6? window.pageYOffset+eventY+10 : eventY
  24. menuobj.thestyle.visibility="visible"
  25. }
  26. function ie_y(e){  
  27. var t=e.offsetTop;  
  28. while(e=e.offsetParent){  
  29. t+=e.offsetTop;
  30. }  
  31. return t;  
  32. }  
  33. function ie_x(e){  
  34. var l=e.offsetLeft;  
  35. while(e=e.offsetParent){  
  36. l+=e.offsetLeft;  
  37. }  
  38. return l;  
  39. }
  40. function highlightmenu(e,state){
  41. if (document.all)
  42. source_el=event.srcElement
  43. while(source_el.id!="popmenu"){
  44. source_el=document.getElementById? source_el.parentNode : source_el.parentElement
  45. if (source_el.className=="menuitems"){
  46. source_el.id=(state=="on")? "mouseoverstyle" : ""
  47. }
  48. }
  49. }
  50. function hidemenu(){if (window.menuobj)menuobj.thestyle.visibility="hidden"}
  51. function dynamichide(e){if ((ie4||ns6)&&!menuobj.contains(e.toElement))hidemenu()}
  52. document.onclick=hidemenu
  53. document.write("<div class=menuskin id=popmenu onmouseover=highlightmenu(event,'on') onmouseout=highlightmenu(event,'off');dynamichide(event)></div>");
  54. //菜单END
  55. //cn
  56. var index ='<div class=menuitems><a href="index.asp">网 站 首 页</a></div>'
  57. index+='<div class=menuitems><a href="../Default.asp">公司形象页</a></div>'
  58. var CoProfile ='<div class=menuitems><a href="CoProfile.asp?Action=Profile">公 司 介 绍</a></div>'
  59. CoProfile+='<div class=menuitems><a href="CoProfile.asp?Action=Ceo">总 裁 致 辞</a></div>'
  60. CoProfile+='<div class=menuitems><a href="CoProfile.asp?Action=Culture">公 司 文 化</a></div>'
  61. CoProfile+='<div class=menuitems><a href="CoProfile.asp?Action=Organize">组 织 机 构</a></div>'
  62. CoProfile+='<div class=menuitems><a href="CoProfile.asp?Action=Principle">精 神 理 念</a></div>'
  63. CoProfile+='<div class=menuitems><a href="CoProfile.asp?Action=Contact">联 系 我 们</a></div>'
  64. var News ='<div class=menuitems><a href="News.asp?Action=Co">公 司 新 闻</a></div>'
  65. News+='<div class=menuitems><a href="News.asp?Action=Ye">业 内 资 讯</a></div>'
  66. News+='<div class=menuitems><a href="News.asp?Action=Pr">产 品 动 态</a></div>'
  67. var Product ='<div class=menuitems><a href="Product.asp">产 品 展 示</a></div>'
  68. Product+='<div class=menuitems><a href="Products.asp">产 品 分 类</a></div>'
  69. Product+='<div class=menuitems><a href="Search.asp">产 品 搜 索</a></div>'
  70. var Honor ='<div class=menuitems><a href="Honor.asp?Action=Honor">公 司 荣 誉</a></div>'
  71. Honor+='<div class=menuitems><a href="Honor.asp?Action=Img">公 司 形 象</a></div>'
  72. var Sale ='<div class=menuitems><a href="Sale.asp?Action=Sale">国 内 市 场</a></div>'
  73. Sale+='<div class=menuitems><a href="Sale.asp?Action=Salea">国 际 市 场</a></div>'
  74. var Job ='<div class=menuitems><a href="Job.asp">人 才 招 聘</a></div>'
  75. Job+='<div class=menuitems><a href="Jobs.asp">人 才 策 略</a></div>'
  76. //var Download='<div class=menuitems><a href="Job.asp">下 载 中 心</a></div>'
  77. var Server ='<div class=menuitems><a href="Faq.asp">问 题 解 答</a></div>'
  78. Server+='<div class=menuitems><a href="Server.asp">会 员 中 心</a></div>'
  79. Server+='<div class=menuitems><a href="Went.asp">信 息 反 馈</a></div>'
  80. Server+='<div class=menuitems><a href="NetBook.asp">留 言 中 心</a></div>'
  81. Server+='<div class=menuitems><a href="E_shop.asp">订 单 查 询</a></div>'
  82. var Skins ='<div class=menuitems><a href="cookies.asp?menu=BsSkins&no=201">风格 201</a></div>'
  83. //En
  84. var En_index ='<div class=menuitems><a href="index.asp">HomePage</a></div>'
  85. En_index+='<div class=menuitems><a href="../Default.asp">Home image</a></div>'
  86. var En_CoProfile ='<div class=menuitems><a href="En_CoProfile.asp?Action=Profile">Co,introduction</a></div>'
  87. En_CoProfile+='<div class=menuitems><a href="En_CoProfile.asp?Action=Ceo">President oration</a></div>'
  88. En_CoProfile+='<div class=menuitems><a href="En_CoProfile.asp?Action=Culture">Co,culture</a></div>'
  89. En_CoProfile+='<div class=menuitems><a href="En_CoProfile.asp?Action=Organize">Organization</a></div>'
  90. En_CoProfile+='<div class=menuitems><a href="En_CoProfile.asp?Action=Principle">Spiritual idea</a></div>'
  91. En_CoProfile+='<div class=menuitems><a href="En_CoProfile.asp?Action=Contact">Contact us</a></div>'
  92. var En_News ='<div class=menuitems><a href="#">Co,news</a></div>'
  93. En_News+='<div class=menuitems><a href="#">Trade info</a></div>'
  94. var En_Product ='<div class=menuitems><a href="En_Product.asp">Product show</a></div>'
  95. En_Product+='<div class=menuitems><a href="En_Products.asp">Product class</a></div>'
  96. En_Product+='<div class=menuitems><a href="En_search.asp">Product Search</a></div>'
  97. var En_Honor ='<div class=menuitems><a href="En_Honor.asp?Action=Honor">Company honor</a></div>'
  98. En_Honor+='<div class=menuitems><a href="En_Honor.asp?Action=Img">Corporate image</a></div>'
  99. var En_Sale ='<div class=menuitems><a href="En_Sale.asp?Action=Sale">China market</a></div>'
  100. En_Sale+='<div class=menuitems><a href="En_Sale.asp?Action=Salea">International market</a></div>'
  101. var En_Job ='<div class=menuitems><a href="En_Job.asp">Job recruitment</a></div>'
  102. En_Job+='<div class=menuitems><a href="En_Jobs.asp">Job tactics</a></div>'
  103. var En_Server ='<div class=menuitems><a href="En_Server.asp">Member centre</a></div>'
  104. En_Server+='<div class=menuitems><a href="En_NetBook.asp">Leave word</a></div>'
  105. En_Server+='<div class=menuitems><a href="En_E_shop.asp">Order inquiry</a></div>'
  106. var En_Skins ='<div class=menuitems><a href="cookies.asp?menu=BsSkins&no=201">style 201</a></div>'
  107. var IMG1="<IMG height=20 src=../Skin/"
  108. var IMG2="/bgmenu_m.gif width=1 align=absMiddle>"
  109. //顶边的中文菜单
  110. function CnTopMenu(JsSkins){
  111. document.write ('<DIV align="center">');
  112. document.write ('<TABLE cellPadding=0 cellSpacing=0 class="TopMenu">');
  113. document.write ('<TR><TD class="TopMenu_Td1"><IMG src="../img/1x1_pix.gif" width=3 height=1></TD></TR>');
  114. document.write ('<TR><TD class="TopMenu_Td2"><IMG src="../img/1x1_pix.gif" width=3 height=1></TD></TR>');
  115. document.write ('<TR>');
  116. document.write ('<TD class="TopMenu_Td3">');
  117. document.write ('<TABLE width="100%" cellSpacing=0 cellPadding=0 border=0>');
  118. document.write ('<TR>'); 
  119. document.write ('<TD width="98%" valign="bottom" align="center"> ');
  120. document.write ('<a class="Top" href="index.asp" onMouseOver='ShowMenu(event,index)'>首 页</a> '+IMG1+JsSkins+IMG2+' ');
  121. document.write ('<a class="Top" href="CoProfile.asp?Action=Profile" onMouseOver='ShowMenu(event,CoProfile)'>公司简介</a> '+IMG1+JsSkins+IMG2+' ');
  122. document.write ('<a class="Top" href="News.asp?Action=Co" onMouseOver='ShowMenu(event,News)'>新闻资讯</a> '+IMG1+JsSkins+IMG2+' ');
  123. document.write ('<a class="Top" href="Product.asp" onMouseOver='ShowMenu(event,Product)'>产品展示</a> '+IMG1+JsSkins+IMG2+' ');
  124. document.write ('<a class="Top" href="Honor.asp?Action=Honor" onMouseOver='ShowMenu(event,Honor)'>公司荣誉</a> '+IMG1+JsSkins+IMG2+' ');
  125. document.write ('<a class="Top" href="Sale.asp?Action=Sale" onMouseOver='ShowMenu(event,Sale)'>营销网络</a> '+IMG1+JsSkins+IMG2+' ');
  126. document.write ('<a class="Top" href="Job.asp" onMouseOver='ShowMenu(event,Job)'>人才招聘</a> '+IMG1+JsSkins+IMG2+' ');
  127. document.write ('<a class="Top" href="Download.asp">下载中心</a> '+IMG1+JsSkins+IMG2+' ');
  128. document.write ('<a class="Top" href="Faq.asp" onMouseOver='ShowMenu(event,Server)'>服务支持</a> '+IMG1+JsSkins+IMG2+' ');
  129. document.write ('<a class="Top" href="cookies.asp?menu=BsSkins&no=1" onMouseOver='ShowMenu(event,Skins)'>风 格</a>');
  130. document.write ('&nbsp;&nbsp;</TD>');
  131. document.write ('</TR>');
  132. document.write ('</TABLE>');
  133. document.write ('</TD>');
  134. document.write ('</TR>');
  135. document.write ('</TABLE>');
  136. document.write ('</DIV>');
  137. }
  138. //顶边的英文菜单
  139. function EnTopMenu(JsSkins){
  140. document.write ('<DIV align="center">');
  141. document.write ('<TABLE cellPadding=0 cellSpacing=0 class="TopMenu">');
  142. document.write ('<TR><TD class="TopMenu_Td1"><IMG src="../img/1x1_pix.gif" width=3 height=1></TD></TR>');
  143. document.write ('<TR><TD class="TopMenu_Td2"><IMG src="../img/1x1_pix.gif" width=3 height=1></TD></TR>');
  144. document.write ('<TR>');
  145. document.write ('<TD class="TopMenu_Td3">');
  146. document.write ('<TABLE width="100%" cellSpacing=0 cellPadding=0 border=0>');
  147. document.write ('<TR>'); 
  148. document.write ('<TD width="98%" valign="bottom" align="center"> ');
  149. document.write ('<a class="Top" href="index.asp" onMouseOver='ShowMenu(event,En_index)'>Home</a> '+IMG1+JsSkins+IMG2+' ');
  150. document.write ('<a class="Top" href="En_CoProfile.asp?Action=Profile" onMouseOver='ShowMenu(event,En_CoProfile)'>Co,Profile</a> '+IMG1+JsSkins+IMG2+' ');
  151. document.write ('<a class="Top" href="En_Product.asp" onMouseOver='ShowMenu(event,En_Product)'>Products</a> '+IMG1+JsSkins+IMG2+' ');
  152. document.write ('<a class="Top" href="En_Honor.asp?Action=Honor" onMouseOver='ShowMenu(event,En_Honor)'>Co,Honor</a> '+IMG1+JsSkins+IMG2+' ');
  153. document.write ('<a class="Top" href="En_Sale.asp?Action=Sale" onMouseOver='ShowMenu(event,En_Sale)'>Market</a> '+IMG1+JsSkins+IMG2+' ');
  154. document.write ('<a class="Top" href="En_Went.asp">Feedback</a> '+IMG1+JsSkins+IMG2+' ');
  155. document.write ('<a class="Top" href="En_Server.asp" onMouseOver='ShowMenu(event,En_Server)'>Services</a> '+IMG1+JsSkins+IMG2+' ');
  156. document.write ('<a class="Top" href="cookies.asp?menu=BsSkins&no=1" onMouseOver='ShowMenu(event,En_Skins)'>Style</a>');
  157. document.write ('&nbsp;&nbsp;</TD>');
  158. document.write ('</TR>');
  159. document.write ('</TABLE>');
  160. document.write ('</TD>');
  161. document.write ('</TR>');
  162. document.write ('</TABLE>');
  163. document.write ('</DIV>');
  164. }