change var into a cascade animation jQuery
<p>I have a cascade animation in jQuery. The problem is that: into the div I have two different element with two different class: linguetta_small, linguetta.
If the element to aniamte has class "linguetta" have to be a margin of 5px instead if the class is linguetta_small the margin left have to be 40px. How can I make that?
This is my html</p>

<pre><code>&lt;div id="linguetta_next"&gt;
    &lt;div class="linguetta" id="linguetta_next1 moved" style="margin-left:100%;"&gt;
        &lt;p class="tit_linguetta"&gt;azienda&lt;/p&gt;
    &lt;/div&gt;
    &lt;div class="linguetta_small" id="linguetta_next2 moved" style="margin-left:100%; margin-top:10px; background:#b0f271;"&gt;
        &lt;p class="tit_linguetta_small"&gt;staff&lt;/p&gt;
    &lt;/div&gt;
    &lt;div class="linguetta_small" id="linguetta_next3 moved" style="margin-left:100%; margin-top:10px; background:#0a5a0a;"&gt;
        &lt;p class="tit_linguetta_small" style="color:#fff;"&gt;risorse umane&lt;/p&gt;
     &lt;/div&gt;
 &lt;/div&gt;
</code></pre>

<p>And this is my jQuery code:</p>

<pre><code>function movePageCenter(id, old_id) {
    var margin = "1%";
    $("#linguetta_next div").each(function(i) {
        var el = $(this);
        setTimeout(function() {
            el.animate({
                marginLeft: margin
            }, 400, function() {
                if (el.next(".linguetta_small").hasClass('linguetta_small')) {
                    margin = "40px";
                }
                else {
                    if (el.next(".linguetta").hasClass('linguetta')) {
                        margin = "5px";
                    }
                }
            });
        }, i * 200);
    });

});
}
</code></pre>
