
      	var http_request;
           function checkFunCustomerExist()
           {
              var userName=document.creator.loginname.value;
              if (document.creator.loginname.value==""||document.creator.loginname.value.length<5||document.creator.loginname.value.length>8||isSsnString(document.creator.loginname.value)==false) 
              {
					var need_loginname=document.creator.need_loginname.value;
					alert(need_loginname);
					document.creator.loginname.focus();
              }
              else{
					 if (window.XMLHttpRequest)
					 { // if Mozilla, Safari etc
					   http_request=new XMLHttpRequest()
					   if (http_request.overrideMimeType)
						 http_request.overrideMimeType('text/xml');
					  }
					  else if (window.ActiveXObject)
					  { // if IE
						try {
						  http_request=new ActiveXObject("Msxml2.XMLHTTP");
						}
						catch (e){
						  try{
							 http_request=new ActiveXObject("Microsoft.XMLHTTP");
						  }
						  catch (e){}
						}
					  }
	
					 
					 http_request.onreadystatechange=process;
					 http_request.open("GET","../CheckCustomerExist.jsp?userName=w"+userName+"&dbtype=neweasy");
					 http_request.send(null);  
              }     

          }
          
          function process()
          {
             if(http_request.readyState==4)
             {
               var chkResult = http_request.reponseXML; 
               var can = document.creator.check_success.value;
               var cannot = document.creator.check_false.value;   
			   
			   var LoginName="w"+document.creator.loginname.value+",";
               //alert(chkResult);

               if(chkResult==1)
               {    
                	//document.getElementById("chkName").innerHTML="<font color='red'>ϲûʹ!</font>";
                	alert(LoginName+cannot);
               }
               else
               {
                 	//document.getElementById("chkName").innerHTML="<font color='red'>ûѾ!뻻һû!</font>";
                 	alert(LoginName+can);
               }
            
            }
          }
