/**
 * Google maps for the reigate office
 *
 * @package    byronfinance.com
 * @author     Rob Edwards
 * @copyright  (c)  bryce:FARRAH
 */



/**
 * Kicks off the map
 *
 * @author Rob Edwards
 */
$(document).ready(function() {
    setGoogleMaps();
});


/**
 * Generates the google maps content
 *
 * @author Rob Edwards
 */
function setGoogleMaps() {
    //Check that the browser is compatible
    if (GBrowserIsCompatible()) {
        
        //Create the map div and create a Google maps instance
        var map = new GMap2(document.getElementById("map"));
        
        //Enable special zoom on browsers which support it
        map.enableContinuousZoom();
        
        //Add controls to the map
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        
        //Set the start location of the map and the zoom level
        map.setCenter(new GLatLng(51.468952,-0.439453), 9);
        
        
        //Set up the marker
        point = new GLatLng(51.24186,-0.20489);
        name = 'Reigate';
        address = "Foundation House, 42-48 London Road, RH2 9QQ";
        details = '<h1>Reigate Office</h1>'+
        '<p> Tel: +44 (0)1737 228777<br />'+
        'Email: <a href="mailto:reigate@byronfinance.com" title="Email our Reigate office">reigate@byronfinance.com</a>'+
        '</p>';
        
        //Add the marker to the map
        createMarker(map, point, name, details, address);
    }
}