
var a = new Array();
function d() {
	if (a) {
		var c = a.length;
		for (b = 0; b < c; b++) {
			if (a[b] && a[b].istimeout()) {
				a[b].abort();
				if (a.splice(b, 1) != undefined) {
					b--;
					c--;
				}
			}
		}
		for (b = 0; b < c; b++) {
			if (a[b]) {
				a[b].d();
			}
		}
		for (b = 0; b < c; b++) {
			if (a[b] && a[b].canremove()) {
				if (a.splice(b, 1) != undefined) {
					b--;
					c--;
				}
			}
		}
	}
}
var xxx = "Content";
var uuu = "charset";
var vvv = "form";
var rrr = "urlencoded";
var h = function (asyncFlag) {
	this.timeout = 900;
	this.begintime = new Date();
	this.processed = false;
	if (asyncFlag == undefined) {
		this.asyncFlag = true;
	} else {
		this.asyncFlag = asyncFlag;
	}
	this.responseText = "";
	this.i = j();
	if (this.asyncFlag && this.i) {
		this.i.onreadystatechange = d;
		if (a) {
			a.splice(0, 0, this);
		}
	}
};
h.prototype.canremove = function () {
	return this.processed;
};
h.prototype.istimeout = function () {
	var now = new Date();
	return now - this.begintime > this.timeout * 1000 ? true : false;
};
h.prototype.abort = function () {
	try {
		this.i.abort();
		return true;
	}
	catch (e) {
		alert("abort error: " + e);
		return false;
	}
};
var yyy = "application";
var zzz = "Type";
var sss = "UTF";
h.prototype.d = function () {
	if (this.processed) {
		return false;
	}
	if (this.getreadyState() == 4) {
		if (this.getstatus()) {
			if (this.getstatus() == 200) {
				this.getresponseText();
			} else {
			}
		} else {
		}
	}
};
h.prototype.u = function (method, URL) {
	try {
		this.i.open(method, URL, this.asyncFlag);
		return true;
	}
	catch (e) {
		alert("u error: " + e);
		return false;
	}
};
var asd = "Microsoft";
h.prototype.r = function (content) {
	try {
		this.responseText = "";
		this.i.send(content);
		return true;
	}
	catch (e) {
		alert("r error: " + e);
		return false;
	}
};
var uvw = "GET";
h.prototype.getreadyState = function () {
	try {
		return this.i.readyState;
	}
	catch (e) {
		alert("getreadyState error: " + e);
		return false;
	}
};
var zxc = "XMLHTTP";
h.prototype.getresponseText = function () {
	try {
		this.responseText = this.i.responseText;
		if (this.asyncFlag) {
			this.onsetresponseText();
			this.processed = true;
		}
		return true;
	}
	catch (e) {
		alert("getresponseText error: " + e);
		return false;
	}
};
var rst = "POST";
h.prototype.getstatus = function () {
	try {
		return this.i.status;
	}
	catch (e) {
		return false;
	}
};
var qwe = "Msxml2";
h.prototype.getstatusText = function () {
	try {
		return this.i.statusText;
	}
	catch (e) {
		alert("getstatusText error: " + e);
		return false;
	}
};
h.prototype.getresponseXML = function () {
	try {
		return this.i.responseXML;
	}
	catch (e) {
		alert("getresponseXML error: " + e);
		return false;
	}
};
function j() {
	if (window.XMLHttpRequest) {
		try {
			return new XMLHttpRequest();
		}
		catch (e) {
			return false;
		}
	} else {
		if (ActiveXObject) {
			try {
				return new ActiveXObject(qwe + "." + zxc);
			}
			catch (e) {
				try {
					return new ActiveXObject(asd + "." + zxc);
				}
				catch (e) {
					return false;
				}
			}
		} else {
			return false;
		}
	}
}
var k = new h(false);
h.prototype.getAllResponseHeaders = function () {
	try {
		return this.i.getAllResponseHeaders();
	}
	catch (e) {
		alert("getAllResponseHeaders error: " + e);
		return "";
	}
};
h.prototype.getResponseHeader = function (headerLabel) {
	try {
		return this.i.getResponseHeader(headerLabel);
	}
	catch (e) {
		alert("getResponseHeader error: " + e);
		return "";
	}
};
h.prototype.v = function (label, value) {
	try {
		this.i.setRequestHeader(label, value);
		return true;
	}
	catch (e) {
		alert("v error: " + e);
		return false;
	}
};
h.prototype.onsetresponseText = function () {
	this.t();
};
h.prototype.t = function () {
	try {
		if (this.destination != "") {
			var target = document.getElementById(this.destination);
			if (target != null) {
				target.innerHTML = this.responseText;
			}
		}
	}
	catch (e) {
		alert("t error: " + e);
		return false;
	}
};
h.prototype.destination = "";
h.prototype.s = function (destination) {
	this.destination = destination;
};
h.prototype.o = "";
h.prototype.w = function (form) {
	if (this.m(form)) {
		this.r(this.o);
	}
};
h.prototype.m = function (form) {
	this.o = "";
	var first = 0;
	for (i = 0; i < form.elements.length; i++) {
		if (form.elements.item(i).name.length > 0) {
			if ((form.elements.item(i).type != "checkbox" && form.elements.item(i).type != "radio") || (form.elements.item(i).type == "checkbox" && form.elements.item(i).checked) || (form.elements.item(i).type == "radio" && form.elements.item(i).checked)) {
				first = first + 1;
				if (first > 1) {
					this.o = this.o + "&";
				}
				this.o = this.o + this.n(form.elements.item(i).name);
				this.o = this.o + "=" + this.n(form.elements.item(i).value);
			}
		}
	}
	return true;
};
function x(url, target, timeout) {
	var l = new h();
	if (timeout != undefined) {
		l.timeout = timeout;
	}
	l.s(target);
	l.u(uvw, url);
	l.r("");
}
function y(form, url, target, timeout) {
	var l = new h();
	if (timeout != undefined) {
		l.timeout = timeout;
	}
	l.s(target);
	l.u(rst, url);
	l.v(xxx + "-" + zzz, yyy + "/x-www-" + vvv + "-" + rrr + "; " + uuu + "=" + sss + "-8");
	l.w(form);
}
function get(url, target, async, timeout) {
	if (async == undefined || async == false) {
		k.u(uvw, url);
		k.r("");
		k.d();
		if (target != null && target != "" && target != undefined) {
			k.s(target);
			k.t();
		} else {
			return k.responseText;
		}
	} else {
		x(url, target, timeout);
	}
}
function post(form, url, target, async, timeout) {
	if (async == undefined || async == false) {
		k.u(rst, url);
		k.v(xxx + "-" + zzz, yyy + "/x-www-" + vvv + "-" + rrr + "; " + uuu + "=" + sss + "-8");
		k.w(form);
		k.d();
		if (target != null && target != "" && target != undefined) {
			k.s(target);
			k.t();
		} else {
			return k.responseText;
		}
	} else {
		y(form, url, target, timeout);
	}
}
h.prototype.n = function (origin) {
	var aa = encodeURI(origin);
	var bb = aa.replace(/&/g, "%26");
	var cc = bb.replace(/\+/g, "%2B");
	return cc;
};
function save(source, url, target, async, timeout) {
	if (async == undefined || async == false) {
		k.u(rst, url);
		k.yy(source);
		k.d();
		if (target != null && target != "" && target != undefined) {
			k.s(target);
			k.t();
		} else {
			return k.responseText;
		}
	} else {
		zz(source, url, target, timeout);
	}
}
function zz(source, url, target, timeout) {
	var xx = new h();
	if (timeout != undefined) {
		xx.timeout = timeout;
	}
	xx.s(target);
	xx.u(rst, url);
	xx.yy(source);
}
h.prototype.yy = function (source) {
	var src = document.getElementById(source);
	this.v(xxx + "-" + zzz, "text/html; " + uuu + "=" + sss + "-8");
	this.r(src.innerHTML);
};

