function ajax_object() {
  try {
    xhrObj = new XMLHttpRequest();
  } catch (e) {
    try {
      xhrObj=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      xhrObj=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
  
  return xhrObj;
}
function ajax_request(url,callback)
{
  var xhrobj = ajax_object();
  xhrobj.open("GET", url);
  xhrobj.setRequestHeader("X-Requested-With", "XMLHttpRequest"); 
 
  xhrobj.onreadystatechange = function()
  {
    if (xhrobj.readyState == 4 && xhrobj.status == 200)
    {
      if (xhrobj.responseText)
      {
          callback(xhrobj.responseText);
      }
    }
  };
  xhrobj.send(null);
}
