var DTAjax=function()
{
	this.xmlHttpObj=null;
	this.postStr="";
	this.getXmlHttpObj=function()
	{
		var obj;
		if(window.XMLHttpRequest){    
		   obj = new XMLHttpRequest();         
		   if(obj.overrideMimeType){    
			   obj.overrideMimeType("text/xml");    
		   }    
		}else if(window.ActiveXObject){    
			try{    
				 obj = new ActiveXObject("Msxml2.XMLHTTP");    
			}catch(e){    
				  try{    
					   obj = new ActiveXObject("Microsoft.XMLHTTP");    
				  }catch(e){}    
			}     
		} 
		return obj; 
	}
	

	this.getStringFromUrl=function(method,url,syn)
	{
		if(url.indexOf("?")>=0)
		{
			url=url+"&"+Math.random(1)
		}
		else
		{
			url=url+"?a="+Math.random(1)
		}
		if(/get/i.test(method))
		{
			this.xmlHttpObj.open("GET", url, syn);
			this.xmlHttpObj.send(null);
		}
		else
		{
			this.xmlHttpObj.open("POST", url, syn);
			this.xmlHttpObj.setRequestHeader("Content-Length",this.postStr.length);  
			this.xmlHttpObj.setRequestHeader("Content-type","application/x-www-form-urlencoded;CharSet=GB2312");   
			this.xmlHttpObj.send(this.postStr);
			
		}
		
		//alert("eee");
		//document.write(this.xmlHttpObj.responseText);
	}
	
	
	this.getReadyStateChangeHandle=function(obj)
	{
		return function()
		{
			//document.write(obj.xmlHttpObj.readyState);
			obj.onReadyStateChange(obj.xmlHttpObj.readyState,obj.xmlHttpObj);
			if(obj.xmlHttpObj.readyState==4)
			{
				//alert(obj.xmlHttpObj.responseText);
				obj.onGet(unescape(obj.xmlHttpObj.responseText));
			}
		}
	}
	
	this.addPostData=function(name,value)
	{
		if(!this.postStr)
		{
			this.postStr=name+"="+escape(value);
		}
		else
		{
			this.postStr+="&"+name+"="+escape(value);
		}
	}
	this.onGet=function(rc){}
	this.onReadyStateChange=function(id,xmlHttpObj){};
	this.xmlHttpObj=this.getXmlHttpObj();
	this.xmlHttpObj.onreadystatechange = this.getReadyStateChangeHandle(this);

}