function ajax()
{
	this.xmlHttp = this.create();
	this.httpMethod = 'GET';
	this.serverUrl = '';
	this.isAsync = true;
	this.respFunc = '';

	this.method = function(method)
	{
		var success = false;
		if('GET' == method || 'POST' == method)
		{
			this.httpMethod = method;
			success = true;
		}
		return success;
	}

	this.url = function(url)
	{
		var success = false;
		if('' != url)
		{
			this.serverUrl = url;
			success = true;
		}
		return success;
	}

	this.async = function(bool)
	{
		var success = false;
		if(true == bool || false == bool)
		{
			this.isAsync = bool;
			success = true;
		}
		return success;
	}

	this.send = function()
	{
		var success = false;
		if(this.xmlHttp && this.serverUrl != '')
		{
			try
			{
				this.xmlHttp.open(this.httpMethod, this.serverUrl, this.isAsync);
				this.xmlHttp.onreadystatechange = this.respFunc;
				this.xmlHttp.send(null);
				success = true;
			}
			catch(e)
			{
				success = false;
			}
		}
		return success;
	}
}

ajax.prototype.create = function()
{
	var xmlHttpRequest = false;
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttpRequest = new XMLHttpRequest();
	}
	catch(e)
	{
		// Internet Explorer
		try
		{
			xmlHttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				xmlHttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				xmlHttpRequest = false;
			}
		}
	}
	return xmlHttpRequest;
}
