
function Ajax(url, callback, params) {
	var req = init();
	var mode = "xml";
	var async = true;
	function init() {
		if (window.XMLHttpRequest) {
			return new XMLHttpRequest();
		} else {
			if (typeof ActiveXObject != "undefined") {
				return new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
	}
	function processRequest() {
		if (req.readyState == 4) {
			if (req.status == 200) {
				if (callback) {
					if ("html" === mode) {
						callback(req.responseText);
					} else {
						callback(req.responseXML);
					}
				}
			}
		}
	}
	this.setMode = function setMode(m) {
		mode = m;
	};
	this.setAsync = function setAsync(a) {
		async = a;
	};
	this.doPost = function () {
		req.open("POST", url, async);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		req.onreadystatechange = processRequest;
		req.send(params);
	};
	this.doGet = function () {
		req.open("GET", url, async);
		req.onreadystatechange = processRequest;
		req.send(null);
	};
}
function Ajax(url, callback, params, jsparams) {
	var req = init();
	var mode = "xml";
	var async = true;
	function init() {
		if (window.XMLHttpRequest) {
			return new XMLHttpRequest();
		} else {
			if (typeof ActiveXObject != "undefined") {
				return new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
	}
	function processRequest() {
		if (req.readyState == 4) {
			if (req.status == 200) {
				if (callback) {
					if ("html" === mode) {
						callback(req.responseText, jsparams);
					} else {
						callback(req.responseXML, jsparams);
					}
				}
			}
		}
	}
	this.setMode = function setMode(m) {
		mode = m;
	};
	this.setAsync = function setAsync(a) {
		async = a;
	};
	this.doPost = function () {
		req.open("POST", url, async);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		req.onreadystatechange = processRequest;
		req.send(params);
	};
	this.doGet = function () {
		req.open("GET", url, async);
		req.onreadystatechange = processRequest;
		req.send(null);
	};
}
function Ajax(url, callback, params, jsparams, jsparams2) {
	var req = init();
	var mode = "xml";
	var async = true;
	function init() {
		if (window.XMLHttpRequest) {
			return new XMLHttpRequest();
		} else {
			if (typeof ActiveXObject != "undefined") {
				return new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
	}
	function processRequest() {
		if (req.readyState == 4) {
			if (req.status == 200) {
				if (callback) {
					if ("html" === mode) {
						callback(req.responseText, jsparams, jsparams2);
					} else {
						callback(req.responseXML, jsparams, jsparams2);
					}
				}
			}
		}
	}
	this.setMode = function setMode(m) {
		mode = m;
	};
	this.setAsync = function setAsync(a) {
		async = a;
	};
	this.doPost = function () {
		req.open("POST", url, async);
		req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		req.onreadystatechange = processRequest;
		req.send(params);
	};
	this.doGet = function () {
		req.open("GET", url, async);
		req.onreadystatechange = processRequest;
		req.send(null);
	};
}

