function Ajax( strURL )
{
  var currentServer = document.location.href;
  currentServer = document.location.href.match(/http:\/\/[^\/]+/);
	if(!currentServer)
	{
    currentServer = document.location.href.match(/https:\/\/[^\/]+/);
	}
  this.url = currentServer + strURL;
  this.query = '';
}

Ajax.prototype.setCallbacks = function(oSuccessCallback)
{
  this.oSuccessCallback = oSuccessCallback;
}
Ajax.prototype.setArguments = function(oArguments)
{
  var sArgs = '?';
  for (var i in oArguments)
  {
    sArgs += i + '=' + oArguments[i] + '&';
  }
  this.query = sArgs;  
}

Ajax.prototype.makeRequest = function (oSuccessCallback, oArguments)
{
  this.oSuccessCallback = oSuccessCallback;
  if(oArguments)
  {
    this.setArguments(oArguments);
  }
  this.httpRequest = getXHRObject();
  if(!this.httpRequest)
  {
    alert('error, couldn\'t create httpRequest object');
    return;
  }
  if(!this.oSuccessCallback)
  {
    //alert('You must use a callback');
    return;
  }

// Start Callback function
  var selfAjax = this;
  this.httpRequest.onreadystatechange = function()
  {
    if(selfAjax.httpRequest.readyState == 4)
    {
	  this.requestStatus = selfAjax.httpRequest.status;
      if(selfAjax.httpRequest.status == 200)
      {
        selfAjax.oSuccessCallback(selfAjax.httpRequest.responseText);
      }
      else
      {
		if (selfAjax.oErrorCallback) 
		{
        	selfAjax.oErrorCallback(selfAjax.httpRequest.status, selfAjax.url, selfAjax.query);
		}
		else
		{
        	alert('Error: ' + selfAjax.httpRequest.status + '\nLocation: ' + selfAjax.url + selfAjax.query);
		}
      }
    }
  }
// End Callback function  
  var url = this.url + this.query;
  // this.httpRequest.open('GET', url);
  this.httpRequest.open('GET', url, true);
  this.httpRequest.send(null);
}
