window.addEvent('domready', function(){
	var accordion;
	// Creating slideshow
	var slide = new HorizontalSlideshow( 'slideshow', 'slideshow_content', 'slideshow_block', 'slideshow_navigation', {
						auto_scrolling: {active: false},
						css: {left_arrow: 'prev',	right_arrow: 'next'}
					}
				);	
	
	var aGmap = $$('.gmap');
	var aLatitude = $$('.latitude');
	var aLongitude = $$('.longitude');
	var aPicto = $$('.pictoCarto');
			
	if ( aLongitude.length == aLatitude.length && aLongitude.length == aGmap.length && aLongitude.length == aPicto.length )
	{
		for(var i = 0; i < aGmap.length; i++ )
		{
			var chemin_picto = aPicto[i].value;
			if ( aLatitude[i].value != '' &&  aLongitude[i].value != '')
			{
				mapManager = new GMapManager( $(aGmap[i]), {
					oGPSCenter: {
						sLatitude	:	aLatitude[i].value,
						sLongitude	:	aLongitude[i].value
					},
					iZoomValue		:	11,
					sTypeData		:	'url',
					oIcon: {
						sIconPath	: 	chemin_picto,
						sIconSize	: 	new Array(21, 25),
						sIconAnchor	: 	new Array(21, 25)
					},
					sTplTip			: '',
					sAjaxURL		: '',
					oControl		: {
						bView		: true						
					},
					aDataMarkers: [{'latitude': aLatitude[i].value,'longitude': aLongitude[i].value}]
				});
			}
			else
			{
				if ($('gmap'))
					$('gmap').setStyle('display', 'none');
			}
		}
	} 
	else
	{
		if ($('gmap'))
			$('gmap').setStyle('display', 'none');
	}

	if ( isPrinting != true ) 
	{
		var trig = $$('div.acc_toggler');
		var box = $$('div.acc_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
			}
		);
	}
	
});

