	window.addEvent('domready',doMap);
	
    var gmarkers = [];
	var gicon = [];
    var i = 1;

    // A function to create the marker and set up the event window
    function createMarker(point,name,html,icon) {
	 	
		var popuphtml = "<div id=\"mapPopup\">" + html + "<\/div>";
        var marker = new GMarker(point,icon);
        GEvent.addListener(marker, "click", function() {
          marker.openInfoWindowHtml(html);
        });
        // save the info we need to use later for the side_bar
        gmarkers[i] = marker;
		gicon[i] = icon;
        i++;
        return marker;
    }


	
	function doMap() {
    
		// create the map
      	var map = new GMap2(document.getElementById("map"));
      	//map.addControl(new GLargeMapControl());
      	//map.addControl(new GMapTypeControl());
      	map.setUIToDefault();
		map.setCenter(new GLatLng(53.593800,-2.296480), 15);
	  
	  	//create Office Icon
	  	var iconOffice = new GIcon();
	  	iconOffice.image = "/images/iconHQ.png";
		iconOffice.iconSize=new GSize(52,47);
		iconOffice.shadow = "/images/roundShadow.png";
	  	iconOffice.shadowSize=new GSize(52,47);
	  	iconOffice.iconAnchor=new GPoint(16,32);
	  	iconOffice.infoWindowAnchor=new GPoint(16,0);
	  
	  	// add the Office    
      	var point = new GLatLng(53.593800,-2.296480);
      	var marker = createMarker(point,"Bamboo Solutions","<div class='divHTMLpopup'><h2>Bamboo Solutions</h2><p>1st Floor<br />1 The Rock<br />Bury<br />Greater Manchester<br />BL9 0JP</p></div>",iconOffice);
      	map.addOverlay(marker);
	
	}
