var markers = []; var to_htmls = []; var from_htmls = []; var i = 0; function createMarker(lat, lon, infoMessage, locationName) { var marker = new GMarker(new GLatLng(lat, lon)); var direction_html = '
Get directions: To here - From here
'; var pre_message = "
"; var post_message = "
"; var full_message = pre_message + infoMessage + direction_html + post_message; // The info window version with the "to here" form open to_htmls[i] = pre_message + infoMessage + '
Get directions: To here - From here' + '
Start address:
' + '' + ' ' + '' + '' + post_message; // The info window version with the "from here" form open from_htmls[i] = pre_message + infoMessage + '
Get directions: To here - From here' + '
End address:' + '' + ' ' + '' + '
' + post_message; GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(full_message); }); i++; return marker; } // functions that open the directions forms function tohere(i) { markers[i].openInfoWindowHtml(to_htmls[i]); } function fromhere(i) { markers[i].openInfoWindowHtml(from_htmls[i]); } function PSMapInit(m) { m.addControl(new GSmallMapControl()); m.addControl(new GMapTypeControl()); var mgr = new GMarkerManager(m); markers.push(createMarker(0.000000, 0.000000, "Shintaido Open-hand
Sundays, 9:00AM
details...

Shintaido Jojutsu
Tuesdays, 7:00AM
details...

Shintaido Jojutsu
Fridays, 7:00AM
details...
", "Zoom Keiko")); markers.push(createMarker(37.848156, -122.233643, "Shintaido Karate & Kenjutsu
Saturdays, 8:00AM
details...
", "Lake Temescal Park")); markers.push(createMarker(37.767010, -122.465278, "Shintaido Bojutsu
Saturdays, 9:00AM
details...
", "Golden Gate Park")); mgr.addMarkers(markers, 3); mgr.refresh(); }