function getHTTPObject() {
	var xhr = false;
	if (window.XMLHttpRequest) {
		xhr = new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		try {
			xhr = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				xhr = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				xhr = false;
			}
		}
	}
	return xhr;
}

function fishing(settings) {
	this.request = getHTTPObject();
	if (this.request) {
		this.request.onreadystatechange = function () {
			if (request.readyState == 4) {
				if (request.status == 200 || request.status == 304) {
					if (typeof settings.onready == "function") {
						settings.onready(request);
					}
				}
				else {
					if (typeof settings.onfail == "function") {
						settings.onfail(request);
					}
				}
			}
		}
		this.request.open(settings.method, settings.url, true);
		this.request.send(null);
	}
}
