function AsynchRequest (in_url, in_ok_callback, in_load_callback, in_error_callback, in_method, in_data, in_content_type)
{
	var ie;
	var xmlhttp;
	var request_type;
	var target_url;
	var content_type;
	var submit_data;
	var request_status;
	var ok_callback;
	var load_callback;
	var error_callback;

	//Init base object

	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	  try {
	  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");
	  ie=true;
	 } catch (e) {
	  try {
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		ie=true;
	  } catch (E) {
	   xmlhttp=false
	  }
	 }
	@else
	 xmlhttp=false
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	 try {
	  xmlhttp = new XMLHttpRequest();
	 } catch (e) {
	  xmlhttp=false
	 }
	}


	//Init vars
	request_status = 0;
	target_url     = in_url;
	ok_callback    = in_ok_callback;

	if (in_load_callback)
		load_callback  = in_load_callback;

	if (in_error_callback)
		error_callback = in_error_callback;

	if (in_method)
		request_type=in_method;
	else
		request_type="GET";

	if (in_data)
		submit_data = in_data;

	if (in_content_type)
		content_type = in_content_type;


	//Set methods

	this.setOkCallback    = function (cbk)     { ok_callback    = cbk;     }
	this.setTargetURL     = function (url)     { target_url     = url;     }
	this.setErrorCallback = function (cbk)     { error_callback = cbk;     }
	this.setLoadCallback  = function (cbk)     { load_callback  = cbk;     }
	this.setRequestType   = function (method)  { request_type   = method;  }
	this.setContentType   = function (content) { content_type   = content; }
	this.setSubmitData    = function (data)    { submit_data    = data;    }

	this.getStatus	   	  = function () {return request_status;}

	this.supported        = function() {return !(!xmlhttp);}

	this.send             = function()
  {
    if (this.supported())
    {
      xmlhttp.onreadystatechange=function()
      {
        //support states
        //1 - Loading
        //4 - Initialised

        //currently ignore states
        //2 - Some content loaded
        //3 - Interactive (support soon!)

        var state = xmlhttp.readyState;
        
        if (state==1)
        {
          if (load_callback) load_callback();
        }
        else if (state==4)
        {
          request_status=xmlhttp.status;
          if (request_status==200)
            ok_callback(xmlhttp.responseText, xmlhttp);
          else
            if (error_callback) error_callback(request_status);
        }
      }

      xmlhttp.open(request_type, target_url);

      xmlhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest');

      if(request_type=="POST")
      {
        xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        xmlhttp.send(submit_data);
      }
      else
      {
        if (ie)
          xmlhttp.send();
        else
          xmlhttp.send(null);
      }
    }
  }
}
