(function () {
  // The great Gist swap.
  $(function () {
    $(".gist").each(function () {
      var that = $(this)[0];
      $("#gisted-" + that.id.match(/\d+$/)).html(that);
    });
  })

  // The great iPhone fix.
  if (navigator.userAgent.match(/Mobile.*Safari/))
    document.body.className = "iphone";

  // The great HTML5 blink tag.
  var html5 = $("i.black");
  setTimeout(function () { html5.toggleClass("black"); }, 1000);
  setTimeout(function () { html5.toggleClass("black"); }, 1030);
  setTimeout(function () { html5.toggleClass("black"); }, 1160);

  // The great hCard overlay.
  $("a#hcard-link").after(' <span id="hcard-info"></span>');
  $("a#hcard-link img").hover(
    function () { $("#hcard-info").text($(this)[0].title); },
    function () { $("#hcard-info").text(""); }
  );

  // The great otherwise overlay.
  $("#otherwise").after(' <span id="otherwise-info"></span>');
  $("#otherwise li a img").hover(
    function () { $("#otherwise-info").text($(this)[0].title); },
    function () { $("#otherwise-info").text(""); }
  );
})();
