// JavaScript Document

// this variable will collect the html which will eventually be placed in the side_bar
var side_bar_html = "";
// arrays to hold copies of the markers and html used by the side_bar
// because the function closure trick doesnt work there
var gmarkers = [];
var i = 0;
// A function to create the marker and set up the event window
function createMarker(point,name,html) {
var marker = new GMarker(point);


//////////////testing
var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = "assets/map_logo2.png";
blueIcon.iconSize= GSize(37,51);

markerOptions = { icon:blueIcon };

////////////end testing

GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
// save the info we need to use later for the side_bar
gmarkers[i] = marker;
// add a line to the side_bar html
side_bar_html += '<p><a href="#showmap" onclick="javascript:myclick(' + i + ')">' + name + '</a><br>' + html +'<br></p>';
i++;
return marker;
}
// This function picks up the click and opens the corresponding info window
function myclick(i) {
GEvent.trigger(gmarkers[i], "click");
}
if (GBrowserIsCompatible()) {
// create the map
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(37.80659678769507, -122.41376638412476), 14);
//////////////////////////////////////////////////////////////////


// add the points
var point = new GLatLng(37.828133,-122.424356);
var marker = createMarker(point,'Alcatraz Island','<a href="http://www.nps.gov/alcatraz" target="_blank"><b>Alcatraz Island</b></a><br>is one of Golden Gate National Recreation Area’s most popular destinations, offering a close-up look at a historic and infamous federal prison long off-limits to the public.')
map.addOverlay(marker);
var point = new GLatLng(37.816158,-122.478418);
var marker = createMarker(point,' Golden Gate ','The Golden Gate Bridge is the iconic  suspension bridge spanning the Golden Gate, the opening of the San Francisco Bay onto the Pacific Ocean.')
map.addOverlay(marker);
//var point = new GLatLng(37.81153,-122.410655);
var point = new GLatLng(37.80922,-122.40988);
var marker = createMarker(point,' PIER 39 ','<a href="http://www.pier39.com" target="_blank">Pier 39</a> is San Francisco’s #1 attraction. With something for everyone in the family to enjoy, from great shopping and dining, to watching our famous street performers or playful sea lions in action, new memories are sure to be created.')
map.addOverlay(marker);
var point = new GLatLng(37.807648,-122.421041);
var marker=createMarker(point,'Ghirardelli Square','Once a chocolate factory, now a historic landmark, <a href="http://www.ghirardellisq.com/" target="_blank">Ghirardelli Square</a> is home to an exceptional collection of over 50 specialty shops, galleries and award winning restaurants.')
map.addOverlay(marker);
var point = new GLatLng(37.778279228261084, -122.38996982574463);
var marker = createMarker(point,' AT&T Ballpark ','AT&amp;T Park – Home of the San Francisco Giants, and one of the top, classically designed stadiums in the country, features breathtaking views from many sections of the stadium.')
map.addOverlay(marker);
var point = new GLatLng(37.807400,-122.419300);
var marker = createMarker(point,'The Cannery','<a href="http://www.thecannery.com/" target="_blank">The Cannery</a> at Del Monte Square is one of San Francisco’s most treasured places.')
map.addOverlay(marker);
var point = new GLatLng(37.808818,-122.419474);
var marker = createMarker(point,'Fishermans Wharf','<a href="http://www.fishermanswharf.org" target="_blank">Fisherman’s Wharf</a> is one of San Francisco’s most popular destinations.')
map.addOverlay(marker);
var point = new GLatLng(37.808818,-122.412479);
var marker = createMarker(point,'North Beach','<a href="http://www.sfnorthbeach.org" target="_blank">North Beach</a> is a San Francisco neighborhood adjacent to Chinatown and Fisherman’s Wharf.')
map.addOverlay(marker);
var point = new GLatLng(37.859150,-122.485920);
var marker = createMarker(point,'Sausalito','Sausalito has been compared to the French Riviera because of its Mediterranean flair and breathtaking views.')
map.addOverlay(marker);
var point = new GLatLng(37.80238,-122.405658);
var marker = createMarker(point,' Coit Tower ','Coit Tower sits atop Telegraph Hill. It’s a steep trek to the base of the tower, but once you reach it, you’ll be amazed by the 360 degree, unobstructed views of the Golden Gate Bridge, the Bay Bridge, and the San Francisco Bay in between.')
map.addOverlay(marker);
var point = new GLatLng(37.79679, -122.40789);
var marker = createMarker(point,'Chinatown','Chinatown is located in downtown San Francisco, and roughly bordered by Powell Street and the Nob Hill Neighborhood.')
map.addOverlay(marker);
var point = new GLatLng(37.800864,-122.428299);
var marker = createMarker(point,' Lombard Street ','Lombard Street’s famous switchback turns, on Russian Hill between Hyde and Leavenworth Streets, make it known as the crookedest street in the city.')
map.addOverlay(marker);
var point = new GLatLng(37.804537,-122.421271);
var marker = createMarker(point,'Cable Car Turn Around','<a href="http://www.sfcablecar.com" target="_blank">Cable Car Turn Around</a> is where the city’s top attractions connect to Fisherman’s Wharf.')
map.addOverlay(marker);
var point = new GLatLng(36.156757,-121.525607);
var marker = createMarker(point,'Wine Country','<b>Wine Country</b>')
map.addOverlay(marker);
var point = new GLatLng(36.607639,-121.887769);
var marker = createMarker(point,'Monterey','<b>Monterey</b>')
map.addOverlay(marker);
var point = new GLatLng(37.784321,-122.399299);
var marker = createMarker(point,'Moscone Convention Center','Moscone Convention Center is the city of San Francisco’s main convention center, located in the South of Market District.')
map.addOverlay(marker);
var point = new GLatLng(37.767543,-122.481723);
var marker = createMarker(point,'Golden Gate Park','Golden Gate Park was originally developed in the 1890’s and still today has been maintained and preserved as a place to play and relax in the city of San Francisco.')
map.addOverlay(marker);
var point = new GLatLng(37.77005,-122.446817);
var marker = createMarker(point,' Haight-Ashbury Street ','Haight-Ashbury is a district most famous for its role in the 1960s hippie movement. It is located near Golden Gate Park  and encompasses the neighborhood surrounding Haight Street.')
map.addOverlay(marker);
var point = new GLatLng(37.801604,-122.456199);
var marker = createMarker(point,' The Presidio ','<b>The Presidio</b>')
map.addOverlay(marker);
var point = new GLatLng(37.788048,-122.407872);
var marker = createMarker(point,' Union Square ','Union Square is one of San Francisco’s main shopping destinations in the city.')
map.addOverlay(marker);
var point = new GLatLng(37.80659678769507, -122.41376638412476);
var marker = createMarker(point,'Sheraton Fisherman\'s Wharf','<b>Sheraton Fisherman\'s Wharf</b>')
map.addOverlay(new GMarker(point, markerOptions));
var point = new GLatLng(37.80832601147965, -122.41490364074707);
var marker = createMarker(point,'Wax Museum','The Wax Museum at Fisherman’s Wharf is one of the city’s most popular landmarks.')
map.addOverlay(marker);
var point = new GLatLng(37.80832, -122.415161);
var marker = createMarker(point,'Boudin’s Sourdough Museum','Fisherman’s Wharf is the flagship location for <a href="http://www.boudinbakery.com/" target="_blank">Boudin’s Sourdough</a>. It’s where bakers have been making the famous sourdough bread since 1849.');
map.addOverlay(marker);
var point = new GLatLng(37.80600341726133, -122.42913007736206);
var marker = createMarker(point,"Maritime Museum",'When you visit <a href="http://www.maritime.org/index.htm" target="_blank">San Francisco’s Maritime Museum</a>, you’ll discover historic vessels and discover your connections to the city’s maritime heritage.')
map.addOverlay(marker);
var point = new GLatLng(37.80179882732586, -122.44784116744995);
var marker = createMarker(point,"Palace of Fine Arts",'Built in 1915 for the Panama-Pacific International Exposition, the <a href="http://www.maritime.org/index.htm" target="_blank">Palace of Fine Arts</a> features a classical Roman rotunda in a picturesque park setting.')
map.addOverlay(marker);
var point = new GLatLng(37.79409, -122.392427);
var marker = createMarker(point,"Teatro ZinZanni",'For an evening of entertainment and amazing food, look no further than <a href="http://love.zinzanni.org/" target="_blank">Teatro ZinZanni</a>, set along San Francisco’s historic waterfront.')
map.addOverlay(marker);
var point = new GLatLng(37.799374, -122.410278);
var marker = createMarker(point,"Beach Blanket Babylon",'An internationally acclaimed San Francisco institution, Steve Silver&prime;s <a href="http://www.beachblanketbabylon.com/" target="_blank">Beach Blanket Babylon</a>, is a zany musical spoof of pop culture with extravagant costumes and outrageously huge hats.')
map.addOverlay(marker);
var point = new GLatLng(37.794546, -122.411392);
var marker = createMarker(point,"Cable Car Museum",'<a href="http://www.cablecarmuseum.org/" target="_blank">The Cable Car Museum</a> was established in 1974, and is operated by the Friends of the Cable Car Museum as a nonprofit educational facility.')
map.addOverlay(marker);
var point = new GLatLng(37.77883890190859, -122.51373767852783);
var marker = createMarker(point,"Cliff House and Sea Rock",'<a href="http://www.sanfranciscomemories.com/cliff/house.html">Cliff House and Sea Rock</a>&nbsp;Four different variations of the Cliff House have stood on the cliffs overlooking Seal Rocks, at the Northwest corner of San Francisco.')
map.addOverlay(marker);
var point = new GLatLng(37.78160328837516, -122.49446868896484);
var marker = createMarker(point,"Palace of the Legion of Honor",'<a href="http://www.crissyfield.org/" target="_blank">The Legion of Honor</a>&nbsp;represents the museum collection and the building itself.')
map.addOverlay(marker);
var point = new GLatLng(37.803918106204456, -122.46228218078613);
var marker = createMarker(point,"Crissy Field",'<a href="http://www.crissyfield.org/" target="_blank">Crissy Field</a>&nbsp;Established in 1981, the Golden Gate National Parks Conservancy is the nonprofit partner that supports and assists the Golden Gate National Parks in research, interpretation, and conservation programs.')
map.addOverlay(marker);
var point = new GLatLng(37.784503, -122.407351);
var marker = createMarker(point,"San Francisco’s Westfield Shopping Center",'<a href="http://www.westfield.com/sanfrancisco/" target="_blank">San Francisco’s Westfield Shopping Center</a>&nbsp;is San Francisco’s premier shopping mall located on Market Street.')
map.addOverlay(marker);
var point = new GLatLng(37.69078, -122.416333);
var marker = createMarker(point,"Monster Park",'<a href="http://www.monsterpark.com" target="_blank">Monster Park</a>&nbsp;Home of the San Francisco 49ers, formerly known as Candlestick Park is located south of downtown San Francisco.')
map.addOverlay(marker);







///
} else {
alert("Sorry, the Google Maps API is not compatible with this browser");
}