function ajaxQuery(){
	
/* Создание нового объекта XMLHttpRequest для общения с Web-сервером */
this.xmlHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  this.xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
} catch (e) {
  try {
    this.xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
  } catch (e2) {
    this.xmlHttp = false;
  }
}
@end @*/

if (!this.xmlHttp && typeof XMLHttpRequest != 'undefined') {
	this.xmlHttp = new XMLHttpRequest();
}
	
	this.query = function(url, value, method){	
		if( url == "" ){
			return false;
		}else{
			var s = "";
			for (var key in value) {
				var val = value[key];
				if( method.toLowerCase() == "get" ){
					if( s == "" ) s += "?"; else s += "&";
				}else{
					if( s != "" ) s += "&"; 
				}
				s += key + "=" + encodeURIComponent(val);
			}
			if( method.toLowerCase() == "get" ){
				this.xmlHttp.open("GET",url+s,false);
				this.xmlHttp.send(null);
				var res = false;
				var res = this.xmlHttp.responseText;
				return res;
			}else{
				this.xmlHttp.open("POST",url,false);
				this.xmlHttp.send(s);
				this.xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				var res = false;
				var res = this.xmlHttp.responseText;
				return res;
			}
		}
	}

}
