function InitAjax(){
　  http_request=false;
    //开始初始化XMLHttpRequest对象
    if(window.XMLHttpRequest){//Mozilla浏览器
     http_request=new XMLHttpRequest();
     if(http_request.overrideMimeType){//设置MIME类别
       http_request.overrideMimeType("text/xml");
     }
    }
    else if(window.ActiveXObject){//IE浏览器
     try{
      http_request=new ActiveXObject("Msxml2.XMLHttp");
     }catch(e){
      try{
      http_request=new ActiveXobject("Microsoft.XMLHttp");
      }catch(e){}
     }
    }
    if(!http_request){//异常，创建对象实例失败
     window.alert("创建XMLHttp对象失败！");
     return false;
    }
    return http_request;
}
function CheckName(user){
	  if(typeof(user)=='undefined'){
   return false;
  }
 var url="check_username.php?username="+user;
 var show=document.getElementById("result");
 show.innerHTML = "checking username,please wait...";
 var ajax=InitAjax();
 ajax.open("GET",url,true);
 ajax.onreadystatechange=function(){
   if(ajax.readyState==4 && ajax.status==200){
    show.innerHTML=ajax.responseText;
   }
 }
 ajax.send(null);
}

