function stateChanged_month()
{ if(xmlHttp.readyState==4)
    { document.getElementById("load_calendar").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;
}

function goMonth(month,year,NextOrPre)
{ if( NextOrPre == 'previous' )
    { /*If the month is January, decrement the year. */
      if(month == 1) {--year; month = 13;}
      month = month-1;
     }
  else
    if( NextOrPre == 'next' )
      { /*If the month is December, increment the year. */
	if(month == 12) {++year; month = 0;}
	month = month+1;
      }

  xmlHttp=GetXmlHttpObject();
  if (xmlHttp===null){alert ("Your browser does not support AJAX!");return;}
  var url='/includes/left-section/calendar/calendar.php?month='+month+'&year='+year+'&' +Math.random();
  xmlHttp.onreadystatechange=stateChanged_month;
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  //document.location.href = 'calendar.php?month='+(month-1)+'&year='+year+'&form='+form+'&field='+field;
}

