function HTTPQuery()
{
	var xhr;
	var bDone = false;

	if (window.XMLHttpRequest)
	{
		xhr = new XMLHttpRequest();
		if (xhr.overrideMimeType) xhr.overrideMimeType("text/xml");
	}
	else
	{
		if (window.ActiveXObject)
		{
			try
			{
				xhr = new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch(e)
			{
				try
				{
					xhr = new ActiveXObject("Microsoft.XMLHTTP");
				}
				catch(e)
				{
					xhr = false;
				}
			}
		}
	}
	if (!xhr) return null;

	this.Query = function(URL,Method,Vars,onDone)
	{
		if (!xhr) return false;
		bDone = false;
		Method = Method.toUpperCase();
		try
		{
			if (Method=="GET")
			{
				xhr.open("GET",URL+"?"+Vars,true);
				Vars = "";
			}
			else if (Method=="POST")
			{
				xhr.open("POST",URL,true);
				xhr.setRequestHeader("Method","POST "+URL+" HTTP/1.1");
				xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
			}
			else return false;
			xhr.onreadystatechange = function()
			{
				if ((xhr.readyState==4) && (!bDone))
				{
					bDone = true;
					onDone(xhr);
				}
			}
			xhr.send(Vars);
		}
		catch(e)
		{
			return false;
		}
	}
	
	return this;
}
