//<!-- Begin hiding from older browsers
function Node(name,value) {
  this.nodeName=name;
  this.nodeValue=value;
}

function subTree() {
  var nodeList=new Object();
  var i=0;
  while (this.cursor<this.source.length) {
    var start=this.cursor;
    var tagStart=this.source.indexOf('<',this.cursor);
    if (tagStart==-1) return nodeList;
    var tagEnd=this.source.indexOf('>',tagStart);
    this.cursor=tagEnd+1;
    var tag=this.source.substr(tagStart+1,tagEnd-tagStart-1);
    if (tag.charAt(0)=='/') //found end tag
      if (i==0) // no child-elements, there was chardata
        return this.source.substr(start,tagStart-start);
      else 
        return nodeList;
    else if (tag.charAt(tag.length-1)=='/') // found empty tag
      nodeList[i++]=new Node(tag.substr(0,tag.length-1),'');
    else // found start tag, parse childnodes
      nodeList[i++]=new Node(tag,this.subTree());
  }
//return ('');
}


function MinXMLDocument(source) {
  this.subTree=subTree;
  this.source=source;
  this.cursor=0;
  this.documents=this.subTree();
}

function show(x) {
 // document.forms[0].elements[0].value=x;
  document.parseinfo.display.value=x;
}

var indent;
function getRDF(o) {  
 var oldIndent=indent;
  indent += '  ';
  var s=''; 
 if (o.constructor==String) {;} else {
   if(o.nodeName=='arc') { 
	var subject,predicate,object,dt,lang,webobject;
	// the i child nodes of the arc
	for (var i in o.nodeValue) {
		v = o.nodeValue[i].nodeValue;
		a = o.nodeValue[i].nodeName;
		if (a == 'subject' ) subject=v;
		if (a == 'predicate' ) predicate=v;
		if (a == 'object' ) object=v; //literals
		if (a == 'webobject' ) webobject=v; // URI values
		if (a == 'dt' )	dt=v; // datatyped literals
		if (a == 'lang' ) lang = v;	// language
		}
	if (webobject) { object="{"+webobject+"}"} else { object = "\""+object+"\""}
	s += "\rtriple({"+predicate+ '},{' + subject + '}, ' + object + ' ). ';
	}
	for (var c in o) { 
		s += getRDF(o[c]);
		};	
}
indent=oldIndent;
return s;
} 

function renderTree(o) {  
  var oldIndent=indent;
  indent+='  ';
  var s='';
  if (o.constructor==String) s='="'+o+'"'; else
    for (var i in o) s+=indent+'+-'+i+renderTree(o[i]);
  indent=oldIndent;
  return s;
}  


function moreData(url){
         myWin= open(url, "displayWindow","status=yes,toolbar=yes,menubar=yes,resizable,scrollbars,location");
	return (myWin);
}
