Javascript error in syntax?
<p>I've been trying to write a function that makes all links execute a function on click, but I have NO idea why this isn't working:</p>

<pre><code>function interceptLinks() {
    var ls = document.links, numLinks = ls.length
    for (i=0; i&lt;numLinks; i++) {
        if ls[i].onclick {
            //Don't do anything, cause there's already code there!
        }
        else {
            ls[i].onclick = "reloadInfo();";
        }
    }
}
</code></pre>

<p>It just throws a "interceptLinks is not defined" error when I run the function.</p>
