window.addEvent('domready', function(){
    geocoder = new google.maps.Geocoder();
	
	/*var addresses = [
					 	{
							'lat': 50.854640,
							'lng': 4.399306,
							'title': 'Moof - Museum of original figurines', 
							'info':'<strong>Moof</strong><br />Blvd Auguste Reyers 32<br />1030 Bruxelles<br /><br />T : 0032 (0)2 705 57 09 - F : 0032 (0)2 705 57 09',
							'icon':{
								img: '/moof_icon_googlemaps.png', 
								size: {x:30, y:63}, 
								point1: {x:0, y:0}, 
								point2: {x:0, y:63}
							},
							'center': true
						},
						{
							'lat': 50.853431, 
							'lng': 4.402235,
							'title': 'Parking de délestage de la RTBF sortie E40 Liège - Bruxelles Reyers', 
							'info':'<strong>Parking</strong><br />Parking de délestage de la RTBF sortie E40 Liège - Bruxelles Reyers',
							'icon':{
								img: '/parking_icon_googlemaps.gif', 
								size: {x:25, y:25}, 
								point1: {x:0, y:0}, 
								point2: {x:0, y:25}
							},
							'center': false
						},
						{
							'lat': 50.855237, 
							'lng': 4.400116,
							'title': 'Parking accès libre de grande surface commerciale Distance 200 m', 
							'info':'<strong>Parking</strong><br />accès libre de grande surface commerciale Distance 200 m',
							'icon':{
								img: '/parking_icon_googlemaps.gif', 
								size: {x:25, y:25}, 
								point1: {x:0, y:0}, 
								point2: {x:0, y:25}
							},
							'center': false
						}
					];	
	*/

	var addresses = [
					 	{
							'lat': 50.846123,
							'lng': 4.356084,
							'title': 'Moof - Museum of original figurines', 
							'info':'<strong>Moof</strong><br />Rue Marché-aux-herbes 116<br />1030 Bruxelles<br /><br />T : 0032 (0)2 265 33 25 - F : 0032 (0)2 265 33 25',
							'icon':{
								img: '/moof_icon_googlemaps.png', 
								size: {x:30, y:63}, 
								point1: {x:0, y:0}, 
								point2: {x:0, y:63}
							},
							'center': true
						}
	];

	var myOptions = {
						zoom: 17,						
						mapTypeControl: true,
						mapTypeId: google.maps.MapTypeId.HYBRID,
						center: new google.maps.LatLng(50.846123,4.356084)
					}	
	
	var map = new google.maps.Map($("map_canvas"), myOptions);
	
	addresses.each(function(el){
							
		var latlng = new google.maps.LatLng(el["lat"], el["lng"]);
		

		var image = new google.maps.MarkerImage(el['icon']['img'],
						  new google.maps.Size(el['icon']['size']['x'], el['icon']['size']['y']),
						  new google.maps.Point(el['icon']['point1']['x'], el['icon']['point1']['y']),
						  new google.maps.Point(el['icon']['point2']['x'], el['icon']['point2']['y'])
		);
									
		var marker = new google.maps.Marker({
			position: latlng,
			map: map,
			icon: image,
			title: el["title"]
		});
													
		var html = el["info"];					
		var infowindow = new google.maps.InfoWindow({content: html});
					
		google.maps.event.addListener(marker, 'click', function() {
					infowindow.open(map,marker);
		});					
	});
});
