Why does variable not pass when wrapped in a setTimeout
<p>If intervalIsClear is true, the hoveredItemIndex is picking up the index of the LI element fine.</p>

<p>If intervalIsClear is false, it is hoveredItemIndex is declared inside a setTimeout(), but is returning -1. Why can't it find the index once it is wrapped in a setTimeout()?</p>

<pre><code>function()
                {
                    if (intervalIsClear == true){

                        hoveredItemIndex = $('.menu li').index(this);
                        changeToHoverText();
                    } else {
                        hello = setTimeout(function(){
                            hoveredItemIndex = $('.menu li').index(this);
                            alert (hoveredItemIndex);
                            changeToHoverText();
                        },500);
                    }
                }
</code></pre>
