//Get an HTTPRequest Object depending on browser
if(window.XMLHttpRequest)
{
	HRObject = new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
	HRObject = new ActiveXObject("Microsoft.XMLHTTP");
}
function getModuleData(destId, appRootPath, callerId)
{
	if(destId == null || destId == "")
	{
		alert("Invalid Destinatin Id");
		return false;
	}
	if(appRootPath == null || appRootPath == "")
	{
		alert("Invalid Path");
		return false;
	}
	var data;
	HRObject.open("POST", "/scripts/php/moduleDataHandler.php", false);
	HRObject.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	HRObject.send("path=" + appRootPath + "&callerId=" + callerId);
	if((HRObject.readyState == 4) && (HRObject.status == 200))
	{
		if(HRObject.responseText != "")
		{
			addModuleData(destId, HRObject.responseText);
			return true;
		}
		else
		{
			addModuleData(destId, "No data to display");
		}
	}
	alert("Request Failed");
	return false;
	
}
function addModuleData(destId, html)
{
	var dest = document.getElementById(destId);
	if(dest != null)
	{
		dest.innerHTML = html;
	}
}

