Javascript recursion on mouseOver not working?
<p>The following code is supposed to gently vary the color of a tab, which i pass into the function. However, the gradient only increases every new time that i enter the tab, instead of increasing the one time i put the mouse over...</p>

<pre><code>&lt;script type = "text/javascript"&gt;
        hex=255;
    function fadetext(element){ 

    if(hex&gt;0) {
        hex-=11;
        element.style.backgroundColor="rgb("+hex+","+hex+","+hex+")";
        setTimeout("fadetext(element)",50); 
    }
    else
        hex=255;
    }
&lt;/script&gt;


    &lt;div id="tabs"&gt;
    &lt;ul&gt;
         &lt;li&gt;&lt;a href="tab-frame-css.html" class="selected" target="mainFrame"  onMouseOver = "fadetext(this)" onclick="loadit(this)"&gt;Personal details&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/div&gt;
</code></pre>
