    $.extend({
      macro: function(name, fn)
      {
        $.fn[name] = fn;
      }
    });

    $.fn.extend({
      wait: function(delay, type)
      {
        delay = delay || 1000;
        type = type || "fx";

        var element = this;
        return this.queue(type, function()
        {
          setTimeout(function()
          {
            $(element).dequeue();
          }, delay);
        });
      },

      macro: function(name)
      {
        var queue = this.queue().slice();

        $.macro(name, function()
        {
          this.queue(queue);
          return this.dequeue();
        });

        return this;
      }
    });

    var q;
    function preparePage()
    {
      $.macro("slideAndBounce", function()
      {
        this.hide()
            .show("slide", {direction: "up"}, 400)
            .effect("bounce", {direction: "down", distance: "30", times: 5}, 300);
      });
      
      $("#verifyExternalLink").dialog(
      {
        autoOpen: false,
        modal: true,
        draggable: false,
        width: 450,
        buttons:
        {
          "Ok": function(){top.location.href = $("#verifyExternalLink #externalUrl").attr("href");},
          "Cancel": function(){$(this).dialog("close");}
        },
        title: "Are You Sure?"
      });

      $("#dayaVideo").dialog(
      {
        autoOpen: false,
        modal: true,
        width: 610,
        resizable: false,
        draggable: false,
        title: "DAYA Speaks to the Episcopal Church"
      });

      $("a.external").click(verifyExternalLink);
    }

    function verifyExternalLink()
    {
      $("#verifyExternalLink #externalUrl").html(this.href);
      $("#verifyExternalLink #externalUrl").attr("href", this.href);
      $("#verifyExternalLink").dialog("open").parent().slideAndBounce();
      return false;
    }
    
    function showDayaVideo()
    {
      $("#dayaVideo").dialog("open").parent().slideAndBounce();
    }