/*-----------------------------------------------------------------------+
 | Replaces ampersands with spans to create the best ampersands possible |
 | Requires jQuery                                                       |
 +-----------------------------------------------------------------------*/

$(function(){
  $("h1:contains('&')", document.body).contents().each(function() {
    if (this.nodeType == 3) {
      $(this)
        .replaceWith(this
          .nodeValue
          .replace(/&/g, "<span class='amp'>&</span>")
        );
      }
    }
  );
});
