var mapframe;
function setup() {
  if(document.getElementById) {	// If this isn't available we can't use the maps, so just ignore.
    var theTable, theLinks, i, placeName, linkText
    theTable = document.getElementById("schedule");
    theLinks = theTable.getElementsByTagName("span");
    if (theLinks.length) {
      for (i=0; i<theLinks.length; i++) {
        if (theLinks[i].className == "maplink") {
          placeName = theLinks[i].innerHTML;
          if (placeName in places) {
            linkText = places[placeName];
            theLinks[i].innerHTML = '<a href="#" onClick="showMap(\''+placeName+'\');return false;">[map]</a>';
            theLinks[i].className = "viewlink";
          }
        }
        document.getElementById("mapnote").innerHTML=" [map] links show a google map on this page.";
      }
    }
  }
}
function showMap(param) {
  if (mapframe) {
    window.frames[0].showmap(param);
  } else {
    mapframe = document.createElement("iframe");
    mapframe.src="map.html?"+param;
    mapframe.height="440px";
    mapframe.width="640px";
    mapframe.className = "mapframe";
    mapframe.scrolling = "no";
    document.getElementById("mapdisplay").appendChild(mapframe);
  }
  mapframe.scrollIntoView();
  return false;
}

