// 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    -->
	
		 
		
		 
		 // Anuradhapura
	var point = new GPoint(80.383333, 8.333333);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/sri-lanka/anuradhapura.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/sri-lanka/images/thumbnails/anuradhapura-stupa-cc-DennisSylvesterHurd.jpg'><b>Anuradhapura</b></a><br><br>This sacred city, now in ruins, was once a major center of Sri Lankan civilization. Sights include huge bell-shaped stupas built of small sun-dried bricks, temples, sculptures, palaces, and ancient reservoirs. A World Heritage Site.</div>","Anuradhapura");
	
	// Dambulla
	var point = new GPoint(80.648317, 7.85692);
	createMarker(point,"<div id=bubble><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/sri-lanka/images/thumbnails/dambulla-seated-statues-nc-Luis-Reyes-pbase.jpg'><b>Dambulla</b><br><br>Dambulla is famed for its many caves containing splendid Buddhist frescoes and sculptures as well as examples of Hindu art. A World Heritage Site.</div>","Dambulla"); 	
	
		 // Kandy
	var point = new GPoint(80.640278, 7.293611);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/sri-lanka/kandy.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/sri-lanka/images/thumbnails/kandy-overview-nc-Luis-Reyes.jpg'><b>Kandy</b></a><br><br>This city of about 100,000 is home to the Temple of the Tooth, one of the most important Buddhist pilgrimage sites in the world. A World Heritage Site.</div>","Kandy");
	
	// Mihintale
	var point = new GPoint(80.447222, 8.353333);
	createMarker(point,"<div id=bubble><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/sri-lanka/images/thumbnails/minhitale-buddha-cc-prince-roy.jpg'><b>Mihintale</b><br><br>This sacred mountain is believed to be where Buddhism was first introduced to Sri Lanka. Sights include numerous temples, monasteries and splendid Buddha statues.</div>","Mihintale"); 
	
	 // Polonnaruwa
	var point = new GPoint(81.00154, 7.94591);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/sri-lanka/polonnaruwa.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/sri-lanka/images/thumbnails/polonn-audience-hall3-cc-anuradhac.jpg'><b>Polonnaruwa</b></a><br><br>This ancient city was the Sri Lankan capital in the Middle Ages. Many fascinating ruins remain at the site, including a reclining Buddha, seated Buddha and standing Buddha all carved out of a single block of granite. A World Heritage site.</div>","Polonnaruwa"); 
	
	
	
	// Sigiriya
	var point = new GPoint(80.75, 7.95);
	createMarker(point,"<div id=bubble><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/sri-lanka/images/thumbnails/sigiriya-rock-cc-massive-defeat.jpg'><b>Sigiriya</b><br><br>This fascinating 5th-century palace is built atop a great rock and accessed via a stairway flanked by giant lion paws. Halfway up are frescoes of bare-breasted maidens and at the top are gardens and fountains.</div>","Sigiriya");
	
	// 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;
    }

	//]]>