var heatmapTileLayer;

function initHeatMap() {
  bounds = new GLatLngBounds( new GLatLng(-90, -180)
                            , new GLatLng(90, 180)
                             );
  copyright = new GCopyright( ''
                            , bounds
                            , 0
                            , "(c) 2010 Total Active Media " +
                              "<http://www.totalactivemedia.nl/>"
                             );
  copyrights = new GCopyrightCollection();
  copyrights.addCopyright(copyright);
  heatmap = new GTileLayer(copyrights, 10, 0);
  heatmap.getTileUrl = function (tile, zoom) {
      base = 'http://acceptatie2.totalactivemedia.nl:8080/';
      color_scheme = 'classic';
      url = base + color_scheme +'/'+ current_hash +'/'+ zoom +'/'
      url += tile.x +','+ tile.y +'.png';
      return url;
  }
  heatmap.isPng = function () {return true;}
  heatmap.getOpacity = function () {return 1.0;}
  heatmapTileLayer = new GTileLayerOverlay(heatmap);
}

function showHeatmap() {
  map.addOverlay(heatmapTileLayer);
}

function hideHeatmap() {
  map.removeOverlay(heatmapTileLayer);
}
