function initArenaPage(){
  map = new GMap2(document.getElementById('map'));
  geocoder = new GClientGeocoder();

  //var burnsvilleMN = new GLatLng(44.797916,-93.278046);
  //map.setCenter(burnsvilleMN, 8);
  //showAddress("866 boul. Gérard Cadieux Beauharnois, Québec  J6N 2G2")
  addr = $(".street-address").html() +" "+ $(".locality").html() +" "+ $(".region").html() +" "+ $(".postal-code").html();
  showAddress(addr );
  $("#map").show();
  if(startlocation){
    directionsPanel = document.getElementById("route");
    directions = new GDirections(map, directionsPanel);
    directions.load("from: "+startlocation+" to: "+addr);
  }
  $("#startlocform").submit(function(){
    if(!directions){
      directionsPanel = document.getElementById("route");
      directions = new GDirections(map, directionsPanel);
    }
    document.getElementById("route").innerHTML = "";
    directions.load("from: "+$("#startlocfield").val()+" to: "+addr,{"locale":"fr_CA"});
    //GEvent.addListener(directions, "load", function() {
    //}
    GEvent.addListener(directions, "error", function() {
      document.getElementById("route").innerHTML = "<span style='color: brown'>Malheureusement, l'adresse que vous avez entrée n'a pas pu être trouvée.</span>";
      s = directions.getStatus();
      try{
        if(s['code'] == 200){
          alert("200 baby");
        }
      }catch(e){
        alert("Il y a eu une erreur attrappée");
      }
    });
    
    return false;
  });
}
function initArenasPage(){
}
function showAddress(address) {
  if (geocoder) {
    geocoder.getLatLng(
      address,
      function(point) {
      if (!point) {
        //alert(address + " not found");
        document.getElementById("map").innerHTML = "Couldn't find this address on a map.";
      } else {
        map.setCenter(point,13);
        //map.addControl(new GSmallMapControl());
        //map.setMapType(G_HYBRID_MAP);
        map.setZoom(16);
        map.setUIToDefault();
        
        var marker = new GMarker(point);
        marker.title = "Click to get directions from Google maps";
        map.addOverlay(marker);
        var durl = 'http://maps.google.com/?q='+escape(address);
        GEvent.addListener(marker, "click", function (){
          infowin = map.getInfoWindow();
          infowin.setLatLng(point);
          infowin.show();
          //window.open('http://maps.google.com/?q='+escape(address),'mywindow','');
        });
        
        
        //marker.openInfoWindowHtml("<h1>Hello</h1>"+address);
        //marker.openInfoWindowHtml(document.createTextNode("Hello, world"));
      }
      }
    );
  }
}