
function getXmlHttpObject()
{
  var xmlHttp=null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}

var xmlHttp = getXmlHttpObject();

var browser = navigator.appName;

function handleResponse(div) {
	if(xmlHttp.status == 200){
		document.getElementById(div).innerHTML = xmlHttp.responseText;
	}
}

function LoadPagePart(act,div)
{
	xmlHttp.open('get','LoadContent.php?content='+act,false);
	xmlHttp.send(null);
	
	if(browser == "Microsoft Internet Explorer")
	{
		handleResponse(div);
	}
	else
	{
		xmlHttp.onreadystatechange = handleResponse(div);	
	}
}

function RestoreBodyMain()
{
	document.getElementById("mainPage").innerHTML = "<div id=\"first\"><hr /></div><div id=\"second\"><hr /></div><div id=\"third\"></div></div>";
}
