title: Fancybox: make group of photos with the each() of jQuery
body: <p>In the standart case we can create a photo gallery (group of photos) by doing the next:</p>
  
  <pre><code>$( '.fancybox' ).fancybox();
  </code></pre>
  
  <p>In HTML we must to set the attribute <strong>rel</strong> of the tag 'a' to the same value:</p>
  
  <pre><code>&lt;a rel="group" title="" href="/profile/photos/files/74.jpeg" class="fancybox no-tooltip" id="photo-link-74"&gt;&lt;img class="image-curving" style="display: block;" alt="" src="/profile/photos/files/74_thumb.jpeg"&gt;&lt;/a&gt;
  &lt;a rel="group" title="" href="/profile/photos/files/74.jpeg" class="fancybox no-tooltip" id="photo-link-74"&gt;&lt;img class="image-curving" style="display: block;" alt="" src="/profile/photos/files/74_thumb.jpeg"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>What about the situation when we want to use each() of jQuery?</p>
  
  <pre><code>        $(".fancybox").each(    
              function()
              {
                  var parentId = $( this ).parent().parent().attr( 'id' );
                  var id = parentId.substring( parentId.indexOf( '-' ) + 1, parentId.length );
  
                  $( this ).fancybox(
                      {
                          minWidth: 600,
                          afterShow: function() { afterShow( id ); },
                          title: "&lt;img href='/pics/indikator.gif'&gt;",
                          helpers: 
                          {
                              title: 
                              {
                                  type : 'inside'
                              }
                          }
                      }
                  );
              }
          );
  </code></pre>
  
  <p>In the last case the photos will not be grouped. How can I handle the function <code>each()</code> and make all photos grouped for which the rel attribute is the same?</p>