/**
 * Google maps set up for the locations page, allows for the showing
 * off the three offices
 *
 * @package    byronfinance.com
 * @author     Rob Edwards
 * @copyright  (c)  bryce:FARRAH
 */



/**
 * Get it all going
 *
 * @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);
        
        //Set up the marker ''+
        point = new GLatLng(51.37265,-0.53679);
        name = 'Chertsey';
        address = "3000 Hillswood Drive, KT16 0RS";
        details = '<h1>Chertsey Office</h1>'+
        '<p> Tel: +44 (0)1932 895888<br />'+
        'Email: <a href="mailto:chertsey@byronfinance.com" title="Email our Chertsey office">chertsey@byronfinance.com</a>'+
        '</p>';
        
        //Add the marker to the map
        createMarker(map, point, name, details, address);
        
        //Set up the marker
        point = new GLatLng(51.49485,-0.1458);
        name = 'London';
        address = "111 Buckingham Palace Road, SW1W 0SR";
        details = '<h1>London Office</h1>'+
        '<p> Tel: +44 (0)20 7340 8555<br />'+
        'Email: <a href="mailto:london@byronfinance.com" title="Email our London office">london@byronfinance.com</a>'+
        '</p>';
        
        //Add the marker to the map
        createMarker(map, point, name, details, address);
    }
}