$(function(){

  // Front

  $("img.faded").fadeTo('fast', 0.4);

	$("#front-conferences a").hover(
	 function(){
	   $this = $(this);
	   $parent = $this.parent();
	   position = $this.position().top;
	   if ($parent.hasClass('col2')) {
	     if ($parent.hasClass('lastrow')) position -= 160;
	     else position += 160;
	   }
	   $("img.color", this).fadeIn();
	   $("header", $parent).css('top', position).fadeIn();
	 },
	 function(){
	   $("img.color", this).hide();
	   $("header", $(this).parent()).hide();
	 });
	 
	 // Photos

	 $("select#saisonsphotos").change(function(){
	   window.location = 'photos.php?saison=' + $(this).val();
	 });
	 
	 $("a.colorbox").colorbox({loop:false, maxWidth:'95%', maxHeight:'95%'});
	 $("a.colorbox img")
	   .fadeTo('fast', 0.66)
	   .hover(
	     function(){ $(this).fadeTo('fast', 1);},
	     function(){ $(this).fadeTo('fast', 0.66);});
	 
	 // Archives
	 
	 $("select#saisonsarchives").change(function(){
	   window.location = 'archives.php?saison=' + $(this).val();
	 });
	 
	 $(".conf a").hover(
	   function(){ $("img.color", this).fadeIn();},
	   function(){ $("img.color", this).hide();}
	 );

});

