// Source Script from Vn4U website : www.vn4u.net
// Add to Script BmT 3.1
// wWw.MinhThanh.Net
	var req;
	var url;
	function Initialize()
	{
		try
		{
			req=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				req=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(oc)
			{
				req=null;
			}
		}
	
		if(!req&&typeof XMLHttpRequest!="undefined")
		{
			req=new XMLHttpRequest();
		}
	
	}
	function Processing(name)
	{
		obj = document.getElementById(name);
		obj.innerHTML = '<center><img border=0 src="images/load.gif" align="absbottom"></center><br>';
	}
		function DisplayContent(name)
	{
		obj = document.getElementById(name);
		obj.innerHTML = req.responseText;
	}
	function SendQuery(url,callbackFunction,method,cache,request)
	{
			Initialize();
		if ( (req!=null) )
		{		
			req.onreadystatechange = function()
									{
									// only if req shows "complete"
										if (req.readyState == 4)
									    {
								        // only if "OK"
											if (req.status == 200)
											{
												// Process
												eval(callbackFunction);
											}
										}
									};
					
						
			// Cache data or not , default is yes(1)
	

			if ( cache != 1 )
			{
				url += "&rand="+Math.random()*1000;

			}
			
			// Use POST or GET method , default is GET
			if ( method == 'POST' )
			{
		        req.open("POST", url, true);
		        req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		        req.send(request);
			}
			else
			{										
				req.open("GET", url , true);
				req.send(null);
			}
		}
	}

