﻿ function CheckUserName(obj,type){
	
	var xmlhttp;
	try{   
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
	   try{
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	   }catch(e){
	   }
	}
	
	if(!xmlhttp && window.XMLHttpRequest){
		xmlhttp=new XMLHttpRequest();
	}
	
	 xmlhttp.onreadystatechange = function() {         
	   if(xmlhttp.readystate==4){
			if(xmlhttp.status == 200){ 
				//alert((xmlhttp.responseText).length);
				document.getElementById("tipsmsg").innerHTML = xmlhttp.responseText;
				/*if("true"==xmlhttp.responseText){
					//alert("恭喜！用户名可用");
					
				}else{
					tips_username.innerHTML="该用户不存在！";							
				}*/
			 }
		}
   }           
  xmlhttp.open("get","servlet/CheckUserName?username="+obj.value + "&type=" + type,true);
  xmlhttp.send(null);
} 