// Takes a block of XML and a property name and returns the string value contained within it.
/*
 * Example:
 * 	var theData = "<xml><thingy>somedata</thingy></xml>";
 * 	theValue = ExtractProperty( theData, "thingy" );
 */
 
function ExtractProperty( pData, pProperty )
{
	if ( ( pData != "" ) && ( pProperty != "" ) )
	{
		try
		{
		var myRegExp = new RegExp( "<" + pProperty + ">([^<]*)<\/" + pProperty + ">", "i" );
		var theValue = pData.match( myRegExp )[1];
		}
		catch(e)
		{ theValue = ""; }
	}
	return theValue;
}