var xmlHttp

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;
}

function getMaxId()
{
  var strURL="staff-calendar_id_get.php";
  var req = GetXmlHttpObject();
  req.open("GET", strURL, false); //third parameter is set to false here
  req.send(null);
  return req.responseText;
}