﻿        var map = null;
        var geocoder = null;
        function load() {
            if (GBrowserIsCompatible()) {
                map = new GMap2(document.getElementById("map"));
                map.setCenter(new GLatLng(48.133689, 17.194075), 13);
                map.addControl(new GSmallMapControl());
                map.addControl(new GOverviewMapControl());
                map.addControl(new GMapTypeControl());
                map.enableDoubleClickZoom();
	            map.enableScrollWheelZoom();
	            geocoder = new GClientGeocoder();

	            var address = 'Office: Ulica svornosti 43, 821 06 Bratislava, Slovakia';
	            point = new GLatLng(48.133689, 17.194075);

	            var marker = new GMarker(point);
	            map.setCenter(point, 13);
	            map.addOverlay(marker);
	            map.setMapType(G_NORMAL_MAP);
	            GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(address); });
	            marker.openInfoWindowHtml(address);
            }
        } 
        function showAddress(address,text) {
            if (geocoder) {
                geocoder.getLatLng(
          address,
          function(point) {
              if (!point) {
                  alert(address + " not found");
              } else {
                  map.setCenter(point, 13);
                  var marker = new GMarker(point);
                  map.addOverlay(marker);
                  marker.openInfoWindowHtml(text);
              }
          }
        );
            }
        }

