// 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    -->
	
		
		 // Beijing
	var point = new GPoint(116.390791, 39.916715);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/china/beijing.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/china/temple-of-heaven-beijing.htm'><b>Beijing</b></a><br><br>Beijing (formerly Peking) is the political and spiritual capital of China. With a population of 15 million, it is China's second largest city after Shanghai.</div>","Beijing");
		 
		 // Emei Shan
	var point = new GPoint(103.3325,29.519722);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/china/emei-shan.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Emei Shan</b></a><br><br>Mt. Emei is one of the four Buddhist sacred mountains of China. At 3,099 meters, it is more than 1,000 meters higher than the other three sacred mountains. It is a World Heritage Site noted for its breathtaking scenery, mysterious natural wonders, and historical Buddhist sites.</div>","Emei Shan");
	
		 // Leshan Giant Buddha
	var point = new GPoint(103.769238,29.547037);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/china/leshan-giant-buddha.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Giant Buddha of Leshan</b></a><br><br>This is the tallest stone Buddha statue in the world. Construction began in 713 AD by a Chinese monk named Haitong, who hoped that the Buddha would calm the turbulent waters that plagued the shipping vessels travelling down the river. The statue depicts a seated Maitreya Buddha with his hands resting on his knees.</div>","Leshan Giant Buddha");
	
		 // Longmen Caves
	var point = new GPoint(112.47,34.5539);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/china/longmen-caves.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Longmen Caves</b></a><br><br>These Buddhist cave temples stretch for 1km along the west bank of the Yi River near Luoyang. The site includes some 1,350 caves and 40 pagodas, which are filled with thousands of Buddhist statues carved out of the hard limestone cliffs. </div>","Longmen Caves");
	
		 // Mogao Caves
	var point = new GPoint(94.8052,40.0382);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/china/mogao-caves.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Mogao Caves</b></a><br><br>These Buddhist cave temples were a center of culture on the Silk Road from the 4th to the 14th centuries and contain well-preserved religious murals and carvings spanning that entire period. There are about 600 surviving cave temples, of which 30 are open to the public.</div>","Mogao Caves");
	
			 
		 // Shaolin Temples
	var point = new GPoint(112.915486, 34.500483);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/china/shaolin.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Shaolin Temples</b></a><br><br>A group of Chinese Buddhist monasteries on the sacred mountain of Song Shan famed for their long association with Chan (Zen) Buddhism and martial arts. They are especially famous in the west as the home of kung fu.</div>","Shaolin Temples");
	
	
		 // White Horse Temple - low-res, not certain
	var point = new GPoint(112.591152,34.724543);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/china/white-horse-temple.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>White Horse Temple</b></a><br><br>Baima Si was the first Buddhist temple in China, established by Emperor Mingdi in the year 68 AD. The historic, leafy site features several ancient buildings and a highly devotional atmosphere.</div>","White Horse Temple");
	
	// Xi'an Great Mosque
	var point = new GPoint(108.936712,34.263428);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/china/xian-great-mosque.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Great Mosque of Xi'an</b></a><br><br>.</div>","Xian: Great Mosque");
	
	// 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;
    }

	//]]>