Image Map using XML

Hi all,

I’m trying to create an image map and using XML but not sure how to go about this. I’m trying to create a campus map, and so when you click on a button/area on the entire map, an image and text appears. Each button should call a different image and text which will be in an XML file. All the buttons will be getting the image and text from this XML file. But I’m not sure how to accomplish this. Do I assign each node to each button that’s clicked on?

If so, how do I go about doing this? So far, I have the following code (using the XML and Photo Gallery tutorial), but not sure how to specify a specific image and text for a specific button. Any help is greatly appreciated. Thanks!

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = “file not loaded!”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“images.xml”);