if(event.srcelement.tagname=="td"){event.srcelement.bgcolor='';event.srcelement.style.bordertop='';
event.srcelement.style.borderbottom=''
}else if(event.srcelement.tagname=="font"||event.srcelement.tagname=="a"){event.srcelement.parentelement.bgcolor='';
event.srcelement.parentelement.style.bordertop='';event.srcelement.parentelement.style.borderbottom=''}
}
function click1(){ //一,二级菜单时click单击事件时使用本函数转到指定网址
if(event.srcelement.tagname=="td")location.href=event.srcelement.all.tags('a')(0).href
}
function over2(){ //基本的html导航栏在mouseover时使用本函数,设定背景,并清除定时关闭
if(event.srcelement.tagname=="td"){event.srcelement.bgcolor='white';if(cleartime!=1)cleartimeout(cleartime)}
}
function out2(){ //基本的html导航栏在mouseout时使用本函数,设定背景,并加上定时关闭菜单的效果
if(event.srcelement.tagname=="td"){event.srcelement.bgcolor='';
cleartime=settimeout('happydiv.style.display="none";happydiv2.style.display="none"',500)}
}
function click2(){ //基本的html导航栏在click单击时转到的网址,目标网址使用自定义的html属性goto做目标
location.href=event.srcelement.goto
}
function document.onclick(){ //页面单击时关闭所有菜单
happydiv.style.display='none';happydiv2.style.display='none'
}
</script>
<table id=happydiv style='position:absolute;z-index:5;display:none;cursor:hand;border-top:0;border-bottom:0'
bgcolor=white cellspacing=0 border=1 rules=none bordercolorlight=black bordercolordark=white
onmouseover="over1();cleartimeout(cleartime)"
onmouseout="out1();temp1='none';cleartime=settimeout('happydiv.style.display=temp1;happydiv2.style.display=temp1',500)"
onclick=click1()>
<tr><td></td></tr>
</table> <!--一级容器菜单显示表格结束-->
<table id=happydiv2 style='position:absolute;z-index:5;display:none;cursor:hand;border-left:0'
bgcolor=white cellspacing=0 border=1 rules=none bordercolorlight=black bordercolordark=white
onmouseover="over1();cleartimeout(cleartime)"
onmouseout="out1();temp1='none';cleartime=settimeout('happydiv.style.display=temp1;happydiv2.style.display=temp1',500)"
onclick=click1()>
<tr><td></td></tr>
</table> <!--二级扩展菜单显示表格结束-->
<!--
整个程序就是这样的,乍看来乱不可言,细看来则条理清晰,非常实用,几乎没有多余代码,由于定义了函数,所以移植性和可塑性很强
其中数据为 - 相当于"windows菜单中的水平线"