// 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    -->
	
	 
		 
		 // Almudena Cathedral
	var point = new GPoint(-3.714591,40.415579);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/spain/madrid-almudena-cathedral.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Almudena Cathedral</b></a><br><br>Dating from the late 19th and 20th centuries, Almudena Cathedral is very new by European standards, and its traditional yet modern design reflects its youth.</div>","");
	
		 // M-30 Mosque
	var point = new GPoint(-3.658082,40.438529);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/spain/madrid-mezquita.htm'><b>M-30 Mosque</b></a><br><br>Opened in 1992, this is the largest mosque in Europe.</div>","M-30 Mosque");
	
	
	// Monasterio de las Descalzas Reales
	var point = new GPoint(-3.705629,40.417421);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/spain/madrid-monasterio-de-las-descalzas-reales.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Monasterio de las Descalzas Reales</b></a><br><br></div>","Monasterio de las Descalzas Reales");
	
	// National Archaeological Museum
	var point = new GPoint(-3.689389,40.423608);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/spain/madrid-archaeological-museum.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>National Archaeological Museum</b></a><br><br></div>","National Archaeological Museum");
	
		 // San Francisco
	var point = new GPoint(-3.714591,40.410408);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/spain/madrid-basilica-de-san-francisco-el-grande.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Basilica de San Francisco el Grande</b></a><br>This 18th-century Franciscan church boasts the largest dome in Spain.<br></div>","San Francisco el Grande");
		 
		 // Templo de Debod 
	var point = new GPoint(-3.717799,40.424123);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/spain/madrid-templo-de-debod.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Templo de Debod</b></a><br><br></div>","Templo de Debod");
	
	
	// 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;
    }

	//]]>