// 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    -->
	
		 
		 // Almoravid Koubba
	var point = new GPoint(-7.987345,31.631501);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/morocco/marrakesh-koubba.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/morocco/images/marrakesh/thumbnails/IMG_1008.jpg'><b>Almoravid Koubba</b></a><br><br>The oldest monument in Marrakesh and the only Almoravid building anywhere in Morocco, this attractive domed structure dates from around 1100. Its design was highly influential on Moroccan architecture.</div>","Almoravid Koubba");
	
		 	 
		 // Ben Youssif Medersa
	var point = new GPoint(-7.986444,31.63204);
	createMarker(point,"<div id=bubble><a href=''><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/morocco/images/marrakesh/thumbnails/IMG_0941.jpg'><b>Ben Youssif Medersa</b></a><br><br></div>","Ben Youssif Medersa");
		 
		 // Ben Youssef Mosque
	var point = new GPoint(-7.987329,31.632054);
	createMarker(point,"<div id=bubble><a href=''><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Ben Youssef Mosque</b></a><br><br></div>","Ben Youssef Mosque");
			 
		 // Koutoubia Mosque
	var point = new GPoint(-7.993798,31.623764);
	createMarker(point,"<div id=bubble><a href=''><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/morocco/images/marrakesh/thumbnails/IMG_0579.jpg'><b>Koutoubia Mosque</b></a><br><br></div>","Koutoubia Mosque");
	
		 	 
		 // Jewish Cemetery
	var point = new GPoint(-7.979245,31.620292);
	createMarker(point,"<div id=bubble><a href=''><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Jewish Cemetery</b></a><br><br></div>","Jewish Cemetery");
	
		 // Mouassin Mosque
	var point = new GPoint(-7.989625,31.629606);
	createMarker(point,"<div id=bubble><b>Mouassin Mosque</b><br><br></div>","Mouassin Mosque");
	
		 	 
		 // Saadian Tombs
	var point = new GPoint(-7.988702,31.6173);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/morocco/marrakesh-saadian-tombs.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/morocco/images/marrakesh/thumbnails/IMG_0629.jpg'><b>Saadian Tombs</b></a><br><br>This site next to the old kasbah was used for burials throughout the Saadian period (beginning 1557), then sealed up for centuries. It consists of two beautiful mausoleums and nearly 200 tiled tombs of royals.</div>","Saadian Tombs");
	
		 // Sidi Abd al Aziz
	var point = new GPoint(-7.989281,31.632163);
	createMarker(point,"<div id=bubble><a href='http://www.sacred-destinations.com/morocco/marrakesh-sidi-abd-el-aziz.htm'><img style='border-color:#666666' border='1' hspace='5' align='left' src='http://www.sacred-destinations.com/morocco/images/marrakesh/thumbnails/IMG_0591.jpg'><b>Mausoleum of Sidi Abd El Aziz</b></a><br><br>This small mausoleum is one of the tombs of the Seven Men of Marrakesh, established as a pilgrimage circuit in the 17th century. Sidi Abd El Aziz was a theologian in Fes and died in 1508.</div>","Mausoleum of Sidi Abd El Aziz");
	
	// 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);

	 
		 // Badi Palace
	var point = new GPoint(-7.98911,31.617716);
	createMarker(point,"<div id=bubble><b>Badi Palace</b><br><br></div>","");
		 
		 // Bahia Palace
	var point = new GPoint(-7.982367,31.621589);
	createMarker(point,"<div id=bubble><a href=''><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Bahia Palace</b></a><br><br></div>","");
	
			 
		 // Djemaa el Fna
	var point = new GPoint(-7.989357,31.625792);
	createMarker(point,"<div id=bubble><a href=''><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Jemaa el Fna</b></a><br><br>The famous main square of Marrakesh.</div>","");
		 
		 // Riad Darhani
	var point = new GPoint(-7.989619,31.632004);
	createMarker(point,"<div id=bubble><a href='http://www.darhani.com'><img style='border-color:#666666' border='1' hspace='5' align='left' src=''><b>Riad Darhani</b></a><br><br>This is where we stayed during our visit to Marrakesh and it is recommended.</div>","");
	
	
	 // put the assembled sidebar_html contents into the sidebar div
    //document.getElementById("sidebar").innerHTML = sidebar_html;
    }

	//]]>