var http = getHTTPObject();
 
function getHTTPObject(){
	var xmlhttp;
	try {    // Firefox, Opera 8.0+, Safari
		xmlhttp = new XMLHttpRequest();    
	} catch (e)	{    // Internet Explorer
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e){
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	return xmlhttp;
}

function sendHttpRequest(url, func){
	/*alert(url);
	http.open("GET", url, true);
	http.onreadystatechange = function(){
		if(http.readyState == 4){
			func(http.responseText);
		}
	}
	http.send(null);*/
	Ajax(url, func, null);
}

function Ajax(szUrl, pfnCallback, szPost)
{
	var http = ( window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest() );
	if( http )
	{
		if( szPost == null ) // get method
		{
			http.open("GET", szUrl);
		}
		else // post method
		{
			http.open("POST", szUrl);
			http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
			http.setRequestHeader("Content-length", szPost.length);
			http.setRequestHeader("Connection", "close");
		}

		http.onreadystatechange = function()
		{
			if( http.readyState == 4 )
			{
				pfnCallback(http.responseText);
			}
		};

		http.send(szPost);
	}
	else
	{
		alert("Your browser does not support AJAX!");
	}
}