GetAjaxDataByCriteria = function(){
    this.ElementPrefix = "";
    this.ElementNumber = 0;
    this.arQueryString = new Array();
    this.RequestFile = "";
    this.MethodName = "";
    this.arCommaSeparatedField = new Array();
    this.arStartedRequests = new Array();
    if(typeof(window._Instances["WorkingAjax"]) == "undefined"){
        window._Instances["WorkingAjax"] = new Array();
    }
    this.UserKeys = new Array();
    this.UseUserKeys = false;
    
    this.CollectData = function(){
        var Key = ""; 
        for(var z = 0; z < this.ElementNumber; z++){
            
            if(this.UseUserKeys){
                Key = this.UserKeys[z];
            }else{
                Key = z;
            }
            if(typeof(Key) != "undefined"){
                if(typeof(window._Instances) == "undefined"){
		            window._Instances = new Array();
		        }
	            this._sInstanceKey = window._Instances.length;
	            window._Instances[window._Instances.length] = this;
        	    
                var HttpRequest = new CHttpRequest();
	            HttpRequest.QueryString = "AjaxType=HTML&RequestFile="+ this.RequestFile +"&MethodName=" + this.MethodName;
	            HttpRequest.AssyncCall = true;
	            HttpRequest.AddProperty("Arguments[Query]", this.arQueryString[Key]);
	            HttpRequest.AddProperty("Arguments[Field]", this.arCommaSeparatedField[Key]);
	            HttpRequest.AddProperty("Arguments[Field]", this.arCommaSeparatedField[Key]);
	            HttpRequest.Additional = this.ElementPrefix + Key;
	            HttpRequest.onReturn = "window._Instances[" + this._sInstanceKey + "].CollectData_CallBack";
	            var Response = HttpRequest.Send();
	            window._Instances["WorkingAjax"][window._Instances["WorkingAjax"].length] = Response;
	        } 
	    }
    }
    
    this.CollectData_CallBack = function(httpRequest, Additional){
        document.getElementById(Additional).innerHTML = httpRequest.responseText;
    }
   
    this.CancelAllRequest = function(){
        
    }
}
