﻿var map;

function initialize() 
{
	if (GBrowserIsCompatible()) 
	{
		map = new GMap(document.getElementById("map_canvas"));
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl());
		map.centerAndZoom(new GLatLng(55.60, 12.80), 7);		
	}
}

function GoToLatLng(lat, lng)
{
	map.centerAndZoom(new GLatLng(lng, lat), 4);
	map.addOverlay(new GMarker(new GLatLng(lng, lat)));
}

function FindAdress(address)
{
	var geocoder = new GClientGeocoder();

	geocoder.getLatLng(
	address,
	function(point) 
	{
		if (!point) 
		{
			//alert(address + " not found");
		} 
		else 
		{
			map.setCenter(point, 13);
			var marker = new GMarker(point);
			map.addOverlay(marker);
		}
	}
	);
}