jQuery(document).ready(function($)
{
  $("a[rel^=lightbox]").each(function(index, obj)
  {
    var rel = obj.getAttribute("rel");
    var group = /lightbox\[([^\]]+)\]/.exec(rel);
    if (group != null)
    {
      $(obj).colorbox({rel:group[1], maxWidth:"95%", maxHeight:"95%"});
    }
    else
    {
      $(obj).colorbox({maxWidth:"95%", maxHeight:"95%"});
    }
  });
});