<!--

/* This class simply extracts a few fields from a simple XML file. */
function ImageMetaData(fName) {
  /* Init this with default meta-data */
  this.title = "untitled";
  this.client = "gods of ink and paint";
  this.media = "digital";
  this.note = "No data available";
  this.note_type = "n";
  /* Try to get real meta-data */
  var xmlhttp = null;
	
	/* Create whatever XMLHttpRequest object is available.
	   This trick is from http://msdn.microsoft.com/en-us/library/ms537505%28VS.85%29.aspx */
	if (window.XMLHttpRequest) {
    /* If IE7, Mozilla, Safari, and so on: Use native object. */
    xmlhttp = new XMLHttpRequest();
	}
	else {
		if (window.ActiveXObject) {
			/* ...otherwise, use the ActiveX control for IE5.x and IE6. */
			xmlhttp = new ActiveXObject('MSXML2.XMLHTTP.3.0');
		}
	}
		
	if (xmlhttp) {
		xmlhttp.open("GET", fName, false); /* ToDo: make this more robust. */
		xmlhttp.send(null);
		if(xmlhttp.responseXML) {
			var xmlDoc=xmlhttp.responseXML.documentElement;
			this.title = xmlDoc.getElementsByTagName("myTitle")[0].childNodes[0].nodeValue;
			this.client = xmlDoc.getElementsByTagName("myClient")[0].childNodes[0].nodeValue;
			this.media = xmlDoc.getElementsByTagName("myMedia")[0].childNodes[0].nodeValue;
			this.note = xmlDoc.getElementsByTagName("myNote")[0].childNodes[0].nodeValue;
			var aNote = xmlDoc.getElementsByTagName("myNote")[0];
			this.note_type = aNote.attributes.getNamedItem("type").nodeValue;
		}
	} /* end of IF (xmlhttp exists) */
	else {
		 alert("Failed to make XMLHttpRequest object");
	}
}

-->

