function ajaxRequest(props)
{
  this.properties = props;
  this.xmlObject = null;
  
  var that = this;
  
  if(typeof this.properties.type == 'undefined')
  {
    this.properties.type = 'GET';
  }
  
  try
  {
		this.xmlObject = new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			this.xmlObject = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				this.xmlObject = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
  
  var handleResponse = function()
  {
    if(typeof that.properties.callback != 'function')
		  return false;
	
  	if(that.xmlObject.readyState == 4)
    {
  		that.properties.callback({
  		  text      : that.xmlObject.responseText,
        xml       : that.xmlObject.responseXML,
        options   : that.properties.options
      });
  	}
  }
  
  this.xmlObject.onreadystatechange = handleResponse;
  
  this.startRequest = function()
  {
    var now = new Date;
    var time = that.properties.url.substr(that.properties.url.length-3,3) == 'php' || that.properties.url.substr(that.properties.url.length-4,4) == 'html' ? '?time=' + now.getTime() : '&time=' + now.getTime();
    
    that.xmlObject.open(that.properties.type, that.properties.url + time, true);
  	// ajaxRequest.setRequestHeader("Pragma", "no-cache");
  	that.xmlObject.setRequestHeader("Cache-Control", "must-revalidate");
  	that.xmlObject.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
  	
  	var postData = '';
  	
  	if(typeof that.properties.data != 'undefined')
  	{
  	  if(typeof that.properties.data === 'string')
  	  {
    	  postData += 'data=' + encodeURIComponent(that.properties.data) + '&';
  	  }
  	  else
  	  {
  	    for(name in that.properties.data)
    	  {
    	    if(name === 'click' || name === 'clickElement' || name === 'mouseout' || name === 'mouseover' || name === 'queryState' || name === 'toggle')
    	      continue;
  	      
    	    postData += name + '=' + encodeURIComponent(that.properties.data[name]) + '&';
    	  }
  	  }
  	}
  	
  	that.xmlObject.send(postData);  
  }
}