// JavaScript Document

function creat_Object()
{ 
var xmlhttp;
// This if condition for Firefox and Opera Browsers 
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
{
try 
{
xmlhttp = new XMLHttpRequest();
} 
catch (e) 
{
alert("Your browser is not supporting XMLHTTPRequest");
xmlhttp = false;
}
}
// else condition for ie
else
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlhttp;
}

var request = creat_Object();
function update_calendar()
{
if(request.readyState == 1)
{
document.getElementById('eventscalendar').innerHTML='';
document.getElementById('eventscalendar').innerHTML = 'Loading...';
}
if(request.readyState == 4)
{
var answer = request.responseText;
document.getElementById('eventscalendar').innerHTML='';
document.getElementById('eventscalendar').innerHTML = answer;
}
}
function change_week(week)
{
request.open("GET", "MODULES/events_calendar.asp?week=" + week + "&nocache=" + new Date().getTime()); 
request.onreadystatechange = update_calendar;
request.send('');

}