var xmlHttp=null;
			if (window.ActiveXObject){
					xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				}else{
					xmlHttp=new XMLHttpRequest();
				}
		
		function dwzhu(){
			 var username2=document.getElementById("name2").value;
	         var password2=document.getElementById("password2").value;
			 if(xmlHttp.readyState==4)
				{
				if (xmlHttp.status==200){
					var res=xmlHttp.responseText.substring(0,4);
					if (res=="have"){
				        alert("用户名或者密码错误");
				        return false;
					}	
					else{
				        alert("登陆成功");
				        window.location.href="http://www.jianyouwang.com/state/state2.html";
				        return true;
					}
				}
			}
		}
	function denlu(){
			var username2=document.getElementById("name2").value;
	        var password2=document.getElementById("password2").value;
	        if(username2==""){
	        	alert("用户名不能为空");
	        	return false;
	        }
	        else if(password2==""){
	        	alert("密码不能为空");
	            return false;
	        }else{
	        var url="userLogin_userLoginCeShi.action?username="+username2+"&password="+password2;
			xmlHttp.open("post",url,false);
      		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");    
			xmlHttp.onreadystatechange = dwzhu;
			xmlHttp.send(null);
			}
	}
