	function showDIV(eve){
		document.getElementById("loginButton").disabled=false;
		var div =  document.getElementById("yu");
		var sLeft = (document.body.offsetWidth-parseInt(div.style.width))/2+"px";
		//var sTop = scroll_top()+160+"px";
		div.style.left = sLeft;
		//div.style.top = sTop;
		div.style.display="block";
		div.style.position="absolute";
		document.getElementById("selStyle").style.display="none";
		$("tips").innerHTML="请输入正确的用户名和密码";
		$("tUname").focus();
	}
	function closeDIV(){
		var div =  document.getElementById('yu');
		var forbd = document.getElementById("forbid");
		div.style.display="none";
		forbd.style.visibility="hidden";
		document.getElementById("selStyle").style.display="";
		$("tUname").value = "";
		$("tUpasd").value = "";
	}
        
	function showForbid(){
		var arrayPageSize   = getPageSize();
		var forbd = document.getElementById("forbid");
		forbd.style.width = arrayPageSize[0]+"px";
		forbd.style.height = arrayPageSize[1]+"px";
		forbd.style.visibility = "visible";
	}
	function scroll_top(){    
	    var scrollPos;    
	    if (typeof window.pageYOffset != 'undefined') {    
	         scrollPos = window.pageYOffset;
	     }    
	    else if (typeof document.compatMode != 'undefined' &&    
	         document.compatMode != 'BackCompat') {    
	         scrollPos = document.documentElement.scrollTop;    
	     }    
	    else if (typeof document.body != 'undefined') {    
	         scrollPos = document.body.scrollTop;    
	     }    
	    return scrollPos;    
	} 
	window.onscroll = function(){
		var div =  document.getElementById("yu");
		div.style.top = scroll_top()+160+"px"; 
	}
	function loginLace(){
		var uname = $("tUname");
		var upwd = $("tUpasd");
		if(Trim(uname.value) == ""){
			$("tips").innerHTML = "<font color='red'>用户名不能为空!</font>";
		    uname.focus();
		    return false;
		}
		if(Trim(upwd.value) == ""){
			$("tips").innerHTML = "<font color='red'>密码不能为空!</font>";
		    upwd.focus();
		    return false;
		}
		document.getElementById("loginButton").disabled="disabled";
		login_server(uname.value,upwd.value);
		return false;
	}
	var req;
	function login_server(uname,upwd){
		var contentPath = document.getElementById("contentPath").value;
		var parameters="uname="+uname+"&upwd="+upwd;
	    if(window.XMLHttpRequest){
			req=new XMLHttpRequest();
	    }else if (window.ActiveXObject){
	       req=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    if(req)	{
	        req.open("post",contentPath+"/loginAction.jsp",true);
	        req.onreadystatechange=callbackLogin;
			req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	        req.send(parameters);
		}
	}
	function callbackLogin(){
	    if(req.readyState==4){
		    if(req.status==200){
		        parseMessageLogin();
		    }else{
		    }
	    }else{
	    }
	}
	function parseMessageLogin(){
	    var stat = req.responseText;
	    document.getElementById("loginButton").disabled=false;
		if(stat == null||Trim(stat)==""){
			return false;
		}else if(parseInt(stat)==-1){
			$("tips").innerHTML = "<font color='red'>用户名或密码为空!</font>";
			return false;
		}else if(parseInt(stat) == -2){
			$("tips").innerHTML = "<font color='red'>用户不存在或密码不正确!</font>";
			$("tUpasd").value="";
			$("tUpasd").focus();
			return false;
		}else if(parseInt(stat) == -3){
			$("tips").innerHTML = "<font color='red'>该用户已经被停用!</font>";
			$("tUname").value="";
			$("tUpasd").value="";
			$("tUname").focus();
			return false;
		}else if(parseInt(stat) == -4){
			$("tips").innerHTML = "<font color='red'>该用户未通过审核!</font>";
			$("tUname").value="";
			$("tUpasd").value="";
			$("tUname").focus();
			return false;
		}else{
			var div = document.getElementById("sublogo");
			while(div.childNodes.length-1>0){
				if(div.childNodes[0].id=="login"){
					var oSpan1 = document.createElement("span");
					oSpan1.style.cssText = "margin-left:10px";
					oSpan1.innerHTML = "<a href='"+Trim(stat).substring(1)+"/member/?action=coordination.jsp'>"+$("tUname").value+"<span style='margin-right:10px;'></span></a>";
					div.replaceChild(oSpan1,div.childNodes[0]);
					var oSpan2 = document.createElement("span");
					oSpan2.style.cssText = "margin-left:10px";
					oSpan2.id = "accountMgr";
					oSpan2.innerHTML = "&nbsp;<img src='"+Trim(stat).substring(1)+"/images/hao.gif' width='12' height='11'>&nbsp;<a href='"+Trim(stat).substring(1)+"/member/'>账户管理<span style='margin-right:10px;'></span></a>";
					div.appendChild(document.createTextNode("|"));
					div.appendChild(oSpan2)
					var oSpan3 = document.createElement("span");
					oSpan3.style.cssText = "margin-left:10px";
					div.appendChild(document.createTextNode("|"));
					oSpan3.innerHTML = "&nbsp;<a href='javascript:logout_server();void(0);'>退出</a>";
					div.appendChild(oSpan3);
					closeDIV();
					return;
				}
				div.removeChild(div.childNodes[0]);
			}
		}
	}
	function key_enter(eve){
		var oEve = eve||event;
		if(oEve.keyCode == 13){
			document.getElementById("loginButton").click();
		}
	}
	function logout_server(){
		var contentPath = document.getElementById("contentPath").value;
		var parameters="";
	    if(window.XMLHttpRequest){
			req=new XMLHttpRequest();
	    }else if (window.ActiveXObject){
	       req=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	    if(req)	{
	        req.open("post",contentPath+"/login_out.jsp",true);
	        req.onreadystatechange=function(){
	        	 if(req.readyState==4){
				    if(req.status==200){
				        parseMessageLogout();
				    }else{
				    }
			    }else{
			    }
	        };
			req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	        req.send(parameters);
		}
	}
	function parseMessageLogout(){
	    var stat = req.responseText;
		var div = document.getElementById("sublogo");
		while(div.childNodes[0].tagName==null){
			div.removeChild(div.childNodes[0]);
		}
		var oSpan1 = document.createElement("span");
		oSpan1.style.cssText = "margin-left:10px";
		oSpan1.id = "login";
		oSpan1.innerHTML = "<a href='javascript:void(0);' onclick='javascript:showDIV(arguments[0]);showForbid();'>登陆<span style='margin-right:10px;'></span></a>";
		div.replaceChild(oSpan1,div.childNodes[0]);
		div.insertBefore(document.createTextNode("|"),div.childNodes[0]);
		var oSpan2 = document.createElement("span");
		oSpan2.style.cssText = "margin-left:10px";
		oSpan2.innerHTML = "<a href='"+stat+"/reg/'>免费注册&nbsp;&nbsp;</a>";
		div.insertBefore(oSpan2,div.childNodes[0]);
		while(div.childNodes.length-1>0){
			if(div.childNodes[div.childNodes.length-1].id == "accountMgr"){
				div.removeChild(div.childNodes[div.childNodes.length-1]);
				div.removeChild(div.childNodes[div.childNodes.length-1]);
				return;
			}
			div.removeChild(div.childNodes[div.childNodes.length-1]);
		}
	}
	//获取页面实际大小
	function getPageSize(){
		var xScroll,yScroll;
		if (window.innerHeight  &&  window.scrollMaxY){
			xScroll = document.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight){
			xScroll = document.body.scrollWidth;
			yScroll = document.body.scrollHeight;
		} else {
			xScroll = document.body.offsetWidth;
			yScroll = document.body.offsetHeight;
		}
		var windowWidth,windowHeight;
		//var pageHeight,pageWidth;
		if (self.innerHeight) {
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (document.documentElement  &&  document.documentElement.clientHeight) {
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) {
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}
		var pageWidth,pageHeight
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else {
			pageHeight = yScroll;
		}
		if(xScroll < windowWidth) {
			pageWidth = windowWidth;
		} else {
			pageWidth = xScroll;
		}
		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
		return arrayPageSize;
	}