var xmlHttp=null;
function toggle(mdiv){
	if (mdiv == "calendar") {
		document.getElementById("calendar").style.display = "block";
		document.getElementById("calendartitle").style.display = "none";
	}

} 
function showCalendar(str) {
    var url="home_cal.php";
    if (str.length == 0){ 
        document.getElementById("calendar").innerHTML="";
        return;
    }
    xmlHttp=GetXmlHttpObject();
    if (xmlHttp==null){
        alert ("Your browser does not support AJAX!");
        return;
    }
    else {   
        url=url+"?m="+str;
        xmlHttp.onreadystatechange=stateChanged;
        xmlHttp.open("GET",url,true);
        xmlHttp.send(null);
    }
}

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

function GetXmlHttpObject()
{
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;
}


