$(document).ready(function(){

        if (document.URL=="http://www.brucepoker.com/?pokerclubs"){
            googleMapsLoad();
	alert('test');
	
	}
    });



    /*
     * What to do when the window closes.
     */
    $(window).unload(function () {
        if (url_path=="/?pokerclubs")
            GUnload();
    });



// Google Maps FUNCTIONS =============================================================================================================================================================

function googleMapsLoad() {
    if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(53.409532, -7.844238), 6);

        GDownloadUrl("http://www.brucebetting.com/shop_locations.xml", function(data) {
            var xml = GXml.parse(data);
            var markers = xml.documentElement.getElementsByTagName("marker");
            for (var i = 0; i < markers.length; i++) {
                var name = markers[i].getAttribute("name");
                var address = markers[i].getAttribute("address");
                var type = markers[i].getAttribute("type");
                var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng")));
                var marker = googleMapsCreateMarker(point, name, address, type);
                map.addOverlay(marker);
            }
        });
    }
}

function googleMapsCreateMarker(point, name, address, type) {
   /* var gIconBlue = new GIcon();
    gIconBlue.image = 'http://www.brucebetting.com/graphics/mm_20_red.png';
    gIconBlue.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    gIconBlue.iconSize = new GSize(12, 20);
    gIconBlue.shadowSize = new GSize(22, 20);
    gIconBlue.iconAnchor = new GPoint(6, 20);
    gIconBlue.infoWindowAnchor = new GPoint(5, 1);

    var gIconRed = new GIcon();
    gIconRed.image = 'http://www.brucebetting.com/graphics/mm_20_red.png';
    gIconRed.shadow = 'http://labs.google.com/ridefinder/images/mm_20_shadow.png';
    gIconRed.iconSize = new GSize(12, 20);
    gIconRed.shadowSize = new GSize(22, 20);
    gIconRed.iconAnchor = new GPoint(6, 20);
    gIconRed.infoWindowAnchor = new GPoint(5, 1);

    var gCustomIcons = [];
    gCustomIcons["shop x"] = gIconBlue;
    gCustomIcons["shop"] = gIconRed;

    var marker = new GMarker(point, gCustomIcons[type]);
    var html = "<b>" + name + "</b> <br/>" + address;
    GEvent.addListener(marker, 'click', function() {
        marker.openInfoWindowHtml(html);
*/
    });
   /* return marker; */

}
