//################### GOOGLE-MAP .... #########################//
var map;
var geocoder;
var icon;

function initialize() {
	map = new GMap2(document.getElementById("kartenuebersicht"));
	map.setCenter(new GLatLng(document.f2.q2.value, document.f2.q1.value), 5);
	geocoder = new GClientGeocoder();
	
	icon = new GIcon();
	icon.image = "images/pin_googlemap.png";
	icon.shadow = "images/pin_googlemap_shadow.png";
	icon.iconSize = new GSize(53, 60);
	icon.shadowSize = new GSize(53, 60);
	icon.iconAnchor = new GPoint(0, 60);
	icon.infoWindowAnchor = new GPoint(5, 2);
}

function addAddressToMap(response) {
	map.clearOverlays();
	if (!response || response.Status.code != 200) {
		point = new GLatLng(document.f2.q2.value,document.f2.q1.value);
		map.setCenter(new GLatLng(document.f2.q2.value, document.f2.q1.value), 14);
	} else {
		place = response.Placemark[0];
		point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
		map.setCenter(new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]), 14);
	}
	marker = new GMarker(point, icon);
	map.addOverlay(marker);
	
	_mPreferMetric = true;
	//var OMap = new GOverviewMapControl(); 
	//map.addControl(OMap);
	//OMap.hide(false);

	map.addControl(new GOverviewMapControl());
	map.addControl(new GLargeMapControl());
	map.addControl(new GMapTypeControl()); 

}

function showLocation() {
	geocoder.getLocations(document.f2.q.value, addAddressToMap);
}





