var xmlhttp;
var gResp="";
var gAct="";
function loadXMLDoc(url,act,resp)
{
	gAct = act;
	gResp = resp;
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
  {
	  xmlhttp=new XMLHttpRequest();
	  xmlhttp.onreadystatechange=state_Change;
	  xmlhttp.open("GET",url,true);
	  xmlhttp.send(null);
  }
	// code for IE
	else if (window.ActiveXObject)
  {
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		if (xmlhttp)
    {
	    xmlhttp.onreadystatechange=state_Change;
	    xmlhttp.open("GET",url,true);
	    xmlhttp.send();
    }
  }
}

function state_Change()
{
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	{
	  // if "OK"
	  if (xmlhttp.status==200)
	  {
	  	document.getElementById(gResp).innerHTML = xmlhttp.responseText;
	  	eval(gAct);
	  }
	  else
	  {
		  alert('Problem retrieving data:' + xmlhttp.statusText);
		}
	}
}

// loadXMLDoc('test_xmlhttp.txt')