function XmlHttpReq(strURL, strMethod, strCallBack) {
	var boolSupport = true;

	if (window.ActiveXObject) {
		this.objXmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	} else if (window.XMLHttpRequest) {
		this.objXmlHttp = new XMLHttpRequest();
	} else {
		alert("本頁只支援下列網頁瀏覽器，其他網頁瀏覽器有機會不能正常顯示：\nMicrosoft Internet Explorer 5.5 或以上\nMozilla Firefox 1.5 或以上\nApple Safari 1.2 或以上\nNetscape Browser 8.0 或以上\nOpera 9.0 或以上");
		boolSupport = false;
	}

	if (boolSupport == true) {
		this.strURL = strURL;
		this.strMethod = strMethod.toUpperCase();
		this.strCallBack = strCallBack;

		if (typeof XmlHttpReq._initialized == "undefined") {
			XmlHttpReq.prototype.makeReq = function(varParam) {
				var obj = this;

				var varSend = null;
				var strTempURL = this.strURL + "?hash=" + Math.random();

				if (this.strMethod == "GET") {
					for (var i=0; i<varParam.length; i++) {
						strTempURL += "&" + varParam[i][0] + "=" + varParam[i][1];
					}
				} else if (this.strMethod == "POST") {
					varSend = varParam;
					this.objXmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				} else {
					return false;
				}

				this.objXmlHttp.open(this.strMethod, strTempURL, true);
				//this.objXmlHttp.onreadystatechange = eval(this.strCallBack);
				this.objXmlHttp.onreadystatechange = function() {
					if (obj.objXmlHttp.readyState == 4) {
						var boolStatus;

						if (obj.objXmlHttp.status == 200) {
							boolStatus = true;
						} else {
							boolStatus = false;
						}

						var strToDo = obj.strCallBack + "(" + boolStatus + ")";
						eval(strToDo);
					}
				};
				this.objXmlHttp.send(varSend);
			};

			XmlHttpReq.prototype.getResult = function(strType) {
				var obj = this;

				if (strType.toLowerCase() == "text") {
					return obj.objXmlHttp.responseText;
				} else if (strType.toLowerCase() == "xml") {
					return obj.objXmlHttp.responseXML;
				} else {
					return null;
				}
			}

			XmlHttpReq._initialized = true;
		}
	}
}
