			function SweetAjax(){
				/**
				 *Author : 罗泽坤(rostar)
				 *Date : 2010年1月5日
				 *------------------------------------
				 *属性
					1.IsXml(Boolean)
						指定是否按XML方式处理返回数据true(Xml),false(Text).默认为true.
					2.Call(Function)
						指定处理返回数据的函数.必须在调用get()或post()方法前设置
				 *方法
					1.get(String url [,String parameter])
						GET方法发送数据(在IE下使用中文参数时出现异常)
					2.post(String url [,String parameter])
						GET方法发送数据,有中文参数时最好使用该方法
				 *------------------------------------
				 *备注: Ajax会以UTF-8形式发送数据到服务器,所以在服务器端应将接收到的
						数据进行相应的转码否则可能会出现异常(特别是中文).例如,在PHP
						下可以采用iconv()函数转码.iconv("utf-8","gbk",$_REQUEST["qkey"]);
						如果出现数据异常,请仔细核对各页面的编码!
				*/
				var bIsXml=true;
				var oCallFunction=null;
				var oXmlHttp=window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
				this.IsXml=true;				
				this.Call=null;
				this.get=get;
				function get(url,data){
					bIsXml=this.IsXml;
					oCallFunction=this.Call;
					if(oCallFunction==null){
						alert("先指定SweetAjax对象的Call属性(值为一个处理函数)");
						return false;
					}
					if(window.ActiveXObject){
						//(IE)附加一个随机URL参数从而每次都能刷新服务器端
						oXmlHttp.open("GET",url+"?"+data+"&"+Math.random(),true);
					}else{
						oXmlHttp.open("GET",url+"?"+data,true);
					}
					oXmlHttp.send(null);					
					oXmlHttp.onreadystatechange=function(){
						if(oXmlHttp.readyState==4 && oXmlHttp.status==200){
							if(bIsXml){
								oCallFunction(oXmlHttp.responseXML);
							}else{
								oCallFunction(oXmlHttp.responseText);
							}
						}         
					}
				}				
				//如果发送参数含有中文,最好用POST方法
				this.post=post;				
				function post(url,data){
					bIsXml=this.IsXml;
					oCallFunction=this.Call;
					if(oCallFunction==null){
						alert("先指定SweetAjax对象的Call属性(值为一个处理函数)");
						return false;
					}
					oXmlHttp.open("POST",url,true);
					oXmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
					oXmlHttp.send(data);					
					oXmlHttp.onreadystatechange=function(){
						if(oXmlHttp.readyState==4 && oXmlHttp.status==200){
							if(bIsXml){
								oCallFunction(oXmlHttp.responseXML);
							}else{
								oCallFunction(oXmlHttp.responseText);
							}
						}         
					}
				} 
			}
			
			
			
			var Ajax=new SweetAjax();
			Ajax.IsXml=false;		
			Ajax.Call=showRegUserTips;
			function showRegUserTips(s){
				var resultarr=s.split("-");
				var reginfo,reginfo2,reginfo3;
				
				
				
				if(resultarr[0]==0){
					if(resultarr[1]=='' || resultarr[1]=='sim'){
						reginfo="该用户名可以使用";						
					}else if(resultarr[1]=='tra'){
						reginfo="該用戶名可以使用";						
					}else if(resultarr[1]=='en'){
						reginfo="This ID can be used";
					}		
				}else if(resultarr[0]==1){
					if(resultarr[1]=='' || resultarr[1]=='sim'){
						reginfo="该用户名已被注册";			
					}else if(resultarr[1]=='tra'){
						reginfo="該用戶名已被註冊";		
					}else if(resultarr[1]=='en'){
						reginfo="This ID has been registered";
					}				
					
				}
				
			   if(resultarr[0]==1 && document.ADDUser.UserId.value.trim()!=""){
					document.getElementById("showreginfo").style.color="red";
					document.getElementById("showreginfo").innerHTML=reginfo;
			   }else{
				   if(resultarr[0]==0 && document.ADDUser.UserId.value.trim()!="" && document.ADDUser.UserId.value.trim().length>=4 && document.ADDUser.UserId.value.trim().length<=16){
					   document.getElementById("showreginfo").style.color="green";
					   document.getElementById("showreginfo").innerHTML=reginfo;
				   }else{
					   if(document.ADDUser.UserId.value.trim()!=""){						   
						   document.getElementById("showreginfo").style.color="red";
						   document.getElementById("showreginfo").innerHTML="非法用户名(Illegal ID)";
					   }
				   }
			   }
			} 
			function checkRegUser(){
			   document.getElementById("showreginfo").innerHTML="";
			   Ajax.get("checkuser.php","UserId="+document.ADDUser.UserId.value.trim());
			} 
