function Ajax() {
var xmlHttp;
var objSelf = this;
this.callBack = function(xmlObject) {return;}//回发函数
this.method = "POST"; //处理方式
this.url = ""; //请求地址
this.async = true; //同步异步
this.content = ""; //传输数据
this.send = function() {
	if (window.XMLHttpRequest) {
		xmlHttp = new XMLHttpRequest();
	}
	else if (window.ActiveXObject) {
		xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
	}
	if (xmlHttp != null) {
		if(this.method=='POST')
		{
			xmlHttp.open(this.method, this.url, this.async);
		}
		else
		{
			xmlHttp.open(this.method, this.url+'?'+this.content, this.async);
		}
		xmlHttp.setRequestHeader("contentType", "text/html;charset=gb2312");
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.onreadystatechange = function() {
			if (xmlHttp.readyState == 4) {

				if (xmlHttp.status == 200) {
					objSelf.callBack(xmlHttp);
				}
				else
				{
					//window.alert(xmlHttp.responseText);
				}
			}
		}
		if (this.method == "POST") xmlHttp.send(this.content);
		else xmlHttp.send(null);

	}
	else {
		alert('Your browser does not support XMLHTTP.');
	}
}
}

String.prototype.Trim = function() 
{ 
	return this.replace(/(^\s*)|(\s*$)/g, ""); 
}

String.prototype.clear=clear;
function clear()
{
	return this.replace(/\'|\"|\*|\s|\&/g,"");
}


//使用示例
//var ajaxObject = new Ajax();
//ajaxObject.method="POST";
//ajaxObject.url="../WebForm1.aspx";
//ajaxObject.url="http://localhost/ERP/M_Main/WebForm1.aspx";
//ajaxObject.content="Corp=1";
//ajaxObject.callBack = function(xmlObject) 
//{
	//window.alert(xmlObject.responseText);
//}
//ajaxObject.send();
