var xmlHttp1;
var xmlHttp1_message;

function stateChanged1() 
 { 
  if (xmlHttp1.readyState==4)
   { 
    document.getElementById("cald").innerHTML=xmlHttp1.responseText;
   }
 }

function GetXmlHttpObject1()
 {
  var xmlHttp1=null;
  try
   {
    // Firefox, Opera 8.0+, Safari
    xmlHttp1=new XMLHttpRequest();
   }
  catch (e1)
   {
    // Internet Explorer
    try
     {
      xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
     }
    catch (e2)
     {
      xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
     }
   }
  return xmlHttp1;
 }

function goLastMonth(m, y, lng)
 { 
  var month;
  var year;
  if(m == "1") 
   { 
    year = parseInt(y, 10)-1;
    month = 12; 
   } 
  else
   {
    month = parseInt(m, 10)-1; 
    year = y;
   }
  //alert(month + " " + year);
  xmlHttp1=GetXmlHttpObject1();
  if (xmlHttp1===null)
   {
    return;
   } 
  var url="";
  url="getmonth.php";
  url=url+"?sid="+Math.random() + "&month=" + month + "&year=" + year + "&lng=" + lng;
  xmlHttp1.onreadystatechange=stateChanged1;
  xmlHttp1.open("GET",url,true);
  xmlHttp1.send(null);  
 }