var Ajax = 
{
	xmlhttp:false,
	Response:"",
	CallBack:"",
	Init:function()
	{
		var a = Ajax;
		try 
		{
			a.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try 
			{
				a.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (E) 
			{ 
				a.xmlhttp = false; 
			}
		}
		if (!a.xmlhttp && typeof XMLHttpRequest!='undefined')
		{
			try 
			{
				a.xmlhttp = new XMLHttpRequest();
			} 
			catch (e) 
			{ 
				a.xmlhttp=false; 
			}
		}
		if (!a.xmlhttp && window.createRequest) 
		{
			try 
			{
				a.xmlhttp = window.createRequest();
			} 
			catch (e) 
			{	
				a.xmlhttp=false; 
			}
		}
		return a;
	},
	Send:function(Method,URL,Params)
	{
		var a = Ajax;
		if(typeof Params!="undefined")
		{
			var start = new Date();
			Params = Params+'&t='+start.getTime();
		}
		Method = Method.toUpperCase();
		if(Method == 'GET')
		{
			URL = URL+'?'+Params;
		}
		a.xmlhttp.open(Method,URL,true);
		a.xmlhttp.onreadystatechange = function() 
		{
			if(a.xmlhttp.readyState == 1)
			{
//				alert("Loading "+URL);
			}
			if(a.xmlhttp.readyState == 2)
			{
//				alert(URL+" loaded");
			}
			if(a.xmlhttp.readyState == 3)
			{
//				alert("Interacting with "+URL);
			}
			if(a.xmlhttp.readyState == 4)
			{
				a.Response = a.xmlhttp.responseText;
				if(a.CallBack != '')
				{
					a.CallBack(a.Response);
				}
			}
		}
		a.xmlhttp.setRequestHeader('Accept','message/x-jl-formresult');
		a.xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		a.xmlhttp.setRequestHeader("Content-length", Params.length);
		a.xmlhttp.setRequestHeader("Connection", "close");
		if(typeof Params!="undefined" && Method == 'POST')
		{
			a.xmlhttp.send(Params);
		}
		else
		{
			a.xmlhttp.send(null);
		}
	}
}
