var ajax_c = function()
{
	this.path_s = '#';
	this.argument_a = new Array();
	this.type_s = 'POST';
	this.listener_a = new Array();

	this.setPath = function(path_s)
	{
		this.path_s = path_s;
	};

	this.setArgument = function(name_s, value_u)
	{
		this.argument_a[name_s] = value_u;
	};

	this.setType = function(type_s)
	{
		this.type_s = type_s.toUpperCase();
	};

	this.setListener = function(object_o, method_s, argument_o)
	{
		this.listener_a[this.listener_a.length] = {object: object_o, method: method_s, argument: argument_o};
	};

	this.getHttp = function()
	{
		return window.XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : false);
	};

	this.getArgumentString = function()
	{
		var argument_a = new Array();

		for (var key_s in this.argument_a)
			argument_a[argument_a.length] = key_s + '=' + escape(this.argument_a[key_s]);

		return argument_a.join('&');
	};

	this.setRequest = function()
	{
		var http_o = this.getHttp();

		if (http_o)
		{
			var this_o = this;

			http_o.onreadystatechange = function()
			{
				for (var i_i = 0; i_i < this_o.listener_a.length; i_i++)
				{
					var status_i;

					try { status_i = typeof http_o.status != 'unknown' ? http_o.status : 0; }
					catch (exception_o) { status_i = 0; }

					var response_s = typeof http_o.responseText != 'unknown' ? http_o.responseText : '';

					this_o.listener_a[i_i].object[this_o.listener_a[i_i].method](http_o.readyState, status_i, response_s, this_o.listener_a[i_i].argument);
				}
			};

			switch (this.type_s)
			{
				case 'GET':

				http_o.open(this.type_s, this.path_s + '?' + this.getArgumentString(), true);
				http_o.send('');

				break;

				case 'POST':

				var argument_s = this.getArgumentString();

				http_o.open(this.type_s, this.path_s, true);
				http_o.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
      			http_o.setRequestHeader('Content-length', argument_s.length);
      			http_o.setRequestHeader('Connection', 'close');
				http_o.send(argument_s);

				break;
			}
		}
	};
};