function ajax(async)
{
	this.async = async ? true : false;
	this.vars = new Object();
	this.me = this;

	try
	{
		this.handler = new XMLHttpRequest();
		this.compatible = (this.handler.setRequestHeader ? true : false);
	}
	catch(e) {
		try
		{
			this.handler = new ActiveXObject('Microsoft.XMLHTTP');
			this.compatible = true;
		}
		catch(e)
		{
			this.compatible = false;
		}
	}

	this.ready = function()
	{
		return (this.handler.readyState && (this.handler.readyState == 4));
	}

	this.onReadyStateChange = function(event)
	{
		if (this.handler && typeof event == 'function')
		{
			this.handler.onreadystatechange = event;
			return true;
		}
		else
		{
			return false;
		}
	}

	this.setVar = function(varbl, value)
	{
    	this.vars[varbl] = value;
	}

	this.send = function(url)
	{
		if (!this.handler && this.ready()) return false;
		var data = '';
		for(varbl in this.vars)
		{
			data += (data.length > 0?'&':'') + varbl + '=' + escape(this.vars[varbl]);
		}
		this.handler.open('POST', url, this.async);
		this.handler.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
		this.handler.send(data);
	}
}