/**
 * 
 * @author James Socol <me@jamessocol.com>
 */

/**
 *
 * @author James Socol <me@jamessocol.com>
 */
function Ajax ()
{
	try {
		this.request = new XMLHttpRequest();
	} catch(e) {
		try {
			this.request = new ActiveXObject('Microsoft.XMLHTTP');
		} catch(e) {
		}
	}

	if ( null == this.request ) {
		return false;
	}
}

Ajax.prototype.action = function ( f )
{
	this.request.onreadystatechange = f;
}

Ajax.prototype.onSuccess = function () {}
Ajax.prototype.onFailure = function () {}
Ajax.prototype.onComplete = function () {}

Ajax.prototype.send = function ( url, method )
{
	if ( method != "POST" ) {
		method = "GET";
	}

	this.request.open(method,url,true);

	this.request.send(null);
}
