My jQuery.each() doesn't work properly
<p>I have a problem with my <code>jquery.each()</code> function as it somehow runs 2 or 3 times for the same <code>div</code>. The problem is that on the first page of my site it works but on the interior pages it does this.</p>

<pre><code>$(function() {
    /**
     * Sunt adaugate butoanele de editare
     */

    $('#page-banner')
        .wrap($('&lt;div class="context-block"/&gt;')
        .css({
            'padding':'0',
            'clear':'both'    
        }));

    $('.context-block, .cms-left-adds, .cms-left-menu, #footer,#header').each(function(index,value) {
        $(this)
            .wrapInner($('&lt;div class="edit-block" /&gt;')
            .css({
                'height':$(this).height()+'px',
                'top': '0',
                'left':'0',
                'width':$(this).width()-2+'px'
            }))
            .prepend($('&lt;div class="edit-header"/&gt;')
            .append('&lt;span class="edit-handler" id="action_' + $(this).prop('id').slice(3) + '" title="' + editText + '"&gt;' + editText + '&lt;/span&gt;'));

        updateCSS();

        alert("block targetat " + $(this));
    });
});
</code></pre>
