 var h;
 var w;
 var l;
 var t;
 var topMar = 3;
 var leftMar = -10;
 var space = 2;
 var isvisible;
 var MENU_SHADOW_COLOR='#C8E3FF';
 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;
		mY = window.event.clientY+document.documentElement.scrollTop;
		//alert(window.event.clientY);
		//alert(document.body.scrollTop);
		//alert(mX+","+mY);
		if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-15) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight))
		{
			vDiv.style.visibility = "hidden";
			isvisible = false;
		}
	}
}

function Play(id)
{
	document.getElementById(id).style.display = "block";
}
function Hidden(id)
{
	document.getElementById(id).style.display = "none";
}
function ShowMenu(vMnuCode,tWidth) {
	vSrc = window.event.srcElement;
	vMnuCode = "<table id='submenu' cellspacing=0 cellpadding=4 style='width:"+tWidth+"'><tr height=5><td></td></tr>" + vMnuCode + "</table>";

	h = vSrc.offsetHeight-3;
	w = vSrc.offsetWidth;
	l = vSrc.offsetLeft + leftMar+10;
	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+6;
	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=' + (50 * opacity) + ')';
		el.insertAdjacentElement('afterEnd', rect);
		global.fo_shadows[global.fo_shadows.length] = rect;
	}
} 

function OnSelChange(obj)
{
	var str =obj[obj.selectedIndex].value;
	if( str != "0" && str != "" )
	{
		window.open(str,"","");
	}
	
}	
function OnSubmit()	
{
	var form=document.getElementById("form1");
	var user=document.getElementById("username");
	var pwd=document.getElementById("password");
	if(user.value=="")
	{
		alert("请输入用户名！")
		
	}
	else
	{
		if(pwd.value=="")
		{
			alert("请输入密码！");
			
		}
		else
		{
			form.submit();
			user.value = "";
		    pwd.value = "";

		}
	}
}	

function check()
{
	var form=document.getElementById("form1")
	var info=document.getElementById("info")
	if(info.value=="")
	{
		alert("请输入信息！");
	}
	else
	{
		form.submit();
		info.value = "";
		password.value = "";
		
	}
}
 
function scall(){
 //document.getElementById("Javascript.Div2").style.top=(document.documentElement.scrollTop)+"px";
 //document.getElementById("Javascript.Div2").style.left=(document.documentElement.scrollLeft)+"px";
}
window.onscroll=scall;
window.onresize=scall;
window.onload=scall;