		var applicationBaseUrl = '';
		var additionalParam = '';
		var allAJAX_requests = new Array();
		
		///////////////////////////////////
		///////                   /////////
		///////  class  XML       /////////
		///////                   /////////
		///////////////////////////////////
		function allXMLDoc(str)
		{
			this.doc = str;
		}
		allXMLDoc.prototype.getFirstElementByPath = function(path)
		{
		     var el = this.getElementsByPath(path);
		     if(el == null) return el;
		     var pathItems = path.split('/');
		     for(var i = 0; i < pathItems.length; i++)
		     {
		          el = el[0];
		     }
		     return el;
		}
		allXMLDoc.prototype.getElementsByPath = function(path)
		{
			if(path.substr(0, 1) == '/') path = path.substr(1, (path.length - 1));
			pathItems = path.split('/');
			var val = new allXMLElement();
			val.content = this.doc;
			val = this.getRecursive(pathItems, 0, val)
			return val;
		}
		allXMLDoc.prototype.getRecursive = function(pathItems, pathItem, val)
		{
		     var new_val = new Array();
		     val = this.getNode(pathItems[pathItem], val);
		     if(val == null) return null;
		     if(pathItem == (pathItems.length-1)) return val;
			for(var i = 0; i < val.length; i++)
			{
			     val[i] = this.getRecursive(pathItems, (pathItem + 1), val[i])
			     if(val[i] != null) new_val[new_val.length] = val[i];
			}
			if(new_val.length == 0) return null;
			return new_val;
		}
		allXMLDoc.prototype.findClose = function(sp, ep, key, str, cnt)
		{
		     var sp_ = sp;
		     var ep_ = sp;
			var o_count = 0;
			var c_count = 0;
			var tmp_str = '';
			while(true)
			{
				ep_ = str.indexOf('<', sp_);
				if(ep_ == -1) break;
                    while((str.charAt(ep_) == " " || str.charAt(ep_) == "\t") && ep_ < (str.length - key.length))  ep_++;
                    if(key != str.substr(ep_, key.length))
                    {
				     ep_ = str.indexOf('>', ep_);
				     if(ep_ == -1) break;
                         sp_ = ep_ + 1;
                         continue;
                    }
				ep_ = str.indexOf('>', ep_);
				if(ep_ != -1 && ep_ < ep)
				{
					o_count++;
					sp_ = ep_ + 1;
				}
				else break;
			}
			if(o_count == cnt) return ep;
			//if(o_count < cnt) return null;
			while(true)
			{
				ep_ = str.indexOf('</' + key + '>', sp_);
				if(ep_ != -1 && o_count > c_count)
				{
				     tmp_str = '</' + key + '>';
					sp_ = ep_ + tmp_str.length;
					c_count++;
				}
				else
				{
				     if(ep_ == -1 && o_count > c_count)
     				{
     				     return null;
     				}
     				else
     				{
     				     ep = this.findClose(sp, sp_, key, str, c_count);
     					if(ep == null) return null;
     					else if(ep == ep_)
     					{
     						return ep;
     					}
     				}
				}
			}
		}
		allXMLDoc.prototype.findNextElement = function(ps, name, str)
		{
		     var ps_ = ps;
		     var pe_ = ps;
		     var pe = ps;
		     var n_name = null;
		     var tmp_p = 0;
		     var isFindClose = true;
		     var flag = true;
		     while(true)
		     {
     		     ps_ = str.indexOf('<', ps_);
     		     if(ps_ == -1) return null;
     		     ps = ps_;
     		     ps_ = ps_ + 1;
                    while((str.charAt(ps_) == " " || str.charAt(ps_) == "\t") && ps_ < (str.length - 1))  ps_++;
     		     if(str.charAt(ps_) != '/') break;
		     }
		     pe_ = str.indexOf('>', (ps_ + 1));
		     pe = pe_;
		     if(pe_ == -1) return null;
		     if(str.charAt(pe_ - 1) == '/')
		     {
		          isFindClose = false;
		          pe_ = pe_ - 1;
		     }
		     tmp_p = str.indexOf(' ', ps_);
		     if(tmp_p != -1 && tmp_p < pe_) pe_ = tmp_p;
		     n_name = str.substring((ps + 1), pe_);
		     if(n_name == name || name == true)
		     {
		          return ps;
		     }
		     else ps_ = ps;
		     if(isFindClose)
		     {
		          ps_ = pe;
     		     pe_ = str.indexOf('</' + n_name + '>', ps_);
     		     if(pe_ == -1) return null;
     		     pe_ = this.findClose(ps_, pe, n_name, str, 0);
     		     if(pe_ == null) return null;
     		     tmp_p = '</' + n_name + '>';
     		     pe_ = pe_ + tmp_p.length;
		     }
		     else pe_ = pe + 2;
		     
		     return this.findNextElement(pe_, name, str);
		}
		allXMLDoc.prototype.getAttributes = function(str)
		{
		     var attributes = new Array();
		     var ps = 0;
		     var ps_ = 0;
		     var pe = 0;
		     var pe_ = 0;
		     var p = 0;
		     var p_ = 0;
		     var name = '';
		     var value = '';
		     ps = str.indexOf(' ', ps);
		     ps_ = str.indexOf("\t", ps_);
		     if((ps_<ps && ps_ != -1) || (ps_>ps && ps == -1)) ps = ps_;
		     while(ps != -1)
		     {
		          value = '';
		          while((str.charAt(ps) == ' ' || str.charAt(ps) == "\t") && ps<str.length)  ps++;
		          if(str.charAt(ps) == '>') break;
		          pe = str.indexOf('=', ps);
		          
		          if(pe == -1)
		          {
		               pe = str.indexOf(' ', ps);
          		     pe_ = str.indexOf("\t", ps);
          		     if((pe_<pe && pe_ != -1) || (pe_>pe && pe == -1)) pe = pe_;
		          }
		          p = str.indexOf(' ', ps);
		          p_ = str.indexOf("\t", ps);
		          if((p_<p && p_ != -1) || (p_>p && p == -1)) p = p_;
		          if((p != -1 && p < pe) || (p>pe && pe==-1)) pe = p;
		          if(pe == -1)
		          {
		               pe = str.length - 2;
		          }
		          name = str.substring(ps, pe);
		          ps = pe;
		          while((str.charAt(ps) == ' ' || str.charAt(ps) == "\t") && ps<(str.length - 1))  ps++;
		          if(str.charAt(ps) == '>') break;
		          if(str.charAt(ps) == '=')
		          {
		               ps++;
		               while((str.charAt(ps) == ' ' || str.charAt(ps) == "\t") && ps<(str.length-1))  ps++;
		               if(str.charAt(ps) == '>') break;
		               if(str.charAt(ps) == '"')
		               {
		                    ps++;
		                    pe = str.indexOf('"', ps);
		                    if(pe != -1)
		                    {
		                         value = this.decode(str.substring(ps, pe));
		                         ps = pe;
		                    }
		                    else break;
		               }
		               else
		               {
		                    if(str.charAt(ps) == "'")
     		               {
     		                    ps++;
     		                    pe = str.indexOf("'", ps);
     		                    if(pe != -1)
     		                    {
     		                         value = this.decode(str.substring(ps, pe));
     		                         ps = pe;
     		                    }
     		                    else break;
     		               }
     		               else
     		               {
     		                    pe = str.indexOf(" ", ps);
     		                    pe_ = str.indexOf("\t", ps);
     		                    if((pe_ != -1 && pe_<pe) || (pe_>pe && pe==-1)) pe = pe_;
     		                    if(pe != -1)
     		                    {
     		                         value = this.decode(str.substring(ps, pe));
     		                         ps = pe;
     		                    }
     		                    else
     		                    {
     		                         pe = str.length - 1;
     		                         value = this.decode(str.substring(ps, pe));
     		                         ps = pe;
     		                    }
     		               }
		               }
		          }
		          attributes[name] = value;
		          ps = str.indexOf(' ', ps);
		          ps_ = str.indexOf("\t", ps);
		          if((ps_ != -1 && ps_<ps) || (ps_>ps && ps==-1)) ps = ps_;
		          if(ps == -1) break;
		     }
		     return attributes;
		}
		allXMLDoc.prototype.getNode = function(key, el)
		{
			var str = '';
			var val = new Array();
			var sp = 0;
			var tep = 0;
			var tsp = 0;
			var ep = 0;
			var sp_ = 0;
			var ep_ = 0;
			var arrFlag = true;
			var tag = null;
			var val_pos = 0;
			var isFindClose = true;
			var flagStart = true;
			var flagEnd = true;
			count = 0;
			arrFlag = true;
			str = el.content;
			sp = this.findNextElement(sp_, key, str);
			if(sp == null) return null;
			ep = str.indexOf('/>', sp);
			if(ep > str.indexOf('>', sp)) ep = -1;
			if(ep != -1) isFindClose = false;
			if(ep == -1 && str.indexOf('</' + key + '>', sp) == -1) return null;
		     tsp = sp;
		     sp = str.indexOf('>', sp) + 1;
			if(isFindClose)
			{
			     ep = str.indexOf('</' + key + '>', sp);
			}
			sp_ = sp;
			while(arrFlag == true)
			{
			     if(isFindClose)
			     {
			           ep = this.findClose(sp, ep, key, str, 0);
			           if(ep == null) break;
			     }
			     val_pos = val.length;
				if(ep >= sp)
				{
				     val[val_pos] = new allXMLElement();
				     tep = str.indexOf('>', tsp) + 1;
				     val[val_pos].attributes = this.getAttributes(str.substring(tsp, tep));
				     sp_ = str.indexOf('/', tsp);
				     if(sp_ != -1 && sp_ < tep) tep = sp_;
				     //alert(tsp);
				     sp_ = str.indexOf(' ', tsp);
				     if(sp_ != -1 && sp_ < tep) tep = sp_;
				     val[val_pos].name = str.substring((tsp + 1), tep);
				     val[val_pos].content = isFindClose?str.substring(sp, ep):'';
				}
				sp = this.findNextElement(ep, key, str);
				if(sp == null) break;
				ep = str.indexOf('/>', sp);
				if(ep > str.indexOf('>', sp)) ep = -1;
				if(ep != -1) isFindClose = false;
				if(ep != -1 && str.indexOf('</' + key + '>') == -1) continue;
				else
				{
				     tsp = sp;
				     sp = str.indexOf('>', sp) + 1;
				}
				if(isFindClose) ep = str.indexOf('</' + key + '>', sp);
			}
			return (val.length == 0?null:val);
		}
		allXMLDoc.prototype.getAllByName = function(name)
		{
			var f = new Array();
			var str = this.doc;
			var sp = 0;
			var ep = 0;
			var flag = true;
			while(flag == true)
			{
				sp = str.indexOf('<'+name+'>', sp);
				if(sp == -1) break;
				else sp = sp + 18;
				ep = str.indexOf('</'+name+'>', sp);
				if(ep == -1) break;
				f[f.length] = str.substring(sp, ep);
			}
			return f;
		}
		allXMLDoc.prototype.decode = function(str)
		{
		     str = this.replace('&quot;', '"', str);
		     str = this.replace('&lt;', '<', str);
		     str = this.replace('&gt;', '>', str);
		     
		     str = this.replace('&amp;', '&', str);
		     
		     return str;
		}
		allXMLDoc.prototype.replace = function(obj, target, str)
		{
		     var ps = 0;
		     ps = str.indexOf(obj, ps);
		     while(ps != -1)
		     {
		          str = str.substr(0, ps) + '' + target + '' + str.substr(ps + obj.length);
		          ps = str.indexOf(obj, (ps + target.length));
		     }
		     return str;
		}
		allXMLDoc.prototype.ToString = function()
		{
			return this.doc;
		}
		
		function allXMLElement()
		{
		     this.name=null;
		     this.attributes = null;
		     this.content = null;
		}
		///////////////////////////////////
		///////                   /////////
		///////  class  XML       /////////
		///////                   /////////
		///////////////////////////////////
		
		
		///////////////////////////////////
		///////                   /////////
		///////  JsHttpRequest    /////////
		///////                   /////////
		///////////////////////////////////
		var JsHttpRequest_script_container = new Array();
		var JsHttpRequest_script_container_id = 0;
		var JsHttpRequest_response_container = new Array();
		
		function JsHttpRequest()
		{
			this.JsHttpRequestName = 'JsHttpRequest';
			this.uid = 0;
			this.readyState_enum = new Array('Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete');
			this.readyState = 0;
			this.status_enum = new Array(/*OK:*/ 200, /*Created:*/ 201, /*Accepted:*/ 202, /*NoContent:*/ 204, /*BadRequest:*/ 400, /*Forbidden:*/ 403, /*NotFound:*/ 404, /*Gone:*/ 410, /*ServerError:*/ 500);
			this.status = null;
			this.onreadystatechange = null;
			this.timer = null;
			
			this.url = null;
			this.conn = null;
			
			this.responseText = null;
			
			this.date = null;
		}
		
		JsHttpRequest.prototype.jsValueToXml = function()
		{
			this.responseText = JsHttpRequest_response_container[uid];
			debug(' ------ ' + this.responseText);
			if(JsHttpRequest_response_container[uid] != null)
			{
					JsHttpRequest_response_container[uid] = null;
					this.conn.src = '';
					JsHttpRequest_script_container[this.conn.id] = true;
			}
		}
		
		JsHttpRequest.prototype.createScript = function()
		{
			var s = document.createElement( 'script' );
			s.id = (this.JsHttpRequestName + '_' + Math.round(Math.random() * 999999999) + '_js');
			s.type='application/x-javascript';
			document.body.appendChild( s );
			return s;
		}
		
		JsHttpRequest.prototype.getScript = function()
		{
			var flg = true;
			var obj = null;
			var scr = null;
			var i = 0;
			
			while(flg == true)
			{
				try
				{
					obj = document.getElementById(this.JsHttpRequestName + (i==0?'':('_'+i)));
					if(obj == null)
					{
						flg = false;
						scr = null;
						break;
					}
				}
				catch(e)
				{
					flg = false;
					scr = null;
					break;
				}
				
				if(i > 0)
				{
					try
					{
						scr = document.getElementById(this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1))) + '_js');
						if(scr != null && JsHttpRequest_script_container[(this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1))) + '_js')] == true)
						{
							i = i - 1;
							obj = document.getElementById(this.JsHttpRequestName + (i==0?'':('_'+i)));
							break;
						}
						else scr = null;
					}
					catch(e)
					{
						scr = null;
					}
				}
				i++;
			}
			
			if(i > 0) obj = document.getElementById(this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1))));
			if(obj == null) return null;
			if(scr == null)
			{
				obj.innerHTML = '<div id="' + (this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1)))) + '_container">a<script id="' + (this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1)))) + '_js" language="javascript"></script></div><div id="' + this.JsHttpRequestName + '_' + i + '"></div>';
				try
				{
					scr = document.getElementById(this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1))) + '_js');
					JsHttpRequest_script_container[(this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1))) + '_js')] = false;
				}
				catch(e)
				{
				}
			}
			else
			{
				obj = document.getElementById(this.JsHttpRequestName + (i==0?'':('_'+i)) + '_container');
				obj.innerHTML = 'a<script id="' + (this.JsHttpRequestName + (i==0?'':('_'+i))) + '_js" language="javascript" type="text/javascript"></script>';
				scr = document.getElementById(this.JsHttpRequestName + (i==0?'':('_'+i)) + '_js');
				JsHttpRequest_script_container[(this.JsHttpRequestName + (i==0?'':('_'+i)) + '_js')] = false;
			}
			
			return scr;
		}
		
		JsHttpRequest.prototype.getIFrame = function()
		{
			var flg = true;
			var obj = null;
			var scr = null;
			var i = 0;
			
			while(flg == true)
			{
				try
				{
					obj = document.getElementById(this.JsHttpRequestName + (i==0?'':('_'+i)));
					if(obj == null)
					{
						flg = false;
						scr = null;
						break;
					}
				}
				catch(e)
				{
					flg = false;
					scr = null;
					break;
				}
				
				if(i > 0)
				{
					try
					{
						scr = document.getElementById(this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1))) + '_iframe');
						if(scr != null && JsHttpRequest_script_container[(this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1))) + '_iframe')] == true)
						{
							i = i - 1;
							obj = document.getElementById(this.JsHttpRequestName + (i==0?'':('_'+i)));
							break;
						}
						else scr = null;
					}
					catch(e)
					{
						scr = null;
					}
				}
				i++;
			}
			
			if(i > 0) obj = document.getElementById(this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1))));
			if(obj == null) return null;
			if(scr == null)
			{
				obj.innerHTML = '<div id="' + (this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1)))) + '_container">a<iframe name="' + (this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1)))) + '_iframe" id="' + (this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1)))) + '_iframe" width="1" height="1"></iframe></div><div id="' + this.JsHttpRequestName + '_' + i + '"></div>';
				try
				{
					scr = document.getElementById(this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1))) + '_iframe');
					JsHttpRequest_script_container[(this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1))) + '_iframe')] = false;
				}
				catch(e)
				{
				}
			}
			else
			{
				//obj = document.getElementById(this.JsHttpRequestName + (i==0?'':('_'+i)) + '_container');
				//obj.innerHTML = 'a<iframe id="' + (this.JsHttpRequestName + ((i-1)==0?'':('_'+(i-1)))) + '_iframe" width="1" height="1"></iframe>';
				scr = document.getElementById(this.JsHttpRequestName + (i==0?'':('_'+i)) + '_iframe');
				JsHttpRequest_script_container[(this.JsHttpRequestName + (i==0?'':('_'+i)) + '_iframe')] = false;
			}
			
			return scr;
		}
		
		JsHttpRequest.prototype.open = function(request_type, url_adress, asinhr)
		{
			
			
			this.conn = this.getIFrame();//scr;
			this.url = url_adress;
			
		}
		
		JsHttpRequest.prototype.send = function(request)
		{
			if(this.conn != null)
			{
				this.uid = null;
				while(this.uid == null)
				{
					this.uid = Math.round(Math.random() * 999999999);
					try
					{
					if(eval('JsHttpRequest_JsResponseFromServer_' + this.uid + ' == null')) eval('JsHttpRequest_JsResponseFromServer_' + this.uid + ' = false;');
					if(eval('JsHttpRequest_JsResponseFromServer_' + this.uid + ' == undefined') || eval('JsHttpRequest_JsResponseFromServer_' + this.uid + ' == false')) break;
					}
					catch(e)
					{
					}
				}
				this.conn.src = this.url + '&JsHttpRequest_JsResponseFromServer_uid=' + this.uid;//
				
				debug(this.uid + '  -  ' + this.conn.src);
				this.readyState = 1;
				this.date = new Date();
				this.timer = setInterval(('JsHttpRequest_check_response(' + this.uid + ')'), 1000);
			}
		}
		
		function JsHttpRequest_check_response(uid)
		{
		
			var str = null;
			var flg = true;
			if(JsHttpRequest_response_container[uid] == undefined || JsHttpRequest_response_container[uid] == null) flg = false;

			for(var i in allAJAX_requests)
			{
				if(allAJAX_requests[i] != null && allAJAX_requests[i].status == 1 && allAJAX_requests[i].conn != null)
				{
					try
					{
						if(allAJAX_requests[i].conn.uid == uid)
						{
							if(allAJAX_requests[i].conn.date != null)
								if((allAJAX_requests[i].conn.date + 60) < (new Date()) && !flg)
								{
									clearInterval(allAJAX_requests[i].conn.timer);
									allAJAX_requests[i].conn.onreadystatechange();
								}
							if(!flg) return false;
							clearInterval(allAJAX_requests[i].conn.timer);
							allAJAX_requests[i].conn.responseText = JsHttpRequest_response_container[uid];//responseToXml();
							//debug(allAJAX_requests[i].conn.responseText);
							allAJAX_requests[i].conn.src = '';
							JsHttpRequest_response_container[uid] = null;
							JsHttpRequest_script_container[uid] = true;
							allAJAX_requests[i].conn.readyState = 4;
							allAJAX_requests[i].conn.status = 200;
							allAJAX_requests[i].conn.onreadystatechange();
						}
					}
					catch(e)
					{
						
					}
				}
			}
			
		}
		
		function JsHttpRequest_init()
		{
			document.open('text/html');
			document.write('<div id="' + (new JsHttpRequest()).JsHttpRequestName + '" style="display: none;"></div>');
			document.close();
		}
		
		function JsHttpRequest_response_container_setValue(uid, value)
		{
			JsHttpRequest_response_container[uid] = value;
			debug(JsHttpRequest_response_container[uid]);
		}
		JsHttpRequest_init();
		
		///////////////////////////////////
		///////                   /////////
		///////  JsHttpRequest    /////////
		///////                   /////////
		///////////////////////////////////

		
		///////////////////////////////////
		///////                   /////////
		///////   class  AJAX     /////////
		///////                   /////////
		///////////////////////////////////
		function allAJAX(url)
		{
		     if(url == undefined || url == null) url = '';
			this.conn = null;
			this.url = url;
			this.params = new Array();
			this.response = null;
			this.callback = null;
			this.status = 0;
			this.sTime = 0;
			this.method = 'GET';
			this.Request = allAJAX_createConnection;
		}
		
		function allAJAX_createConnection()
		{
			var request;
			if(!this.conn || this.conn == null)
			{
				try {
					request = new XMLHttpRequest();
				} catch (trymicrosoft) {
					try {
						request = new ActiveXObject("Msxml2.XMLHTTP");
					} catch (othermicrosoft) {
						try {
						request = new ActiveXObject("Microsoft.XMLHTTP");
						} catch (js) {
							/*try
							{
								request = new JsHttpRequest();
							}
							catch(failed)
							{
								request = false;
							}*/
							request = false;
						}
					}
				}
			}
			else request = this.conn;
			
			//request = new JsHttpRequest();
			var d = 0;
			for(d in request)
			{
				
			}
			if (!request)
			{
				alert("Error initializing AJAX!");
				return false;
			}
			
			var postData = null;
			var params = '';
		     postData = new PostData();
			var cx = 0;
			for(var j in this.params)
			{
			     if(typeof(this.params[j]) == 'object')
			     {
			          for(var xj in this.params[j])
			          {
          				postData.Add(j, this.params[j][xj]);
          				cx++;
			          }
			     }
			     else
			     {
     				postData.Add(j, this.params[j]);
     				cx++;
			     }
			}
		     
			if(this.method == 'GET' || this.method=='get')
			{
			     params = postData.toPostString();
			     if(params !='')
     			{
     				this.url += (this.url.indexOf('?') != -1?'&':'?') + params + (additionalParam != ''?('&' + additionalParam):'');
     			}
     			else
     			{
     				this.url += (additionalParam != ''?((this.url.indexOf('?') != -1?'&':'?') + additionalParam):'');
     			}
			}
			
			try
			{
     			this.status = 1;
     			request.open(this.method, (this.url + (params == ''?(this.url.indexOf('?') != -1?'&':'?'):'&') + 'tuid=' + Math.round(Math.random() * 9999999999) + '-' + Math.round(Math.random() *9999999999)), true);
     			request.onreadystatechange = allAJAX_onChangeStatus;
     			if(this.method == 'POST' || this.method=='post') request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
     			if(this.method == 'POST' || this.method=='post') request.send(postData.toPostString());
     			else request.send(null);
     			this.conn = request;
     			this.sTime = new Date();
			}
			catch(e)
			{}
		}
		function allAJAX_onChangeStatus()
		{
			try
			{
				for(var i in allAJAX_requests)
				{
					if(allAJAX_requests[i] != null && allAJAX_requests[i].status == 1 && allAJAX_requests[i].conn != null)
					{
						if (allAJAX_requests[i].conn.readyState == 4)
						{
							if (allAJAX_requests[i].conn.status == 200 && allAJAX_requests[i].status == 1)
							{
								allAJAX_requests[i].status = 0;
								allAJAX_requests[i].response = new allXMLDoc(allAJAX_requests[i].conn.responseText);
								var XML = allAJAX_requests[i].response;
                                        XML.doc = allReplace('<'+'?xml version="1.0" encoding="UTF-8"?>', '', XML.doc);
								if(allAJAX_requests[i].response.getFirstElementByPath('root/error') == null)
								{
									if(allAJAX_requests[i].callback != null) eval(allAJAX_requests[i].callback + "(XML)");
								}
								/*var fcb = allAJAX_requests[i].response.getAllCallBack();
								if(fcb.length > 0)
								{
									for(var fc in fcb)
									{
										eval(fcb[fc] + "(XML)");
									}
								}*/
							}
							else
							{
								if(allAJAX_requests[i].callback != null) eval(allAJAX_requests[i].callback + '(null)');
							}
							allAJAX_requests[i].status = 0;
						}
						else
						{
							if (allAJAX_requests[i].conn != null && allAJAX_requests[i].conn.readyState < 4)
							{
								if((allAJAX_requests[i].sTime + 60) < (new Date))
								{
									if(allAJAX_requests[i].callback != null) eval(allAJAX_requests[i].callback + '(null)');
									allAJAX_requests[i].status = 0;
								}
							}
						}
					}
				}
			}
			catch (e)
			{}
		}
		
		

          function PostData()
          {
          	this.indx = 0;
          	this.names = new Array();
          	this.values = new Array();
          
          	this.Reset = function() { 
          		this.indx = 0; 
          		this.names = new Array();
          		this.values = new Array();
          	}
          
          	// returns: key1=val&key2=val2&....
          	this.toPostString = function() {
          		var str = "";
          		for (var j=0; j<this.indx; j++) {
          			if (j>0) str += '&';
          			str = str + this.names[j] + '=' + this.values[j];
          		}
          		return str;
          	}
          
          	this.Add = function(name, value) {
          		this.names[this.indx] = name;
          		this.values[this.indx] = encodeURIComponent(value);
          		this.indx++;
          	}
          
          }
		///////////////////////////////////
		///////                   /////////
		///////   class  AJAX     /////////
		///////                   /////////
		///////////////////////////////////
			
		
		

		function allAJAX_getFreeRequest()
		{
			for(var i in allAJAX_requests)
			{
				if(allAJAX_requests[i].status == 0) return i;
			}
			return allAJAX_requests.length;
		}
		
		function print_arr(obj)
		{
			var str = '';
			for(var i in obj) str += "\n" + i + " = " + obj[i];
			return str;
		}
		
		function trace_error(obj)
		{
			print_arr(obj);
		}
		function callback(str)
		{
			if(str != null) alert(str.string());
		}
		function message(obj)
		{
			var m = obj.getValue('root/alert_message');
			for(var i in m)
			{
				alert(m[i]);
			}
		}
		
		
		
		function setInvitation()
		{
			
				var i = allAJAX_getFreeRequest();
				allAJAX_requests[i] = new allAJAX(applicationBaseUrl + 'admin/events_ajax.aspx');
				allAJAX_requests[i].params['setInvitation'] = id;
				allAJAX_requests[i].params['setInvitationType'] = type;
				allAJAX_requests[i].callback = 'setInvitationCallBack';
				allAJAX_requests[i].Request();
		}
		
		
		
		function allDecode(str)
		{
		     str = allReplace('&quot;', '"', str);
		     str = allReplace('&lt;', '<', str);
		     str = allReplace('&gt;', '>', str);
		     
		     str = allReplace('&amp;', '&', str);
		     
		     return str;
		}
		
		function allReplace(obj, target, str)
		{
		     var ps = 0;
		     ps = str.indexOf(obj, ps);
		     while(ps != -1)
		     {
		          str = str.substr(0, ps) + '' + target + '' + str.substr(ps + obj.length);
		          ps = str.indexOf(obj, (ps + target.length));
		     }
		     return str;
		}
		
		function $(id)
		{
		     var obj = null;
		     try
		     {
		        obj = document.getElementById(id);
		     }
		     catch(e)
		     {
		          obj = null;
		     }
		     return obj;
		}
		
		
		
		///////////////////////////////////
		///////                   /////////
		///////  class  Progress  /////////
		///////                   /////////
		///////////////////////////////////
		
		
		function AlProgressBar_Engine()
		{
		     this.text = 'Please wait...';
		     this.top = 0;
		     this.left = 0;
		     this.width = '300px';
		     this.height = '150px';
		     this.html = '<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%; border: 1px solid #408E32; background: #FFEED0;">\
		                       <tr>\
		                            <td colspan="2" align="right"><a href="javascript:AlProgressBar.hide();" style="text-decoration: none; color: #F36B2A;">[ &times; ]</a> &nbsp; </td>\
		                       </tr>\
		                       <tr style="height: 100%">\
		                            <td style="padding: 5px;">\
		                                 &nbsp;&nbsp; <img alt="" src="../images/progress_ajax.gif" border="0" />\
		                            </td>\
		                            <td style="padding: 5px; font-size: 18px; font-weight: 700;">\
		                                 &nbsp; Please wait...\
		                            </td>\
		                       </tr>\
		                       </table>';
		     this.container = null;
		}
		AlProgressBar_Engine.prototype.init = function ()
		{
		     document.open('text/html');
		     document.write('<div id="AlProgressBar_c" style="display: none; z-index: 1000; position:absolute;"></div>');
		     document.close();
		     this.container = document.getElementById('AlProgressBar_c');
		}
		AlProgressBar_Engine.prototype.show = function ()
		{
		     try{
		     $('content_menu_tree').style.display = 'none';
		     $('content_container').style.display = 'none';
		     $('standart_form').style.display = 'none';
		     } catch(e) {}
		     
		     
               var posTop = window.pageYOffset != undefined && window.pageYOffset != null?window.pageYOffset:document.body.scrollTop;
               var posLeft = window.pageXOffset != undefined && window.pageXOffset != null?window.pageXOffset:document.body.scrollLeft;
		     if(this.top == 0) this.container.style.top = posTop + (screen.height/2 - 150 - parseInt(this.height)/2) + 'px';
		     else this.container.style.top = this.top;
		     if(this.left == 0) this.container.style.left = posLeft + (screen.width/2 - parseInt(this.width)/2 - 10) + 'px';
		     else this.container.style.left = this.left;
		     
		     this.container.style.width = this.width;
		     this.container.style.height = this.height;
		     if(this.html != '') this.container.innerHTML = this.html;
		     else this.container.innerHTML = this.text;
		     this.container.style.display = 'block';
		     
		}
		AlProgressBar_Engine.prototype.hide = function ()
		{
		     try{
		     $('content_menu_tree').style.display = 'block';
		     $(display_form).style.display = 'block';
		     } catch(e) {}
		     this.container.style.display = 'none';
		}
		
		var AlProgressBar = new AlProgressBar_Engine();
		AlProgressBar.init();
		
		///////////////////////////////////
		///////                    ////////
		///////      Debug         ////////
		///////                    ////////
		///////////////////////////////////
		
		
		var myDebugWindow = null;
		var isRuningDebug = false;
		var isActiveDebug = false;
		
		function debug(str)
		{
			if (!isActiveDebug)
				return false;
			
			if(myDebugWindow == null)
			{
				try
				{
					myDebugWindow = window.open('', ('myDebugWindow'), 'width=800,height=800,toolbar=0,status=1,location=0,menubar=0,scrollbars=1');
				
					var doc = myDebugWindow.document;
					doc.open('text/html');
					doc.write('<html><head><title>Debud</title></head><body style="background-color:#1e4060; padding: 0px; margin: 0px;"><table cellspacing="0" cellpadding="0" border="0" style="width: 100%; height: 100%; background-color:#1e4060;"><tr><td style="height: 10px; background-color:#1e4060;">&nbsp;</td></tr><tr><td id="content" style="color: #082F66; font-size: 10pt; background-color: #BBC5D2; padding-left: 10px; padding-bottom: 20px; font-family: Arial,Verdana,Helvetica; font-weight: bold;" valign="top"></td></tr><tr><td style="height: 10px;">&nbsp;<input type="button" name="stst" id="stst" value="STOP &times;" onclick="opener.debugStartStop()" /> <input type="button" name="cl" id="cl" value="CLEAR" onclick="opener.debugClear()" /></td></tr></table></body></html>');
					doc.close();
					isRuningDebug = true;
				}
				catch(e)
				{
					try
					{
						myDebugWindow.close();
					}
					catch(e)
					{
					}
					myDebugWindow = null;
					isRuningDebug = false;
					return;
				}
			}
				
			try
			{
				if(isRuningDebug)
				{
					//str = str.Replace('<', '&lt;');
					str = str_replace('<', '&lt;', str);
					//str = str.Replace('>', '&rt;');
					str = str_replace('>', '&gt;', str);
					str = str_replace('\n', '\n<br>', str);
					myDebugWindow.document.getElementById('content').innerHTML += '<br><hr><br>'+str;
					myDebugWindow.document.body.scrollTop += 100;
				}
			}
			catch(e)
			{
				myDebugWindow = null;
				isRuningDebug = false;
			}
			
		}
		
		function debugStartStop()
		{
			if(isRuningDebug)
			{
				isRuningDebug = false;
				myDebugWindow.document.getElementById('stst').value = 'START >>';
			}
			else
			{
				isRuningDebug = true;
				myDebugWindow.document.getElementById('stst').value = 'STOP [x]';
			}
		}
		
		function debugClear()
		{
			myDebugWindow.document.getElementById('content').innerHTML = '';
		}
		
		function str_replace(chto, nachto, gde)
		{
			var tmp = gde.split(chto);
			gde = '';
			for(var i = 0; i < tmp.length; i++)
				if(i != (tmp.length-1)) gde += tmp[i] + nachto;
				else gde += tmp[i];
				
			return gde;
		}
		
		function _confirm(str)
		{
		     if(!confirm(str + "\n\n" + ' continue?')) return false;
		     else return true;
		}
		
		///////////////////////////////////
		///////                    ////////
		///////      Debug         ////////
		///////                    ////////
		///////////////////////////////////

