function getElementTextNS(prefix, local, parentElem, index) {
	    var result = "";
	    if (prefix && isIE) {
		// IE/Windows way of handling namespaces
		result = parentElem.getElementsByTagName(prefix + ":" + local)[index];
	    } else {
		// the namespace versions of this method 
		// (getElementsByTagNameNS()) operate
		// differently in Safari and Mozilla, but both
		// return value with just local name, provided 
		// there aren't conflicts with non-namespace element
		// names
		result = parentElem.getElementsByTagName(local)[index];
	    }
	    if (result) {
		// get text, accounting for possible
		// whitespace (carriage return) text nodes 
		if (result.childNodes.length > 1) {
		    return result.childNodes[1].nodeValue;
		} else {
		    return result.firstChild.nodeValue;    		
		}
	    } else {
		return "n/a";
	    }
	}
	
	function appendToSelect(select, value, content) {
	    var opt;
	    opt = document.createElement("option");
	    opt.value = value;
	    opt.appendChild(content);
	    select.appendChild(opt);
	}
	
	function clearSelectOptions(id) {
	    var select = document.getElementById(id);
	    while (select.length > 0) {
		select.remove(0);
	    }
	}
	
	function print_r(input, _indent)
	{
	    var indent       = (typeof(_indent)=='string')?_indent+'&nbsp;&nbsp;&nbsp;&nbsp;':'&nbsp;&nbsp;&nbsp;&nbsp;';
	    var paren_indent = (typeof(_indent)=='string')?_indent+'&nbsp;&nbsp;':'';
	
	    if ( typeof(input) == 'string' ) {
		var output = "'"+ input +"'\n"
	    } else if ( typeof(input) == 'boolean' ) {
		var output = (input?'true':'false') +"\n"
	    } else if ( typeof(input) == 'object' ) {
		var output  = ((input.reverse)?'Array':'Object') +"\n"
		output     += paren_indent + "(\n";
		for ( var i in input ) {
		    output += indent + "["+ i +"] => "+ print_r(input[i],indent)
		}
		output += paren_indent + ")\n"
	    }
	    return output
	    }

