/* ****************************************************

	@file			gl0bal.js
	@description	Comportements globaux
	@author			Erick G (ixmedia.com)
	@date			27 mai 2010
	vim: set noet ts=4 fdm=marker fenc=utf-8:

***************************************************** */
function mycarousel_initCallback(carousel){
		// Pause l'autoscrolling si survolé par le curseur
		carousel.clip.hover(function() {
			carousel.stopAuto();
		}, function() {
			carousel.startAuto();
		});
};

(function($) {

	$(function() {



/* @effet HOVER du mnenu {{{
******************************************************************************/
		if (!($.browser.msie && $.browser.version.substr(0,1) < 7)) { // pas d'animation pour Explorer 6
			$('#corps').removeClass('sans-javascript');
			$('#menu li a.hover-graphique, #fil-nouveaute')
				.css({backgroundPosition: '0% 100%'})
				.mouseover(function(){
					$(this).stop().animate(
						{backgroundPosition:'(0% 0%)'},
						{duration:500}
					);
				})
				.mouseout(function(){
					$(this).stop().animate(
						{backgroundPosition:'(0% 100%)'},
						{duration:250}
					);
				});
		};

/* @Nouvelles SCROLL de l'accueil {{{
******************************************************************************/
		if ($('body#accueil').length) { // on load le script juste à l'accueil
			
			$('#scrolling-txt').jcarousel({
				vertical: true,
				visible: 1,
				scroll: 1,
				auto: tickerVitesse,
				wrap: 'both',
				initCallback: mycarousel_initCallback
			});

			$('#rotation_couvertures').serialScroll({
				items: 'li',
				start:0,
				step:1,
				exclude:2,
				duration:6500,
				interval: 1,//auto scroll constantly
				easing:'linear',
				constant:true,
				force:true,
				lock:true,
				cycle:true, //don't pull back once you reach the end
				jump: false //click on the images to scroll to them
			});
			$('#rotation_couvertures').hover(function(){
				$(this).stop().trigger('stop');
			},function(){
				$(this).stop().trigger('start');
			});

		};


/*}}}*/

	})

})(jQuery);
