var map, Map = Class.create();
Map.prototype = {
	initialize: function(){
		this.map = new GMap2($('map'));
		this.map.addControl(new GSmallMapControl());
		this.map.addControl(new GMapTypeControl());
		
		this.directions = new GDirections(this.map, $('directions'));
		
		point = new GLatLng(52.629475, 4.946964);
		this.map.setCenter(point, 13);
		this.map.addOverlay(new GMarker(point));
		this.map.setMapType(G_HYBRID_MAP);
	},

	plan: function(address, city) {
		if(address != '') address += ', '
	
		this.directions.load('from: ' + address + city + ' to: De Goorn 21, De Goorn');
	
		new Effect.Fade('contactform', {duration: 1});
	
		window.setTimeout(function(){
			new Effect.ScrollTo('map');
			
			new Effect.Appear('route');
		}, 1000);
	}
}