// 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    -->
	
		 	 
		 // Arequipa Cathedral
	var point = new GPoint(-71.536676, -16.398125);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/peru/arequipa-cathedral.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Arequipa Cathedral</b></a><br><br>Built in 1656 and reconstructed after an 1868 earthquake, Arequipa Cathedral is a fine example of Spanish colonial architecture but is especially notable for its immense size. Its huge facade dominates an entire side of the Plaza de Armas in the center of the city. Inside is the largest organ in South America, a gift from Belgium.</div>","Arequpa Cathedral");
	
		 // Cusco (Cuzco)
	var point = new GPoint(-71.960278, -13.524514);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/peru/cusco.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/peru/images/thumbs/cusco-compania-night-cc-drp.jpg'><b>Cusco (Cuzco)</b></a><br><br>This historic city in southeastern Peru is situated in the Huatanay Valley (the &quot;Sacred Valley&quot;) of the Andes. Considered the archaeological capital of the Americas, Cusco has a stately and historic city center with cobblestone streets, colonial churches, and building foundations laid by the Incas more than 500 years ago.</div>","Cusco (Cuzco)");
		 
		 // Lima
	var point = new GPoint(-77.029706, -12.046676);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/peru/lima.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/peru/images/thumbs/lima-san-francisco-facade-cc-amyallcock.jpg'><b>Lima</b></a><br><br></div>","Lima");
		 
		 // Machu Picchu
	var point = new GPoint(-72.546008, -13.162859);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/peru/machu-picchu.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/peru/images/thumbs/machu-picchu-body-of-condor4-cc-drp.jpg'><b>Machu Picchu</b></a><br><br>Machu Picchu (&quot;Old Peak&quot;) is a well-preserved ancient ceremonial site high on a mountain ridge in Peru. It is the end point of the most popular hike in South America, the Inca Trail. The site has ruins of a large palace, temples to Incan deities, and a variety of other buildings.</div>","Machu Picchu");
	
		 
		 // Nazca Lines
	var point = new GPoint(-75.137043, -14.701505);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/peru/nazca-lines.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/peru/images/thumbs/nazca-spider-nc-latinamericanstudies.gif'><b>Nazca Lines</b></a><br><br>The Nazca Desert, a high plateau that stretches 37 miles between the towns of Nazca and Palpa, is home to the remarkable Nazca Lines - giant earth drawings of a hummingbird, monkey, spider, lizard, and many other shapes. They were created between 200 BC and 600 AD.</div>","Nazca Lines");
	
	
	// 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;
    }

	//]]>