//下拉菜单相关代码
 var h;
 var w;
 var l;
 var t;
 var topMar = 1;
 var leftMar = 1;
 var space = 1;
 var isvisible;
 var MENU_SHADOW_COLOR='#FFFFFF';//定义下拉菜单阴影色
 var global = window.document
 global.fo_currentMenu = null
 global.fo_shadows = new Array

function HideMenu() 
{
 var mX;
 var mY;
 var vDiv;
 var mDiv;
	if (isvisible == true)
{
		vDiv = document.all("menuDiv");
		mX = window.event.clientX + document.body.scrollLeft;
		mY = window.event.clientY + document.body.scrollTop;
		if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight)){
			vDiv.style.visibility = "hidden";
			isvisible = false;
		}
}
}

function ShowMenu(vMnuCode,tWidth) {
	vSrc = window.event.srcElement;
	//vMnuCode = "<table id='submenu' border=1 cellspacing=1 cellpadding=3 bordercolor=#CCCCCC style='width:"+tWidth+"' class=tableborder1 onmouseout='HideMenu()'><tr height=23><td nowrap align=left class=tablebody1>" + vMnuCode + "</td></tr></table>";
vMnuCode = "<table id='submenu' cellspacing=1 cellpadding=3 style='border:1px solid #28558E;width:"+tWidth+"' class=tableborder1 onmouseout='HideMenu()'><tr height=23><td nowrap align=left class=tablebody1>" + vMnuCode + "</td></tr></table>";


	h = vSrc.offsetHeight;
	w = vSrc.offsetWidth;
	l = vSrc.offsetLeft + leftMar-6;     //调整弹出的下拉矩形框与左端的距离
	t = vSrc.offsetTop + topMar + h + space+3; //调整弹出的下拉矩形框与顶端的距离
	vParent = vSrc.offsetParent;
	while (vParent.tagName.toUpperCase() != "BODY")
	{
		l += vParent.offsetLeft;
		t += vParent.offsetTop;
		vParent = vParent.offsetParent;
	}

	menuDiv.innerHTML = vMnuCode;
	menuDiv.style.top = t;
	menuDiv.style.left = l;
	menuDiv.style.visibility = "visible";
	isvisible = true;
    makeRectangularDropShadow(submenu, MENU_SHADOW_COLOR, 4);
}

function makeRectangularDropShadow(el, color, size)
{
	var i;
	for (i=size; i>0; i--)
	{
		var rect = document.createElement('div');
		var rs = rect.style;
		rs.position = 'absolute';
		rs.left = (el.style.posLeft + i) + 'px';
		rs.top = (el.style.posTop + i) + 'px';
		rs.width = el.offsetWidth + 'px';
		rs.height = el.offsetHeight + 'px';
		rs.zIndex = el.style.zIndex - i;
		rs.backgroundColor = color;
		var opacity = 1 - i / (i + 1);
		rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
		el.insertAdjacentElement('afterEnd', rect);
		global.fo_shadows[global.fo_shadows.length] = rect;
	}
}


function show(vMnuCode,tWidth){

	vMnuCode = "<table id='submenu' cellspacing=1 cellpadding=3 style='border:1px solid #28558E;width:"+tWidth+"' class=tableborder1><tr height=23><td nowrap align=left class=tablebody1>" + vMnuCode + "</td></tr></table>";
	var ifm=document.createElement("<iframe frameborder=0 marginheight=0 marginwidth=0 hspace=0 vspace=0 scrolling=no></iframe>")	
	menuDiv.innerHTML=vMnuCode;
	var ifmstyle = ifm.style;	
	ifmstyle.width = submenu.offsetWidth + 'px';
	ifmstyle.height =submenu.offsetHeight + 'px';
	ifm.name=ifm.uniqueID
	menuDiv.innerHTML=""
	menuDiv.appendChild(ifm)
    
	var style = "<STYLE type=text/css> td{ font-size: 12px; font-family: 宋体} A:link {text-decoration: none; color:0000A0} A:active {text-decoration: none; color:#0000A0} A:visited {text-decoration: none; color:#0000A0} A:hover {text-decoration: none; color: red}</STYLE>"
	window.frames[ifm.name].document.write(style+"<body leftmargin=0 topmargin=0>"+vMnuCode+"</body>")	
	
	vSrc = window.event.srcElement;
	h = vSrc.offsetHeight;	
	w = vSrc.offsetWidth;
	l = vSrc.offsetLeft + leftMar-6;     //调整弹出的下拉矩形框与左端的距离
	t = vSrc.offsetTop + topMar + h + space+3; //调整弹出的下拉矩形框与顶端的距离
	vParent = vSrc.offsetParent;
	while (vParent.tagName.toUpperCase() != "BODY")
	{
		l += vParent.offsetLeft;
		t += vParent.offsetTop;
		vParent = vParent.offsetParent;
	}

	with(document.all.menuDiv.style){
		pixelLeft=l
		pixelTop=t
		visibility=''
	} 
}

function hide(){
	document.all.menuDiv.style.visibility='hidden'
}

