// JavaScript Document


// Fait clignoter un element
function Clignote ( eid , speed )
{
	if ( speed == undefined ) speed = 'slow';
	
	var fadeIn = function FadeIn ( eid )
	{
		jQuery('#' + eid).fadeIn ( speed , function() { fadeOut ( eid ); } );
	}
	
	var fadeOut = function FadeOut ( eid )
	{
		jQuery('#' + eid).fadeOut ( speed , function() { fadeIn ( eid ); } );
	}
	
	fadeOut ( eid );
}


/*
// Fait défiler un texte
function Defile ( eid , speed )
{
	if ( speed == undefined ) speed = 20;

	jQuery('#' + eid).marquee('pointer').mouseover
	(
		function ()
		{
			$(this).trigger('stop');
		}
	).mouseout
	(
		function ()
		{
			$(this).trigger('start');
		}
	)
	
}
*/


// Gère un slideshow
function Slideshow ( eid , ctrls , speed )
{
	if ( ctrls  == undefined ) ctrls = true;
	if ( speed  == undefined ) speed = 3000;
	
	
	// Determine la taille de la plus grande image
	var width = 0;
	var height = 0;
	var element = document.getElementById( eid );
	for ( i = 0; i < element.childNodes.length; i++ )
	{
		var child = element.childNodes[i];
		if ( child.width > width )
			width = child.width;
		if ( child.height > height )
			height = child.height;
	}

	
	
	jQuery(document).ready(
	function()
	{
		jQuery('#' + eid).slideshow(
		{
			title:false,
			width:width,
			height:height,
			playframe:false,
			time:speed,
			play:true,
			imgresize:false,
			imgzoom:false,
			panel:ctrls,
			imgcenter:true,
			
			controls:
			{
				'hide':false,
				'help':false
			}
		});
	}
);
}


