Filtering blocks + adding a class to every 3rd element
<p>I'm using <a href="http://css-tricks.com/filtering-blocks-v2/" rel="nofollow">Filtering Blocks</a> code written by Chris Coyier, but I want to add a class 'last' to every third 'block' element (to remove margin-right).
So far I have this:</p>

<p><strong>HTML</strong></p>

<pre><code>&lt;div id="blocks-nav"&gt;
     &lt;a rel="all" class="current"&gt;All&lt;/a&gt;
     &lt;a rel="www"&gt;Internet&lt;/a&gt;
     &lt;a rel="ci"&gt;Logo&lt;/a&gt;
&lt;/div&gt;

&lt;div id="blocks-gropup"&gt;
     &lt;div class="block all www"&gt;
     &lt;!-- some content --&gt;
     &lt;/div&gt;

     &lt;div class="block all ci"&gt;
     &lt;!-- some content --&gt;
     &lt;/div&gt;

     &lt;div class="block all www"&gt;
     &lt;!-- some content --&gt;
     &lt;/div&gt;

     &lt;div class="block all ci"&gt;
     &lt;!-- some content --&gt;
     &lt;/div&gt;

     &lt;div class="block all ci"&gt;
     &lt;!-- some content --&gt;
     &lt;/div&gt;

     &lt;div class="block all www"&gt;
     &lt;!-- some content --&gt;
     &lt;/div&gt;         

&lt;/div&gt;
</code></pre>

<p><strong>jQuery:</strong></p>

<pre>
<code>
$(function() {

        var newSelection = "";

        $("#blocks-nav a").click(function(){

            $("#blocks-nav").fadeTo(200, 0.10);

                $("#blocks-nav a").removeClass("current");
                $(this).addClass("current");

                newSelection = $(this).attr("rel");

                $("div.block").not("."+newSelection).slideUp();
                $("."+newSelection).slideDown();

            $("#blocks-group").fadeTo(600, 1);

        });

});


$("div#blocks-group > div:nth-child(3n)").addClass('last');
</code></pre>

<p>This last line actually works, and adds a class "last" to every 3rd div, but after filtering blocks, the class stays with the same div, which isn't necessary at 3rd position.
So, my question is - how can I merge those two functions, so the class would be added on page load to every third div, then removed and added again after filtering blocks.</p>

<p>Any help or assistance would be greatly appreciated! </p>
