window.addEvent('domready', function(){
	
	var oBounds = new GLatLngBounds();
	
	var map = new GMapManager(
		"gmap",
		{ 
			oGPSCenter :										
			{
				sLatitude: '43.608176',
				sLongitude: '3.8794455'
			},
			oIcon: {
				sIconPath	: 'img/global/framboise/large_picto.gif',
				sIconSize	: new Array('30', '30'),
				sIconAnchor	: new Array('10', '30')
			},
			iZoomValue : 8,
			oIconStart: {
				sIconPath	: './img/global/framboise/large_picto_start.gif',
				sIconSize	: new Array(30, 30),
				sIconAnchor	: new Array(10, 30) 
			},
			oIconFinish: {
				sIconPath	: './img/global/framboise/large_picto_finish.gif',
				sIconSize	: new Array(30, 30),
				sIconAnchor	: new Array(10, 30) 
			},
			oControl		: {
				bView		: true,
				sAnchor		: 0
			}
		}
	);
	
	map.tracePath(aPoints, '#EB2A5D', 5);
	map.addPoints(aHighlights, '../content/ajax/GMapTip.php');
	
	if (aPoints.length > 0)
	{
		aPoints.each(function(elem){
			oBounds.extend(new GLatLng(elem.latitude, elem.longitude));
		});
	}
	
	if (aHighlights.length > 0)
	{
		aHighlights.each(function(elem){
			oBounds.extend(new GLatLng(elem.latitude, elem.longitude));
		});
	}
	
	var iZoom = map.oMap.getBoundsZoomLevel(oBounds);
	map.oMap.setCenter(oBounds.getCenter(), iZoom);
	
	var trig = $$('div.highlight_toggler');
	var box = $$('div.highlight_element'); 
	var accordion = new MultipleAccordion(trig, box, {
			onActive: function(trig, i)
			{
				trig.addClass('selected');
			},
			onBackground: function(trig, i)
			{
				trig.removeClass('selected');
			},
			active: 'selected',
			inactive: '',
			opacity: false,
			alwaysHide: true
		}
	);
});
