How do I determine if my javascript uses too many resources (and help optimizing)
<p>Is this horribly inefficient or does it look ok???  How do I test resources used by it?</p>

<pre><code>$.easing.def = "easeOutBack";
        $(document).ready(function() {
            var numResults = $("#scroll &gt; div").size();
            var scrollSize = numResults * 264;
            var stopSize = ((numResults - 6) * 264) * -1;
            $("#scroll").width(scrollSize);
            $("#page-left").hide();
            $("#page-right").click(function() {
                var marginleft = parseInt(jQuery("#scroll").css("margin-left"));
                if(marginleft &gt; stopSize) {
                    $("#page-left").show();
                    $(this).hide();
                    $("#scroll").animate({"margin-left": "-=783px"}, 800, function() {
                        var marginleft = parseInt(jQuery("#scroll").css("margin-left"));
                        if(marginleft &gt; stopSize) {
                            $("#page-right").show();
                        }
                    });
                }
            });
            $("#page-left").click(function() {
                var marginright = parseInt(jQuery("#scroll").css("margin-left"));
                if(marginright &lt; -10) {
                    $("#page-right").show();
                    $(this).hide();
                    $("#scroll").animate({"margin-left": "+=783px"}, 800, function() {
                        var marginright = parseInt(jQuery("#scroll").css("margin-left"));
                        if(marginright &lt; -10) {
                            $("#page-left").show();
                        }
                    });
                }
            });
        });
</code></pre>
