
var elemMR = null;
var elemMRShowed = null;

function animMR() {
	elemMRShowed.hide();
	
	$('#plusInfos').animate({top:(elemMR.outerHeight(true)+20)+'px'}, 500, function() {
		elemMR.show();
		elemMR.animate({opacity: 1.}, 500);
		elemMRShowed = elemMR;
	});
}

$(document).ready(function() {
	$(window).scroll(function (e) {
		$('#rightBarScroll').stop();	
		var scrollTop = $(e.target).scrollTop() - $('#rightBarScroll').parent().offset().top;
		$('#rightBarScroll').animate({top:(scrollTop < 0 ? 0 : scrollTop)+'px'}, 1000);
	});
						   
	$('#redaction a').each(function() {
		$('#text-'+this.id).css('opacity', 0)
						   .hide();
	
		$(this).bind('click', function() {
			elemMR = $('#text-'+this.id);
			
			if(!elemMRShowed) {
				elemMRShowed = elemMR;
				animMR();
			}
			else if(elemMRShowed.attr('id') != elemMR.attr('id'))
				elemMRShowed.animate({opacity: 0.}, 200, animMR);
		});
	});
		   
   $('#kwixonx').click(function(e){
	   popuprnp3x();
	   e.stopPropagation();
	   return false;
   });

});


