window.addEvent('domready', function(){

	var opciFx = new Fx.Morph($('topOpci'), { duration: 700, transition: Fx.Transitions.Quad.easeOut, link: 'cancel' });
	var scpiFx = new Fx.Morph($('topScpi'), { duration: 700, transition: Fx.Transitions.Quad.easeOut, link: 'cancel' });
	
	$('topScpi').addEvents({
		'mouseenter': function(){
			scpiFx.start({
				'left': 0,
				'width': 934
			});
			opciFx.start({
				'width': 0
			});
		},
		'mouseleave': function(){
			scpiFx.start({
				'left': 473,
				'width': 461
			});
			opciFx.start({
				'width': 464
			});
		}
	});
	$('topOpci').addEvents({
		'mouseenter': function(){
			scpiFx.start({
				'left': 934,
				'width': 0
			});
			opciFx.start({
				'width': 934
			});
		},
		'mouseleave': function(){
			scpiFx.start({
				'left': 473,
				'width': 461
			});
			opciFx.start({
				'width': 464
			});
		}
	});

	if($$('.cCarrouItem').length > 1){
		var links   = $$('.cCarrouLink');
		var linkNum = links.length;
		
		var toto = new mooVcarrousel('cCarrousel', 'cCarrouContent', 'cCarrouItem', {
			items   : {
				space : 4,
				width : 255
			},
			butts     : {
				nextB : "cCarrouNext",
				prevB : "cCarrouPrev"
			},
			onStart   : function(){
				links.each(function(el, i){
					i == 0 ? el.setStyle('left', 0) : el.setStyle('left', -10000);
				});
				this.i = 0;
			},
			onNext    : function(){
				this.i ++;
				if (this.i == linkNum) this.i = 0;
				links.each(function(el, i){
					i == this.i ? el.setStyle('left', 0) : el.setStyle('left', -10000);
				}.bind(this));
			},
			onPrev    : function(){
				this.i --;
				if (this.i == -1) this.i = linkNum - 1;
				links.each(function(el, i){
					i == this.i ? el.setStyle('left', 0) : el.setStyle('left', -10000);
				}.bind(this));
			}
		});
	}

}); //ends domready général
