function loadXMLDoc(url) 
{
xmlhttp=null
// code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest()
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=onResponse;
  xmlhttp.open("GET",url,true);
  xmlhttp.send(null);
  }
else
  {
  alert("Your browser does not support XMLHTTP.")
  }
}

function checkReadyState(obj)
{
  if(obj.readyState == 4)
  {
    if(obj.status == 200)
    {
      return true;
    }
    else
    {
      alert("Problem retrieving XML data");
    }
  }
}

function onResponse() 
{
  if(checkReadyState(xmlhttp))
  {
  var response = xmlhttp.responseXML.documentElement;
  txt="<table id='tmap'>"
  x=response.getElementsByTagName("STATE")
  for (i=0;i<x.length;i++)
    {
    xx=x[i].getElementsByTagName("SNAME")
      {
      try
        {
        txt=txt + "<caption>" + xx[0].firstChild.data + "</caption>"
        }
      catch (er)
        {
        txt=txt + "<caption> </caption>"
        }
      }
		}
	txt=txt + "<tr> <th> County </th> <th> Constituents </th> </tr>"
  x=response.getElementsByTagName("COUNTY")
  for (i=0;i<x.length;i++)
    {
    txt=txt + "<tr>"
    xx=x[i].getElementsByTagName("NAME")
      {
      try
        {
        txt=txt + "<td id='one'>" + xx[0].firstChild.data + "</td>"
        }
      catch (er)
        {
        txt=txt + "<td id='one'> </td>"
        }
      }
    xx=x[i].getElementsByTagName("NUMBER")
      {
      try
        {
        txt=txt + "<td id='two'>" + xx[0].firstChild.data + "</td>"
        }
      catch (er)
        {
        txt=txt + "<td id='two'> </td>"
        }
      }
    txt=txt + "</tr>"
    }
  txt=txt + "</table><br />"
  x=response.getElementsByTagName("CONSTITS")
  for (i=0;i<x.length;i++)
    {
    xx=x[i].getElementsByTagName("TOTAL")
      {
      try
        {
        txt=txt + "<h2>Total constituents in this state: " + xx[0].firstChild.data + "</h2>"
        }
      catch (er)
        {
        txt=txt + "<h2> </h2>"
        }
      }
		}
  document.getElementById('copy').innerHTML=txt
  }
}
