function AQuery() {
	this.xmlHttp					= this.getXmlHttp();	
	this.container					= ABC.create('div');
	this.requestStatChangeHandler	= this.processReqChange;
	this.preprocessFnc				= this.defaultPreprocessor;
}

AQuery.prototype.query = function(url, method, data, container, preprocessFnc) {
	if (parent.document.getElementById('templateframe')) {
		return false;
	}
	
	container && (this.container = container);
	preprocessFnc && (this.preprocessFnc = preprocessFnc);
	this.container.style.display = 'none';
	
	this.xmlHttp.open(method, url, true);
	this.xmlHttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	
	var obj = this;
	this.xmlHttp.onreadystatechange = function() { obj.requestStatChangeHandler(obj.xmlHttp); };
	
	if(method.toLowerCase() == 'post') {
		this.xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=windows-1251");
	}		
	this.xmlHttp.send(data || null);
}

AQuery.prototype.getXmlHttp = function() {
	var xmlhttp = null;
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
			xmlhttp = false;
	    }
	  }
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
  return xmlhttp;
}

AQuery.prototype.processReqChange = function(pXmlHttp) {	 
	if (pXmlHttp.readyState == 4) {
		if (pXmlHttp.status == 200) {
			this.container.innerHTML = this.preprocessFnc(pXmlHttp.responseText);
			$(this.container).slideDown("slow");						
		} else {
			//div.innerHTML = '';
		}
		
	}
}

AQuery.prototype.setRequestStatChangeFunction = function(pFunction) {
	this.requestStatChangeHandler = pFunction;
}

AQuery.prototype.defaultPreprocessor = function(pText) {
	return pText;
}