ajax = Class.create();

ajax.prototype = {
	initialize: function(url, options) {
		this.transport = this.getTransport();
		this.onComplete = options.onComplete;

		this.request(url);
	},

	request: function(url) {
		this.transport.open("GET", url, true);
		this.transport.onreadystatechange = this.onStateChange.bind(this);
		this.transport.send(null);
	},

	onStateChange: function() {
		if (this.transport.readyState == 4 && this.transport.status == 200) {
			if (this.onComplete) {
				this.onComplete(this.transport);
			} else {
				alert ("no on complete method to call");
			}
		}
	},

	getTransport: function() {
		if (window.ActiveXObject) return new ActiveXObject('Microsoft.XMLHTTP');
		else if (window.XMLHttpRequest) return new XMLHttpRequest();
		else return false;
	}
};