document.onmouseover=HideMenu;

//下拉菜单相关代码
 var h;
 var w;
 var l;
 var t;
 var topMar = 1;
 var leftMar = -2;
 var space = 1;
 var isvisible;
 var MENU_SHADOW_COLOR='#999999';//定义下拉菜单阴影色
 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(tWidth,vMnuCode) {
	vSrc = window.event.srcElement;
	//alert(vMnuCode);
	//alert(tWidth);
	if (vMnuCode!="")
	{
		var C_vMnuCode="";
		//typeof(<%=rs_top("BigClassEnglishName")%>)!='undefined'
		 for(i=0;i<vw_Big_small_class.length;i++)
   		 {
     		   if(vw_Big_small_class[i][2].toString()==vMnuCode && vw_Big_small_class[i][2].toString()!="chris_top")
					{
						//selCity.options[count]=new Option(Citys[i][1],Citys[i][0]);
						//alert(vw_Big_small_class[i][3]);
						//alert(vw_Big_small_class[i][4]);
						if (vw_Big_small_class[i][3]==1)
						{
							if (vw_Big_small_class[i][4]=="True")
							C_vMnuCode=C_vMnuCode+"<a style=font-size:9pt;line-height:14pt; href='../model/model_pic.asp?BigClass="+vw_Big_small_class[i][2].toString()+"&smallClassName="+vw_Big_small_class[i][0].toString()+"'>"+vw_Big_small_class[i][1].toString()+"</a><br>";
							else
							C_vMnuCode=C_vMnuCode+"<a style=font-size:9pt;line-height:14pt; href='../model/model.asp?BigClass="+vw_Big_small_class[i][2].toString()+"&smallClassName="+vw_Big_small_class[i][0].toString()+"'>"+vw_Big_small_class[i][1].toString()+"</a><br>";
							//count=count+1;
						}
						else
						{
							if (vw_Big_small_class[i][5]!="")
								C_vMnuCode=C_vMnuCode+"<a style=font-size:9pt;line-height:14pt; href='../include/"+vw_Big_small_class[i][5]+"'>"+vw_Big_small_class[i][1].toString()+"</a><br>";
							else
								C_vMnuCode=C_vMnuCode+"<a style=font-size:9pt;line-height:14pt; href='#'>"+vw_Big_small_class[i][1].toString()+"</a><br>";
						}
					}
				/*else if (vw_Big_small_class[i][2].toString()=="chris_top" && vMnuCode=="chris_top")
				{
						if (vw_Big_small_class[i][1].toString()=="留言板")
					
							C_vMnuCode=C_vMnuCode+"<a style=font-size:9pt;line-height:14pt; href='../User/message.asp'>"+vw_Big_small_class[i][1].toString()+"</a><br>";
						else
						{
							if (vw_ispic[i]=="True")
								C_vMnuCode=C_vMnuCode+"<a style=font-size:9pt;line-height:14pt; href='../model_old/model_pic.asp?BigClass="+vw_Big_small_class[i][0].toString()+"'>"+vw_Big_small_class[i][1].toString()+"</a><br>";
							else
								C_vMnuCode=C_vMnuCode+"<a style=font-size:9pt;line-height:14pt; href='../model_old/model.asp?BigClass="+vw_Big_small_class[i][0].toString()+"'>"+vw_Big_small_class[i][1].toString()+"</a><br>";
						}
					
				}*/
  		 }
		  if (C_vMnuCode!="")
		  {
					//alert(C_vMnuCode); 
					//vMnuCode= '<a style=font-size:9pt;line-height:14pt; href="../include/index.asp?moder=in&boardid=60">操作系统/软件</a><br><a style=font-size:9pt;line-height:14pt; href="../include/index.asp?moder=in&boardid=1">硬件/网络</a><br><a style=font-size:9pt;line-height:14pt; href="../include/index.asp?moder=in&boardid=10">程序人生</a><br><a style=font-size:9pt;line-height:14pt; href="../include/index.asp?moder=in&boardid=11">下载天地</a><br><a style=font-size:9pt;line-height:14pt; href="../include/index.asp?moder=in&boardid=257">BT下载版</a>'
					vMnuCode = "<table id='submenu' cellspacing=1 cellpadding=3 style='width:"+tWidth+"' class=tableborder1 onmouseout='HideMenu()'><tr height=23><td nowrap align=left class=tablebody1>" + C_vMnuCode + "</td></tr></table>";
				
					h = vSrc.offsetHeight;
					w = vSrc.offsetWidth;
					l = vSrc.offsetLeft + leftMar+4;
					t = vSrc.offsetTop + topMar + h + space-2;
					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;
	}
}


document.write('<div id=menuDiv style="Z-INDEX: 2; VISIBILITY: hidden; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; BACKGROUND-COLOR: #9cc5f8"></div>');
document.write('<style>td.TableBody1{background-color: #FFFFFF;}.tableBorder1{width:97%;border: 1px; background-color: #6595D6;}</style>');

