function MyApplication() {
        var geocoder;
        var map;
        //var address = new Array();
        address = document.getElementById('gmap_address').innerHTML;
        //address[1] = "9011, Győr HU";
        var name = "Ez itt a felirat a buborékban";

        // Create new map object
          map = new GMap2(document.getElementById("gmap_div"));
          map2 = new GMap2(document.getElementById("gmap_div2"));

          // Create new geocoding object
          geocoder = new GClientGeocoder();

          // Retrieve location information, pass it to addToMap()
          geocoder.getLocations(address, addToMap);
          geocoder.getLocations(address, addToMap2);
          map.enableScrollWheelZoom();
          map2.enableScrollWheelZoom();
          map.addControl(new GLargeMapControl());
          

        function addToMap(response)
        {
          // Retrieve the object
          place = response.Placemark[0];

          // Retrieve the latitude and longitude
          point = new GLatLng(place.Point.coordinates[1],
                              place.Point.coordinates[0]);

          // Center the map on this point
          map.setCenter(point, 15);

          // Create a marker
          marker = new GMarker(point);

          // Add the marker to map
          map.addOverlay(marker);

          // Add address information to marker
          marker.setImage('http://www.budapest.com/themes/absol/images/x.png');
          //marker.openInfoWindowHtml(place.address + "<br/>" + name);
          
          // atadom a lathato terkepszelveny koordinatait az oldalra (keresehez kell majd)
          	var bounds = map.getBounds();
			var southWest = bounds.getSouthWest();
			var northEast = bounds.getNorthEast();
			TopLeftLng = southWest.lng();
			TopLeftLat = southWest.lat();
			BottomRightLng = northEast.lng();
			BottomRightLat = northEast.lat();
			
			document.getElementById('gps_tleft_lat').value 		= TopLeftLat;
			document.getElementById('gps_tleft_lng').value 		= TopLeftLng;
			document.getElementById('gps_bright_lat').value 	= BottomRightLat;
			document.getElementById('gps_bright_lng').value 	= BottomRightLng;
       }
       
        function addToMap2(response)
        {
          // Retrieve the object
          place = response.Placemark[0];

          // Retrieve the latitude and longitude
          point = new GLatLng(place.Point.coordinates[1],
                              place.Point.coordinates[0]);

          // Center the map on this point
          map2.setCenter(point,12);

          // Create a marker
          marker = new GMarker(point);

          // Add the marker to map
          map2.addOverlay(marker);

          // Add address information to marker
          marker.setImage('http://www.budapest.com/themes/absol/images/x.png');
          //marker.openInfoWindowHtml(place.address + "<br/>" + name);
       }       

}

function initialize() {
    if (!GBrowserIsCompatible()) { return; }
    var application = new MyApplication();
}




