Javascript function not working correct in IE and Chrome, image not change if image in inside a accordion
<p>I have ASP.NET site. At the master page I have javascript code. </p>

<pre><code> $(document).ready(function () {

            var img = $("img");

            img.each(function (index, element) {
                if (img[index].complete == true) {
                    Pixastic.process(img[index], "desaturate", {});
                }
                else {
                    img.load(function () {
                        Pixastic.process(img[index], "desaturate", {});
                    });
                }
            });
 });
</code></pre>

<p>I have a pages, where data is loaded from the database. And if in this data have image script do not process this image.</p>

<p>This code working correct in FF and Opera. But not in IE and Chrome</p>

<p>I'm not correct said</p>

<pre><code> &lt;asp:Literal ID="ltlContent" runat="server" /&gt; &lt;- here too data loaded from database (but image change)
    &lt;br /&gt;
    &lt;br /&gt;
    &lt;div id="accordion" style="width: 740px; float: left;"&gt;
        &lt;asp:Repeater ID="AccStDp" runat="server"&gt; &lt;- here I use accordion
            &lt;ItemTemplate&gt;
                &lt;h3&gt;
                    &lt;a href="#"&gt;
                        &lt;%#Eval("nameStDp")%&gt;&lt;/a&gt;&lt;/h3&gt;
                &lt;div&gt;
                    &lt;asp:Literal ID="ltlcontentPos" runat="server" Text='&lt;%# Eval("textStDp") %&gt;' /&gt;
                &lt;/div&gt;
            &lt;/ItemTemplate&gt;
        &lt;/asp:Repeater&gt;
    &lt;/div&gt;
</code></pre>

<p><strong>How work in FF</strong></p>

<p><img src="http://i.stack.imgur.com/lFiqy.png" alt="How work in FF"></p>

<p><strong>How work in Opera</strong></p>

<p><img src="http://i.stack.imgur.com/tePeE.png" alt="How work in Opera"></p>

<p><strong>How work in Chrome</strong></p>

<p><img src="http://i.stack.imgur.com/D7BjJ.png" alt="How work in Chrome"></p>

<p><strong>How work in IE</strong></p>

<p><img src="http://i.stack.imgur.com/TcbRk.png" alt="How work in IE"></p>
