// JavaScript Document
$(document).ready(function(){
	
	/*$('#bgImg').css({left:$('.header').offset().left+$('.header').outerWidth()-200,top:$(window).height()-$('#bgImg').height()-40});*/
	
	$('.LeftLine').css({height:$(window).height()});
	$(document).scroll(function() {
	  $('.LeftLine').css({top:$(document).scrollTop()});
	});
	
	$('.header .bandeau .bandeauIn .shadow').dropShadow({left:2,top:1,opacity:0.3});
	
	$('.header .topMenu .bandeau').mouseenter(function(){
		if(!$(this).find('.bandeauIn').hasClass('bandeauSelected'))
			$(this).find('.bandeauIn').addClass('bandeauOver');
	});
	$('.header .topMenu .bandeau').mouseleave(function(){
		if(!$(this).find('.bandeauIn').hasClass('bandeauSelected'))
			$(this).find('.bandeauIn').removeClass('bandeauOver');
	});
	
	
	$('.menuLeft > ul > li > ul > li > a.on').parent().parent().addClass('chosenSubMenu');
	$('.menuLeft > ul > li').mouseenter(function(){
		if(!$(this).find('ul').hasClass('over')) {
			$(this).find('ul').addClass('over');
			$(this).find('ul').slideDown(300);
		}
	});
	
	$('.menuLeft').mouseleave(function(){
		$('.menuLeft ul li ul').each(function(){
			$(this).removeClass('over');
			if(!$(this).hasClass('chosenSubMenu')) {
			$(this).slideUp(200);
			}
		});
	});
	
	
	$('.expendableTrigger').mouseenter(function(){
		$(this).find('p').find('.arrow').addClass('arrowOver');											
	});
	$('.expendableTrigger').mouseleave(function(){
		$(this).find('p').find('.arrow').removeClass('arrowOver');
	});
	$('.expendableTrigger').live('click',function(){
		if($(this).hasClass('expand')) {
			$(this).removeClass('expand');
			$(this).next('.expendableText').slideUp();
			$(this).find('p').find('.arrow').html("D&eacute;couvrir les crit&egrave;res");
		}
		else {
			$(this).addClass('expand');
			$(this).next('.expendableText').slideDown();
			$(this).find('p').find('.arrow').html("Masquer les crit&egrave;res");
		}
	});
});
