javascript制作的菜单
可以扩展收缩
Code
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>教务信息管理系统</title>
<style type="text/css">
<!--
*{margin:0;padding:0px;border:0;}
body {
font-family: arial, 宋体, serif;
font-size:12px;
background:#92B9E0;
}
#nav {
width:178px;
line-height: 24px;
list-style-type: none;
text-align:left;
/*定义整个ul菜单的行高和背景色*/
}
/*==================一级目录===================*/
#nav a {
width: 178px;
display: block;
padding-left:20px;
/*Width(一定要),否则下面的Li会变形*/
}
#nav li {
background:#92B9E0; /*一级目录的背景色*/
border-bottom:#FFF 1px solid; /*下面的一条白边*/
float:left;
background-image: url(images/导航2.jpg)
/*float:left,本不应该设置,但由于在Firefox不能正常显示 继承Nav的width,限制宽度,li自动向下延伸*/
}
#nav li a:hover{
background:#3399ff; /*一级目录onMouseOver显示的背景色*/
}
#nav a:link {
color:black; text-decoration:none;
}
#nav a:visited {
color:black;text-decoration:none;
}
#nav a:hover {
color:#FFF;text-decoration:none;font-weight:bold;
}
/*==================二级目录===================*/
#nav li ul {
list-style:none;
text-align:left;
}
#nav li ul li{
background: #DDEEF9; /*二级目录的背景色*/
}
#nav li ul a{
padding-left:20px;
width:178px;
/* padding-left二级目录中文字向右移动,但Width必须重新设置=(总宽度-padding-left)*/
}
/*下面是二级目录的链接样式*/
#nav li ul a:link {
color:#666; text-decoration:none;
}
#nav li ul a:visited {
color:#666;text-decoration:none;
}
#nav li ul a:hover {
color:#F3F3F3;
text-decoration:none;
font-weight:normal;
background:#006699;
/* 二级onmouseover的字体颜色、背景色*/
}
/*==================三级目录===================*/
ul.third{
padding-left:0px;
width:178px;
background:#000000!important;
color:#FF0000; text-decoration:none;
}
/*==============================*/
#nav li:hover ul {
left: auto;
}
#nav li.sfhover ul {
left: auto;
}
#content {
clear: left;
}
#nav ul.collapsed {
display: none;
}
-->
#PARENT{
width:178px;
}
.STYLE1 {color: #326EE9}
</style>
</head>
<body>
<div id="PARENT" style="width: 178px; height: 1248px">
<ul id="nav" >
<li><a href="#Menu=ChildMenu2" onclick="DoMenu('ChildMenu2')">教学资源管理</a>
<ul id="ChildMenu2" class="collapsed">
<li><a href="teachsource/PressionalInfo.aspx" target="mainFrame">学院</a></li>
<li><a href="teachsource/PressionalInfo.aspx" target="mainFrame">专业</a></li>
<li><a href="" target="mainFrame">专业方向</a></li>
<li><a href="city/cityStore.do" target="mainFrame">班级</a></li>
<li><a href="city/cityStore.do" target="mainFrame">教室</a></li>
<li><a href="city/cityStore.do" target="mainFrame">课程</a></li>
<li><a href="city/cityStore.do" target="mainFrame">教师</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu2" onclick="DoMenu('ChildMenu2')">教师管理</a>
<ul id="Ul1" class="collapsed">
<li><a href="city/cityStore.do" target="mainFrame">教师维护</a></li>
<li><a href="ProfessionalInfo.aspx" target="mainFrame">统计查询</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu3" onclick="DoMenu('ChildMenu3')">学生成绩管理</a>
<ul id="ChildMenu3" class="collapsed">
<li><a href="GradeManage/GradeInput.htm" target="mainFrame">录入</a></li>
<li><a href="GradeManage/GradeModify.htm" target="mainFrame">修改</a></li>
<li><a href="GradeManage/GradeDelete.htm" target="mainFrame">删除</a></li>
<li><a href="GradeManage/GradeQuery.htm" target="mainFrame">查询与打印</a></li>
<li><a href="GradeManage/GradeStat.htm" target="mainFrame">统计与分析</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu4" onclick="DoMenu('ChildMenu4')">学生学籍管理</a>
<ul id="ChildMenu4" class="collapsed">
<li><a href="permitstation/permit.do" target="mainFrame">基本信息</a></li>
</ul>
</li>
<li class="STYLE1"><a href="#Menu=ChildMenu1" onclick="DoMenu('ChildMenu1')" )>教学计划管理</a>
<ul id="ChildMenu1" class="collapsed">
<li><a href="TeachPlan/TeachPlanInfo.aspx" target="mainFrame">教学计划维护</a></li>
<li><a href="TeachPlan/TeachPlanSwitch.aspx" target="mainFrame">教学计划按学期转换</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu6" onclick="DoMenu('ChildMenu6')">网上报名管理</a>
<ul id="ChildMenu6" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu7" onclick="DoMenu('ChildMenu7')">教学任务管理</a>
<ul id="ChildMenu7" class="collapsed">
<li><a href="TeachTask/TeachTaskInfo.aspx" target="mainFrame">教学任务维护</a></li>
<li><a href="TeachTask/TeachTaskSwitch.aspx" target="mainFrame">教学任务按学期转换</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu8" onclick="DoMenu('ChildMenu8')">课程编排管理</a>
<ul id="ChildMenu8" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">列出信息</a></li>
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu9" onclick="DoMenu('ChildMenu9')">学生选课管理</a>
<ul id="ChildMenu9" class="collapsed">
<li><a href="OptionalCourse/OpenAndCloseSetup.aspx" target="mainFrame">选课开始和结束设置</a></li>
<li><a href="OptionalCourse/RegisterOptional.aspx" target="mainFrame">选修课程登记</a></li>
<li><a href="OptionalCourse/OptionalTeacherReport.aspx" target="mainFrame">选修课程申报</a></li>
<li><a href="OptionalCourse/OptionalInstituteAudit.aspx" target="mainFrame">选修课程院系审核</a></li>
<li><a href="OptionalCourse/OptionalCourseInfo.aspx" target="mainFrame">选修课程信息维护</a></li>
<li><a href="OptionalCourse/OptionalStudentInfo.aspx" target="mainFrame">选课学生名单管理</a></li>
<li><a href="OptionalCourse/OptionalResultDispose.aspx" target="mainFrame">选课结果处理</a></li>
<li><a href="OptionalCourse/OptionalCourseTableQuery.aspx" target="mainFrame">选课课表查询</a></li>
<li><a href="OptionalCourse/OptionalCourceStat.aspx" target="mainFrame">选修课程统计</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu11" onclick="DoMenu('ChildMenu11')">考试管理</a>
<ul id="ChildMenu11" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">列出信息</a></li>
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu11" onclick="DoMenu('ChildMenu11')">教学考评管理</a>
<ul id="ChildMenu11" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">列出信息</a></li>
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu11" onclick="DoMenu('ChildMenu11')">教材管理</a>
<ul id="ChildMenu11" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">列出信息</a></li>
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu10" onclick="DoMenu('ChildMenu10')">门户管理</a>
<ul id="ChildMenu10" class="collapsed">
<li><a href="Portal/BulletinInfo.aspx" target="mainFrame">公告管理</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu12" onclick="DoMenu('ChildMenu12')">系统管理</a>
<ul id="ChildMenu12" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">列出信息</a></li>
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu5" onclick="DoMenu('ChildMenu5')">成绩管理子系统</a>
<ul id="ChildMenu5" class="collapsed">
<li><a href="hello.jsp" onClick="changeSubStyle(this);event.cancelBubble=true;" target="mainFrame">功能1</a>
<ul class="third">
<li><a href="hello.jsp" target="mainFrame">功能11</a></li>
<li><a href="hello.jsp" target="mainFrame">功能12</a></li>
<li><a href="hello.jsp" target="mainFrame">功能13</a></li>
<li><a href="hello.jsp" target="mainFrame">功能14</a></li>
</ul>
</li>
<li><a href="hello.jsp" onClick="changeSubStyle(this);event.cancelBubble=true;" target="mainFrame">功能2</a>
<ul class="third" style="display:none;">
<li><a href="hello.jsp" target="mainFrame">功能21</a></li>
<li><a href="hello.jsp" target="mainFrame">功能22</a></li>
<li><a href="hello.jsp" target="mainFrame">功能23</a></li>
<li><a href="hello.jsp" target="mainFrame">功能24</a></li>
</ul>
</li>
<li><a href="hello.jsp" onClick="changeSubStyle(this);event.cancelBubble=true;" target="mainFrame">功能3</a></li>
</ul>
</li>
</ul>
</div>
</body>
</html>
<script type=text/javascript><!--
var lastThirdElemnet;
function changeSubStyle(obj)
{
var objSubChild = obj.parentNode.getElementsByTagName("ul")[0];
var isDisplay = objSubChild.style.display=="none";
objSubChild.style.display = isDisplay?"block":"none";
if(lastThirdElemnet!=null)
{
lastThirdElemnet.style.display = "none";
lastThirdElemnet = null;
}
if(isDisplay)
{
lastThirdElemnet = objSubChild;
}
}
var LastLeftID = "";
function menuFix() {
var obj = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<obj.length; i++) {
obj[i].onmouseover=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
obj[i].onMouseDown=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
obj[i].onMouseUp=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
obj[i].onmouseout=function() {
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
}
}
}
function DoMenu(emid)
{
var obj = document.getElementById(emid);
obj.className = (obj.className.toLowerCase() == "expanded"?"collapsed":"expanded");
if((LastLeftID!="")&&(emid!=LastLeftID)) //关闭上一个Menu
{
document.getElementById(LastLeftID).className = "collapsed";
}
LastLeftID = emid;
}
function GetMenuID()
{
var MenuID="";
var _paramStr = new String(window.location.href);
var _sharpPos = _paramStr.indexOf("#");
if (_sharpPos >= 0 && _sharpPos < _paramStr.length - 1)
{
_paramStr = _paramStr.substring(_sharpPos + 1, _paramStr.length);
}
else
{
_paramStr = "";
}
if (_paramStr.length > 0)
{
var _paramArr = _paramStr.split("&");
if (_paramArr.length>0)
{
var _paramKeyVal = _paramArr[0].split("=");
if (_paramKeyVal.length>0)
{
MenuID = _paramKeyVal[1];
}
}
/*
if (_paramArr.length>0)
{
var _arr = new Array(_paramArr.length);
}
//取所有#后面的,菜单只需用到Menu
//for (var i = 0; i < _paramArr.length; i++)
{
var _paramKeyVal = _paramArr[i].split('=');
if (_paramKeyVal.length>0)
{
_arr[_paramKeyVal[0]] = _paramKeyVal[1];
}
}
*/
}
if(MenuID!="")
{
DoMenu(MenuID)
}
}
GetMenuID(); //*这两个function的顺序要注意一下,不然在Firefox里GetMenuID()不起效果
menuFix();
--></script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>教务信息管理系统</title>
<style type="text/css">
<!--
*{margin:0;padding:0px;border:0;}
body {
font-family: arial, 宋体, serif;
font-size:12px;
background:#92B9E0;
}
#nav {
width:178px;
line-height: 24px;
list-style-type: none;
text-align:left;
/*定义整个ul菜单的行高和背景色*/
}
/*==================一级目录===================*/
#nav a {
width: 178px;
display: block;
padding-left:20px;
/*Width(一定要),否则下面的Li会变形*/
}
#nav li {
background:#92B9E0; /*一级目录的背景色*/
border-bottom:#FFF 1px solid; /*下面的一条白边*/
float:left;
background-image: url(images/导航2.jpg)
/*float:left,本不应该设置,但由于在Firefox不能正常显示 继承Nav的width,限制宽度,li自动向下延伸*/
}
#nav li a:hover{
background:#3399ff; /*一级目录onMouseOver显示的背景色*/
}
#nav a:link {
color:black; text-decoration:none;
}
#nav a:visited {
color:black;text-decoration:none;
}
#nav a:hover {
color:#FFF;text-decoration:none;font-weight:bold;
}
/*==================二级目录===================*/
#nav li ul {
list-style:none;
text-align:left;
}
#nav li ul li{
background: #DDEEF9; /*二级目录的背景色*/
}
#nav li ul a{
padding-left:20px;
width:178px;
/* padding-left二级目录中文字向右移动,但Width必须重新设置=(总宽度-padding-left)*/
}
/*下面是二级目录的链接样式*/
#nav li ul a:link {
color:#666; text-decoration:none;
}
#nav li ul a:visited {
color:#666;text-decoration:none;
}
#nav li ul a:hover {
color:#F3F3F3;
text-decoration:none;
font-weight:normal;
background:#006699;
/* 二级onmouseover的字体颜色、背景色*/
}
/*==================三级目录===================*/
ul.third{
padding-left:0px;
width:178px;
background:#000000!important;
color:#FF0000; text-decoration:none;
}
/*==============================*/
#nav li:hover ul {
left: auto;
}
#nav li.sfhover ul {
left: auto;
}
#content {
clear: left;
}
#nav ul.collapsed {
display: none;
}
-->
#PARENT{
width:178px;
}
.STYLE1 {color: #326EE9}
</style>
</head>
<body>
<div id="PARENT" style="width: 178px; height: 1248px">
<ul id="nav" >
<li><a href="#Menu=ChildMenu2" onclick="DoMenu('ChildMenu2')">教学资源管理</a>
<ul id="ChildMenu2" class="collapsed">
<li><a href="teachsource/PressionalInfo.aspx" target="mainFrame">学院</a></li>
<li><a href="teachsource/PressionalInfo.aspx" target="mainFrame">专业</a></li>
<li><a href="" target="mainFrame">专业方向</a></li>
<li><a href="city/cityStore.do" target="mainFrame">班级</a></li>
<li><a href="city/cityStore.do" target="mainFrame">教室</a></li>
<li><a href="city/cityStore.do" target="mainFrame">课程</a></li>
<li><a href="city/cityStore.do" target="mainFrame">教师</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu2" onclick="DoMenu('ChildMenu2')">教师管理</a>
<ul id="Ul1" class="collapsed">
<li><a href="city/cityStore.do" target="mainFrame">教师维护</a></li>
<li><a href="ProfessionalInfo.aspx" target="mainFrame">统计查询</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu3" onclick="DoMenu('ChildMenu3')">学生成绩管理</a>
<ul id="ChildMenu3" class="collapsed">
<li><a href="GradeManage/GradeInput.htm" target="mainFrame">录入</a></li>
<li><a href="GradeManage/GradeModify.htm" target="mainFrame">修改</a></li>
<li><a href="GradeManage/GradeDelete.htm" target="mainFrame">删除</a></li>
<li><a href="GradeManage/GradeQuery.htm" target="mainFrame">查询与打印</a></li>
<li><a href="GradeManage/GradeStat.htm" target="mainFrame">统计与分析</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu4" onclick="DoMenu('ChildMenu4')">学生学籍管理</a>
<ul id="ChildMenu4" class="collapsed">
<li><a href="permitstation/permit.do" target="mainFrame">基本信息</a></li>
</ul>
</li>
<li class="STYLE1"><a href="#Menu=ChildMenu1" onclick="DoMenu('ChildMenu1')" )>教学计划管理</a>
<ul id="ChildMenu1" class="collapsed">
<li><a href="TeachPlan/TeachPlanInfo.aspx" target="mainFrame">教学计划维护</a></li>
<li><a href="TeachPlan/TeachPlanSwitch.aspx" target="mainFrame">教学计划按学期转换</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu6" onclick="DoMenu('ChildMenu6')">网上报名管理</a>
<ul id="ChildMenu6" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu7" onclick="DoMenu('ChildMenu7')">教学任务管理</a>
<ul id="ChildMenu7" class="collapsed">
<li><a href="TeachTask/TeachTaskInfo.aspx" target="mainFrame">教学任务维护</a></li>
<li><a href="TeachTask/TeachTaskSwitch.aspx" target="mainFrame">教学任务按学期转换</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu8" onclick="DoMenu('ChildMenu8')">课程编排管理</a>
<ul id="ChildMenu8" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">列出信息</a></li>
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu9" onclick="DoMenu('ChildMenu9')">学生选课管理</a>
<ul id="ChildMenu9" class="collapsed">
<li><a href="OptionalCourse/OpenAndCloseSetup.aspx" target="mainFrame">选课开始和结束设置</a></li>
<li><a href="OptionalCourse/RegisterOptional.aspx" target="mainFrame">选修课程登记</a></li>
<li><a href="OptionalCourse/OptionalTeacherReport.aspx" target="mainFrame">选修课程申报</a></li>
<li><a href="OptionalCourse/OptionalInstituteAudit.aspx" target="mainFrame">选修课程院系审核</a></li>
<li><a href="OptionalCourse/OptionalCourseInfo.aspx" target="mainFrame">选修课程信息维护</a></li>
<li><a href="OptionalCourse/OptionalStudentInfo.aspx" target="mainFrame">选课学生名单管理</a></li>
<li><a href="OptionalCourse/OptionalResultDispose.aspx" target="mainFrame">选课结果处理</a></li>
<li><a href="OptionalCourse/OptionalCourseTableQuery.aspx" target="mainFrame">选课课表查询</a></li>
<li><a href="OptionalCourse/OptionalCourceStat.aspx" target="mainFrame">选修课程统计</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu11" onclick="DoMenu('ChildMenu11')">考试管理</a>
<ul id="ChildMenu11" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">列出信息</a></li>
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu11" onclick="DoMenu('ChildMenu11')">教学考评管理</a>
<ul id="ChildMenu11" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">列出信息</a></li>
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu11" onclick="DoMenu('ChildMenu11')">教材管理</a>
<ul id="ChildMenu11" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">列出信息</a></li>
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu10" onclick="DoMenu('ChildMenu10')">门户管理</a>
<ul id="ChildMenu10" class="collapsed">
<li><a href="Portal/BulletinInfo.aspx" target="mainFrame">公告管理</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu12" onclick="DoMenu('ChildMenu12')">系统管理</a>
<ul id="ChildMenu12" class="collapsed">
<li><a href="hello.jsp" target="mainFrame">列出信息</a></li>
<li><a href="hello.jsp" target="mainFrame">修改信息</a></li>
<li><a href="hello.jsp" target="mainFrame">查询信息</a></li>
</ul>
</li>
<li><a href="#Menu=ChildMenu5" onclick="DoMenu('ChildMenu5')">成绩管理子系统</a>
<ul id="ChildMenu5" class="collapsed">
<li><a href="hello.jsp" onClick="changeSubStyle(this);event.cancelBubble=true;" target="mainFrame">功能1</a>
<ul class="third">
<li><a href="hello.jsp" target="mainFrame">功能11</a></li>
<li><a href="hello.jsp" target="mainFrame">功能12</a></li>
<li><a href="hello.jsp" target="mainFrame">功能13</a></li>
<li><a href="hello.jsp" target="mainFrame">功能14</a></li>
</ul>
</li>
<li><a href="hello.jsp" onClick="changeSubStyle(this);event.cancelBubble=true;" target="mainFrame">功能2</a>
<ul class="third" style="display:none;">
<li><a href="hello.jsp" target="mainFrame">功能21</a></li>
<li><a href="hello.jsp" target="mainFrame">功能22</a></li>
<li><a href="hello.jsp" target="mainFrame">功能23</a></li>
<li><a href="hello.jsp" target="mainFrame">功能24</a></li>
</ul>
</li>
<li><a href="hello.jsp" onClick="changeSubStyle(this);event.cancelBubble=true;" target="mainFrame">功能3</a></li>
</ul>
</li>
</ul>
</div>
</body>
</html>
<script type=text/javascript><!--
var lastThirdElemnet;
function changeSubStyle(obj)
{
var objSubChild = obj.parentNode.getElementsByTagName("ul")[0];
var isDisplay = objSubChild.style.display=="none";
objSubChild.style.display = isDisplay?"block":"none";
if(lastThirdElemnet!=null)
{
lastThirdElemnet.style.display = "none";
lastThirdElemnet = null;
}
if(isDisplay)
{
lastThirdElemnet = objSubChild;
}
}
var LastLeftID = "";
function menuFix() {
var obj = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<obj.length; i++) {
obj[i].onmouseover=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
obj[i].onMouseDown=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
obj[i].onMouseUp=function() {
this.className+=(this.className.length>0? " ": "") + "sfhover";
}
obj[i].onmouseout=function() {
this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"), "");
}
}
}
function DoMenu(emid)
{
var obj = document.getElementById(emid);
obj.className = (obj.className.toLowerCase() == "expanded"?"collapsed":"expanded");
if((LastLeftID!="")&&(emid!=LastLeftID)) //关闭上一个Menu
{
document.getElementById(LastLeftID).className = "collapsed";
}
LastLeftID = emid;
}
function GetMenuID()
{
var MenuID="";
var _paramStr = new String(window.location.href);
var _sharpPos = _paramStr.indexOf("#");
if (_sharpPos >= 0 && _sharpPos < _paramStr.length - 1)
{
_paramStr = _paramStr.substring(_sharpPos + 1, _paramStr.length);
}
else
{
_paramStr = "";
}
if (_paramStr.length > 0)
{
var _paramArr = _paramStr.split("&");
if (_paramArr.length>0)
{
var _paramKeyVal = _paramArr[0].split("=");
if (_paramKeyVal.length>0)
{
MenuID = _paramKeyVal[1];
}
}
/*
if (_paramArr.length>0)
{
var _arr = new Array(_paramArr.length);
}
//取所有#后面的,菜单只需用到Menu
//for (var i = 0; i < _paramArr.length; i++)
{
var _paramKeyVal = _paramArr[i].split('=');
if (_paramKeyVal.length>0)
{
_arr[_paramKeyVal[0]] = _paramKeyVal[1];
}
}
*/
}
if(MenuID!="")
{
DoMenu(MenuID)
}
}
GetMenuID(); //*这两个function的顺序要注意一下,不然在Firefox里GetMenuID()不起效果
menuFix();
--></script>