// 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    -->
	
	
		 // Mt. Agung
	var point = new GPoint(115.508,-8.342);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/indonesia/bali-mt-agung.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/indonesia/images/thumbs/besakih-view-cc-joachim-kim-ella.jpg'><b>Mt. Agung</b></a><br><br>An active volcano, Mt. Agung is a highly sacred mountain that is home to Pura Besakih, the Mother Temple of Bali.</div>","Mt. Agung");
	
		 // Mt. Batur
	var point = new GPoint(115.378,-8.24103);
	createMarker(point,"<div id=bubble><b>Mt. Batur</b><br><br>Another sacred mountain, second in importance to Mt. Agung.</div>","Mt. Batur");
	
		 // Tanah Lot
	var point = new GPoint(115.087,-8.6212);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/indonesia/bali-tanah-lot.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/indonesia/images/thumbs/tanah-lot-temple-cc-PaulT.jpg'><b>Tanah Lot</b></a><br><br>Best known for its magnificent silhouette at sunset, this 16th-century temple occupies a picturesque location on a tidal island.</div>","Tanah Lot");
	
		 // Taman Ayun Temple
	var point = new GPoint(115.172,-8.54192);
	createMarker(point,"<div id=bubble><b>Taman Ayun</b><br><br></div>","Taman Ayun");
	
		 // Tirta Empul
	var point = new GPoint(115.296,-8.38977);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/indonesia/bali-pura-tirta-empul.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/indonesia/images/thumbs/bathing-cc-thebigdurian.jpg'><b>Tirta Empul</b></a><br><br>Thousand-year-old temple centered around a pool fed by a sacred spring created by Indra.</div>","Tirta Empul");
	
	
		 // Ulun Danu
	var point = new GPoint(115.166,-8.27531);
	createMarker(point,"<div id=bubble><b>Ulun Danu</b><br><br></div>","Ulun Danu");
	
		 // Uluwatu
	var point = new GPoint(115.084,-8.82944);
	createMarker(point,"<div id=bubble><b>Uluwatu</b><br><br></div>","Uluwatu");
	
	
	
	// 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;
    }

	//]]>
