function XmlHttp() {
	var xmlHttp = false;
	if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
		if(xmlHttp.overrideMimeType) {
			xmlHttp.overrideMimeType('text/xml');
		}
	} else {
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(E) {
				xmlHttp = false;
			}
		}
	}
	if (!xmlHttp){
		alert("构造XmlHttp失败，相关的操作将不能继续！");
	}
	this.xmlHttp = xmlHttp; 
}

/**
* 以异步方式获取服务器端数据
* @parm sUrl 服务器程序url
* @parm oXml 提交的内容
* @parm callback 服务器响应后触发的方法
* @parm sMethod 提交的方法默认为 GET
*/
XmlHttp.prototype.response = function( sUrl, oXml , callback ,method, mimeType) {
	var xmlobj = this.xmlHttp;
	if (!xmlobj){
		return false;
	}
	try{
		if(method!="POST"){
			method = "GET"
		}
		xmlobj.open(method, sUrl, true);
		xmlobj.setRequestHeader("Cache-Control","no-cache");
		xmlobj.setRequestHeader("If-Modified-Since","0");

		//post时设置Header
		if(mimeType){
			xmlobj.setRequestHeader("Content-Type",mimeType);			
		}else{
			xmlobj.setRequestHeader("Content-Type","text/xml");
		}
	 	xmlobj.setRequestHeader("Content-Type","gb2312");

		xmlobj.onreadystatechange =  function() {			
			if (xmlobj.readyState==4){
  			  if (xmlobj.status==200){
							if(callback && callback!=""){
								eval(callback+"");
							}
					}
			}
		}

		//此处相当于重载一个方法
		if (arguments.length >= 2){			
			xmlobj.send(oXml);
		}else{			
			xmlobj.send(null);
		}

	}catch(e){
		alert("发送请求出现异常！请确认您的网络处于连接状态。"+e);
		return false;
	}
}
