function AjaxRequest( method, page, data )
{
	var xmlHttp = null
	try{ xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP" )}
	catch(e){ xmlHttp = new XMLHttpRequest() }
	
	method = method.toLowerCase()
	data = ( data != null ) ? data.replace( "?","" ) : data
	page = ( method == "get" ) ? ( page + "?" + data ) : page
	
	xmlHttp.open( method, page, false )
	
	if( method == "post" && data != null )
	{
		xmlHttp.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' );
		xmlHttp.setRequestHeader( 'Content-length', data.length ); 	
	}
	
	xmlHttp.send( data )
			
	AjaxRequest.prototype.getXml = function(){ return xmlHttp.responseXML }
	AjaxRequest.prototype.getText = function(){ return xmlHttp.responseText }
	AjaxRequest.prototype.isDone = function(){ return ( xmlHttp.status == 200 ) }
	AjaxRequest.prototype.getError = function()
	{
		switch( xmlHttp.status )
		{
			case 404: return "Página não encontrada"
			case 500: return "Erro interno do servidor"
			default: return ( ( xmlHttp.status != 200 ) ? "Erro desconhecido" : "Não contém erros " )
		}
	}
}
