jQuery(function($){
  var largeur = $("div.photo img").width();
  
  // cas paysage --> centre
  if ( largeur > "450" ) {
    $(".article div.photo").css({
       width      : $(".photo img").width(),
       margin     : "0 auto",
       display    : "block",
       float      : "none"
     });
     
    $(".article div.photo .legende").css({
       width      : $(".photo img").width(),
       margin     : "0 auto"
     });
  }
  
  // cas portrait --> float
  if ( ( largeur < "450" ) && ( largeur > "310" ) ){
    $(".article .photo").css({
       width      : $(".photo img").width(),
       margin     : "0 5px 0 0"
     });
    
    $(".article .photo .legende").css({
       width      : $(".photo img").width(),
       margin     : "0 5px 0 0"
     });
  }
  
  // cas portrait --> float limite
  if ( largeur < "310" ) {
    $(".article div.photo").css({
       width      : "310px",
       margin     : "0 auto"
     });

    $(".article div.photo .legende").css({
       width      : "310px",
       margin     : "0 auto"
     });
  }
});


jQuery(function($){
  if ( $("div.photo").length > 0 ) { 
  	// affichage de la légende au survole de la souris
    $(".i_blocredac div.photo").hover(function () {
        $(".i_blocredac .legende").fadeIn("slow");
    }, function() {
        $(".i_blocredac .legende").fadeOut("slow");
    });
   }
});


/*
jQuery(function($){
 var width_image = $(".photo img").attr("width");
 var height_image = $(".photo img").attr("height");
 $(".legende").width(width_image);
 //$(".photo").height(height_image);
 $(".photo").width(width_image);
});
*/