// JavaScript Document
function mapa() {
      this.map = new GMap2(document.getElementById("map"));
      this.map.setCenter(new GLatLng(52.1065,19.1601), 5);
      this.map.addControl(new GLargeMapControl());
      this.map.addControl(new GMapTypeControl());
      this.p = new Array();
      this.m = new Array();
      /*
      var myWindow= GEvent.bind(this.m, "click", this,function() {
        var myHtml = 'gg';
        this.map.openInfoWindowHtml(this.p, myHtml);
      });
      */
      /*
      function createMarker(point, number) {
        var marker = new GMarker(point);
        var message = ["This","is","the","secret","message"];
        marker.value = number;
        GEvent.addListener(marker, "click", function() {
          var myHtml = "<b>#" + number + "</b><br/>" + message[number -1];
          map.openInfoWindowHtml(point, myHtml);
        });
        return marker;
      }
      */
      this.odzial = function(lat,lng,i,message){
        this.p.push(new GLatLng(lat,lng));
        this.m.push(new GMarker(this.p[i]));
        GEvent.bind(this.m[i], "click", this,function() {
          var myHtml = message;
          this.map.setCenter(new GLatLng(lat,lng), 12);
          this.map.openInfoWindowHtml(this.p[i], myHtml);
        });
        this.map.addOverlay(this.m[i]);
      }
      

}
