function init_extern() {
  $('a.extern').each(function() { $(this).attr("target", "_blank"); });

  //Edition
  $('span.base-edit').each(function() {
      rel = $(this).attr('rel');
      txt = $(this).html();
      p_type = $(this).parent().get(0).tagName.toLowerCase();
      if (p_type == 'a') $(this).parent().before('<a href="'+rel+'" class="base-edit" title="'+txt+'">'+txt+'</a>');
      else $(this).before('<a href="'+rel+'" class="base-edit" title="'+txt+'">'+txt+'</a>');
      $(this).remove();
    });
}

$(init_extern);