function XMLHTTPObject_()
{
	this.CallBackContext = null;
	this.CallBackFunction = null;
	this.CallBackArgument = null;
	this.XMLHTTPObject = null;

	this.Initialize = function()
	{
		if (typeof(XMLHttpRequest)!='undefined')
			return new XMLHttpRequest();

		var ActiveXObjectDefinition = ['Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.4.0', 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'];
		for(var Loop=0;Loop<ActiveXObjectDefinition.length;Loop++)
		{
			try
			{
				return new ActiveXObject(ActiveXObjectDefinition[Loop]);
			}
			catch(e)
			{
			}
		}
		return null;
	}

	this.Deinitialize = function()
	{
		if (this.XMLHTTPObject)
			delete this.XMLHTTPObject;
		this.XMLHTTPObject = null;

		this.CallBackContext = null;
		this.CallBackFunction = null;
		this.CallBackArgument = null;
	}

	this.Request = function(Type, URL, Variable)
	{
		var VariableFormated = "";
		Type = Type.toUpperCase();

		if (typeof(Variable)=="undefined")
			Variable = "";

		if (typeof(Variable)=="object")
		{
			for (var Name in Variable)
				VariableFormated += ((VariableFormated)?"&":"") + encodeURIComponent(Name) + "=" + encodeURIComponent(Variable[Name]);
		}
		else
			VariableFormated = Variable;


		this.XMLHTTPObject.onreadystatechange = new Function;

		if (this.XMLHTTPObject.readyState)
			this.XMLHTTPObject.abort();

		this.XMLHTTPObject.onreadystatechange = this.OnReadyStateChange.bind(this);
		this.XMLHTTPObject.open(Type, URL+(((Type=="GET")&&(VariableFormated))?"?"+VariableFormated:""), true);

		if (Type=="POST")
		{
			this.XMLHTTPObject.setRequestHeader("Cache-Control", "no-cache");
			this.XMLHTTPObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		}

		this.XMLHTTPObject.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
		this.XMLHTTPObject.send(((Type=="POST")?VariableFormated:""));

	}

	this.OnReadyStateChange = function()
	{
		if (this.XMLHTTPObject.readyState==4)
		{
			if (typeof(this.CallBackFunction)=="function")
			{
				if (typeof(this.CallBackArgument)!="undefined")
				{
					var Argument = this.CallBackArgument;
					Argument[Argument.length] = this.XMLHTTPObject.responseText;
				}
				else
					var Argument = Array(this.XMLHTTPObject.responseText);

				this.CallBackFunction.apply(this.CallBackContext, Argument);
			}

			this.XMLHTTPObject.onreadystatechange = new Function;
		}
	}

	this.CallBack = function(CallBackContext, CallBackFunction, CallBackArgument)
	{
		this.CallBackContext = CallBackContext;
		this.CallBackFunction = CallBackFunction;
		this.CallBackArgument = CallBackArgument;
	}

	this.XMLHTTPObject = this.Initialize();
//	General.EventHandlerAdd(window, "unload", this.Deinitialize.bind(this));
}
