/**
 * Å¬·¡½º¸í : XmlHttp()
 * ±â    ´É : XML HTTP REQUEST
 * ÀÛ ¼º ÀÏ : 2007.04.19, Á¤¿ø±¤
 *
 */
XmlHttp = function (req, url, hdr) {
	this.xml = null;
	this.ver = ["MSXML2.XMLHttp.7.0", "MSXML2.XMLHttp.6.0", "MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp", "Microsoft.XMLHttp"];
	this.req = req;
	this.url = url;
	this.hdr = hdr;
	this.msg = "";

	// °´Ã¼ ±¸ÇÏ±â
	if (window.XMLHttpRequest) {
		this.xml = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		for (var i = 0; i < this.ver.length; i++) {
			try {
				this.xml = new ActiveXObject(this.ver[i]);
				break;
			} catch (e) {
			}
		}
	}

	// ½ÇÇà (±âº»)
	this.init = function () {
		this.xml.open(this.req, this.url, false);

		if (this.hdr.length > 0) {
			this.xml.setRequestHeader(this.hdr[0], this.hdr[1]);
		}

		this.xml.send(null);

		if (this.xml.readyState == 4) {
			if (this.xml.status == 200) {
				this.msg = this.xml.responseText;
			}
		}
	}

	// °´Ã¼ ÀÐ±â
	this.read = function () {
		return this.xml;
	}

	// ¿­±â
	this.open = function (req, url, sync) {
		this.xml.open(req, url, sync);
	}

	// Àü¼Û
	this.send = function () {
		this.xml.send(null);
	}
}

