function loadXMLDoc(dname) {
  if ((navigator.appName == 'Microsoft Internet Explorer') && (window.location.protocol=='file:')) {
    var xmldoc = new ActiveXObject( "Microsoft.XMLDOM" );
    xmldoc.async = false;
//  xmldoc.resolveExternals = false;
    xmldoc.load( dname );
    return xmldoc;
  } else {
    if (window.XMLHttpRequest) {
      xhttp=new XMLHttpRequest();
    } else {			// Internet Explorer 5/6
      xhttp=new ActiveXObject( "Microsoft.XMLHTTP" );
    }
    xhttp.open( 'GET', dname, false );
    xhttp.send( '' );
    return xhttp.responseXML;
} }

/*
#	Node type	nodeName returns	nodeValue returns
1	Element		element name		null
2	Attr		attribute name		attribute value
3	Text		#text			content of node
4	CDATASection	#cdata-section		content of node
5	EntityReference	entity reference name	null
6	Entity		entity name		null
7	ProcessingInstruction	target		content of node
8	Comment		#comment		comment text
9	Document	#document		null
10	DocumentType	doctype name		null
11	DocumentFragment #document fragment	null
12	Notation	notation name		null
*/

function getNextChild(n,ntyp) {
  var y=n.nextSibling;
  if (ntyp==null) { ntyp = 1; };
  while ((y!=null)&&(y.nodeType!=ntyp)) { y=y.nextSibling; };
  return y;
}

function getFirstChild(n,ntyp) {
  var y=n.firstChild;
  if (ntyp==null) { ntyp = 1; };
  while (y.nodeType!=ntyp) { y=y.nextSibling; };
  return y;
}
