function lastUpdate(xmlfile)
{
var xhttp=GetXmlHttpObject()
xhttp.open("GET",xmlfile,false);
xhttp.send(null);
xmlDoc=xhttp.responseXML;
var x=xmlDoc.getElementsByTagName("LastUpdate");
var yr=x[0].getElementsByTagName("Year")[0].childNodes[0].nodeValue;
var mo=x[0].getElementsByTagName("Month")[0].childNodes[0].nodeValue;
var da=x[0].getElementsByTagName("Day")[0].childNodes[0].nodeValue;
return mo + " " + da + ", " + yr
}

function countRows(xmlfile,ID)
{
var xhttp=GetXmlHttpObject();
xhttp.open("GET",xmlfile,false);
xhttp.send(null);
xmlDoc=xhttp.responseXML;
var x=xmlDoc.getElementsByTagName(ID);
return x.length;
}

function countByspe(xmlarchive,xmlinfo,ID,loclevel,loc)
{
var xhttp=GetXmlHttpObject();
xhttp.open("GET",xmlinfo,false);
xhttp.send(null);
xmlDoc1=xhttp.responseXML;
var x1=xmlDoc1.getElementsByTagName(ID);
var xhttp=GetXmlHttpObject();
xhttp.open("GET",xmlarchive,false);
xhttp.send(null);
xmlDoc2=xhttp.responseXML;
var x2=xmlDoc2.getElementsByTagName(ID);
var count=0;
for (i=0;i<x1.length;i++)
  {
  if (x1[i].getElementsByTagName(loclevel)[0].childNodes[0].nodeValue == loc)
    {
	for (j=0;j<x2.length;j++)
	  {
	  if (x2[j].getElementsByTagName("Name")[0].childNodes[0].nodeValue == x1[i].getElementsByTagName("Name")[0].childNodes[0].nodeValue)
	    {
		count=count+1;
		}
	  }
	}
  }
return count;


}

function countByloc(xmlfile,ID,loclevel,loc)
{
var xhttp=GetXmlHttpObject();
xhttp.open("GET",xmlfile,false);
xhttp.send(null);
xmlDoc=xhttp.responseXML;
var x=xmlDoc.getElementsByTagName(ID);
var count=0;
for (i=0;i<x.length;i++)
  {
  if (x[i].getElementsByTagName(loclevel)[0].childNodes[0].nodeValue == loc)
    {
	count=count+1
	}
  }
return count;
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest) // IE7+, Firefox, Chrome, Opera, Safari
  {
  return new XMLHttpRequest();
  }
else // Internet Explorer 5/6
  {
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
