// 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    -->
		 
		 // Cathedral
	var point = new GPoint(-4.697245, 40.655647);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/spain/avila-cathedral.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/spain/images/thumbnails50/avila-cathedral-cc-martius.jpg'><b>Ávila Cathedral </b></a><br><br>Ávila's fortress-like cathedral was started in the Romanesque style in the 12th century, later continued in the Gothic style, and has never been entirely finished.</div>","Ávila Cathedral ");
		 
		 // San Vicente
	var point = new GPoint(-4.695947, 40.657942);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/spain/avila-basilica-san-vicente.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/spain/images/thumbnails50/avila-san-vicente-from-walls-cc-aloriel.jpg'><b>Basilica de San Vicente</b></a><br><br>This mostly-Romanesque basilica outside the walls marks the site of the martyrdom of St. Vincent by the Romans. It has a fine Romanesque portal and portico.</div>","Basilica de San Vicente");
	 
		 // Convento de Santa Teresa
	var point = new GPoint(-4.70232, 40.655395);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/spain/avila-convent-of-st-teresa.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/spain/images/thumbnails50/avila-convent-cc-martius.jpg'><b>Convento de Santa Teresa</b></a><br><br>The main shrine of St. Teresa in Ávila, this 17th-century convent stands on the site of Teresa's birth and contains her relics.</div>","Convento de Santa Teresa");
		 
		 // Los Cuatro Postes
	var point = new GPoint(-4.710131, 40.658178);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/spain/avila-los-cuatro-postes.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/spain/images/thumbnails50/avila-four-posts-cc-aloriel.jpg'><b>Los Cuatro Postes</b></a><br><br>This little shrine ouside the walls marks the spot where, at age seven, St. Teresa's uncle stopped her from running off to seek martyrdom from the Moors.</div>","Los Cuatro Postes");
	
		 // San Pedro
	var point = new GPoint(-4.695379, 40.654157);
	createMarker(point,"<div id=bubble><b>San Pedro</b><br><br>An attractive Romanesque church made of local sandstone on the Plaza de Santa Teresa.</div>","San Pedro");
	
	
	// 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;
    }

	//]]>