function connect()
{
   var http;
	if(window.XMLHttpRequest)
	{
		http = new XMLHttpRequest();
	}
	else if(window.ActiveXObject)
	{
		http = new ActiveXObject("Microsoft.XMLHTTP");
	}
   return http;
	//if(!http) return false;
}

function getData(url,callback_function,loadingImgTarget,return_xml)
{
	if(loadingImgTarget) addLoadingImg(loadingImgTarget);
	var http=connect();
	http.open("GET", url, true);
	http.onreadystatechange = function()
	{
		if (http.readyState == 4)
		{
			if (http.status == 200)
			{
				if(return_xml)
				{
					eval(callback_function + '(http.responseXML)');
				}
				else
				{
					eval(callback_function + '(http.responseText)');
				}
				http=null;
				delete http;
			}
			else
				alert('There was a problem with the request. Please try again later');
		}
	}
	http.send(null);
	if(loadingImgTarget) removeLoadingImg(loadingImgTarget);
}

function doSearchUser()
{
	var param="q="+encodeURI($("searchuserdialog").value);
	window.location="http://localhost:8080/herd/member/searchuser.php?"+param;
}
