function Asynchronous() {
	this._xmlhttp = new FactoryXMLHttpRequest();
}

function Asynchronous_call(url,domElement,jsFunction) {
	var instance = this;
	
	this._xmlhttp.open("GET", url, true);
	this._xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	this._xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest");
	this._xmlhttp.setRequestHeader("If-Modified-Since",url || "Thu, 01 Jan 1970 00:00:00 GMT");

	this._xmlhttp.onreadystatechange = function() {
		switch(instance._xmlhttp.readyState) {
			case 1:
				instance.loading();
				break;
			case 2:
				instance.loaded();
				break;
			case 3:
				instance.interactive();
				break;
			case 4:
				domElement.innerHTML = instance._xmlhttp.responseText;
				
				if (jsFunction != null){eval(jsFunction);}
				
				break;
		}
	}
	this._xmlhttp.send(null);
}

function Asynchronous_loading() {
}

function Asynchronous_loaded() {
}

function Asynchronous_interactive() {
}

Asynchronous.prototype.loading = Asynchronous_loading;
Asynchronous.prototype.loaded = Asynchronous_loaded;
Asynchronous.prototype.interactive = Asynchronous_interactive;
Asynchronous.prototype.call = Asynchronous_call;
