//Ajax Connection Class

function AjaxConnection(url) 
{
   this.setOptions=setOptions;
   this.getOptions=getOptions;
   this.connect=connect;
   this.uri=url;
} 
function setOptions(opt)
{
	this.opts = opt;
}
function getOptions()
{
	return this.opts;
}

function connect(return_func,div,wizzy){

	with(this)
	{
		this.x=init_object();
		this.x.open("POST", uri,true);
		this.x.onreadystatechange = function() {
				if (x.readyState != 4){
					return;
				}
				if(return_func!='NO RETURN'){
					eval(return_func + '(x.responseText,"'+div+'","'+wizzy+'")');
				}
				delete x;
		}

		this.x.setRequestHeader('Content-Type',
		'application/x-www-form-urlencoded');
		this.x.send(opts);
	}
}
function init_object() {
        var x;
        try {
                x=new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
                try {
                        x=new ActiveXObject("Microsoft.XMLHTTP");
                } catch (oc) {
                        x=null;
                }
        }
        if(!x && typeof XMLHttpRequest != "undefined")
                x = new XMLHttpRequest();
        if (x)
                return x;
}