function getXMLHttp()
{
  var xmlHttp

  try
  {
    //Firefox, Opera 8.0+, Safari
    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {
    //Internet Explorer
    try
    {
      xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
    }
    catch(e)
    {
      try
      {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
      catch(e)
      {
        return false;
      }
    }
  }
  return xmlHttp;
}

function MakeRequest(n)
{
  var xmlHttp = getXMLHttp();
  var param = "id=" + n;
 
  xmlHttp.open("POST", "counter/counter.php", true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.setRequestHeader("Content-length", param.length);
  xmlHttp.setRequestHeader("Connection", "close");

  xmlHttp.send(param);
}

function HandleResponse(response)
{
  document.getElementById('ResponseDiv').innerHTML = response;
}