function creeDecalage(element, taille) {
    element.before('<div class="decalage noPrint" style="padding-bottom:' + taille + 'px"></div>');
}

$(function() {
  // limiter la largeur des images
  $("img").each(function() {
    var image = $(this);
    if(image.parents().is("#notes") && (parseInt(image.attr("width")) > 200)) {
      image.removeAttr("height").attr("width", 200);
    }
  })

  // decaller la hauteur des notes
  $("#notes > *").each(function(){
      var note = $(this);
      var topNote = note.offset().top;
      var idLien = note.find(".spip_note").attr("href");
      var topTexte = $(idLien).offset().top;
      if(topNote < topTexte) {
          creeDecalage(note, topTexte - topNote);
      }
  });
});


