	var marrAttractions = new Array();
		
	function AddPushPin( longitude, latitude, place, date, link, photoLink, photoWidth, photoHeight )
	{
		var PushPin = new Array();

      PushPin[0] = longitude;
		PushPin[1] = latitude;
		PushPin[2] = place;
		PushPin[3] = date;
		PushPin[4] = link;
		PushPin[5] = photoLink;
		PushPin[6] = photoHeight;
		PushPin[7] = photoWidth;
		
		marrAttractions[marrAttractions.length] = PushPin;
	}

	function load()
	{
       if (GBrowserIsCompatible())
       {
      	var map = new GMap2(document.getElementById("map"));

         map.addControl(new GSmallMapControl());
         map.addControl(new GMapTypeControl());
         map.addControl(new GOverviewMapControl(new GSize(150,120)));
         map.addControl(new GScaleControl());
         map.setCenter(new GLatLng(37.1949999999, -4.398), 9);

   		// Create our "tiny" marker icon
			var icon = new GIcon();
			
			icon.image = "http://labs.google.com/ridefinder/images/mm_20_green.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);
			
			//want an array with long, lat, , place, date, url, photo url, photo height, photo width
			
			// Creates a marker at the given point with the given number label
			function createMarker(point, place, date, link, photo, photoHeight, photoWidth) 
			{
			  var marker = new GMarker(point,icon );
			  
			  GEvent.addListener(marker, "click", 
			  	function() 
			  	{
			  		if (link.length > 0)
			  		{
			    		marker.openInfoWindowHtml("<a href=" + link + ">" + place + " - " + date + "</a><br /><br /><p align='center'><a href=" + link + "><img src=" + photo + " alt=" + place + " width=" + photoWidth + " height = " + photoHeight + "/></a></p>");
			    	}
			    	else
			    	{
			    		marker.openInfoWindowHtml(place + " - " + date);
			    	}
			  	});


			  return marker;
			}
			
			for (var i in marrAttractions)
			{
				var details = marrAttractions[i];
			
				var point = new GLatLng(details[0], details[1]);
				map.addOverlay(createMarker(point, details[2], details[3], details[4], details[5], details[6], details[7]));
				
			}	

		}
	}

