var map;
var geocoder;

function initialize() {
	map = new GMap2(document.getElementById("map_canvas"));
	map.setCenter(new GLatLng(47.657988, 16.012573), 8);
	//map.addControl(new GLargeMapControl());
	geocoder = new GClientGeocoder();
}

function addAddressToMap(response) {
	//map.clearOverlays();
	if (!response || response.Status.code != 200) {
		alert("Sorry, we were unable to geocode that address");
	} else {
		place = response.Placemark[0];
		point = new GLatLng(place.Point.coordinates[1],
		place.Point.coordinates[0]);
		marker = new GMarker(point);
		map.addOverlay(marker);
		GEvent.addListener(marker, "click", function() {
			marker.openInfoWindowHtml(place.address);
		});
		//marker.openInfoWindowHtml(place.address);

		map.setCenter(new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]), 15);
	}
}

function showLocation(akarmi) {
	var address = akarmi;
	geocoder.getLocations(address, addAddressToMap);
}
