//定义js包:数据传输
if(richer == null) var richer = {};
if(richer.dtp == null) richer.dtp = {};
	
//数据请求协议
richer.dtp.createRequest = function(){
	if(window.ActiveXObject)  {
		oXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}else if(window.XMLHttpRequest)  {
		oXmlHttp = new XMLHttpRequest();
	}
	return oXmlHttp;
	//alert(typeof(oXmlHttp));
}

//通过URL获取数据内容
/*
 * 当readyState值为0、 1或2时，responseText包含一个空字符串。
 * 当readyState值为3(正在接收)时，响应中包含客户端还未完成的响应信息。
 * 当 readyState为4(已加载)时，该responseText包含完整的响应信息。
 * 因此，我们一直等到readyState为4才开始将结果返回
 */
richer.dtp.getData = function(url,func){
	var oXmlHttp = richer.dtp.createRequest();
	oXmlHttp.open("GET",url,true);
	oXmlHttp.onreadystatechange = function (){
		if(oXmlHttp.readyState==4){
			try{
				if(oXmlHttp.status == 200){
					func.callback(oXmlHttp.responseText);
					//eval(func+'.callback("'+oXmlHttp.responseText+'")');
				}
			}catch(e){
				//alert(e);
			}
		}
	};
	oXmlHttp.send(null);
}