function Tajax()
{
	this.getRequestObject = function()
	{
		var req = null;
		if (typeof XMLHttpRequest != "undefined")
			req = new XMLHttpRequest();

		if (!req && typeof ActiveXObject != "undefined")
		{
			try
			{
				req = new ActiveXObject("Msxml2.XMLHTTP");
				XMLHttpRequest = function(){return new ActiveXObject("Msxml2.XMLHTTP");}
			}
			catch (e)
			{
				try
				{
					req=new ActiveXObject("Microsoft.XMLHTTP");
					XMLHttpRequest = function(){return new ActiveXObject("Microsoft.XMLHTTP");}
				}
				catch (e2)
				{
					try {
						req=new ActiveXObject("Msxml2.XMLHTTP.4.0");
						XMLHttpRequest = function(){return new ActiveXObject("Msxml2.XMLHTTP.4.0");}
					}
					catch (e3)
					{
						req=null;
					}
				}
			}
		}
		if(!req && window.createRequest)
			req = window.createRequest();
		
		if (!req) this.DebugMessage("Request Object Instantiation failed.");
			
		return req;
	}

	this.getDataByURL = function(url){
		var xmlHttp = this.getRequestObject();
		xmlHttp.open('GET',url,false);
		xmlHttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		xmlHttp.send(null);
		return xmlHttp.responseText+'';
	}

	this.DebugMessage = function(text)
	{
		if (text.length > 1000) text = text.substr(0,1000)+"...\n[long response]\n...";
		try {
			if (this.debugWindow == undefined || this.debugWindow.closed == true) {
				this.debugWindow = window.open('about:blank', 'xajax-debug', 'width=800,height=600,scrollbars=1,resizable,status');
				this.debugWindow.document.write('<html><head><title>Xajax debug output</title></head><body><h2>Xajax debug output</h2><div id="debugTag"></div></body></html>');
			}
			debugTag = this.debugWindow.document.getElementById('debugTag');
			if (!debugTag)
				throw new Error();
			text = text.replace(/&/g, "&amp;");
			text = text.replace(/</g, "&lt;");
			text = text.replace(/>/g, "&gt;");
			debugTag.innerHTML = ('<b>'+(new Date()).toString()+'</b>: ' + text + '<hr/>') + debugTag.innerHTML;
		} catch (e) {
			alert("Xajax Debug:\n " + text);
		}
	};
}

var tajax = new Tajax();