/*
// Site : http://press-papiers.com/
// Date : 2008-01-21
*/

//
// Printing functions
window.addEvent('domready', function() {
	$('print_link').addEvent('click', function(event)
	{
		event = new Event(event);
		if(event.target != $('print_link'))
		{ 
			window.print();
			event.stop(); 
		}
	});
});


//
// Phototheques functions
window.addEvent('domready', function()
{
	var phototheque = new Accordion('h2.phototheque', 'div.phototheque',
	{
		opacity: false,
		alwaysHide: true,
		display: -1,

		onActive: function(toggler, element)
		{
			toggler.setStyle('color', '#F60');
		},

		onBackground: function(toggler, element)
		{
			toggler.setStyle('color', '#666');
		}
	}, $('phototheques'));
}); 

window.addEvent('domready', Lightbox.init.bind(Lightbox));


//
// Communiqués functions
window.addEvent('domready', function()
{
	if($$('div.communique').length == 1) return;

	var communique = new Accordion('h2.communique', 'div.communique',
	{
		opacity: false,
		alwaysHide: true,
		display: -1,
		duration: 400,

		onActive: function(toggler, element)
		{
			toggler.setStyle('color', '#F60');
		},

		onBackground: function(toggler, element)
		{
			toggler.setStyle('color', '#666');
		}
	}, $('communiques'));
});


//
// Css Styling
window.addEvent('domready', function()
{

	var list_communiques = $$('div.communique a');

	list_communiques.each(function(element)
	{
		var fx = new Fx.Styles(element, {duration:200, wait:false});

		element.addEvent('mouseenter', function(){
			fx.start({
				'color'            : '#F60'
			});
		});

		element.addEvent('mouseleave', function(){
			fx.start({
				'color'           : '#666'
			});
		});
	});	
});
