var map; // a small kludge, polluting the document's namespace
function initialize() {
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    GEvent.addDomListener(map, "load", function() {
      setTimeout('GKeyboardPatch(map);',3000);
    });
    map.setCenter(new GLatLng(50.723362,-3.525137), 17);
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.enableScrollWheelZoom();
    map.enableContinuousZoom();
    new GKeyboardHandler(map);  
	var point = new GLatLng(50.723362,-3.525137);
          map.addOverlay(new GMarker(point));
    
  }
}

function GKeyboardPatch(map) {
  var button, button_style = 
  'width:100%;height:100%;padding:2px;margin:2px; \
  background:transparent; border-width:0px;border-style:solid \
  cursor: pointer;overflow:hidden;text-indent:-100em; \
  position:absolute;top:-2px;left:-2px;';
  var divs = map.getContainer().getElementsByTagName('DIV');
  for (var i = 0; i < divs.length; i++) {
    if ( divs[i].getAttribute('log') ||
       ( divs[i].getAttribute('id') &&
         (divs[i].getAttribute('id')!='map_magnifyingglass')
       )
     ) {
      button = document.createElement("BUTTON");
      button.setAttribute('value',divs[i].getAttribute('title'));
      // proper W3C DOM method for styling
      button.setAttribute('style',button_style);
      // ...and now to make it work in IE
      button.style.cssText = button_style;
      divs[i].appendChild(button);
      if (divs[i].getAttribute('log')) { // only control buttons
        // override the IE opacity filter that Google annoyingly sets
        divs[i].style.filter = '';
        // should really set to 'transparent'
        divs[i].style.background =
        'url(http://www.google.com/intl/en_ALL/mapfiles/transparent.png)';
      }
    }
  }
}
