/*
 *
 *	@titre: home.
 *	@description: javascript homepage.
 *	@auteur: neov - http://www.neov.net.
 *	@creation: 20100713.
 *	@modification: - .
 *	@required: jquery 1.4.2.
 *
*/


$(
	function()
	{
		btnPreviousCarousel = j_basepath + "design/front/images/bouton/carousel-prev.jpg" ;
		btnNextCarousel = j_basepath + "design/front/images/bouton/carousel-next.jpg" ;

		$('.carousel ul').jcarousel(
			{
				visible:		1,
				wrap:			'circular',
				auto:			6,
				scroll:			1,
				animation:		2500,
				buttonNextHTML: '<a href="#" title="Suivant" class="next"><img src="' + btnNextCarousel + '" width="25" height="25" alt="Suivant" /></a>',
				buttonPrevHTML: '<a href="#" title="Précedent" class="prev"><img src="' + btnPreviousCarousel + '" width="25" height="25" alt="Précedent" /></a>',
				initCallback:	function(carousel)
								{
									// init container.
									var $el = $(carousel.container.parent());
									$el.addClass('loaded-carousel');
									
									// hover action.
									carousel.clip.hover(
										function() {
											carousel.stopAuto();
										}, function() {
											carousel.startAuto();
										}
									); 
								}
			}
		) ;

		var avis_h = $('.avis').height() ;
		var rdv_h = $('.rdv').height() ;

		var el_h = Math.max(avis_h, rdv_h) ;

		$('.avis').height(el_h) ;
		$('.rdv').height(el_h) ;

	}
) ;
