// Java Document

 //<![CDATA[
 
 // Begin Javascript
var gmarkers = [];
var htmls = [];
function myclick(i) {
gmarkers[i].openInfoWindowHtml(htmls[i]);
}
    function onLoad() {
      // Map Overlays
      //
      
	  // This function picks up the click and opens the corresponding info window
// Creates one a small marker at the given point
function createMarker(point, attributeHTMLString, name) {
  var marker = new GMarker(point, icon);
  map.addOverlay(marker);
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(attributeHTMLString);
  });
  // save the info we need to use later for the sidebar
  gmarkers[i] = marker;
  htmls[i] = attributeHTMLString;
  // add a line to the sidebar html
  sidebar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a><br>';
        i++;
        return marker;
}



      // Create small marker icon
var icon = new GIcon();
icon.image = "http://labs.google.com/ridefinder/images/mm_20_blue.png";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);

<!--    begin pulling data    -->
	
		 	

		 // Cao Dai Temple
	var point = new GPoint(106.13,11.2962);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/vietnam/cao-dai-temple.htm'><b>Cao Dai Temple</b></a><br><br>The Great Temple or Holy See is the spiritual center of the intriguing Cao Dai sect, a syncretist Vietnamese religious movement that incorporates aspect of Buddhism, Taoism, Confucianism and Christianity.</div>","Cao Dai Temple");
	
	 // Ho Chi Minh City
	var point = new GPoint(106.663,10.762);
	createMarker(point,"<div id=bubble><b>Ho Chi Minh City</b><br><br>Vietnam's capital, formerly known as Saigon (in fact still called that by most inhabitants).</div>","Ho Chi Minh City");
 

	
		 // Thien Mu Pagoda
	var point = new GPoint(107.545,16.4532);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/vietnam/hue-thien-mu-pagoda.htm'><b>Thien Mu Pagoda</b></a><br><br>Begun in 1601 on a hill outside the city of Hue, this is one of the oldest and prettiest religious structures in Vietnam.</div>","Thien Mu Pagoda");
	
 
	
	// Create small marker icon
var icon = new GIcon();
icon.image = "http://labs.google.com/ridefinder/images/mm_20_white.png";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);



	
	 // put the assembled sidebar_html contents into the sidebar div
    document.getElementById("sidebar").innerHTML = sidebar_html;
    }

	//]]>
