function createRequestObject()
{
	var ro;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer")
	{
		ro = new ActiveXObject("Microsoft.XMLHTTP");
	}
	else
	{
		ro = new XMLHttpRequest();
	}
	return ro;
}

function sendRequest(pagePath,handlerFunction,args)
{
	var http = createRequestObject();
	http.open('get',pagePath);
	http.onreadystatechange =
		function()
		{
			if(http.readyState == 4)
			{
				function_name = handlerFunction+'(http,args)';
				eval(function_name);
			}
		}
	http.send(null);
}

function postRequest(url, post_data, handlerFunction, args) 
{
	http = false;
	if (window.XMLHttpRequest) 
	{ // Mozilla, Safari,...
		http = new XMLHttpRequest();
		if (http.overrideMimeType) 
		{
			// set type accordingly to anticipated content type
			//http_request.overrideMimeType('text/xml');
			http.overrideMimeType('text/html');
		}
	} 
	else if (window.ActiveXObject) 
	{ // IE
		try 
		{
			http= new ActiveXObject("Msxml2.XMLHTTP");
		} 
		catch (e) 
		{
			try 
			{
				http = new ActiveXObject("Microsoft.XMLHTTP");
			} 
			catch (e) {}
		}
	}
	if (!http) 
	{
		alert('Cannot create XMLHTTP instance');
		return false;
	}

	http.onreadystatechange =
		function()
		{
			if(http.readyState == 4)
			{
				function_name = handlerFunction+'(http,args)';
				eval(function_name);
			}
		}
	http.open('POST', url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", post_data.length);
	http.setRequestHeader("Connection", "close");
	http.send(post_data);
}

function setContent(http,args)
{
	//this is a handler to receive content & load it into a page element
	var response = http.responseText;
	var div= document.getElementById(args);
	div.innerHTML=response;
}
