var xmlhttp;

function getContent(str)
{
	var url="id="+str;
	DataHandler(url,"content");
}

function DataHandler(str,target)
{

	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}

	xmlhttp.id = target;
	xmlhttp.onreadystatechange=stateChanged;
	xmlhttp.open("POST","ContentManager.php",true);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlhttp.send(str);
}

function stateChanged()
{
	if (xmlhttp.readyState==4)
	{
		var id = this.id;
		document.getElementById(id).innerHTML=xmlhttp.responseText;
		// eval(document.getElementById(id).innerHTML);
	}
}

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
	  {
	  // code for IE7+, Firefox, Chrome, Opera, Safari
	  return new XMLHttpRequest();
	  }
	if (window.ActiveXObject)
	  {
	  // code for IE6, IE5
	  return new ActiveXObject("Microsoft.XMLHTTP");
	  }
	return null;
}

