var url = "/arch.php?month="; 
var http = getHTTPObject();
var progresspic = "<img src=/images/site/progress.gif alt='' border=0 />";
var resid = "";
function handleHttpResponse() {
  if (http.readyState == 4) {
    results = http.responseText;
	if(resid != "")
	    document.getElementById(resid).innerHTML = results;
  }
}
function ajaxreq(id,url2,hideprogress) {
  if (hideprogress == 0)
  {
	  document.getElementById(id).innerHTML = progresspic;
  }
  http.open("GET", url2 , true);
  resid = id;
  http.onreadystatechange = handleHttpResponse;
  http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
  http.send(null);
}
function ajaxrequest(id,param1,param2,hideprogress) {
  if (hideprogress == 0)
  {
	  document.getElementById(id).innerHTML = progresspic;
  }
  http.open("GET", url + param1 + "&year=" + param2, true);
  resid = id;
  http.onreadystatechange = handleHttpResponse;
  http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
  http.send(null);
}

function getHTTPObject() {
  var xmlhttp;
  if (window.XMLHttpRequest)
  {
    xmlhttp=new XMLHttpRequest();
  }
  else if (window.ActiveXObject)
  {
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
  else
    xmlhttp = false;
  return xmlhttp;
}

function showhideajax(id, month, year) 
{ 
	if (document.getElementById(id).style.display == 'none')
	{
		document.getElementById(id).style.display = 'block';
		ajaxrequest(id,month,year,0);
	} 
	else 
	{
		document.getElementById(id).style.display = 'none';	
		document.getElementById(id).innerHTML = '';
 	}	

}

