if (GBrowserIsCompatible()) {
                var gmarkers = [];
                var gicons = [];

                gicons["Beach"] = new GIcon(G_DEFAULT_ICON, "http://google-maps-icons.googlecode.com/files/beach.png");
                gicons["Church"] = new GIcon(G_DEFAULT_ICON, "http://google-maps-icons.googlecode.com/files/church.png");
                gicons["Landmark"] = new GIcon(G_DEFAULT_ICON, "http://google-maps-icons.googlecode.com/files/embassy.png");
                gicons["Shipwreck"] = new GIcon(G_DEFAULT_ICON, "http://google-maps-icons.googlecode.com/files/museum-naval.png");

                // A function to create the marker and set up the event window
                function createMarker(point, name, category) {
                    var marker = new GMarker(point, gicons[category]);
                    // Store the category and name info as a marker properties
                    marker.mycategory = category;
                    marker.myname = name;
                    GEvent.addListener(marker, "click", function() 
                    {
                        //marker.openInfoWindowHtml(html);
                    });
                    gmarkers.push(marker);
                    return marker;
                }

                // shows all markers of a particular category, and ensures the checkbox is checked
                function show(category) {
                    for (var i = 0; i < gmarkers.length; i++) {
                        if (gmarkers[i].mycategory == category) {
                            gmarkers[i].show();
                        }
                    }
                    // check the checkbox
                    document.getElementById(category + "Box").checked = true;
                }

                // hides all markers of a particular category, and ensures the checkbox is cleared
                function hide(category) {
                    for (var i = 0; i < gmarkers.length; i++) {
                        if (gmarkers[i].mycategory == category) {
                            gmarkers[i].hide();
                        }
                    }
                    // clear the checkbox
                    document.getElementById(category + "Box").checked = false;
                    // close the info window, in case its open on a marker that we just hid
                    map.closeInfoWindow();
                }

                // a checkbox has been clicked
                function boxclick(box, category) {
                    if (box.checked) {
                        show(category);
                    }
                    else {
                        hide(category);
                    }
                }

                function myclick(i) {
                    GEvent.trigger(gmarkers[i], "click");
                }

                // create the map
                var map = new GMap2(document.getElementById("map_1"));
                map.addControl(new GLargeMapControl());
                map.addControl(new GMapTypeControl());
                map.setCenter(new GLatLng(51.593282, -4.121246), 11);

                // Read the data
                GDownloadUrl("Data/GoogleMapCatMarkers.xml", function(doc) {
                    var xmlDoc = GXml.parse(doc);
                    var markers = xmlDoc.documentElement.getElementsByTagName("marker");

                    for (var i = 0; i < markers.length; i++) {
                        // obtain the attribues of each marker
                        var lat = parseFloat(markers[i].getAttribute("lat"));
                        var lng = parseFloat(markers[i].getAttribute("lng"));
                        var point = new GLatLng(lat, lng);

                        var name = markers[i].getAttribute("name");
                        var category = markers[i].getAttribute("category");
                        // create the marker
                        var marker = createMarker(point, name, category);
                        map.addOverlay(marker);
                    }

                    // show or hide the categories initially
                    show("Beach");
                    hide("Church");
                    hide("Landmark");
                    hide("Shipwreck");
                });
            }
            else {
                alert("Sorry, the Google Maps API is not compatible with this browser");
            }