// JavaScript Document
var xmlDoc;
function loadXML(myDoc)
{
	//load xml file
	// code for IE
	if (window.ActiveXObject)
	{
		xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async=false;
		xmlDoc.load( myDoc );
		onLoad();
	}
	// code for Mozilla, Firefox, Opera, etc.
	else if (document.implementation && document.implementation.createDocument)
	{
		xmlDoc=document.implementation.createDocument("","",null);
		xmlDoc.load( myDoc );
		xmlDoc.onload=onLoad
	}
	else
	{
		alert("Your browser cannot handle this script");
	}
}

function getNode( parent, name, index )
{
	if ( parent == null )
	{
		alert("Null parent object for " + name + "[" + index + "].");
		return;
	}
	
	return parent.getElementsByTagName( name )[ index ];
}

function getText( parent )
{
	if ( parent == null )
	{
		alert("Null parent object for getText.");
		return;
	}
	
	return parent.firstChild.nodeValue;
}

function text( node, type )
{
	return getText( getNode( node, type, 0 ) );
}