Odd HTML validation error
<p>I'm getting an odd HTML validation error from this piece of JavaScript any help appreciated, I think it may be causing a bug in the slider function that I'm working with...</p>

<pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
        sfHover = function() {
            var sfEls = document.getElementById("nav2").getElementsByTagName("LI");
            for (var i=0; i&lt;sfEls.length; i++) {
                sfEls[i].onmouseover=function() {
                    this.className+=" sfhover";
                }
                sfEls[i].onmouseout=function() {
                    this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
                }
            }
        }
        if (window.attachEvent) window.attachEvent("onload", sfHover);
    &lt;/script&gt;
</code></pre>

<p>The errors are</p>

<blockquote>
  <p>Error: character ";" not allowed in
  attribute specification list</p>
</blockquote>

<p>and</p>

<blockquote>
  <p>Error: element "sfEls.length"
  undefined</p>
</blockquote>

<p>from the line</p>

<blockquote>
  <p>for (var i=0; i
</blockquote>

<p>and </p>

<blockquote>
  <p>Error: end tag for "sfEls.length"
  omitted, but OMITTAG NO was specified</p>
</blockquote>

<p>from the closing script tag</p>
