function scAjax(startURL) {
	this.url = startURL;
	this.query = '';
	this.persistentQuery = '';
	this.content = '';
	this.POST = 0;
	this.GET = 1;
	this.requestType = this.GET;
	this.callbackFunction = function () { return true; };
	this.error = '';
	this.fallbackFunction = function () { alert(this.error); };
	this.mime = 'text/plain; charset=iso-8859-1';
	
	this.newXMLRequestThread = function () {
		var xmlhttp = false;
		var i = this;
		/*@cc_on @*/
		/*@if (@_jscript_version >= 5)
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				xmlhttp = false;
			}
		}
		@end @*/
		if (!xmlhttp && (typeof XMLHttpRequest != 'undefined')) {
			xmlhttp = new XMLHttpRequest();
			if (xmlhttp.overrideMimeType) {
				xmlhttp.overrideMimeType(i.mime);
			}
		}
		return xmlhttp;
	};

	this.serverRequest = function (urlToGet) {
		var i = this;
		var j = i.newXMLRequestThread();
		var h = 'text/plain; charset=iso-8859-1'; //'application/x-www-form-urlencoded';
		if (j) {
			if (i.requestType == i.POST) {
				j.open("post", urlToGet, true);
				j.setRequestHeader('Content-Type', h);
				j.setRequestHeader('Content-length', i.query.length);
				j.setRequestHeader('Connnection', 'close');
			} else {
				if (i.query.length) {
					urlToGet += '?' + i.query;
				}
				i.query = null;
				j.open("get", urlToGet, true);
			}
			j.onreadystatechange = function() {
				if (j.readyState == 4) {
					if (j.status == 200) {
						i.content = j.responseText;
						i.callbackFunction();
					} else {
						i.error = 'Server returned an error - the page may have been relocated or removed.';
						i.fallbackFunction();
					}
				}
			};
			j.send(i.query);
		} else {
			i.error = 'Unable to create HTTP request thread.';
			i.fallbackFunction();
		}
	};

	this.addQuery = function (name, value, persistent) {
		var a = persistent ? this.persistentQuery : this.query;
		if (a.length) { a += '&'; }
		a += name + (value ? '=' + encodeURIComponent(value) : '');
		if (persistent) { this.persistentQuery = a; } else { this.query = a; }
	};

	this.init = function () {
		if (this.persistentQuery.length) {
			if (this.query.length) { this.query += '&'; }
			this.query += this.persistentQuery;
		}
		this.serverRequest(this.url);
		this.query = '';
	};
}
