<script>
//登录系统校验
function login(){
	var user_ID = document.getElementById("user_ID").value;
	var user_Password=document.getElementById("password").value;
	var verifycode=document.getElementById("verifycode").value;
	if(user_ID.length<1){
		alert("请填写帐号");
	}
	else if(user_Password.length<1){
		alert("请输入密码");
	}
	else if(verifycode.length<1){
		alert("请输入验证码");
	}
	else {
		validate();
	}
}
function showstyle(){
	document.all("mask").style.display="block";
	document.all("loginwin").style.display="block";
}
function nonestyle(){
	document.all("mask").style.display="none";
	document.all("loginwin").style.display="none";
}
//联系我们
function contactwe(){
	eventwin = open ('','','width=300,height=150');
	with (eventwin.document) { 
	writeln("如有站内技术问题，请QQ联系我们！<br>&nbsp;&nbsp;&nbsp;QQ:00000000");
  }
} 
//帮助
function help(){
  eventwin = open ('','','width=300,height=150');
  with(eventwin.document) { 
  writeln("如有站内技术问题，请QQ留言联系我们<br>&nbsp;&nbsp;&nbsp;QQ:00000000");
  }
} 
//注销用户
function logout(){
	document.all("login").style.display="block";
	document.all("memer").style.display="none";
}
//换验证码
function loadimage(){  
	document.getElementById("codeImg").src  =  "share/Code.jsp?"+Math.random();  
}  
var xmlHttp;
function createXMLHttpRequest() {
  if (window.ActiveXObject) {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } 
  else if (window.XMLHttpRequest) {
      xmlHttp = new XMLHttpRequest();                
  }
}
function validate() {
  createXMLHttpRequest();
  var user_ID = document.getElementById("user_ID").value;
  var user_Password=document.getElementById("password").value;
  var verifycode=document.getElementById("verifycode").value;
  //alert(user_ID);
  var url = "RegisterServlet?flag=login&verifycode=" + verifycode+"&user_ID="+user_ID+"&user_Password="+user_Password;
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = callback;
  xmlHttp.send(null);
}
function callback() {
  if (xmlHttp.readyState == 4) {
    if (xmlHttp.status == 200) {
      var s=xmlHttp.responseText;
      hh(s);
    }
  }
}
function hh(s){   	 
 var message="";
 if(s=="ok"){
 	document.all("mask").style.display="none";
  document.all("loginwin").style.display="none";			  
 alert("欢迎您登录！希望能为您服务！");
 document.location="index.jsp";
 }else if(s=="no"){
 	alert("帐号、密码有误！");
 }else if(s=="chk"){
 	alert("验证码不正确！");
 }    	
}
</script>