﻿window.attachEvent('onload', GLoad);
//window.attachEvent('onunload', GUnload);

function GLoad() {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map"));
    
    // Show the large zoom controls
    map.addControl(new GLargeMapControl());
    
    // Show the Satellite/Hybrid controls
    //map.addControl(new GMapTypeControl());            
    
    // Focus on the address (longitude/latitude)
    map.setCenter(new GLatLng(51.514266,-0.104907), 16);
       
    // Zoom in to get closer to be able to see street names
    //map.zoomIn();
    
    // Place a marker in the center of the map
    var marker = new GMarker(map.getCenter());
    map.addOverlay(marker);
    
    // Open the info window automatically
    GShowInfoWindow(marker);
    
    // Allow the marker to be clicked on to re-open the info window
    GEvent.addListener(marker, "click", function() {GShowInfoWindow(marker);});

  }
}

function GShowInfoWindow(marker)
{
    marker.openInfoWindowHtml("<b>Forensic &amp; Compliance Systems</b><br />107-111 Fleet Street<br />London EC4A 2AB<br /><br /><br /><a href='http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=EC4A+2AB&sll=36.509937,-4.886352&sspn=0.215789,0.440826&ie=UTF8&ll=51.515366,-0.104907&spn=0.005221,0.013776&z=16&iwloc=A' target='_blank'>Get directions here <img src='images/new-window.gif' align='middle' border='0' alt='Open larger map in a new window' /></a>");
}