/**
 * @author : Flo :: acti
 * @date : 15/03/2010
 * 
 * Scripts communs 
 */


/**
 * @section documentReady
 */ 
jQuery(document).ready(function() {	

  // fade : Effet fondu
	$('.fade').mouseover(function() { 
		$(this).stop().fadeTo(200, 0.6);
	}).mouseout(function(){ 
		$(this).stop().fadeTo(200, 1); 
	});
	
	// fade_low : Effet fondu
	$('.fade_low').mouseover(function() { 
		$(this).stop().fadeTo(200, 0.8);
	}).mouseout(function(){ 
		$(this).stop().fadeTo(200, 1); 
	});

  // Afficher / Cacher les liens Quicklinks
  $('ul.hideQL').hide();
  $('#quick-links a.toggle').click(function(){
    $('#quick-links > ul:first').slideToggle();
    return false;
  });
  
  // Afficher / Cacher le lien musee
  $('#links .hide').hide();
	
	// Gestion du carrousel page d'accueil
  var fmxSlider = $("#slide").carouFredSel({
  	auto : false,
  	items : {
      visible  : 1,
      width    : "655px",
      height   : "240px"
    },
    scroll : {
      easing   : "jswing",
      duration : 1500,
      onBefore : function(oldItems, newItems) {
        $(".tagline").fadeOut();  
      },
      onAfter  : function(oldItems, newItems) {
        $(".nbSlide").html(eval(fmxSlider.current_position()+1));
        $(".tagline").fadeIn(); 
	    }
    },
    prev : {	
  		button	 : ".previous",
  		key		   : "left"
  	},
  	next : { 
  		button	 : ".next",
  		key		   : "right"
  	}
  });
  
  // Animation zone recherche
  $('.search-box').hover(function(){
    $(this).animate({
      backgroundColor: "#F4F1EB"
    }, 2000);
  }, function() {
    $(this).animate({
      backgroundColor: "#fffdf9"
    }, 2000);
  });
  
  // Menu principal
  $('#main-nav ul li ul').hide();
  $('#main-nav ul li').hover(function(){
    if (!$.browser.msie) {
      $('li a span', this).css("opacity","0"); 
    }                
    $('ul', this).stop(true,true).slideDown({
      duration: 400, 
      easing: "jswing",
      complete: function() {
        if (!$.browser.msie) {
          $('li a span', this).stop(true,true).animate({opacity:1});
        }  
      }
    });
  }, function() {
    $('ul', this).stop(true,true).slideUp({
      duration: 500, 
      easing: "jswing"
    });
  });
  
  
  // Colorbox : Zoom image
  $("a[rel='docImg']").colorbox();
  
  // Gestion du formulaire archives
  $("#form-archives select").change(function() {
    url = $(this).val();
    window.location = url;
  });
  
  // Gestion du carrousel portfolio
  // Désactive - non utilisation
  /*var portfolioSlider = $(".photo-container, .photo-container-r, .photo-container-l").carouFredSel({
  	auto : false,
  	width : 196, 
  	items : {
      visible  : 1,
      width    : "variable",
      height    : "variable"
    },
    scroll : {
      easing   : "jswing",
      duration : 500,
      onAfter  : function(oldItems, newItems) {
        $(".nbSlide").html(eval(portfolioSlider.current_position()+1)); 
	    }
    },
    prev : {	
  		button	 : ".previous",
  		key		   : "left"
  	},
  	next : { 
  		button	 : ".next",
  		key		   : "right"
  	}
  });*/

  

	
});
