function httpRequest()
{
	var req = false;
	
	if(window.XMLHttpRequest && !(window.ActiveXObject))
	{
		try
		{
			this.req = new XMLHttpRequest();
		}
		catch(e)
		{
			this.req = false;
		}
	}
	else if(window.ActiveXObject)
	{
		try
		{
			this.req = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				this.req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				this.req = false;
			}
		}
	}
	
	return this.req;
}


function ask(url, metodo, callback)
{
	Ajax = httpRequest();
	if(Ajax)
	{
		//Ajax.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
		//Ajax.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
		//Ajax.setRequestHeader("Pragma", "no-cache");
		Ajax.onreadystatechange = eval(callback);
		Ajax.open('GET', url, true);
		Ajax.send(null);
	}
}
	
	/*	
	// exemplo de função callback
	function processReqChange()
	{
		if (Ajax.readyState == 4)
		{
			if (Ajax.status == 200)
			{
				// ...instruções de processamento...
			}
			else
			{
				alert("Há um problema:\n" + Ajax.statusText);
			}
		}
	}
	*/
