// JavaScript Document
$(document).ready(function() {
	//
	$("#bloc_actu_sommaire").tabs({ fx: { opacity: 'toggle' } }).tabs('rotate', 6000);
	$('#bloc_actu_sommaire').hover(function(){
			$(this).tabs('rotate', 0, false);
		},function(){
			$(this).tabs({ fx: { opacity: 'toggle' } }).tabs('rotate', 6000);
		}
	);
	//
	function tick2(){
		$('#ticker_02 li:first').slideUp( function () { $(this).appendTo($('#ticker_02')).slideDown(); });
	}
	setInterval(function(){ tick2 () }, 7000);

	/* Changing thedefault easing effect - will affect the slideUp/slideDown methods: */
	$.easing.def = "easeOutSine";
	/* Binding a click event handler to the links: */
	$('h1.button a').click(function(e){
		/* Finding the drop down list that corresponds to the current section: */
		var dropDown = $(this).parent().next();
		/* Closing all other drop down sections, except the current one */
		$('.dropdown').not(dropDown).slideUp('slow');
		dropDown.slideToggle('slow');
		/* Preventing the default event (which would be to navigate the browser to the link's address) */
		e.preventDefault();
	})
	$("a.box_agenda").fancybox({
			'width'				: 400,
			'height'			: 400,
			'autoScale'			: false,
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'overlayOpacity'	: 0.5,
			'overlayColor'		: '#000000',
			'type'				: 'iframe'
		});
		$("a#bte_meteo").fancybox({
			'width'				: 700,
			'height'			: 406,
			'autoScale'			: false,
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'overlayOpacity'	: 0.5,
			'overlayColor'		: '#000000',
			'type'				: 'iframe'
		});
		$("a#art_actu").fancybox({
			'width'				: 640,
			'height'			: 510,
			'autoScale'			: false,
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'overlayOpacity'	: 0.2,
			'overlayColor'		: '#000000',
			'type'				: 'iframe'
		});
		$("a.diapo").fancybox({
				'overlayShow'	: false,
				'transitionIn'	: 'elastic',
				'transitionOut'	: 'elastic'
		});
		$("a[rel=groupe_img]").fancybox({
				'transitionIn'		: 'elastic',
				'transitionOut'		: 'elastic',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + titre : '') + '</span>';
				}
		});
});
