// JavaScript Document


function refreshLogos() {

    $(".logo").hide();
                    $("#references li a").hover(
                        function () {
                            $(this).children(".bgColor").fadeTo(300, 0.8);
                            $(this).children(".logo").fadeIn(500);
                        },
                        function () {
                            $(this).children(".bgColor").fadeOut(300);
                            $(this).children(".logo").fadeOut(500);
                        }
                    );

}


$(document).ready(function(){
						   
	// News
	//--------------------------------------------------------------------------------------
	//mouseover
	$(".hover").parent("a").mouseover (
		function () {
                        $(this).children(".hover").animate({
				 "opacity": ".80"
			}, 300);
		}
	);
	//mouseout
	$(".hover").parent("a").mouseout (
		function () {
			$(this).children(".hover").animate({
				 "opacity": "0"
			}, 300);
		}
	);
	
	$("#news .item h2 a").mouseover (
		function () {
			$(this).parent().parent().children("a").children(".hover").animate({
				 "opacity": ".80"
			}, 300);
		}
	);
	//mouseout
	$("#news .item h2 a").mouseout (
		function () {
			$(this).parent().parent().children("a").children(".hover").animate({
				 "opacity": "0"
			}, 300);
		}
	);
	
	// Sub Menu
	//--------------------------------------------------------------------------------------
	$("#sub-menu > li ul li a ").hover(
		function () { 
			if ( ! $(this).hasClass('active') ) {
				$(this).isHover = true;
				$(this).animate({"padding-right": "15px", "padding-left": "15px"}, 200);
			}
		},
		function () { 
			if ( ! $(this).hasClass('active') ) {
				$(this).isHover = false;
				$(this).animate({"padding-right": "3px", "padding-left": "3px"}, 300);
			}
		}
		
	);
	$("#sub-menu > li ul li a.active").css({"padding-right": "15px", "padding-left": "15px"})
	$("#sub-menu li a").hover(
		function () { 
			if ( $(this).hasClass('active') ) {
				$(this).isHover = true;
				$(this).css({"padding-right": "15px", "padding-left": "15px"})
			}
		}
	);
	
	// R�f�rences Liste
	//--------------------------------------------------------------------------------------
	$(".navPage .liste").click(			
		function () { 
			if ( ! $(this).children("a").hasClass('active') ) {
				$(".navPage .back a").removeClass('active');
				$(this).children("a").addClass('active');
				$("#references #liste").animate({"left": "0"}, 400);
                                $(".folioItemLI").fadeTo(400, 0.1);
			}
		}
	);
	
	$(".navPage .back").click(			
		function () { 
			if ( ! $(this).children("a").hasClass('active') ) {
				$(".navPage .liste a").removeClass('active');
				$(this).children("a").addClass('active');
				$("#references #liste").animate({"left": "-964px"}, 400);
                                $(".folioItemLI").fadeTo(400, 1);
			}
		}
	);



            refreshLogos();
	
	
	
});
