var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);

// check for IE cleanup errors from the ajax prototype library (too bad i've seen it after coding this).

function xmldata()
{
	this.xmlhttp = false;
	this.type = "GET";
	this.post = "";
	this.status = 0;
	this.okfunc = null;
	this.errfunc = null;

	try {
		this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch(e) {
	try {
		this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
		this.xmlhttp = false;
	}
	}
	if (!this.xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
		this.xmlhttp = new XMLHttpRequest();
	}

	//this.emptyFunction = function emptyfunction() {}

	var self = this;
	this.xmlhttp.onreadystatechange=function()
	{
		if (self.xmlhttp.readyState == 4)
		{
			self.okfunc(self.xmlhttp.responseText);
		}
		//self.xmlhttp.onreadystatechange = self.emptyFunction();
	}

	this.set = function set(setting, data)
	{
		if (setting == 'okfunc')
		{
			this.okfunc = data;
			this.status = 1;
		}
		else
		if (setting == 'post')
		{
			this.type = "POST";
			this.post = data;
		}
	}

	this.send = function send(url)
	{
		if (this.status == 1)
		{
			this.xmlhttp.open(this.type, url, true);
			if (this.type == 'POST')
			{
				this.xmlhttp.setRequestHeader("Content-Length", this.post.length);
				this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				this.xmlhttp.send(this.post);
			} else
				this.xmlhttp.send(null);
		}
	}
}
