var map = new GMap(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GOverviewMapControl());
map.centerAndZoom(new GPoint(135.502165,34.693738), 4);

function createMarker(point, Photo, Permalink, Title, Img, Rank, Address, Tel, Time, Holiday, Parking, Do, DoNichi) {
  // Create a lettered icon for this point using our icon class from above
  var icon = new GIcon();
  icon.image = "http://www.osaka-nt.com/img/arr.png";
  icon.shadow = "";
  icon.iconSize = new GSize(40, 30);
  icon.shadowSize = new GSize(33, 30);
  icon.iconAnchor = new GPoint(40, 30);
  icon.infoWindowAnchor = new GPoint(5, 1);
  var marker = new GMarker(point, icon);
  var html = "<table cellpadding=\"0\"><tr><td><a href=\"" + Permalink + "\"><img src=\"" + Photo + "\" alt=\"" + Title + "\" width=\"80\" height=\"60\" class=\"photo3\" /></a></td><td class=\"mapentrytitle\"><a href=\"" + Permalink + "\">" + Title + "</a></td></tr><tr><td colspan=\"2\"><table cellpadding=\"3\"><tr><td valign=\"top\"><img src=\"http://swp.cside.com/gourmet/images/s1.gif\" width=\"50\" height=\"15\" /></td><td>" + Address + "</td></tr><tr><td valign=\"top\"><img src=\"http://swp.cside.com/gourmet/images/s2.gif\" width=\"50\" height=\"15\" /></td><td>" + Tel + "</td></tr></table></td></tr></table>";
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
  });
  return marker;
}

var request = GXmlHttp.create();
request.open("GET", "./googlemap.xml", true);
request.onreadystatechange = function() {
  if (request.readyState == 4) {
    var xmlDoc = request.responseXML;
    var markers = xmlDoc.documentElement.getElementsByTagName("marker");
    for (var i = 0; i < markers.length; i++) {
      var point = new GPoint(parseFloat(markers[i].getAttribute("Lon")),parseFloat(markers[i].getAttribute("Lat")));
      var marker = createMarker(point, markers[i].getAttribute("Photo"), markers[i].getAttribute("Permalink"), markers[i].getAttribute("Title"), markers[i].getAttribute("Img"), markers[i].getAttribute("Rank"), markers[i].getAttribute("Address"), markers[i].getAttribute("Tel"), markers[i].getAttribute("Time"), markers[i].getAttribute("Holiday"), markers[i].getAttribute("Parking"));
      map.addOverlay(marker);
    }
  }
}
request.send(null);