calling jQuery inside a javaScript function, from a method
<p>Im trying to call a jQuery inside a javaScript function, but it doesnt work, what I am doing wrong?</p>

<pre><code>&lt;script type="text/javascript" language="javascript"&gt;

        function Test() {
            $(document).ready(function () {
                $("#pezz").animate({
                    left: '+=150px',
                    height: '+=20px',
                    width: '+=20px'
                });
            });
        }
    &lt;/script&gt;
</code></pre>

<p>call from a method int the Bean</p>

<pre><code>RequestContext.getCurrentInstance().execute("Test");
</code></pre>

<p>UPDATE:</p>

<p>As Gibberish suggested I change the Script to this:</p>

<pre><code>&lt;script type="text/javascript" language="javascript"&gt;
  $(document).ready(function () {
   Test();
  });

 function Test() {
$("#pezz").animate({
  left: '+=150px',
  height: '+=20px',
  width: '+=20px'
});
}
&lt;/script&gt;
</code></pre>

<p>But Works only once, Its supposed to work every time some condition is reached in the method, what canI do to fix this?</p>