//<![CDATA[

	var map;
    var gmarkers = [];
    var htmls = [];

      // This function picks up the click and opens the corresponding info window
      function myclick(i) {
        gmarkers[i].openInfoWindowHtml(htmls[i]);
      }
	
    function Load() {
       if (GBrowserIsCompatible()) {
      
      // this variable will collect the html which will eventualkly be placed in the sidebar
      var sidebar_html = "";
    
      // arrays to hold copies of the markers and html used by the sidebar
      // because the function closure trick doesnt work there
      // var gmarkers = [];
      // var htmls = [];
      var i = 0;


      // A function to create the marker and set up the event window
      function createMarker(point,name,html) {
        var marker = new GMarker(point);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        // save the info we need to use later for the sidebar
        gmarkers[i] = marker;
        htmls[i] = html;
        // add a line to the sidebar html
        sidebar_html += '<a href="javascript:myclick(' + i + ')">' + name + '</a> ';
        i++;
        return marker;
      }

      // create the map
      var map = new GMap2(document.getElementById("my_map"));
		map.setMapType(G_HYBRID_MAP);
		map.addControl(new GSmallMapControl());
		map.addControl(new GScaleControl());

       //map.setCenter(new GLatLng(39.776733,-8.88611), 15);
		map.setCenter(new GLatLng(39.758408,-8.931885), 9); //Marinha Grande
       // add the points

		var point = new GLatLng(39.776733,-8.88611);
		var marker = createMarker(point,"Occasion Machines","<strong style='color:#000000;'>Occasion Machines</strong><br><span style='color:#000000;font-size:12px;'>Tel: +351 916 791 367<br/></span>")
		map.addOverlay(marker);
      
    }
	
    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }
}
    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/   
    // http://www.econym.demon.co.uk/googlemaps/

    //]]>