      function checkaccount(user_name)
    {
      var re, r;
    
      re = /\S/;
      r = user_name.match(re);
      if (!r)
      {
        alert("请输入用户名！");
        return false;
      }
      else
      {
function is_zw(str)
  {
	exp=/[0-9a-zA-Z_]/g;
	if(str.search(exp) != -1)
	{
		return false;
	}
	return true;
  }
 if (document.reg.user_name.value==""){
 alert("用户名不能为空！请继续注册...");
 document.reg.user_name.focus();
 return false;
 }
  if (document.reg.user_name.value.length<4 || document.reg.user_name.value.length>20){
 alert("用户名必须是4-20位的字符！请继续注册...");
 document.reg.user_name.focus();
 return false;
 }
 if (is_zw(document.reg.user_name.value)){
  alert("用户名不能是中文文字！请继续注册...");
  document.reg.user_name.focus();
  return false;
 }
 
 if(reg.user_name.value=="")
  {
    alert("程序有错!");
    reg.user_name.focus();
    return false;
  }
  saveData();
}

var aa=1212111  
function saveData()
{
  var objDom = new ActiveXObject("MSXML2.DOMDocument");
  objDom.loadXML("<Root/>");

  oGeneral = objDom.createElement("shuju");
  oGeneral.text=reg.user_name.value;
  objDom.documentElement.appendChild(oGeneral);

  var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  xmlhttp.open("post","Checkaccount.asp?action=cuser_name&value="+user_name+"",false);
  xmlhttp.send(objDom);
  if(xmlhttp.responseText=="True"){
  window.location="register2.asp";
  }
  else
  {
 var kekai=unescape(xmlhttp.responseText);
// alert(kekai);
 if (kekai=="yes"){
	 alert("用户名可以注册!");
	 }else{
	alert("用户名已经存在!"); 
	}
    //返回值alert
  }
 
 
     //   window.open("Checkaccount.asp?action=cuser_name&value="+user_name,"","width=1,height=1")
      }
    }
   /*function checkuseremail(user_mail)
    {
      var re, r;
    
      re = /\S/;
      r = user_mail.match(re);
      if (!r)
      {
        alert("请正确输入邮箱地址！");
        return false;
      }
      else
      {
        window.open("Checkaccount.asp?action=cuseremail&value="+user_mail,"","width=300,height=150")
      }
    }
*/
   function is_zw(str)
  {
	exp=/[0-9a-zA-Z_]/g;
	if(str.search(exp) != -1)
	{
		return false;
	}
	return true;
  }

 function check_reg(){
 if (document.reg.user_name.value==""){
 alert("用户名不能为空！请继续注册...");
 document.reg.user_name.focus();
 return false;
 }
  if (document.reg.user_name.value.length<4 || document.reg.user_name.value.length>20){
 alert("用户名必须是4-20位的字符！请继续注册...");
 document.reg.user_name.focus();
 return false;
 }
 if (is_zw(document.reg.user_name.value)){
  alert("用户名不能是中文文字！请继续注册...");
  document.reg.user_name.focus();
  return false;
 }
 if (document.reg.user_pass.value==""){
 alert("密码不能是空值！请继续注册...");
 document.reg.user_pass.focus();
 return false;
 }
 if (document.reg.user_pass.value==document.reg.user_name.value ){
 alert("密码不能与用户名相同！请继续注册...");
 document.reg.user_pass.focus();
 return false;
 } 
 if (document.reg.user_pass.value.length<6 ){
 alert("密码不能低于6位的符号！请继续注册...");
 document.reg.user_pass.focus();
 return false;
 }
 if (document.reg.user_pass1.value==""){
 alert("确认密码不能是空值！请继续注册...");
 document.reg.user_pass1.focus();
 return false;
 }
 if (document.reg.user_pass1.value!=document.reg.user_pass.value){
 alert("确认密码与密码不相同！请继续注册...");
 document.reg.user_pass1.focus();
 return false;
 }
 /*
 if (document.reg.user_mail.value==""){
 alert("用户的邮箱必须输入！请继续注册...");
 document.reg.user_mail.focus();
 return false;
 }
 if(document.reg.user_mail.value.indexOf("@")==-1 || document.reg.user_mail.value.indexOf(".")==-1){ 
 alert("用户的邮箱格式不正确！请继续注册...");
 document.reg.user_mail.focus();
 return false;
	}
	*/
 }
