jQuery(document).ready(function(){
	$('#contenu').addClass('js');
		
	/*----------*/
	$("a[href$='.pdf']").attr('target','_blank');
	//$("a:not([href*='"+$("base").attr('href')+"'])").find("a[href|='http']").attr('target','_blank');
	$("a[href^='http']:not(a[href*='"+$("base").attr('href')+"'])").attr('target','_blank');
	
	/*----------*/
	
	$('.acc_t').click(function() {
		$(this).next('.acc_c').stop();
		if($(this).next('.acc_c').is(':visible'))
		{
			$(this).next('.acc_c').find('.go_log').stop().hide();
			$(this).next('.acc_c').find('.go_filet').stop().hide();
			$(this).next('.acc_c').slideUp('slow', function(){
				$(this).find('.go_log').stop().css('left','480px');
				$(this).find('.go_filet').stop().css('width', 0);
			});
		}else{
			$(this).next('.acc_c').slideDown('slow', function(){
				$(this).find('.go_log').stop().show().css('opacity',0).animate({'opacity':1,'left':'520px'},500, function(){
					$(this).prev('.go_filet').stop().show().css('width', 0).animate({'width':'81px'},200);
				});
			});
		}
		
		return false;
	}).next().hide();
	$('.acc_c').wrapInner('<div class="new" />');
	
	var theUrl = window.location.href;
	var hashValue = theUrl.split('#')[1];

	if(typeof(hashValue)!='undefined')
	{
		$('a[name='+hashValue+']').parent().click();
	}
	
	/*----------*/
	
	$('#forma_scroll > div:not(:first)').append('<div class="close"></div>');
	$('#forma_link a').click(function(e) {
		e.preventDefault();
		
		$(this).parent().siblings().stop().css('margin-left',0);
		$(this).parent().stop().animate({'margin-left':'15px'},200);
		id = $(this).parent().index()+1;
		$('#forma_scroll').stop().animate({'left':-$('#forma'+id).position().left+'px'}, 900);
		return false;
	}).next().hide();
	
	$('.close').click(function(e){
		$('.menu_fleche li').stop().css('margin-left',0);
		$(this).parent().parent().stop().animate({'left': 0},500);
	});
	
	$('#print').css('cursor','pointer').click(function()
	{
		window.print();
		return false;
	});
});

