Way to shorten jquerycode
<p>I have several modal popup windows which all use the same settings. One of these requires the following code.</p>

<pre><code>var $modal = $('#modal')
  .attr('id', 'modal')
  .css({zIndex: 3000});

$('#modal-trigger').click(function(evt) {
  evt.preventDefault(), $('#modal').css("visibility","visible");

  $(this).overlay({
    effect: 'fade',
    glossy: true,
    opacity: 0.8,
    closeOnClick: true,
    onShow: function() {
      $('body').append($modal);
    },
    onHide: function() {
      $modal.remove();
    },
  })
});
</code></pre>

<p>So making a second one means changing the <em>modal</em> to something else in the following places:</p>

<p>var $modal = $('#<strong>modal</strong>')</p>

<p>.attr('id', '<strong>modal</strong>')</p>

<p>$('<strong>#modal-trigger</strong>').click(function(evt) {</p>

<p>$('body').append(<strong>$modal</strong>);</p>

<p><strong>$modal</strong>.remove();</p>

<p>Is there a way to shorten this, so I do not have to keep adding the full code to achieve this effect?</p>
