//Original code from calendar to load result.php (event list page)
function ShowWindow(slink_date)
{
		var windowprops = "scrollbars=yes,resizable=1,width=800,height=500";
		var sURL = "result.php?event_date="+slink_date;
		window.open(sURL,"WinPopUp",windowprops);
}
var xmlHttp
function displayCal(month,year)
{
  xmlHttp = GetXmlHttpObject();
  if(xmlHttp)
  {
		var url="calendar_display.php"
		url = url+"?month="+month
		url = url+"&year="+year
		url = url+"&sid="+Math.random()
		xmlHttp.open("GET",url,true)
		xmlHttp.send(null)
		xmlHttp.onreadystatechange = function()
		{
			if(xmlHttp.readyState == 4)
			{
				document.getElementById('calendar').innerHTML = xmlHttp.responseText;
			}
		}
  }
	else
	{
    alert("Browser does not support Ajax");
		return;
	}
}
//Browser test function
function GetXmlHttpObject()
{
	var req = false;
	if(window.XMLHttpRequest && !(window.ActiveXObject))
	{
		try
		{
			req = new XMLHttpRequest();
		}
		catch(e)
		{
			req = false;
		}
	}
	else if(window.ActiveXObject)
	{
		try
		{
			req = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				req = false;
			}
		}
	}
	return req;
}