var map = null;
var geocoder = null;
var tinyIcon = new GIcon();
var point

function initialize(mapname) {
	
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById(mapname));
		map.addControl(new GSmallMapControl());
	
		geocoder = new GClientGeocoder();
		
	
		tinyIcon.image = "http://www.thueringenweb.de/images/map_dartpfeil.png";
		//tinyIcon.shadow = "http://www.thueringenweb.de/images/map_fahne_schattenpng";
		tinyIcon.iconSize = new GSize(79, 45);
		//tinyIcon.shadowSize = new GSize(22, 20);
		tinyIcon.iconAnchor = new GPoint(10, 33);
		tinyIcon.infoWindowAnchor = new GPoint(5, 1);
		
		
	}
}

function viewPoint (point) {
	//alert(point);
	map.setCenter(point, 15);

	// Set up our GMarkerOptions object literal
	markerOptions = { icon:tinyIcon };

	var marker = new GMarker(point,markerOptions);
	// Set up our GMarkerOptions object literal

	map.addOverlay(marker);
	//marker.openInfoWindowHtml(address);
}

function showAddress_LL(myLongitude, myLatitude) {
	
	if (geocoder) 
	{

		if (myLatitude!='' && myLongitude!='') {
			var point = new GLatLng(myLatitude, myLongitude)
			viewPoint(point);
		}
	}
		
}		

function showAddress_ADD(address) {
	
	if (geocoder) 
	{

		geocoder.getLatLng(
			address,
			function(point) 
			{

				if (!point) 
				{
					tinyIcon.image = "http://www.thueringenweb.de/images/map_nofound.png";
					viewPoint(point);
				} 
				else 
				{
					viewPoint(point);
				}
			}
		);
		
	}
}