var xmlHttp

function ShowCalendar(accomid) {
if (accomid.length==0)  { 
  document.getElementById("bookingcalendar").innerHTML="Error accommodation ID not specified.";
  return;
}
  
ajax=GetXmlHttpObject();
if (ajax==null)  {
  alert ("Sorry your browser does not support AJAX!");
  return;
} 

ajax.open("POST", "../functions/ajaxcalendar.php", true);
ajax.setRequestHeader('Content-type','application/x-www-form-urlencoded;charset=UTF-8;');
ajax.onreadystatechange= function () {
	if ((ajax.readyState==4) && (ajax.status == 200))
		document.getElementById("bookingcalendar").innerHTML=ajax.responseText;
}

postvars="accomid="+accomid;
ajax.send(postvars);
} 

function StateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("bookingcalendar").innerHTML=xmlHttp.responseText;
}
}

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